summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac65
1 files changed, 57 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index a5d48d7..8bf1703 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-# Copyright (C) 2003-2022 GraphicsMagick Group
+# Copyright (C) 2003-2023 GraphicsMagick Group
# Copyright (C) 2002 ImageMagick Studio
# Copyright (C) 1998, 1999 E. I. du Pont de Nemours and Company
#
@@ -205,6 +205,7 @@ MAGICK_CODER_MODULE_PATH="${builddir}/coders"
MAGICK_CONFIGURE_SRC_PATH="${srcdirfull}/config"
MAGICK_CONFIGURE_BUILD_PATH="${builddir}/config"
MAGICK_FILTER_MODULE_PATH="${builddir}/filters"
+top_srcdir_native=${srcdirfull}
DIRSEP=':'
case "${build_os}" in
mingw* )
@@ -212,6 +213,7 @@ case "${build_os}" in
MAGICK_CONFIGURE_SRC_PATH=`$WinPathScript "${MAGICK_CONFIGURE_SRC_PATH}" 0`
MAGICK_CONFIGURE_BUILD_PATH=`$WinPathScript "${MAGICK_CONFIGURE_BUILD_PATH}" 0`
MAGICK_FILTER_MODULE_PATH=`$WinPathScript "${MAGICK_FILTER_MODULE_PATH}" 0`
+ top_srcdir_native=`$WinPathScript "${srcdirfull}"`
;;
esac
case "${host_os}" in
@@ -224,6 +226,7 @@ AC_SUBST([MAGICK_CONFIGURE_SRC_PATH])
AC_SUBST([MAGICK_CONFIGURE_BUILD_PATH])
AC_SUBST([MAGICK_FILTER_MODULE_PATH])
AC_SUBST([DIRSEP])
+AC_SUBST([top_srcdir_native])
# Check for programs
AC_PROG_CC
@@ -1084,26 +1087,31 @@ fi
# with Windows builds which don't use configure.
#
+# int8_t
AC_MSG_CHECKING([for signed 8-bit type])
INT8_T='signed char'
AC_MSG_RESULT([$INT8_T])
AC_SUBST([INT8_T])
+# uint8_t
AC_MSG_CHECKING([for unsigned 8-bit type])
UINT8_T='unsigned char'
AC_MSG_RESULT([$UINT8_T])
AC_SUBST([UINT8_T])
+# int16_t
AC_MSG_CHECKING([for signed 16-bit type])
INT16_T='signed short'
AC_MSG_RESULT([$INT16_T])
AC_SUBST([INT16_T])
+# uint16_t
AC_MSG_CHECKING([for unsigned 16-bit type])
UINT16_T='unsigned short'
AC_MSG_RESULT([$UINT16_T])
AC_SUBST([UINT16_T])
+# int32_t
AC_MSG_CHECKING([for signed 32-bit type])
INT32_T='none'
INT32_F='none'
@@ -1120,6 +1128,7 @@ AC_MSG_RESULT([$INT32_T])
AC_SUBST([INT32_T])
AC_SUBST([INT32_F])
+# uint32_t
AC_MSG_CHECKING([for unsigned 32-bit type])
UINT32_T='none'
UINT32_F='none'
@@ -1136,6 +1145,7 @@ AC_MSG_RESULT([$UINT32_T])
AC_SUBST([UINT32_T])
AC_SUBST([UINT32_F])
+# int64_t
AC_MSG_CHECKING([for signed 64-bit type])
INT64_T='none'
INT64_F='none'
@@ -1157,6 +1167,7 @@ AC_MSG_RESULT([$INT64_T])
AC_SUBST([INT64_T])
AC_SUBST([INT64_F])
+# uint64_t
AC_MSG_CHECKING([for unsigned 64-bit type])
UINT64_T='none'
UINT64_F='none'
@@ -1178,6 +1189,7 @@ AC_MSG_RESULT([$UINT64_T])
AC_SUBST([UINT64_T])
AC_SUBST([UINT64_F])
+# uintmax_t
AC_MSG_CHECKING([for unsigned maximum type])
UINTMAX_T='none'
UINTMAX_F='none'
@@ -1194,7 +1206,8 @@ AC_MSG_RESULT([$UINTMAX_T])
AC_SUBST([UINTMAX_T])
AC_SUBST([UINTMAX_F])
-AC_MSG_CHECKING([for pointer difference type])
+# uintptr_t
+AC_MSG_CHECKING([for unsigned pointer storage type])
UINTPTR_T='none'
UINTPTR_F='none'
if test $ac_cv_sizeof_unsigned_long -eq $ac_cv_sizeof_unsigned_intp
@@ -1210,6 +1223,23 @@ AC_MSG_RESULT([$UINTPTR_T])
AC_SUBST([UINTPTR_T])
AC_SUBST([UINTPTR_F])
+# ptrdiff_t
+AC_MSG_CHECKING([for signed pointer difference type])
+PTRDIFF_T='none'
+PTRDDIFF_F='none'
+if test $ac_cv_sizeof_unsigned_long -eq $ac_cv_sizeof_unsigned_intp
+then
+ PTRDIFF_T='signed long'
+ PTRDIFF_F='"l"'
+elif test $ac_cv_sizeof_unsigned_long_long -eq $ac_cv_sizeof_unsigned_intp
+then
+ PTRDIFF_T='long long'
+ PTRDIFF_F='"ll"'
+fi
+AC_MSG_RESULT([$PTRDIFF_T])
+AC_SUBST([PTRDIFF_T])
+AC_SUBST([PTRDIFF_F])
+
MAGICK_SIZE_T='none'
MAGICK_SIZE_T_F='none'
MAGICK_SSIZE_T='none'
@@ -2220,6 +2250,9 @@ then
AC_DEFINE([HasJPEG],[1],[Define if you have JPEG library])
AC_MSG_RESULT([yes])
have_jpeg='yes'
+ # Test for interesting libjpeg-turbo 3.0 functions (which may also appear in other JPEG libraries)
+ AC_CHECK_FUNCS([jpeg_enable_lossless jpeg12_write_scanlines jpeg16_write_scanlines \
+ jpeg12_read_scanlines jpeg16_read_scanlines])
fi
else
AC_MSG_RESULT([no])
@@ -2302,6 +2335,10 @@ AC_SUBST([LIB_JP2])
#
# Check for TTF
#
+# Use pkg-config if available. If pkg-config is not available, then
+# try legacy freetype-config script. If neither is available, then go
+# with defaults.
+#
have_ttf='no'
LIB_TTF=''
if test "$with_ttf" != 'no'
@@ -2581,6 +2618,7 @@ then
AC_CHECK_HEADER([webp/encode.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[])
AC_CHECK_LIB([webp],[WebPDecodeRGB],[passed=`expr $passed + 1`; LIB_WEBP='-lwebp'],[failed=`expr $failed + 1`],[])
AC_CHECK_LIB([webpmux],[WebPMuxSetImage],[LIB_WEBP="$LIB_WEBP -lwebpmux"],[],[-lwebp])
+ AC_CHECK_LIB([sharpyuv],[SharpYuvConvert],[LIB_WEBP="$LIB_WEBP -lsharpyuv"],[],[])
AC_MSG_CHECKING([if WEBP package is complete])
if test $passed -gt 0
then
@@ -2611,9 +2649,16 @@ then
AC_MSG_RESULT()
failed=0
passed=0
- AC_CHECK_HEADER([libheif/heif.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
- # heif always requires hwy no extra test needed
- AC_CHECK_LIB([heif],[heif_context_alloc],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[-lde265])
+ heif_libs=''
+ # Use pkg-config to handle different optional codec libs
+ # and if pkg-config is not available fallback to manual search.
+ PKG_CHECK_MODULES([HEIF], [libheif],
+ [heif_libs=$HEIF_LIBS; passed=1;],
+ [AC_CHECK_HEADER([libheif/heif.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
+ # Assume sensible default for codec; This will fail with a static
+ # libheif that contains a avif codec.
+ heif_libs="-lheif -lde265"])
+ AC_CHECK_LIB([heif],[heif_context_alloc],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[$heif_libs])
AC_MSG_CHECKING([if HEIF package is complete])
if test $passed -gt 0
then
@@ -2622,7 +2667,7 @@ then
AC_MSG_RESULT([no -- some components failed test])
have_heif='no (failed tests)'
else
- LIB_HEIF='-lheif -lde265'
+ LIB_HEIF="$heif_libs"
LIBS="$LIB_HEIF $LIBS"
AC_DEFINE([HasHEIF],[1],[Define if you have HEIF library])
AC_MSG_RESULT([yes])
@@ -3144,7 +3189,10 @@ have_ralcgm='no' ; if test "$CGMDecodeDelegate" != "$CGMDecodeDelegateDefault"
AM_CONDITIONAL([HasPSDelegate],[test "$have_gs" = 'yes'])
# Tests for programs only used while in maintainer mode
-if test "$MAINT" == '' ; then
+if test "$MAINT" = '' ; then
+ # Search for a usable Python
+ AC_CHECK_PROGS([PYTHON],[python3 python python2])
+
# Test for optional rst2html.py utility and define automake conditional HasRST2HTML if found.
AC_CHECK_PROGS([RST2HTML],[rst2html.py rst2html])
@@ -3811,7 +3859,7 @@ if test "$build_modules" != 'no'
then
MAGICK_DEP_LIBS="$LIBS_USER $LIB_LCMS $LIB_TTF $LIB_GS $LIB_XEXT $LIB_IPC $LIB_X11 $LIB_BZLIB $LIB_ZLIB $LIB_LTDL $LIB_TRIO $LIB_GDI32 $LIB_MATH $LIB_THREAD $LIB_TCMALLOC $LIB_UMEM $LIB_MTMALLOC"
else
- MAGICK_DEP_LIBS="$LIBS_USER $LIB_JBIG $LIB_WEBP $LIB_HEIF $LIB_LCMS $LIB_TIFF $LIB_TTF $LIB_JP2 $LIB_JPEG $LIB_JXL $LIB_GS $LIB_PNG $LIB_FPX $LIB_WMF $LIB_DPS $LIB_XEXT $LIB_IPC $LIB_X11 $LIB_LZMA $LIB_BZLIB $LIB_XML $LIB_ZLIB $LIB_ZSTD $LIB_TRIO $LIB_GDI32 $LIB_MATH $LIB_THREAD $LIB_TCMALLOC $LIB_UMEM $LIB_MTMALLOC"
+ MAGICK_DEP_LIBS="$LIBS_USER $LIB_JBIG $LIB_WEBP $LIB_JP2 $LIB_HEIF $LIB_LCMS $LIB_TIFF $LIB_TTF $LIB_JPEG $LIB_JXL $LIB_GS $LIB_PNG $LIB_FPX $LIB_WMF $LIB_DPS $LIB_XEXT $LIB_IPC $LIB_X11 $LIB_LZMA $LIB_BZLIB $LIB_XML $LIB_ZLIB $LIB_ZSTD $LIB_TRIO $LIB_GDI32 $LIB_MATH $LIB_THREAD $LIB_TCMALLOC $LIB_UMEM $LIB_MTMALLOC"
fi
MAGICK_EXTRA_DEP_LIBS="$LIB_OMP" # Extra libraries typically added due to CFLAGS
AC_SUBST([MAGICK_DEP_LIBS])
@@ -3870,6 +3918,7 @@ AC_SUBST([MAGICK_API_CPPFLAGS])
AC_SUBST([MAGICK_API_PC_CPPFLAGS])
AC_SUBST([MAGICK_API_LDFLAGS])
AC_SUBST([MAGICK_API_LIBS])
+AC_SUBST([MAGICK_API_DEP_LIBS])
AC_CONFIG_FILES(\
GraphicsMagick.spec \