1 # Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
2 # dedicated to making software imaging solutions freely available.
4 # You may not use this file except in compliance with the License. You may
5 # obtain a copy of the License at
7 # https://imagemagick.org/script/license.php
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 # Copyright (C) 2003 - 2008 GraphicsMagick Group
17 # Copying and distribution of this file, with or without modification,
18 # are permitted in any medium without royalty provided the copyright
19 # notice and this notice are preserved.
21 # Process this file with autoconf to create configure script.
24 # ==============================================================================
25 # ImageMagick release.
26 # ==============================================================================
27 m4_define([magick_major_version], [7])
28 m4_define([magick_minor_version], [0])
29 m4_define([magick_micro_version], [9])
30 m4_define([magick_patchlevel_version], [1])
31 m4_define([magick_version],
32 [magick_major_version.magick_minor_version.magick_micro_version-magick_patchlevel_version])
33 m4_define([magick_git_revision], esyscmd([sh -c "(gitversion.sh .) | awk '{ print \$1 }' | tr -d '\n'"]))
34 m4_define([magick_tar_name],[ImageMagick])
36 # ==============================================================================
38 # ==============================================================================
39 AC_INIT([ImageMagick],
41 [https://github.com/ImageMagick/ImageMagick/issues],
43 [https://imagemagick.org])
44 AC_CONFIG_SRCDIR([MagickCore/MagickCore.h])
45 AC_CONFIG_AUX_DIR([config])
46 AC_REQUIRE_AUX_FILE([tap-driver.sh])
47 AC_CONFIG_MACRO_DIR([m4])
48 AC_CONFIG_HEADERS([config/config.h])
49 AX_PREFIX_CONFIG_H([MagickCore/magick-baseconfig.h],[MagickCore])
52 AM_INIT_AUTOMAKE([foreign color-tests -Wall -Wno-portability subdir-objects dist-bzip2 dist-lzip dist-xz dist-zip tar-ustar])
53 AM_SILENT_RULES([yes])
56 # Save initial user-tunable values
59 for var in CC CFLAGS CPPFLAGS CXX CXXCPP LDFLAGS LIBS ; do
60 eval isset=\${$var+set}
61 if test "$isset" = 'set'; then
63 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS}'${var}=${val}' "
66 AC_SUBST(DISTCHECK_CONFIG_FLAGS)
68 CONFIGURE_ARGS="$0 ${ac_configure_args}"
69 AC_SUBST(CONFIGURE_ARGS)
71 AC_ARG_ENABLE([reproducible-build],
72 [AC_HELP_STRING([--enable-reproducible-build],
73 [enable reproducible build])],
74 [enable_reproducible_build=$enableval],
75 [enable_reproducible_build='no'])
77 # Source file containing package/library versioning information.
78 . ${srcdir}/version.sh
80 echo "configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}${PACKAGE_VERSION_ADDENDUM}"
82 MAGICK_TARGET_CPU=$host_cpu
83 AC_SUBST(MAGICK_TARGET_CPU)
84 AC_DEFINE_UNQUOTED(MAGICK_TARGET_CPU,$MAGICK_TARGET_CPU,[Target Host CPU])
86 MAGICK_TARGET_VENDOR=$host_vendor
87 AC_SUBST(MAGICK_TARGET_VENDOR)
88 AC_DEFINE_UNQUOTED(MAGICK_TARGET_VENDOR,$MAGICK_TARGET_VENDOR,[Target Host Vendor])
90 MAGICK_TARGET_OS=$host_os
91 AC_SUBST(MAGICK_TARGET_OS)
92 AC_DEFINE_UNQUOTED(MAGICK_TARGET_OS,$MAGICK_TARGET_OS,[Target Host OS])
95 # Substitute versioning
96 AC_SUBST([MAGICK_MAJOR_VERSION],[magick_major_version])
97 AC_SUBST([MAGICK_MINOR_VERSION],[magick_minor_version])
98 AC_SUBST([MAGICK_MICRO_VERSION],[magick_micro_version])
99 AC_SUBST([MAGICK_PATCHLEVEL_VERSION],[magick_patchlevel_version])
100 AC_SUBST([MAGICK_VERSION],[magick_version])
101 AC_SUBST([MAGICK_GIT_REVISION],[magick_git_revision])
103 # Substitute library versioning
104 AC_SUBST(MAGICK_LIBRARY_CURRENT)dnl
105 AC_SUBST(MAGICK_LIBRARY_REVISION)dnl
106 AC_SUBST(MAGICK_LIBRARY_AGE)dnl
107 AC_SUBST([MAGICK_LIBRARY_CURRENT_MIN],
108 [`expr $MAGICK_LIBRARY_CURRENT - $MAGICK_LIBRARY_AGE`])
109 AC_SUBST([MAGICK_LIBRARY_VERSION_INFO],
110 [$MAGICK_LIBRARY_CURRENT:$MAGICK_LIBRARY_REVISION:$MAGICK_LIBRARY_AGE])
112 AC_SUBST(MAGICKPP_LIBRARY_CURRENT)dnl
113 AC_SUBST(MAGICKPP_LIBRARY_REVISION)dnl
114 AC_SUBST(MAGICKPP_LIBRARY_AGE)dnl
115 AC_SUBST([MAGICKPP_LIBRARY_CURRENT_MIN],
116 [`expr $MAGICKPP_LIBRARY_CURRENT - $MAGICKPP_LIBRARY_AGE`])
117 AC_SUBST([MAGICKPP_LIBRARY_VERSION_INFO],
118 [$MAGICKPP_LIBRARY_CURRENT:$MAGICKPP_LIBRARY_REVISION:$MAGICKPP_LIBRARY_AGE])
120 AC_SUBST(PACKAGE_NAME)dnl
121 AC_SUBST(PACKAGE_VERSION)dnl
122 AC_SUBST(PACKAGE_PERL_VERSION)dnl
123 AC_SUBST(PACKAGE_RELEASE)dnl
124 AC_SUBST(PACKAGE_CHANGE_DATE)dnl
125 AC_SUBST(PACKAGE_LIB_VERSION)dnl
126 AC_SUBST(PACKAGE_LIB_VERSION_NUMBER)dnl
127 AS_IF([test X$enable_reproducible_build = Xyes],
128 [PACKAGE_RELEASE_DATE=$PACKAGE_RELEASE_DATE_REPRODUCIBLE],
129 [PACKAGE_RELEASE_DATE=$PACKAGE_RELEASE_DATE_RAW],
131 AC_SUBST(PACKAGE_RELEASE_DATE)dnl
133 AC_SUBST(PACKAGE_VERSION_ADDENDUM)dnl
135 # Ensure that make can run correctly
138 # versioning of library
139 MAGICK_LIB_VERSION="0x"
140 if test ${MAGICK_LIBRARY_CURRENT} -lt 10 ; then
141 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
143 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_CURRENT}
144 if test ${MAGICK_LIBRARY_AGE} -lt 10 ; then
145 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
147 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_AGE}
148 if test ${MAGICK_LIBRARY_REVISION} -lt 10 ; then
149 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
151 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_REVISION}
152 AC_SUBST(MAGICK_LIB_VERSION)
154 # Definition used to define MagickLibVersionText in version.h
155 MAGICK_LIB_VERSION_TEXT="${PACKAGE_VERSION}"
156 AC_SUBST(MAGICK_LIB_VERSION_TEXT)
158 # Definition used to define MagickLibVersionNumber in version.h
159 MAGICK_LIB_VERSION_NUMBER="${MAGICK_LIBRARY_CURRENT},${MAGICK_LIBRARY_AGE},${MAGICK_LIBRARY_REVISION}"
160 AC_SUBST(MAGICK_LIB_VERSION_NUMBER)
162 MAGICKPP_LIB_VERSION="0x"
163 if test ${MAGICKPP_LIBRARY_CURRENT} -lt 10 ; then
164 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}0
166 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}${MAGICKPP_LIBRARY_CURRENT}
167 if test ${MAGICKPP_LIBRARY_AGE} -lt 10 ; then
168 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}0
170 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}${MAGICKPP_LIBRARY_AGE}
171 if test ${MAGICKPP_LIBRARY_REVISION} -lt 10 ; then
172 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}0
174 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}${MAGICKPP_LIBRARY_REVISION}
175 AC_SUBST(MAGICKPP_LIB_VERSION)
177 # Definition used to define MagickLibVersionText in version.h
178 MAGICKPP_LIB_VERSION_TEXT="${PACKAGE_VERSION}"
179 AC_SUBST(MAGICKPP_LIB_VERSION_TEXT)
181 # Definition used to define MagickLibVersionNumber in version.h
182 MAGICK_LIB_VERSION_NUMBER="${MAGICK_LIBRARY_CURRENT},${MAGICK_LIBRARY_AGE},${MAGICK_LIBRARY_REVISION}"
183 AC_SUBST(MAGICK_LIB_VERSION_NUMBER)
187 # Regenerate config.status if ChangeLog or version.sh is updated.
188 AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/version.sh'])
193 MAGICK_CPPFLAGS=$CPPFLAGS_USER
194 MAGICK_PCFLAGS=$CPPFLAGS_USER
200 # Evaluate shell variable equivalents to Makefile directory variables
202 if test "x$prefix" = xNONE; then
203 prefix=$ac_default_prefix
205 # Let make expand exec_prefix.
206 if test "x$exec_prefix" = xNONE; then
207 exec_prefix='${prefix}'
211 eval "eval PREFIX_DIR=${prefix}"
213 eval "eval EXEC_PREFIX_DIR=${exec_prefix}"
214 AC_SUBST(EXEC_PREFIX_DIR)
215 eval "eval BIN_DIR=$bindir"
217 eval "eval SBIN_DIR=$sbindir"
219 eval "eval LIBEXEC_DIR=$libexecdir"
220 AC_SUBST(LIBEXEC_DIR)
221 eval "eval DATA_DIR=$datadir"
223 eval "eval DOC_DIR=$datadir/doc"
225 eval "eval SYSCONF_DIR=$sysconfdir"
226 AC_SUBST(SYSCONF_DIR)
227 eval "eval SHAREDSTATE_DIR=$sharedstatedir"
228 AC_SUBST(SHAREDSTATE_DIR)
229 eval "eval LOCALSTATE_DIR=$localstatedir"
230 AC_SUBST(LOCALSTATE_DIR)
231 eval "eval LIB_DIR=$libdir"
233 eval "eval INCLUDE_DIR=$includedir"
234 AC_SUBST(INCLUDE_DIR)
235 eval "eval PERSISTINCLUDE_DIR=$oldincludedir"
236 AC_SUBST(PERSISTINCLUDE_DIR)
237 eval "eval INFO_DIR=$infodir"
239 eval "eval MAN_DIR=$mandir"
242 # Get full paths to source and build directories
243 srcdirfull="`cd $srcdir && pwd`"
247 # Compute variables useful for running uninstalled software.
249 MAGICK_CODER_MODULE_PATH="${builddir}/coders"
250 MAGICK_CONFIGURE_SRC_PATH="${srcdirfull}/config"
251 MAGICK_CONFIGURE_BUILD_PATH="${builddir}/config"
252 MAGICK_FILTER_MODULE_PATH="${builddir}/filters"
254 case "${build_os}" in
256 MAGICK_CODER_MODULE_PATH=`$WinPathScript "${MAGICK_CODER_MODULE_PATH}" 0`
257 MAGICK_CONFIGURE_SRC_PATH=`$WinPathScript "${MAGICK_CONFIGURE_SRC_PATH}" 0`
258 MAGICK_CONFIGURE_BUILD_PATH=`$WinPathScript "${MAGICK_CONFIGURE_BUILD_PATH}" 0`
259 MAGICK_FILTER_MODULE_PATH=`$WinPathScript "${MAGICK_FILTER_MODULE_PATH}" 0`
268 AC_SUBST(MAGICK_CODER_MODULE_PATH)
269 AC_SUBST(MAGICK_CONFIGURE_SRC_PATH)
270 AC_SUBST(MAGICK_CONFIGURE_BUILD_PATH)
271 AC_SUBST(MAGICK_FILTER_MODULE_PATH)
276 # Enable OS features.
278 AC_USE_SYSTEM_EXTENSIONS
280 # ==============================================================================
281 # Find required base packages
282 # ==============================================================================
283 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
301 AX_GCC_ARCHFLAG([yes])
302 PKG_PROG_PKG_CONFIG([0.20])
306 # Test for 64-bit build.
307 AC_CHECK_SIZEOF([size_t])
311 if test "x$GCC" = "xyes"; then
312 CFLAGS="$CFLAGS -fexceptions"
315 cat > local.exp <<EOF
316 set CC_FOR_TARGET "$CC"
320 # Check for linker script support
324 # Enable run-time checking.
326 AC_ARG_ENABLE([bounds-checking],
327 [AC_HELP_STRING([--enable-bounds-checking],
328 [enable run-time bounds-checking])],
329 [enable_bounds_checking=$enableval],
330 [enable_bounds_checking='no'])
332 if test "$enable_bounds_checking" = yes; then
333 AC_DEFINE([_FORTIFY_SOURCE], [2],
334 [enable run-time bounds-checking])
345 native_win32_build='no'
353 native_win32_build='yes'
355 OLE_LIBS='-loleaut32'
356 WS2_32_LIBS="-lws2_32"
359 if test "${GDI32_LIBS}x" != 'x'; then
360 AC_DEFINE(WINGDI32_DELEGATE,1,Define to use the Windows GDI32 library)
364 AC_SUBST(WS2_32_LIBS)
365 AM_CONDITIONAL(WINGDI32_DELEGATE, test "${GDI32_LIBS}x" != 'x' )
366 AM_CONDITIONAL(WIN32_NATIVE_BUILD, test "${native_win32_build}" = 'yes' )
367 AM_CONDITIONAL(CYGWIN_BUILD, test "${cygwin_build}" = 'yes' )
368 AM_CONDITIONAL(USING_CL, test "x${CC}" = 'xcl.exe' )
370 WinPathScript="${srcdirfull}/winpath.sh"
371 AC_SUBST(WinPathScript)
374 # Compiler flags tweaks
376 if test "${GCC}" != "yes"; then
379 # aCC: HP ANSI C++ B3910B A.03.34
380 CFLAGS="${CFLAGS} -Wp,-H30000"
381 if test -n "${CXXFLAGS}"; then
384 CXXFLAGS="${CXXFLAGS} -AA"
388 # Compaq alphaev68-dec-osf5.1 compiler
389 if test -n "${CXXFLAGS}"; then
390 CXXFLAGS='-std strict_ansi -noimplicit_include'
392 CXXFLAGS="${CXXFLAGS} -std strict_ansi -noimplicit_include"
397 # Check for lazy-loading.
398 AC_CACHE_CHECK([for linker lazyload option],[im_cv_ld_lazyload],
400 im_cv_ld_lazyload='none'
402 *-*-solaris2.8 | *-*-solaris2.9 | *-*-solaris2.1? )
403 if test "$lt_cv_prog_gnu_ld" != 'yes' ; then
404 im_cv_ld_lazyload='-Wl,-zlazyload'
409 if test "${im_cv_ld_lazyload}" != 'none' ; then
410 if test -z "${LDFLAGS}" ; then
411 LDFLAGS="${im_cv_ld_lazyload}"
413 LDFLAGS="${im_cv_ld_lazyload} ${LDFLAGS}"
417 dnl Platform-specific stuff
419 *darwin* | *-macos10*)
420 dnl Disable FORTIFY_SOURCE to fix a bug in LVVM / OpenMP support
421 CFLAGS="${CFLAGS} -D_FORTIFY_SOURCE=0"
422 dnl OS X universal binary support, requires --disable-dependency-tracking
423 AC_ARG_ENABLE([osx-universal-binary],
424 AC_HELP_STRING([--enable-osx-universal-binary],
425 [build universal binary on OS X [[default=no]]]),
426 [build_osxuniversal="${enableval}"], [build_osxuniversal=no])
428 if test "${build_osxuniversal}" != no ; then
429 if test "$enable_dependency_tracking" != no ; then
430 AC_MSG_ERROR([--enable-osx-universal-binary requires --disable-dependency-tracking.
431 Please re-run configure with these options:
432 --disable-dependency-tracking --enable-osx-universal-binary
435 CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
436 CXXFLAGS="$CXXFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
437 LDFLAGS="$LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
443 # ARCH specific include directory
445 AC_ARG_WITH([includearch-dir],
446 [AC_HELP_STRING([--includearch-dir=DIR],
447 [ARCH specific include directory])],
448 [includearch_dir=$withval],
449 [includearch_dir=$INCLUDE_DIR])
451 eval "eval INCLUDEARCH_DIR=$includearch_dir"
452 AC_SUBST(INCLUDEARCH_DIR)
455 # ARCH specific configuration directory
457 AC_ARG_WITH([sharearch-dir],
458 [AC_HELP_STRING([--sharearch-dir=DIR],
459 [ARCH specific config directory])],
460 [sharearch_dir=$withval],
461 [sharearch_dir="${LIB_DIR}"])
463 eval "eval SHAREARCH_DIR=$sharearch_dir"
464 AC_SUBST(SHAREARCH_DIR)
466 # Path to the pkgconfig folder
467 AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=DIR],
468 [Path to the pkgconfig directory @<:@LIBDIR/pkgconfig@:>@]),
469 [pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
470 AC_SUBST([pkgconfigdir])
473 # Enable support for POSIX thread APIs
475 AC_ARG_WITH([threads],
476 [AC_HELP_STRING([--without-threads], [disable POSIX threads API support])],
477 [with_threads=$withval],
478 [with_threads='yes'])
482 if test "$with_threads" != 'no'; then
484 if test "$ax_pthread_ok" = yes; then
486 DEF_THREAD="$PTHREAD_CFLAGS"
487 CFLAGS="$CFLAGS $DEF_THREAD"
488 CXXFLAGS="$CXXFLAGS $DEF_THREAD"
489 THREAD_LIBS="$PTHREAD_LIBS"
490 if test "$CC" != "$PTHREAD_CC"; then
491 AC_MSG_WARN([Replacing compiler $CC with compiler $PTHREAD_CC to support pthreads.])
494 AC_DEFINE(THREAD_SUPPORT,1,[Define if you have POSIX threads libraries and header files.])
497 LIBS="$LIBS $THREAD_LIBS"
498 AC_SUBST(THREAD_LIBS)
500 # Enable support for OpenMP
501 if test "$have_threads" != 'yes'; then
502 ac_cv_prog_c_openmp=unsupported
505 CFLAGS="$OPENMP_CFLAGS $CFLAGS"
506 MAGICK_PCFLAGS="$MAGICK_PCFLAGS $OPENMP_CFLAGS"
507 AC_SUBST(OPENMP_CFLAGS)
508 if test "$enable_openmp" != no; then
509 if test "$ac_cv_prog_c_openmp" != 'unsupported'; then
510 MAGICK_FEATURES="OpenMP $MAGICK_FEATURES"
514 # Enable support for OpenCL
516 CFLAGS="$CL_CFLAGS $CFLAGS"
517 CPPFLAGS="$CL_CFLAGS $CPPFLAGS"
518 LIBS="$CL_LIBS $LIBS"
520 if test "$enable_opencl" != no; then
521 if test "X$ax_cv_check_cl_libcl" != Xno; then :
522 MAGICK_FEATURES="OpenCL $MAGICK_FEATURES"
528 # Check for large file support
534 if test "$enable_largefile" != no; then
535 case $ac_cv_sys_file_offset_bits in
537 # nothing to do here as the host supports LFS fine
540 AC_MSG_CHECKING([for native large file support])
541 AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>
543 exit(!(sizeof(off_t) == 8));
545 [ac_cv_sys_file_offset_bits=64; AC_DEFINE(_FILE_OFFSET_BITS,64)
546 AC_MSG_RESULT([yes])],
547 [AC_MSG_RESULT([no])])
550 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
553 if test "$ac_cv_sys_large_files" != 'no'; then
554 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGE_FILES=1"
556 if test "$ac_cv_sys_largefile_source" != 'no'; then
557 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGEFILE_SOURCE=1"
560 AC_SUBST(LFS_CPPFLAGS)
566 AC_SUBST(LIBTOOL_DEPS)
568 # Check to see if building shared libraries
569 libtool_build_shared_libs='no'
570 if test "$enable_shared" = 'yes'; then
571 libtool_build_shared_libs='yes'
574 # Check to see if building static libraries
575 libtool_build_static_libs='no'
576 if test "$enable_static" = 'yes'; then
577 libtool_build_static_libs='yes'
580 AM_CONDITIONAL(WITH_SHARED_LIBS, test "${libtool_build_shared_libs}" = 'yes')
582 # Enable support for building loadable modules
585 AC_ARG_WITH([modules],
586 [AC_HELP_STRING([--with-modules],
587 [enable building dynamically loadable modules])],
588 [with_modules=$withval],
591 # Only allow building loadable modules if we are building shared libraries
592 if test "$with_modules" != 'no' ; then
593 if test "$libtool_build_shared_libs" = 'no'; then
594 AC_MSG_WARN([Modules may only be built if building shared libraries is enabled.])
600 if test "$build_modules" != 'no' ; then
601 AC_DEFINE(BUILD_MODULES,1,Define if coders and filters are to be built as modules.)
602 MAGICK_FEATURES="$MAGICK_FEATURES Modules"
604 AM_CONDITIONAL(WITH_MODULES, test "$build_modules" != 'no')
606 # Enable build using delegate libraries built in subdirectories rather than installed
607 # delegate libraries (bzlib fftw fpx gslib jp2 jbig jpeg lcms lzma png tiff ttf wmf xml zlib)
608 AC_ARG_ENABLE([delegate-build],
609 [AC_HELP_STRING([--enable-delegate-build],
610 [look for delegate libraries in build directory])],
611 [enable_delegate_build=$enableval],
612 [enable_delegate_build='no'])
614 AC_ARG_ENABLE([deprecated],
615 [AC_HELP_STRING([--disable-deprecated],
616 [exclude deprecated methods in MagickCore and MagickWand APIs])],
617 [enable_deprecated=$enableval],
618 [enable_deprecated='no'])
620 if test "$enable_deprecated" = 'yes'; then
621 AC_DEFINE(EXCLUDE_DEPRECATED,1,[exclude deprecated methods in MagickCore API])
623 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-deprecated "
626 # Build a version of ImageMagick which operates uninstalled.
627 # Used to build distributions located via MAGICK_HOME / executable path
628 AC_ARG_ENABLE([installed],
629 [AC_HELP_STRING([--disable-installed],
630 [Formally install ImageMagick under PREFIX])],
631 [enable_installed=$enableval],
632 [enable_installed='yes'])
634 if test "$enable_installed" = 'yes'; then
635 AC_DEFINE(INSTALLED_SUPPORT,1,[ImageMagick is formally installed under prefix])
637 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-installed "
640 # Permit enciphering and deciphering image pixels.
641 AC_ARG_ENABLE([cipher],
642 [AC_HELP_STRING([--disable-cipher],
643 [disable enciphering and deciphering image pixels])],
644 [enable_cipher=$enableval],
645 [enable_cipher='yes'])
647 if test "$enable_cipher" = 'yes'; then
648 AC_DEFINE(CIPHER_SUPPORT,1,[permit enciphering and deciphering image pixels])
649 MAGICK_FEATURES="Cipher $MAGICK_FEATURES"
652 # Build a zero-configuration version of ImageMagick.
653 AC_ARG_ENABLE([zero-configuration],
654 [AC_HELP_STRING([--enable-zero-configuration],
655 [enable self-contained, embeddable, zero-configuration ImageMagick])],
656 [enable_zero_configuration=$enableval],
657 [enable_zero_configuration='no'])
659 if test "$enable_zero_configuration" = 'yes'; then
660 AC_DEFINE(ZERO_CONFIGURATION_SUPPORT,1,[Build self-contained, embeddable, zero-configuration ImageMagick])
661 MAGICK_FEATURES="Zero-configuration $MAGICK_FEATURES"
664 # Build a high dynamic range version of ImageMagick.
665 AC_ARG_ENABLE([hdri],
666 [AC_HELP_STRING([--enable-hdri],
667 [accurately represent the wide range of intensity levels found in real scenes])],
668 [enable_hdri=$enableval],
672 if test "$enable_hdri" = 'yes'; then
674 magick_hdri_enable='1';
675 MAGICK_FEATURES="HDRI $MAGICK_FEATURES"
677 magick_hdri_enable='0'
679 AC_DEFINE_UNQUOTED(HDRI_ENABLE_OBSOLETE_IN_H,$magick_hdri_enable,[Whether hdri is enabled or not])
680 AC_SUBST(MAGICK_HDRI)dnl
681 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -DMAGICKCORE_HDRI_ENABLE=$magick_hdri_enable"
682 CFLAGS="$CFLAGS -DMAGICKCORE_HDRI_ENABLE=$magick_hdri_enable"
683 CPPFLAGS="$CPPFLAGS -DMAGICKCORE_HDRI_ENABLE=$magick_hdri_enable"
685 # Enable pipes (|) in filenames.
686 AC_ARG_ENABLE([pipes],
687 [AC_HELP_STRING([--enable-pipes],
688 [enable pipes (|) in filenames])],
689 [enable_pipes=$enableval],
692 if test "$enable_pipes" = 'yes'; then
693 AC_DEFINE(PIPES_SUPPORT,1,[enable pipes (|) in filenames])
694 MAGICK_FEATURES="Pipes $MAGICK_FEATURES"
697 # Build a version of ImageMagick with assert statements.
698 AC_ARG_ENABLE([assert],
699 [AC_HELP_STRING([--disable-assert],
700 [disable assert() statements in build])],
701 [enable_assert=$enableval],
702 [enable_assert='yes'])
704 if test "$enable_assert" = 'no'; then
705 AC_DEFINE(NDEBUG,1,[Turn off assert statements])
708 # Don't emit "rebuild rules" for configure, Makefile.ins, etc.
711 # Enable hugepages support
712 AC_ARG_ENABLE([hugepages],
713 [AC_HELP_STRING([--enable-hugepages],
714 [enable 'huge pages' support])],
715 [enable_hugepages=$enableval],
716 [enable_hugepages='no'])
718 # Enable ccmalloc memory debugging support
719 AC_ARG_ENABLE([ccmalloc],
720 [AC_HELP_STRING([--enable-ccmalloc],
721 [enable 'ccmalloc' memory debug support])],
722 [enable_ccmalloc=$enableval],
723 [enable_ccmalloc='no'])
725 # Enable Electric Fence memory debugging support
726 AC_ARG_ENABLE([efence],
727 [AC_HELP_STRING([--enable-efence],
728 [enable 'efence' memory debug support])],
729 [enable_efence=$enableval],
730 [enable_efence='no'])
732 # Enable prof-based profiling support
733 AC_ARG_ENABLE([prof],
734 [AC_HELP_STRING([--enable-prof],
735 [enable 'prof' profiling support])],
736 [enable_prof=$enableval],
739 # Enable gprof-based profiling support
740 AC_ARG_ENABLE([gprof],
741 [AC_HELP_STRING([--enable-gprof],
742 [enable 'gprof' profiling support])],
743 [enable_gprof=$enableval],
746 # Enable gcov-based profiling support
747 AC_ARG_ENABLE([gcov],
748 [AC_HELP_STRING([--enable-gcov],
749 [enable 'gcov' profiling support])],
750 [enable_gcov=$enableval],
753 enable_profiling='no'
754 if test "$enable_prof" = 'yes' || test "$enable_gprof" = 'yes' || test "$enable_gcov" = 'yes'; then
755 enable_profiling='yes'
756 if test "$libtool_build_shared_libs" = 'yes'; then
757 echo "Warning: Can not profile code using shared libraries"
761 # Magick API method prefix
762 AC_ARG_WITH([method-prefix],
763 [AC_HELP_STRING([--with-method-prefix=PREFIX],
764 [prefix MagickCore API methods])],
765 [with_method_prefix=$withval],
766 [with_method_prefix='no'])
768 if test "$with_method_prefix" != 'no'; then
769 AC_DEFINE_UNQUOTED(NAMESPACE_PREFIX,$with_method_prefix,[Magick API method prefix])
770 AC_DEFINE_UNQUOTED(NAMESPACE_PREFIX_TAG,["$with_method_prefix"],[Magick API method prefix tag])
771 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-method-prefix "
774 # Enable legacy support (default no)
775 AC_ARG_ENABLE(legacy-support,
776 [ --enable-legacy-support install legacy command-line utilities (default disabled)],
777 [with_legacy_support=$enableval],
778 [with_legacy_support='no'])
779 AM_CONDITIONAL(LEGACY_SUPPORT, test "$with_legacy_support" != 'no')
781 # Enable building command line utilities (default yes)
782 AC_ARG_WITH(utilities,
783 [ --with-utilities enable building command-line utilities (default yes)],
784 [with_utilities=$withval], [with_utilities='yes'])
785 AM_CONDITIONAL(WITH_UTILITIES, test "$with_utilities" = 'yes')
787 # Number of bits in a Quantum
788 AC_ARG_WITH([quantum-depth],
789 [AC_HELP_STRING([--with-quantum-depth=DEPTH],
790 [number of bits in a pixel quantum (default 16)])],
791 [with_quantum_depth=$withval],
792 [with_quantum_depth=16])
794 if test "$with_quantum_depth" != '8'; then
795 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-quantum-depth=$with_quantum_depth "
798 case "${with_quantum_depth}" in
803 * ) AC_MSG_ERROR("Pixel quantum depth must have value of 8, 16, 32, or 64") ;;
805 QUANTUM_DEPTH="$with_quantum_depth"
806 AC_DEFINE_UNQUOTED(QUANTUM_DEPTH_OBSOLETE_IN_H,$QUANTUM_DEPTH,[Number of bits in a pixel Quantum (8/16/32/64)])
807 AC_SUBST(QUANTUM_DEPTH)dnl
808 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -DMAGICKCORE_QUANTUM_DEPTH=$QUANTUM_DEPTH"
809 CFLAGS="$CFLAGS -DMAGICKCORE_QUANTUM_DEPTH=$QUANTUM_DEPTH"
810 CPPFLAGS="$CPPFLAGS -DMAGICKCORE_QUANTUM_DEPTH=$QUANTUM_DEPTH"
812 # define a lib suffix for abi purpose
813 MAGICK_ABI_SUFFIX="Q${QUANTUM_DEPTH}"
814 if test "$enable_hdri" = 'yes'; then
815 MAGICK_ABI_SUFFIX="Q${QUANTUM_DEPTH}${MAGICK_HDRI}"
817 AC_SUBST(MAGICK_ABI_SUFFIX)
819 # Set pixel cache threshold
821 [AC_HELP_STRING([--with-cache=THRESHOLD],
822 [set pixel cache threshhold in MB (default available memory)])],
823 [with_cache=$withval],
826 if test "$with_cache" != ''; then
827 AC_DEFINE_UNQUOTED(PixelCacheThreshold,$with_cache,[Pixel cache threshold in MB (defaults to available memory)])
828 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-cache=$with_cache "
831 # Disable/Enable support for full delegate paths
832 AC_ARG_WITH([frozenpaths],
833 [AC_HELP_STRING([--with-frozenpaths],
834 [freeze delegate paths])],
835 [with_frozenpaths=$withval],
836 [with_frozenpaths='no'])
838 # Enable build/install of Magick++
839 AC_ARG_WITH([magick-plus-plus],
840 [AC_HELP_STRING([--without-magick-plus-plus],
841 [disable build/install of Magick++])],
842 [with_magick_plus_plus=$withval],
843 [with_magick_plus_plus='yes'])
845 # Encode the this name into the shared library.
846 AC_ARG_WITH([package-release-name],
847 [AC_HELP_STRING([--with-package-release-name=NAME],
848 [encode this name into the shared library])],
849 [MAGICK_LT_RELEASE_OPTS="-release $withval"])
850 AC_SUBST(MAGICK_LT_RELEASE_OPTS)
852 # Disable build/install of PerlMagick.
854 [AC_HELP_STRING([--with-perl],
855 [enable build/install of PerlMagick])],
856 [with_perl=$withval],
859 # Options to pass when configuring PerlMagick
860 AC_ARG_WITH([perl-options],
861 [AC_HELP_STRING([--with-perl-options=OPTIONS],
862 [options to pass on command-line when generating PerlMagick build file])],
863 PERL_MAKE_OPTIONS=$withval)
864 AC_SUBST(PERL_MAKE_OPTIONS)
866 # Enable jemalloc, object-caching memory allocation library.
867 AC_ARG_WITH(jemalloc,
868 [ --with-jemalloc enable jemalloc memory allocation library support],
869 [with_jemalloc=$withval],
870 [with_jemalloc='no'])
871 if test "$with_jemalloc" != 'yes' ; then
872 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jemalloc=$with_jemalloc "
875 # Enable use of TCMalloc library.
876 AC_ARG_WITH(tcmalloc,
877 AS_HELP_STRING([--with-tcmalloc],
878 [enable tcmalloc memory allocation library support]),
879 [with_tcmalloc=$withval],
880 [with_tcmalloc='no'])
881 if test "$with_tcmalloc" != 'no' ; then
882 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-tcmalloc=$with_tcmalloc "
885 # Enable umem, object-caching memory allocation library.
887 [ --with-umem enable umem memory allocation library support],
888 [with_umem=$withval],
890 if test "$with_umem" != 'yes' ; then
891 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-umem=$with_umem "
895 # Specify path to shared libstdc++ if not in normal location
897 AC_ARG_WITH([libstdc],
898 [AC_HELP_STRING([--with-libstdc=DIR],
899 [ use libstdc++ in DIR (for GNU C++)])],
900 [with_libstdc=$withval],
903 if test "$with_libstdc" != ''; then
904 if test -d "$with_libstdc"; then
905 LIBSTDCLDFLAGS="-L$with_libstdc"
908 AC_SUBST(LIBSTDCLDFLAGS)
910 # Does gcc required -traditional?
911 AC_PROG_GCC_TRADITIONAL
915 # Set defines required to build DLLs and modules using MinGW
918 # These options are set for multi-thread DLL module build
919 # libMagickCore: _DLL _MAGICKMOD_ _MAGICKLIB_
921 # executable/Magick++: _DLL _MAGICKMOD_
922 MODULE_EXTRA_CPPFLAGS=''
923 LIBRARY_EXTRA_CPPFLAGS=''
924 if test "${native_win32_build}" = 'yes'; then
925 if test "${libtool_build_shared_libs}" = 'yes'; then
926 CPPFLAGS="$CPPFLAGS -D_DLL"
927 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_DLL"
928 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_DLL"
929 LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKLIB_"
930 if test "$build_modules" = 'yes'; then
931 LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKMOD_"
933 MODULE_EXTRA_CPPFLAGS="$MODULE_EXTRA_CPPFLAGS -D_MAGICKLIB_"
936 CPPFLAGS="$CPPFLAGS -D_LIB"
937 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_LIB"
938 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_LIB"
940 if test "$with_threads" = 'yes'; then
941 CPPFLAGS="$CPPFLAGS -D_MT"
942 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_MT"
943 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_MT"
946 AC_SUBST(MODULE_EXTRA_CPPFLAGS)
947 AC_SUBST(LIBRARY_EXTRA_CPPFLAGS)
949 # Check standard headers
951 if ! test x"$ac_cv_header_stdc" = x"yes"; then
952 AC_MSG_WARN([configure has detected that you do not have the ANSI standard C
953 header files. Compilation cannot proceed. Please install the ANSI C
954 headers and rerun this script.]);
959 # Check additional headers
960 AC_CHECK_HEADERS(arm/limits.h arpa/inet.h complex.h errno.h fcntl.h limits.h linux/unistd.h locale.h machine/param.h mach-o/dyld.h netinet/in.h OS.h process.h sun_prefetch.h stdarg.h sys/ipc.h sys/mman.h sys/resource.h sys/sendfile.h sys/socket.h sys/syslimits.h sys/time.h sys/timeb.h sys/times.h sys/wait.h utime.h wchar.h xlocale.h)
964 # Checks for typedefs, structures, and compiler characteristics.
978 # Checks for language qualifiers and semantics.
986 # If words are stored with the most significant byte first (like
987 # Motorola and SPARC CPUs), define `WORDS_BIGENDIAN'.
990 # Define to a suitable type, if standard headers do not define it.
998 AC_TYPE_LONG_DOUBLE_WIDER
999 AC_TYPE_LONG_LONG_INT
1013 AC_TYPE_UNSIGNED_LONG_LONG_INT
1015 AC_CHECK_TYPES([locale_t], [], [], [[#include <xlocale.h>]])
1017 # Float_t and double_t are intended to be the the most efficient type.
1018 AC_CHECK_TYPES([float_t], [], [], [[#include <math.h>]])
1019 AC_CHECK_TYPES([double_t], [], [], [[#include <math.h>]])
1020 AC_CHECK_SIZEOF([float_t], [], [[#include <math.h>]])
1021 AC_CHECK_SIZEOF([double_t], [], [[#include <math.h>]])
1023 # Get size of float, double and long double for comparaison.
1024 AC_CHECK_SIZEOF([float])
1025 AC_CHECK_SIZEOF([double])
1026 AC_CHECK_SIZEOF([long double])
1028 # Obtain size of an 'signed short' and define as SIZEOF_SIGNED_SHORT
1029 AC_CHECK_SIZEOF(signed short)
1031 # Obtain size of an 'unsigned short' and define as SIZEOF_UNSIGNED_SHORT
1032 AC_CHECK_SIZEOF(unsigned short)
1034 # Obtain size of an 'signed int' and define as SIZEOF_SIGNED_INT
1035 AC_CHECK_SIZEOF(signed int)
1037 # Obtain size of an 'unsigned int' and define as SIZEOF_UNSIGNED_INT
1038 AC_CHECK_SIZEOF(unsigned int)
1040 # Obtain size of a 'signed long' and define as SIZEOF_SIGNED_LONG
1041 AC_CHECK_SIZEOF(signed long)
1043 # Obtain size of a 'unsigned long' and define as SIZEOF_UNSIGNED_LONG
1044 AC_CHECK_SIZEOF(unsigned long)
1046 # Obtain size of a 'long long' and define as SIZEOF_SIGNED_LONG_LONG. If
1047 # 'signed long long' is not supported then the value defined is zero.
1048 AC_CHECK_SIZEOF(signed long long)
1050 # Obtain size of a 'unsigned long long' and define as
1051 # SIZEOF_UNSIGNED_LONG_LONG. If 'unsigned long long' is not
1052 # supported then the value defined is zero.
1053 AC_CHECK_SIZEOF(unsigned long long)
1055 # Obtain size of off_t and define as SIZEOF_OFF_T
1056 AC_CHECK_SIZEOF(off_t)
1058 # Obtain size of size_t and define as SIZEOF_SIZE_T
1059 AC_CHECK_SIZEOF(size_t)
1061 # Obtain size of ssize_t and define as SIZEOF_SSIZE_T
1062 AC_CHECK_SIZEOF(ssize_t)
1064 # Obtain size of an unsigned int pointer and define as SIZEOF_UNSIGNED_INTP
1065 AC_CHECK_SIZEOF(unsigned int*)
1068 # Compute sized types for current CPU and compiler options.
1071 AC_MSG_CHECKING(for signed 8-bit type)
1072 INT8_T='signed char'
1073 AC_MSG_RESULT($INT8_T)
1076 AC_MSG_CHECKING(for unsigned 8-bit type)
1077 UINT8_T='unsigned char'
1078 AC_MSG_RESULT($UINT8_T)
1081 AC_MSG_CHECKING(for signed 16-bit type)
1082 INT16_T='signed short'
1083 AC_MSG_RESULT($INT16_T)
1086 AC_MSG_CHECKING(for unsigned 16-bit type)
1087 UINT16_T='unsigned short'
1088 AC_MSG_RESULT($UINT16_T)
1091 AC_MSG_CHECKING(for signed 32-bit type)
1094 if test $ac_cv_sizeof_signed_int -eq 4; then
1095 INT32_T='signed int'
1097 elif test $ac_cv_sizeof_signed_long -eq 4; then
1098 INT32_T='signed long'
1101 AC_MSG_RESULT($INT32_T)
1105 AC_MSG_CHECKING(for unsigned 32-bit type)
1108 if test $ac_cv_sizeof_unsigned_int -eq 4; then
1109 UINT32_T='unsigned int'
1111 elif test $ac_cv_sizeof_unsigned_long -eq 4; then
1112 UINT32_T='unsigned long'
1115 AC_MSG_RESULT($UINT32_T)
1119 AC_MSG_CHECKING(for signed 64-bit type)
1122 if test $ac_cv_sizeof_signed_long -eq 8; then
1123 INT64_T='signed long'
1125 elif test $ac_cv_sizeof_signed_long_long -eq 8; then
1126 INT64_T='signed long long'
1129 case "${host_os}" in
1134 AC_MSG_RESULT($INT64_T)
1138 AC_MSG_CHECKING(for unsigned 64-bit type)
1141 if test $ac_cv_sizeof_unsigned_long -eq 8; then
1142 UINT64_T='unsigned long'
1144 elif test $ac_cv_sizeof_unsigned_long_long -eq 8; then
1145 UINT64_T='unsigned long long'
1148 case "${host_os}" in
1153 AC_MSG_RESULT($UINT64_T)
1157 AC_MSG_CHECKING(for unsigned maximum type)
1160 if test "$UINT64_T" != 'none'; then
1163 elif test "$UINT32_T" != 'none'; then
1167 AC_MSG_RESULT($UINTMAX_T)
1171 AC_MSG_CHECKING(for pointer difference type)
1174 if test $ac_cv_sizeof_unsigned_long -eq $ac_cv_sizeof_unsigned_intp; then
1175 UINTPTR_T='unsigned long'
1177 elif test $ac_cv_sizeof_unsigned_long_long -eq $ac_cv_sizeof_unsigned_intp; then
1178 UINTPTR_T='unsigned long long'
1181 AC_MSG_RESULT($UINTPTR_T)
1185 AC_MSG_CHECKING([whether our compiler supports __func__])
1187 [{ const char *func = __func__; return(func != 0 ? 0 : 1); }],
1188 AC_MSG_RESULT([yes]),
1190 AC_MSG_CHECKING([whether our compiler supports __FUNCTION__])
1192 [{ const char *func = __FUNCTION__; return(func != 0 ? 0 : 1); }],
1193 AC_MSG_RESULT([yes])
1194 AC_DEFINE(__func__, __FUNCTION__,
1195 [Define to appropriate substitute if compiler does not have __func__]),
1197 AC_DEFINE(__func__, __FILE__,
1198 [Define to appropriate substitute if compiler does not have __func__])))
1202 # Check for functions
1205 AC_FUNC_CLOSEDIR_VOID
1209 AC_FUNC_SELECT_ARGTYPES
1210 AC_FUNC_SETVBUF_REVERSED
1220 AC_CHECK_LIB(m,sqrt,MATH_LIBS="-lm",,)
1221 LIBS="$MATH_LIBS $LIBS"
1225 # Find socket library
1227 AC_SEARCH_LIBS(gethostbyname, resolv nsl)
1228 AC_SEARCH_LIBS(socket, socket,
1230 AC_DEFINE([HAVE_SOCKET],[1],[Define to 1 if you have socket support.])
1231 MAGICK_FEATURES="DPC $MAGICK_FEATURES"
1235 # Check for clock_gettime().
1237 AC_SEARCH_LIBS(clock_gettime, rt,
1239 AC_DEFINE([HAVE_CLOCK_GETTIME],[1],[Define to 1 if you have clock_gettime.])
1240 AC_MSG_CHECKING([whether clock_gettime supports CLOCK_REALTIME])
1243 [[#include <time.h>]],
1244 [[clockid_t clockType = CLOCK_REALTIME;]])],
1247 AC_DEFINE([HAVE_CLOCK_REALTIME],[1],
1248 [Define to 1 if clock_gettime supports CLOCK_REALTIME.])
1254 AC_CHECK_FUNCS([gettimeofday ftime], [break])
1260 # Check for function prototypes
1264 AC_CHECK_DECLS([pread, pwrite],[],[],[
1265 #include <unistd.h>])
1267 AC_CHECK_DECLS([strlcpy],[],[],[
1268 #include <strings.h>])
1270 AC_CHECK_DECLS([vsnprintf],[],[],[
1272 #include <stdarg.h>])
1276 # C++ Support Tests (For Magick++)
1279 have_magick_plus_plus='no'
1280 if test "$with_magick_plus_plus" = 'yes'; then
1285 # Full set of headers used...
1286 # algorithm cctype cerrno cmath cstdio cstdlib cstring ctime exception
1287 # functional iomanip iosfwd iostream iterator list string strstream utility
1292 AX_CXX_NAMESPACE_STD
1293 AC_CXX_HAVE_STD_LIBS
1297 AC_MSG_CHECKING([whether C++ compiler is sufficient for Magick++])
1299 test $ax_cv_cxx_bool = 'yes' && \
1300 test $ax_cv_cxx_namespaces = 'yes' && \
1301 test $ac_cv_cxx_have_std_libs = 'yes' && \
1302 test $ax_cv_cxx_have_std_namespace = 'yes'; then
1303 have_magick_plus_plus='yes'
1305 have_magick_plus_plus='no (failed tests)'
1307 AC_MSG_RESULT([$have_magick_plus_plus])
1310 AM_CONDITIONAL(WITH_MAGICK_PLUS_PLUS, test "$have_magick_plus_plus" = 'yes')
1312 # Only check for delegate libraries in subdirectories if requested.
1313 if test "$enable_delegate_build" != 'no'; then
1314 # Check for delegate sub-directories and add -I & -L options as required.
1315 # This presumes that delegates are installed as detailed in the ImageMagick
1316 # README. If delegates are installed in a standard location where the
1317 # compiler will automatically find them then these options should not be
1321 # Most delegates have includes in the same directory as the library, but not all...
1324 for dir in bzlib fftw fpx gslib/src jp2 jbig/libjbig jpeg lcms/include lzma magick openjp2/include png tiff/libtiff ttf/include wand webp/src wmf/include xml/include zlib; do
1325 if test -d "$builddir/$dir"; then
1326 CPPFLAGS="$CPPFLAGS -I$builddir/$dir"
1328 if test -d "$srcdirfull/$dir"; then
1329 CPPFLAGS="$CPPFLAGS -I$srcdirfull/$dir"
1335 for dir in bzlib fftw fpx gslib/src jbig/libjbig jpeg lcms/src lzma magick openjp2 png tiff/libtiff ttf/objs wand webp wmf/src xml zlib; do
1336 if test -d "$builddir/$dir/.libs"; then
1337 LDFLAGS="$LDFLAGS -L$builddir/$dir/.libs"
1339 if test -d "$srcdirfull/$dir/.libs"; then
1340 LDFLAGS="$LDFLAGS -L$srcdirfull/$dir/.libs"
1343 if test -d "$builddir/$dir"; then
1344 LDFLAGS="$LDFLAGS -L$builddir/$dir"
1346 if test -d "$srcdirfull/$dir"; then
1347 LDFLAGS="$LDFLAGS -L$srcdirfull/$dir"
1353 # Assume that delegate headers reside under same directory as ImageMagick
1354 # installation prefix.
1355 MAGICK_CPPFLAGS="-I$INCLUDE_DIR/${PACKAGE_NAME}-$MAGICK_MAJOR_VERSION $MAGICK_CPPFLAGS"
1358 # Find the X11 RGB database
1360 AC_CACHE_CHECK(for X11 configure files,im_cv_x_configure,
1361 [# Look for the header file in a standard set of common directories.
1362 # Check X11 before X11Rn because it is often a symlink to the current release.
1371 /usr/XFree86/lib/X11 \
1379 /usr/local/X11/lib \
1380 /usr/local/X11R4/lib \
1381 /usr/local/X11R5/lib \
1382 /usr/local/X11R6/lib \
1384 /usr/local/lib/X11 \
1385 /usr/local/lib/X11R4 \
1386 /usr/local/lib/X11R5 \
1387 /usr/local/lib/X11R6 \
1388 /usr/local/lib/X11R7 \
1389 /usr/local/x11r5/lib \
1390 /usr/lpp/Xamples/lib \
1392 /usr/openwin/share/lib \
1393 /usr/unsupported/lib \
1396 if test -f "$ac_dir/X11/rgb.txt"; then
1397 im_cv_x_configure="$ac_dir/X11/"
1399 elif test -f "$ac_dir/rgb.txt"; then
1400 im_cv_x_configure="$ac_dir/"
1405 X11_CONFIGURE_PATH="$im_cv_x_configure"
1406 case "${build_os}" in
1408 X11ConfigurePath=`$WinPathScript "$X11ConfigurePath=" 1`
1411 AC_DEFINE_UNQUOTED(X11_CONFIGURE_PATH,"$X11ConfigurePath",[Location of X11 configure files])
1414 # Find OpenMP library
1417 if test "$enable_openmp" != 'no'; then
1418 if test "${GCC}" = "yes"; then
1419 # Open64 (passes for GCC but uses different OpenMP implementation)
1420 if test "x$GOMP_LIBS" = x ; then
1421 if $CC --version 2>&1 | grep Open64 > /dev/null ; then
1422 AC_CHECK_LIB(openmp,omp_get_num_procs,GOMP_LIBS="-lopenmp",,)
1425 # Clang (passes for GCC but uses different OpenMP implementation)
1426 if test "x$LIB_OMP" = x ; then
1427 if $CC --version 2>&1 | grep clang > /dev/null ; then
1428 AC_CHECK_LIB(omp,GOMP_parallel_start,LIB_OMP="-lomp",,)
1432 if test "x$GOMP_LIBS" = x ; then
1433 AC_CHECK_LIB(gomp,GOMP_parallel_start,GOMP_LIBS="-lgomp",,)
1437 if test "x$GOMP_LIBS" = x ; then
1438 AC_CHECK_LIB(mtsk,sunw_mp_register_warn,GOMP_LIBS="-lmtsk",,)
1441 if test "x$GOMP_LIBS" = x ; then
1442 AC_CHECK_LIB(xlsmp,_xlsmpFlush,GOMP_LIBS="-lxlsmp",,)
1444 # SGI IRIX 6.5 MIPSpro C/C++
1445 if test "x$GOMP_LIBS" = x ; then
1446 AC_CHECK_LIB(mp,mp_destroy,GOMP_LIBS="-lmp",,)
1449 LIBS="$GOMP_LIBS $LIBS"
1454 # Check for jemalloc.
1458 if test "$with_jemalloc" != 'no'; then
1459 AC_MSG_CHECKING(for JEMALLOC support )
1463 AC_CHECK_HEADER([jemalloc/jemalloc.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
1464 AC_CHECK_LIB(jemalloc,[malloc_stats_print],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
1465 AC_MSG_CHECKING(if jemalloc memory allocation library is complete)
1466 if test $passed -gt 0; then
1467 if test $failed -gt 0; then
1468 AC_MSG_RESULT(no -- some components failed test)
1469 have_jemalloc='no (failed tests)'
1471 JEMALLOC_LIBS='-ljemalloc'
1472 LIBS="$JEMALLOC_LIBS $LIBS"
1473 AC_DEFINE(HasJEMALLOC,1,Define if you have jemalloc memory allocation library)
1481 AM_CONDITIONAL(HasJEMALLOC, test "$have_jemalloc" = 'yes')
1482 AC_SUBST(JEMALLOC_LIBS)
1485 # Check for TCMalloc library
1490 if test "$have_threads" = 'yes' -a "$with_tcmalloc" != 'no'; then
1491 AC_MSG_CHECKING([tcmalloc library support ])
1496 AC_CHECK_LIB([tcmalloc_minimal],[mallinfo],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[])
1498 if test $passed -gt 0; then
1499 if test $failed -gt 0; then
1500 have_tcmalloc='no (some components failed test)'
1502 TCMALLOC_LIBS=-ltcmalloc_minimal
1503 LIBS="$TCMALLOC_LIBS $LIBS"
1504 CFLAGS="$CFLAGS -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free"
1505 AC_DEFINE([HAVE_TCMALLOC],[1],[Define if you have the tcmalloc memory allocation library])
1509 AC_MSG_CHECKING([if tcmalloc memory allocation library is complete ])
1510 AC_MSG_RESULT([$have_tcmalloc])
1512 AM_CONDITIONAL([HAVE_TCMALLOC], [test "$have_tcmalloc" = 'yes'])
1513 AC_SUBST([TCMALLOC_LIBS])
1520 if test "$with_umem" != 'no'; then
1521 AC_MSG_CHECKING(for UMEM support )
1525 AC_CHECK_HEADER(umem.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1526 AC_CHECK_LIB(umem,umem_alloc,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1527 AC_CHECK_LIB(umem,umem_free,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1528 AC_MSG_CHECKING(if umem memory allocation library is complete)
1529 if test $passed -gt 0; then
1530 if test $failed -gt 0; then
1531 AC_MSG_RESULT(no -- some components failed test)
1532 have_umem='no (failed tests)'
1535 LIBS="$UMEM_LIBS $LIBS"
1536 AC_DEFINE(HAVE_UMEM,1,Define if you have umem memory allocation library)
1544 AM_CONDITIONAL(HAVE_UMEM, test "$have_umem" = 'yes')
1548 # Add support for ccmalloc memory debugging library if requested
1552 if test "$enable_ccmalloc" = 'yes'; then
1553 AC_PATH_PROG(CCMALLOCDelegate,ccmalloc,)
1554 if test -n "$CCMALLOCDelegate"; then
1555 eval `grep PREFIX= $CCMALLOCDelegate | sed -e 's/PREFIX/CCMALLOC_PREFIX/'`
1557 # Assume that gcc is used with ccmalloc.
1558 LIBS="$LIBS $CCMALLOC_PREFIX/lib/ccmalloc-gcc.o"
1559 AC_CHECK_LIB(ccmalloc,ccmalloc_malloc,CCMALLOC_LIBS="$CCMALLOC_PREFIX/lib/ccmalloc-gcc.o -lccmalloc -ldl",,-ldl)
1560 if test -n "$CCMALLOC_LIBS"; then
1562 LIBS="$LIBS $CCMALLOC_LIBS"
1571 # Add support for 'huge pages' if requested
1573 AS_IF([test "x$enable_hugepages" != "xno"],[
1574 AC_DEFINE(HAVE_HUGEPAGES, 1, [Compile with hugepage support])
1578 # Add support for efence memory debugging library if requested
1580 if test "$enable_efence" = 'yes'; then
1581 EFENCE_LIBS='-lefence'
1582 LIBS="$EFENCE_LIBS $LIBS"
1585 dnl ===========================================================================
1591 AC_ARG_WITH([bzlib],
1592 [AC_HELP_STRING([--without-bzlib],
1593 [disable BZLIB support])],
1594 [with_bzlib=$withval],
1597 if test "$with_bzlib" != 'yes'; then
1598 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-bzlib=$with_bzlib "
1602 if test "$with_bzlib" != 'no'; then
1604 AC_MSG_RESULT([-------------------------------------------------------------])
1605 AC_MSG_CHECKING([for BZLIB])
1610 AC_CHECK_HEADER(bzlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1611 AC_CHECK_LIB(bz2,BZ2_bzDecompress,found_libbz=`expr $found_libbz + 1`,,)
1612 if test "$native_win32_build" = 'yes'; then
1613 AC_CHECK_LIB(bz2,_imp__BZ2_decompress,found_libbz=`expr $found_libbz + 1`,,)
1615 if test $found_libbz -gt 0; then
1616 passed=`expr $passed + 1`
1618 failed=`expr $failed + 1`
1620 AC_MSG_CHECKING(if BZLIB package is complete)
1621 if test $passed -gt 0; then
1622 if test $failed -gt 0; then
1623 AC_MSG_RESULT(no -- some components failed test)
1624 have_bzlib='no (failed tests)'
1627 LIBS="$BZLIB_LIBS $LIBS"
1628 AC_DEFINE(BZLIB_DELEGATE,1,Define if you have the bzip2 library)
1636 AM_CONDITIONAL(BZLIB_DELEGATE, test "$have_bzlib" = 'yes')
1637 AC_SUBST(BZLIB_LIBS)
1640 # Find the X11 include and library directories.
1647 if test "$no_x" != 'yes'; then
1648 AC_MSG_RESULT([-------------------------------------------------------------])
1649 AC_MSG_CHECKING([for X11])
1651 LDFLAGS="$LDFLAGS $X_LIBS"
1652 X11_LIBS="$X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
1653 LIBS="$X11_LIBS $LIBS"
1654 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1656 AC_DEFINE(X11_DELEGATE,1,Define if you have X11 library)dnl
1659 # Check for X11 shared memory extension
1661 # shmctl is required to support the shared memory extension
1662 AC_CHECK_FUNC([shmctl],[have_shmctl='yes'],[])
1663 if test "$have_shmctl" != 'yes'; then
1665 LIBS="$LIBS -lcygipc"
1666 AC_TRY_LINK_FUNC([shmctl],[have_shmctl='yes'; IPC_LIBS='-lcygipc'],[])
1670 if test "$have_shmctl" = 'yes'; then
1671 AC_CHECK_LIB([Xext],[XShmAttach],[XEXT_LIBS='-lXext' ; AC_DEFINE(HAVE_SHARED_MEMORY,1,X11 server supports shared memory extension)],[],[])
1675 # Check for X11 shape extension
1677 AC_CHECK_LIB([Xext],[XShapeCombineMask],[XEXT_LIBS='-lXext' ; AC_DEFINE(HAVE_SHAPE,1,X11 server supports shape extension)],[],[])
1678 AC_CHECK_LIB(Xt,XtSetEventDispatcher,XT_LIBS='-lXt',,)
1679 LIBS="$XEXT_LIBS $XT_LIBS $LIBS"
1681 if test "$no_x" != 'yes'; then
1686 AM_CONDITIONAL(X11_DELEGATE, test "$have_x" = 'yes')
1690 dnl ===========================================================================
1696 [AC_HELP_STRING([--without-zlib],
1697 [disable ZLIB support])],
1698 [with_zlib=$withval],
1701 if test "$with_zlib" != 'yes'; then
1702 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-zlib=$with_zlib "
1709 if test "x$with_zlib" = "xyes"; then
1710 AC_MSG_RESULT([-------------------------------------------------------------])
1711 PKG_CHECK_MODULES(ZLIB,[zlib >= 1.0.0], have_zlib=yes, have_zlib=no)
1715 if test "$have_zlib" = 'yes'; then
1716 AC_DEFINE(ZLIB_DELEGATE,1,Define if you have ZLIB library)
1717 CFLAGS="$ZLIB_CFLAGS $CFLAGS"
1718 LIBS="$ZLIB_LIBS $LIBS"
1721 AM_CONDITIONAL(ZLIB_DELEGATE, test "$have_zlib" = 'yes')
1722 AC_SUBST(ZLIB_CFLAGS)
1725 dnl ===========================================================================
1731 [AC_HELP_STRING([--without-zstd],
1732 [disable ZSTD support])],
1733 [with_zstd=$withval],
1736 if test "$with_zstd" != 'yes'; then
1737 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-zstd=$with_zstd "
1744 if test "x$with_zstd" = "xyes"; then
1745 AC_MSG_RESULT([-------------------------------------------------------------])
1746 PKG_CHECK_MODULES(LIBZSTD,[libzstd >= 1.0.0], have_zstd=yes, have_zstd=no)
1750 if test "$have_zstd" = 'yes'; then
1751 AC_DEFINE(ZSTD_DELEGATE,1,Define if you have ZSTD library)
1752 CFLAGS="$ZSTD_CFLAGS $CFLAGS"
1753 LIBS="$ZSTD_LIBS $LIBS"
1756 AM_CONDITIONAL(ZSTD_DELEGATE, test "$have_zstd" = 'yes')
1757 AC_SUBST(ZSTD_CFLAGS)
1760 dnl ===========================================================================
1762 # whether modules are built or not.
1766 if test "$build_modules" != 'no' || test "X$ax_cv_check_cl_libcl" != Xno; then
1767 AC_MSG_RESULT([-------------------------------------------------------------])
1768 AC_MSG_CHECKING([for libltdl])
1772 AC_CHECK_HEADER([ltdl.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
1773 AC_CHECK_LIB([ltdl],[lt_dlinit],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
1774 AC_MSG_CHECKING([if libltdl package is complete])
1775 if test $passed -gt 0 ; then
1776 if test $failed -gt 0 ; then
1777 AC_MSG_RESULT([no -- some components failed test])
1778 have_ltdl='no (failed tests)'
1781 LIBS="$LTDL_LIBS $LIBS"
1782 AC_DEFINE(LTDL_DELEGATE,1,[Define if using libltdl to support dynamically loadable modules and OpenCL])
1783 AC_DEFINE_UNQUOTED([LTDL_MODULE_EXT],["${shrext_cmds}"],[Native module suffix])
1784 AC_MSG_RESULT([yes])
1790 if test "$have_ltdl" != 'yes' ; then
1791 AC_MSG_FAILURE([libltdl is required for modules and OpenCL builds],[1])
1794 AM_CONDITIONAL(WITH_LTDL, test "$have_ltdl" != 'no')
1797 # If profiling, then check for -ldl and dlopen (required for Solaris & gcc)
1800 if test "$enable_profiling" = 'yes'; then
1801 AC_CHECK_LIB(dl,dlopen,LIB_DL='-ldl',,)
1802 LIBS="$LIB_DL $LIBS"
1806 dnl ===========================================================================
1809 # Set Apple font directory.
1811 AC_ARG_WITH([apple-font-dir],
1812 [AC_HELP_STRING([--with-apple-font-dir=DIR],
1813 [Apple font directory])],
1814 [with_apple_font_dir=$withval],
1815 [with_apple_font_dir='default'])
1817 if test "$with_apple_font_dir" != 'default'; then
1818 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-apple-font-dir=$with_apple_font_dir "
1821 dnl ===========================================================================
1824 # Check for Autotrace delegate library.
1826 AC_ARG_WITH([autotrace],
1827 [AC_HELP_STRING([--with-autotrace],
1828 [enable autotrace support])],
1829 [with_autotrace=$withval],
1830 [with_autotrace='no'])
1832 if test "$with_autotrace" != 'yes'; then
1833 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-autotrace=$with_autotrace "
1840 if test "x$with_autotrace" = "xyes"; then
1841 AC_MSG_RESULT([-------------------------------------------------------------])
1842 PKG_CHECK_MODULES(AUTOTRACE,[autotrace >= 0.31.1], have_autotrace=yes, have_autotrace=no)
1846 if test "$have_autotrace" = 'yes'; then
1847 AC_DEFINE(AUTOTRACE_DELEGATE,1,Define if you have AUTOTRACE library)
1848 CFLAGS="$AUTOTRACE_CFLAGS $CFLAGS"
1851 AM_CONDITIONAL(AUTOTRACE_DELEGATE,test "$have_autotrace" = 'yes')
1852 AC_SUBST(AUTOTRACE_CFLAGS)
1853 AC_SUBST(AUTOTRACE_LIBS)
1855 dnl ===========================================================================
1858 # Check for Display Postscript delegate library.
1861 [AC_HELP_STRING([--without-dps],
1862 [disable Display Postscript support])],
1863 [with_dps=$withval],
1866 if test "$with_dps" != 'yes'; then
1867 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-dps=$with_dps "
1872 if test "$with_dps" != 'no' && test "$with_x" != 'no'; then
1873 AC_MSG_RESULT([-------------------------------------------------------------])
1874 AC_MSG_CHECKING([for DPS])
1878 PERSIST_CPPFLAGS="$CPPFLAGS"
1879 CPPFLAGS="$CPPFLAGS -I${ac_x_includes}/X11"
1880 AC_CHECK_HEADER(DPS/dpsXclient.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1882 # XFree86-4.x needs -lXt to provide XtMalloc for -ldps.
1883 # Cygwin doesn't deliver -lXt as a DLL, which prevents a DLL build.
1884 # Adobe DPS (as delivered on Solaris) doesn't require -lXt.
1885 # ImageMagick itself doesn't use -lXt.
1888 AC_CHECK_LIB(dps,DPSInitialize,have_libdps='yes',have_libdps='no',)
1889 if test "$have_libdps" != 'yes'; then
1890 # Unset cache variable so we can try again.
1891 unset ac_cv_lib_dps_DPSInitialize
1892 AC_CHECK_LIB(dps,DPSInitialize,have_libdps='yes',have_libdps='no',-lXt)
1893 if test "$have_libdps" = 'yes'; then
1897 if test "$have_libdps" = 'yes'; then
1898 passed=`expr $passed + 1`
1900 failed=`expr $failed + 1`
1902 AC_CHECK_LIB(dpstk,XDPSPixelsPerPoint,passed=`expr $passed + 1`,failed=`expr $failed + 1`,-ldps $LIBDPS_XT)
1903 AC_MSG_CHECKING([if DPS package is complete])
1904 if test $passed -gt 0; then
1905 if test $failed -gt 0; then
1906 AC_MSG_RESULT([no -- some components failed test])
1907 have_dps='no (failed tests)'
1908 CPPFLAGS="$PERSIST_CPPFLAGS"
1910 DPS_LIBS="-ldpstk -ldps ${LIBDPS_XT}"
1911 LIBS="$DPS_LIBS $LIBS"
1912 AC_DEFINE(DPS_DELEGATE,1,Define if you have Display Postscript)
1913 AC_MSG_RESULT([yes])
1918 CPPFLAGS=$PERSIST_CPPFLAGS
1921 AM_CONDITIONAL(DPS_DELEGATE, test "$have_dps" = 'yes')
1924 dnl ===========================================================================
1927 # Set DejaVu font directory.
1929 AC_ARG_WITH([dejavu-font-dir],
1930 [AC_HELP_STRING([--with-dejavu-font-dir=DIR],
1931 [DejaVu font directory])],
1932 [with_dejavu_font_dir=$withval],
1933 [with_dejavu_font_dir='default'])
1935 if test "$with_dejavu_font_dir" != 'default'; then
1936 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-dejavu-font-dir=$with_dejavu_font_dir "
1939 dnl ===========================================================================
1942 # Check for FFTW delegate library.
1945 [AC_HELP_STRING([--without-fftw],
1946 [disable FFTW support])],
1947 [with_fftw=$withval],
1950 if test "$with_fftw" != 'yes'; then
1951 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fftw=$with_fftw "
1958 if test "x$with_fftw" = "xyes"; then
1959 AC_MSG_RESULT([-------------------------------------------------------------])
1960 PKG_CHECK_MODULES(fftw3,[fftw3 >= 3.0.0], have_fftw=yes, have_fftw=no)
1964 if test "$have_fftw" = 'yes'; then
1965 AC_DEFINE(FFTW_DELEGATE,1,Define if you have FFTW library)
1966 FFTW_CFLAGS="$fftw3_CFLAGS"
1967 FFTW_LIBS="$fftw3_LIBS"
1968 CFLAGS="$fftw3_CFLAGS $CFLAGS"
1971 AM_CONDITIONAL(FFTW_DELEGATE, test "$have_fftw" = 'yes')
1972 AC_SUBST(FFTW_CFLAGS)
1975 dnl ===========================================================================
1978 # Check for FLIF delegate library.
1981 [AC_HELP_STRING([--without-flif],
1982 [disable FLIF support])],
1983 [with_flif=$withval],
1986 if test "$with_flif" != 'yes'; then
1987 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-flif=$with_flif "
1992 if test "$with_flif" != 'no'; then
1993 AC_MSG_RESULT([-------------------------------------------------------------])
1994 AC_MSG_CHECKING([for FLIF])
1998 AC_CHECK_HEADER(flif.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1999 AC_CHECK_LIB(flif,flif_create_decoder,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2000 AC_MSG_CHECKING([if FLIF package is complete])
2001 if test $passed -gt 0; then
2002 if test $failed -gt 0; then
2003 AC_MSG_RESULT([no -- some components failed test])
2004 have_flif='no (failed tests)'
2007 LIBS="$FLIF_LIBS $LIBS"
2008 AC_DEFINE(FLIF_DELEGATE,1,Define if you have FLIF library)
2009 AC_MSG_RESULT([yes])
2016 AM_CONDITIONAL(FLIF_DELEGATE,test "$have_flif" = 'yes')
2019 dnl ===========================================================================
2022 # Check for FlashPIX delegate library.
2025 [AC_HELP_STRING([--without-fpx],
2026 [disable FlashPIX support])],
2027 [with_fpx=$withval],
2030 if test "$with_fpx" != 'yes'; then
2031 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fpx=$with_fpx "
2036 if test "$with_fpx" != 'no'; then
2037 AC_MSG_RESULT([-------------------------------------------------------------])
2038 AC_MSG_CHECKING([for FlashPIX])
2043 AC_CHECK_HEADER(fpxlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2044 AC_CHECK_LIB(fpx,FPX_OpenImageByFilename,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2046 AC_MSG_CHECKING([if FlashPIX package is complete])
2047 if test $passed -gt 0; then
2048 if test $failed -gt 0; then
2049 AC_MSG_RESULT([no -- some components failed test])
2050 have_fpx='no (failed tests)'
2053 AC_DEFINE(FPX_DELEGATE,1,Define if you have FlashPIX library)
2054 AC_MSG_RESULT([yes])
2062 AM_CONDITIONAL(FPX_DELEGATE, test "$have_fpx" = 'yes')
2065 dnl ===========================================================================
2068 # Check for DJVU delegate library.
2071 [AC_HELP_STRING([--without-djvu],
2072 [disable DjVu support])],
2073 [with_djvu=$withval],
2076 if test "$with_djvu" != 'yes'; then
2077 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-djvu=$with_djvu "
2084 if test "x$with_djvu" = "xyes"; then
2085 AC_MSG_RESULT([-------------------------------------------------------------])
2086 PKG_CHECK_MODULES(ddjvuapi,[ddjvuapi >= 3.5.0], have_djvu=yes, have_djvu=no)
2090 if test "$have_djvu" = 'yes'; then
2091 AC_DEFINE(DJVU_DELEGATE,1,Define if you have DJVU library)
2092 DJVU_CFLAGS="$ddjvuapi_CFLAGS"
2093 DJVU_LIBS="$ddjvuapi_LIBS"
2094 CFLAGS="$ddjvuapi_CFLAGS $CFLAGS"
2097 AM_CONDITIONAL(DJVU_DELEGATE, test "$have_djvu" = 'yes')
2098 AC_SUBST(DJVU_CFLAGS)
2101 dnl ===========================================================================
2104 # Check for fontconfig delegate library.
2106 AC_ARG_WITH([fontconfig],
2107 [AC_HELP_STRING([--without-fontconfig],
2108 [disable fontconfig support])],
2109 [with_fontconfig=$withval],
2110 [with_fontconfig='yes'])
2112 if test "$with_fontconfig" != 'yes'; then
2113 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontconfig=$with_fontconfig "
2116 have_fontconfig='no'
2117 FONTCONFIG_CFLAGS=""
2120 if test "x$with_fontconfig" = "xyes"; then
2121 AC_MSG_RESULT([-------------------------------------------------------------])
2122 PKG_CHECK_MODULES(FONTCONFIG,[fontconfig >= 2.1.0], have_fontconfig=yes, have_fontconfig=no)
2126 if test "$have_fontconfig" = 'yes'; then
2127 AC_DEFINE(FONTCONFIG_DELEGATE,1,Define if you have FONTCONFIG library)
2128 CFLAGS="$FONTCONFIG_CFLAGS $CFLAGS"
2131 AM_CONDITIONAL(FONTCONFIG_DELEGATE,test "$have_fontconfig" = 'yes')
2132 AC_SUBST(FONTCONFIG_CFLAGS)
2133 AC_SUBST(FONTCONFIG_LIBS)
2135 dnl ===========================================================================
2138 # Check for the Freetype delegate library.
2140 AC_ARG_WITH([freetype],
2141 [AC_HELP_STRING([--without-freetype],
2142 [disable Freetype support])],
2143 [with_freetype=$withval],
2144 [with_freetype='yes'])
2146 if test "$with_freetype" != 'yes'; then
2147 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-freetype=$with_freetype "
2154 if test "x$with_freetype" = "xyes"; then
2155 AC_MSG_RESULT([-------------------------------------------------------------])
2156 PKG_CHECK_MODULES(FREETYPE,[freetype2], have_freetype=yes, have_freetype=no)
2160 if test "$have_freetype" = 'yes'; then
2161 AC_DEFINE(FREETYPE_DELEGATE,1,Define if you have FREETYPE library)
2162 CFLAGS="$FREETYPE_CFLAGS $CFLAGS"
2165 AM_CONDITIONAL(FREETYPE_DELEGATE, test "$have_freetype" = 'yes')
2166 AC_SUBST(FREETYPE_CFLAGS)
2167 AC_SUBST(FREETYPE_LIBS)
2169 dnl ===========================================================================
2172 # Check for the raqm delegate library.
2175 [AC_HELP_STRING([--without-raqm],
2176 [disable Raqm support])],
2177 [with_raqm=$withval],
2180 if test "$with_raqm" != 'yes'; then
2181 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-raqm=$with_raqm "
2188 if test "x$with_raqm" = "xyes"; then
2189 AC_MSG_RESULT([-------------------------------------------------------------])
2190 PKG_CHECK_MODULES(RAQM,[raqm], have_raqm=yes, have_raqm=no)
2194 if test "$have_raqm" = 'yes'; then
2195 AC_DEFINE(RAQM_DELEGATE,1,Define if you have RAQM library)
2196 CFLAGS="$RAQM_CFLAGS $CFLAGS"
2199 AM_CONDITIONAL(RAQM_DELEGATE, test "$have_raqm" = 'yes')
2200 AC_SUBST(RAQM_CFLAGS)
2203 dnl ===========================================================================
2206 # Check for Ghostscript library or framework.
2208 # Test for iapi.h & test for gsapi_new_instance in -lgs
2209 # or -framework Ghostscript
2211 AC_ARG_WITH([gslib],
2212 [AC_HELP_STRING([--with-gslib],
2213 [enable Ghostscript library support])],
2214 [with_gslib=$withval],
2217 gslib_framework='no'
2218 if test "$with_gslib" != 'yes'; then
2219 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gslib=$with_gslib "
2224 if test "$with_gslib" != 'no'; then
2225 AC_MSG_RESULT([-------------------------------------------------------------])
2226 AC_MSG_CHECKING([for Ghostscript])
2231 AC_CHECK_HEADER(ghostscript/iapi.h,passed=`expr $passed + 1`,
2232 failed=`expr $failed + 1`,)
2233 AC_CHECK_HEADER(ghostscript/ierrors.h,passed=`expr $passed + 1`,
2234 failed=`expr $failed + 1`,)
2235 AC_CHECK_FRAMEWORK(Ghostscript,gsapi_new_instance,framework=`expr $framework + 1`,
2236 AC_CHECK_LIB(gs,gsapi_new_instance,passed=`expr $passed + 1`,failed=`expr $failed + 1`,),)
2237 AC_MSG_CHECKING([if Ghostscript package is complete])
2238 if test $passed -gt 0; then
2239 if test $failed -gt 0; then
2240 AC_MSG_RESULT([no -- some components failed test])
2241 have_gslib='no (failed tests)'
2243 if test $framework -gt 0; then
2244 GS_LIBS='-framework Ghostscript'
2245 gslib_framework='yes'
2246 AC_MSG_RESULT([yes, using framework.])
2248 AC_MSG_RESULT([yes, using library.])
2251 LIBS="$GS_LIBS $LIBS"
2252 AC_DEFINE(GS_DELEGATE,1,Define if you have Ghostscript library or framework)
2259 AM_CONDITIONAL(GS_DELEGATE, test "$have_gslib" = 'yes')
2262 # Set default font search path
2263 AC_ARG_WITH([fontpath],
2264 [AC_HELP_STRING([--with-fontpath=DIR],
2265 [prepend to default font search path])],
2266 [with_fontpath=$withval],
2269 if test "$with_fontpath" != "yes" && test -z "$with_fontpath"; then
2272 AC_DEFINE_UNQUOTED(MAGICK_FONT_PATH,"$with_fontpath",[Define to prepend to default font search path.])
2274 if test "$with_fontpath=" != ''; then
2275 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontpath=$with_fontpath "
2278 # Set Ghostscript font directory
2279 AC_ARG_WITH([gs-font-dir],
2280 [AC_HELP_STRING([--with-gs-font-dir=DIR],
2281 [Ghostscript font directory])],
2282 [with_gs_font_dir=$withval],
2283 [with_gs_font_dir='default'])
2285 if test "$with_gs_font_dir" != 'default'; then
2286 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gs-font-dir=$with_gs_font_dir "
2289 dnl ===========================================================================
2292 # Check for GVC delegate library.
2295 [AC_HELP_STRING([--with-gvc],
2296 [enable GVC support])],
2297 [with_gvc=$withval],
2300 if test "$with_gvc" != 'yes'; then
2301 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gvc=$with_gvc "
2305 if test "x$with_gvc" = "xyes"; then
2306 AC_MSG_RESULT([-------------------------------------------------------------])
2307 PKG_CHECK_MODULES(GVC,[libgvc >= 2.9.0], have_gvc=yes, have_gvc=no)
2311 if test "$have_gvc" = 'yes'; then
2312 AC_DEFINE(GVC_DELEGATE,1,Define if you have GVC library)
2313 CFLAGS="$GVC_CFLAGS $CFLAGS"
2316 AM_CONDITIONAL(GVC_DELEGATE, test "$have_gvc" = 'yes')
2317 AC_SUBST(GVC_CFLAGS)
2320 dnl ===========================================================================
2323 # Check for the HEIC delegate library.
2326 [AC_HELP_STRING([--without-heic],
2327 [disable HEIC support])],
2328 [with_heic=$withval],
2331 if test "$with_heic" != 'yes'; then
2332 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-heic=$with_heic "
2339 if test "x$with_heic" = "xyes"; then
2340 AC_MSG_RESULT([-------------------------------------------------------------])
2341 PKG_CHECK_MODULES(HEIF,[libheif], have_heic=yes, have_heic=no)
2345 if test "$have_heic" = 'yes'; then
2346 AC_DEFINE(HEIC_DELEGATE,1,Define if you have libheif library)
2347 CFLAGS="$HEIF_CFLAGS $CFLAGS"
2350 AM_CONDITIONAL(HEIC_DELEGATE, test "$have_heic" = 'yes')
2351 AC_SUBST(HEIF_CFLAGS)
2354 dnl ===========================================================================
2357 # Check for JBIG delegate library.
2360 [AC_HELP_STRING([--without-jbig],
2361 [disable JBIG support])],
2362 [with_jbig=$withval],
2367 if test "$with_jbig" != 'no'; then
2368 AC_MSG_RESULT([-------------------------------------------------------------])
2369 AC_MSG_CHECKING([for JBIG])
2373 AC_CHECK_HEADER(jbig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2374 AC_CHECK_LIB(jbig,jbg_dec_init,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2375 AC_MSG_CHECKING([if JBIG package is complete])
2376 if test $passed -gt 0; then
2377 if test $failed -gt 0; then
2378 AC_MSG_RESULT([no -- some components failed test])
2379 have_jbig='no (failed tests)'
2382 LIBS="$JBIG_LIBS $LIBS"
2383 AC_DEFINE(JBIG_DELEGATE,1,Define if you have JBIG library)
2384 AC_MSG_RESULT([yes])
2391 AM_CONDITIONAL(JBIG_DELEGATE, test "$have_jbig" = 'yes')
2394 dnl ===========================================================================
2397 # Check for JPEG delegate library.
2400 [AC_HELP_STRING([--without-jpeg],
2401 [disable JPEG support])],
2402 [with_jpeg=$withval],
2405 if test "$with_jpeg" != 'yes'; then
2406 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jpeg=$with_jpeg "
2411 if test "$with_jpeg" != 'no'; then
2412 AC_MSG_RESULT([-------------------------------------------------------------])
2413 AC_MSG_CHECKING([for JPEG])
2417 AC_CHECK_HEADER(jconfig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2418 AC_CHECK_HEADER(jerror.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2419 AC_CHECK_HEADER(jmorecfg.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2420 AC_CHECK_HEADER(jpeglib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2421 AC_CHECK_LIB(jpeg,jpeg_read_header,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2423 # Test for compatible JPEG library
2424 if test "$ac_cv_jpeg_version_ok" != 'yes'; then
2425 AC_CACHE_CHECK(for JPEG library is version 6b or later, ac_cv_jpeg_version_ok,
2429 #include <jpeglib.h>
2431 changequote(<<, >>)dnl
2433 #if JPEG_LIB_VERSION < 62
2434 #error IJG JPEG library must be version 6b or newer!
2438 changequote([, ])dnl
2439 ac_cv_jpeg_version_ok='yes'; passed=`expr $passed + 1`,
2440 ac_cv_jpeg_version_ok='no'; failed=`expr $failed + 1`)])
2442 AC_MSG_CHECKING([if JPEG package is complete])
2443 if test $passed -gt 0; then
2444 if test $failed -gt 0; then
2445 AC_MSG_RESULT([no -- some components failed test])
2446 have_jpeg='no (failed tests)'
2449 LIBS="$JPEG_LIBS $LIBS"
2450 AC_DEFINE(JPEG_DELEGATE,1,Define if you have JPEG library)
2451 AC_MSG_RESULT([yes])
2458 AM_CONDITIONAL(JPEG_DELEGATE, test "$have_jpeg" = 'yes')
2461 dnl ===========================================================================
2464 # Check for Jpegxl delegate library.
2467 [AC_HELP_STRING([--without-jxl],
2468 [disable Jpegxl support])],
2469 [with_jxl=$withval],
2472 if test "$with_jxl" != 'yes'; then
2473 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jxl=$with_jxl "
2476 # Check for the brunsli libraries, currently the only libraries used by the jxl coder.
2477 # Full jxl support will be added once the full libraries are released.
2480 if test "$with_jxl" != 'no'; then
2481 AC_MSG_RESULT([-------------------------------------------------------------])
2482 AC_MSG_CHECKING([for brunsli])
2486 AC_CHECK_HEADER(brunsli/decode.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2487 AC_CHECK_HEADER(brunsli/encode.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2488 AC_CHECK_LIB(brunslidec-c,DecodeBrunsli,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2489 AC_CHECK_LIB(brunslienc-c,EncodeBrunsli,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2490 AC_MSG_CHECKING([if brunsli package is complete])
2491 if test $passed -gt 0; then
2492 if test $failed -gt 0; then
2493 AC_MSG_RESULT([no -- some components failed test])
2494 have_jxl='no (failed tests)'
2496 JXL_LIBS='-lbrunslidec-c -lbrunslienc-c'
2497 LIBS="$JXL_LIBS $LIBS"
2498 AC_DEFINE(JXL_DELEGATE,1,Define if you have brunsli library)
2499 AC_MSG_RESULT([yes])
2506 AM_CONDITIONAL(JXL_DELEGATE, test "$have_jxl" = 'yes')
2509 dnl ===========================================================================
2512 # Check for LCMS delegate library.
2515 [ --without-lcms disable lcms (v1.1X) support],
2516 [with_lcms=$withval],
2518 if test "$with_lcms" != 'yes' ; then
2519 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lcms=$with_lcms "
2526 if test "x$with_lcms" = "xyes"; then
2527 AC_MSG_RESULT([-------------------------------------------------------------])
2528 PKG_CHECK_MODULES(LCMS2,[lcms2 >= 2.0.0], have_lcms=yes, have_lcms=no)
2532 if test "$have_lcms" = 'yes'; then
2533 AC_DEFINE(LCMS_DELEGATE,1,Define if you have LCMS library)
2534 LCMS_CFLAGS="$LCMS2_CFLAGS"
2535 LCMS_LIBS="$LCMS2_LIBS"
2536 CFLAGS="$LCMS2_CFLAGS $CFLAGS"
2537 AC_CHECK_HEADER(lcms2/lcms2.h,have_lcms_header='yes',,)
2538 if test "$have_lcms_header" = 'yes'; then
2539 AC_DEFINE(HAVE_LCMS2_LCMS2_H,1,Define if you have the <lcms2/lcms2.h> header file.)
2541 AC_DEFINE(HAVE_LCMS2_H,1,Define if you have the <lcms2.h> header file.)
2545 AM_CONDITIONAL(LCMS_DELEGATE, test "$have_lcms" = 'yes')
2546 AC_SUBST(LCMS_CFLAGS)
2549 dnl ===========================================================================
2552 # Check for the OpenJP2 delegate library.
2554 AC_ARG_WITH([openjp2],
2555 [AC_HELP_STRING([--without-openjp2],
2556 [disable OpenJP2 support])],
2557 [with_openjp2=$withval],
2558 [with_openjp2='yes'])
2560 if test "$with_openjp2" != 'yes'; then
2561 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-openjp2=$with_openjp2 "
2565 LIBOPENJP2_CFLAGS=""
2568 if test "x$with_openjp2" = "xyes"; then
2569 AC_MSG_RESULT([-------------------------------------------------------------])
2570 PKG_CHECK_MODULES(LIBOPENJP2,[libopenjp2 >= 2.1.0], have_openjp2=yes, have_openjp2=no)
2574 if test "$have_openjp2" = 'yes'; then
2575 AC_DEFINE(LIBOPENJP2_DELEGATE,1,Define if you have OPENJP2 library)
2576 CFLAGS="$LIBOPENJP2_CFLAGS $CFLAGS"
2579 AM_CONDITIONAL(LIBOPENJP2_DELEGATE, test "$have_openjp2" = 'yes')
2580 AC_SUBST(LIBOPENJP2_CFLAGS)
2581 AC_SUBST(LIBOPENJP2_LIBS)
2584 dnl ===========================================================================
2587 # Check for the LQR (Liquid Rescale) delegate library.
2590 [AC_HELP_STRING([--without-lqr],
2591 [disable Liquid Rescale support])],
2592 [with_lqr=$withval],
2595 if test "$with_lqr" != 'yes'; then
2596 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lqr=$with_lqr "
2603 if test "x$with_lqr" = "xyes"; then
2604 AC_MSG_RESULT([-------------------------------------------------------------])
2605 PKG_CHECK_MODULES(LQR,[lqr-1 >= 0.1.0], have_lqr=yes, have_lqr=no)
2609 if test "$have_lqr" = 'yes'; then
2610 AC_DEFINE(LQR_DELEGATE,1,Define if you have LQR library)
2611 CFLAGS="$LQR_CFLAGS $CFLAGS"
2614 AM_CONDITIONAL(LQR_DELEGATE, test "$have_lqr" = 'yes')
2615 AC_SUBST(LQR_CFLAGS)
2618 dnl ===========================================================================
2620 # Disable LZMA (lzma library)
2622 [ --without-lzma disable LZMA support],
2623 [with_lzma=$withval],
2625 if test "$with_lzma" != 'yes' ; then
2626 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lzma=$with_lzma "
2630 if test "x$with_lzma" = "xyes"; then
2631 AC_MSG_RESULT([-------------------------------------------------------------])
2632 PKG_CHECK_MODULES(LZMA,[liblzma >= 2.9.0], have_lzma=yes, have_lzma=no)
2636 if test "$have_lzma" = 'yes'; then
2637 AC_DEFINE(LZMA_DELEGATE,1,Define if you have LZMA library)
2638 CFLAGS="$LZMA_CFLAGS $CFLAGS"
2641 AM_CONDITIONAL(LZMA_DELEGATE, test "$have_lzma" = 'yes')
2642 AC_SUBST(LZMA_CFLAGS)
2645 dnl ===========================================================================
2648 # Check for the OpenEXR delegate library.
2650 AC_ARG_WITH([openexr],
2651 [AC_HELP_STRING([--without-openexr],
2652 [disable OpenEXR support])],
2653 [with_openexr=$withval],
2654 [with_openexr='yes'])
2656 if test "$with_openexr" != 'yes'; then
2657 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-openexr=$with_openexr "
2664 if test "x$with_openexr" = "xyes"; then
2665 AC_MSG_RESULT([-------------------------------------------------------------])
2666 PKG_CHECK_MODULES(OPENEXR,[OpenEXR >= 1.0.6], have_openexr=yes, have_openexr=no)
2670 if test "$have_openexr" = 'yes'; then
2671 AC_DEFINE(OPENEXR_DELEGATE,1,Define if you have OPENEXR library)
2672 CFLAGS="$OPENEXR_CFLAGS $CFLAGS"
2675 AM_CONDITIONAL(OPENEXR_DELEGATE, test "$have_openexr" = 'yes')
2676 AC_SUBST(OPENEXR_CFLAGS)
2677 AC_SUBST(OPENEXR_LIBS)
2679 dnl ===========================================================================
2682 # Check for PANGO delegate library.
2684 AC_ARG_WITH([pango],
2685 [AC_HELP_STRING([--without-pango],
2686 [disable PANGO support])],
2687 [with_pango=$withval],
2690 if test "$with_pango" != 'yes'; then
2691 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-pango=$with_pango "
2695 have_pangocairo='no'
2699 if test "x$with_pango" = "xyes"; then
2700 AC_MSG_RESULT([-------------------------------------------------------------])
2701 PKG_CHECK_MODULES(PANGO, [pangocairo >= 1.28.1], have_pangocairo=yes, have_pangocairo=no)
2703 PKG_CHECK_MODULES(PANGO, [pango >= 1.28.1], have_pango=yes, have_pango=no)
2707 if test "$have_pango" = 'yes'; then
2708 AC_DEFINE(PANGO_DELEGATE,1,Define if you have PANGO library)
2709 CFLAGS="$PANGO_CFLAGS $CFLAGS"
2712 if test "$have_pangocairo" = 'yes'; then
2713 AC_DEFINE(PANGOCAIRO_DELEGATE,1,Define if you have PANGOCAIRO library)
2714 CFLAGS="$PANGOCAIRO_CFLAGS $CFLAGS"
2717 AM_CONDITIONAL(PANGO_DELEGATE, test "$have_pango" = 'yes')
2718 AM_CONDITIONAL(PANGOCAIRO_DELEGATE, test "$have_pangocairo" = 'yes')
2719 AC_SUBST(PANGO_CFLAGS)
2720 AC_SUBST(PANGO_LIBS)
2722 dnl ===========================================================================
2725 # Check for PNG delegate library.
2728 [AC_HELP_STRING([--without-png],
2729 [disable PNG support])],
2730 [with_png=$withval],
2733 if test "$with_png" != 'yes'; then
2734 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-png=$with_png "
2741 if test "x$with_png" = "xyes"; then
2742 AC_MSG_RESULT([-------------------------------------------------------------])
2743 PKG_CHECK_MODULES(PNG,[libpng >= 1.0.0], have_png=yes, have_png=no)
2747 if test "$have_png" = 'yes'; then
2748 AC_DEFINE(PNG_DELEGATE,1,Define if you have PNG library)
2749 CFLAGS="$PNG_CFLAGS $CFLAGS"
2752 AM_CONDITIONAL(PNG_DELEGATE, test "$have_png" = 'yes')
2753 AC_SUBST(PNG_CFLAGS)
2756 dnl ===========================================================================
2759 # Check for the Raw delegate library.
2762 [AC_HELP_STRING([--without-raw],
2763 [disable Raw support])],
2764 [with_raw=$withval],
2767 if test "$with_raw" != 'yes'; then
2768 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-libraw=$with_raw "
2775 if test "x$with_raw" = "xyes"; then
2776 AC_MSG_RESULT([-------------------------------------------------------------])
2777 PKG_CHECK_MODULES(RAW_R,[libraw_r >= 0.14.8], have_raw=yes, have_raw=no)
2781 if test "$have_raw" = 'yes'; then
2782 AC_DEFINE(RAW_R_DELEGATE,1,Define if you have LIBRAW library)
2783 CFLAGS="$RAW_R_CFLAGS $CFLAGS"
2786 AM_CONDITIONAL(RAW_R_DELEGATE, test "$have_raw" = 'yes')
2787 AC_SUBST(RAW_R_CFLAGS)
2788 AC_SUBST(RAW_R_LIBS)
2790 dnl ===========================================================================
2793 # Check for RSVG delegate library.
2796 [AC_HELP_STRING([--with-rsvg],
2797 [enable RSVG support])],
2798 [with_rsvg=$withval],
2801 if test "$with_rsvg" != 'yes'; then
2802 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-rsvg=$with_rsvg "
2810 if test "x$with_rsvg" = "xyes"; then
2811 AC_MSG_RESULT([-------------------------------------------------------------])
2812 PKG_CHECK_MODULES(RSVG,[librsvg-2.0 >= 2.9.0], have_rsvg=yes, have_rsvg=no)
2814 PKG_CHECK_MODULES(CAIRO_SVG, cairo-svg, have_cairo=yes, have_cairo=no)
2818 if test "$have_rsvg" = 'yes'; then
2819 AC_DEFINE(RSVG_DELEGATE,1,Define if you have RSVG library)
2820 CFLAGS="$RSVG_CFLAGS $CFLAGS"
2823 if test "$have_cairo" = 'yes'; then
2824 AC_DEFINE(CAIRO_DELEGATE,1,Define if you have CAIRO library)
2825 CFLAGS="$CAIRO_SVG_CFLAGS $CFLAGS"
2828 AM_CONDITIONAL(RSVG_DELEGATE, test "$have_rsvg" = 'yes')
2829 AM_CONDITIONAL(CAIRO_DELEGATE, test "$have_cairo" = 'yes')
2830 AC_SUBST(RSVG_CFLAGS)
2833 dnl ===========================================================================
2836 # Check for TIFF delegate library.
2839 [AC_HELP_STRING([--without-tiff],
2840 [disable TIFF support])],
2841 [with_tiff=$withval],
2844 if test "$with_tiff" != 'yes'; then
2845 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-tiff=$with_tiff "
2850 if test "$with_tiff" != 'no'; then
2851 AC_MSG_RESULT([-------------------------------------------------------------])
2852 AC_MSG_CHECKING([for TIFF])
2856 AC_CHECK_HEADER(tiff.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2857 AC_CHECK_HEADER(tiffio.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2858 AC_CHECK_LIB(tiff,TIFFOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2859 AC_CHECK_LIB(tiff,TIFFClientOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2860 AC_CHECK_LIB(tiff,TIFFIsByteSwapped,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2861 AC_CHECK_LIB(tiff,TIFFReadRGBATile,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2862 AC_CHECK_LIB(tiff,TIFFReadRGBAStrip,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2863 AC_MSG_CHECKING([if TIFF package is complete])
2864 if test $passed -gt 0; then
2865 if test $failed -gt 0; then
2866 AC_MSG_RESULT([no -- some components failed test])
2867 have_tiff='no (failed tests)'
2870 LIBS="$TIFF_LIBS $LIBS"
2871 AC_DEFINE(TIFF_DELEGATE,1,Define if you have TIFF library)
2872 AC_MSG_RESULT([yes])
2874 AC_CHECK_HEADERS(tiffconf.h)
2875 AC_CHECK_FUNCS([TIFFIsCODECConfigured TIFFMergeFieldInfo \
2876 TIFFIsBigEndian TIFFReadEXIFDirectory TIFFSetErrorHandlerExt \
2877 TIFFSetTagExtender TIFFSetWarningHandlerExt \
2878 TIFFSwabArrayOfTriples])
2884 AM_CONDITIONAL(TIFF_DELEGATE, test "$have_tiff" = 'yes')
2887 dnl ===========================================================================
2890 # Set URW Base35 font directory.
2892 AC_ARG_WITH([urw-base35-font-dir],
2893 [AC_HELP_STRING([--with-urw-base35-font-dir=DIR],
2894 [URW-base35 font directory])],
2895 [with_urw_base35_font_dir=$withval],
2896 [with_urw_base35_font_dir='default'])
2898 if test "$with_urw_base35_font_dir" != 'default'; then
2899 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-urw-base35-font-dir=$with_urw_base35_font_dir "
2902 dnl ===========================================================================
2905 # Check for the WEBP delegate library.
2908 [AC_HELP_STRING([--without-webp],
2909 [disable WEBP support])],
2910 [with_webp=$withval],
2913 if test "$with_webp" != 'yes'; then
2914 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-webp=$with_webp "
2925 if test "x$with_webp" = "xyes"; then
2926 AC_MSG_RESULT([-------------------------------------------------------------])
2927 PKG_CHECK_MODULES(WEBP,[libwebp], have_webp=yes, have_webp=no)
2928 PKG_CHECK_MODULES(WEBPMUX,[libwebpmux >= 0.5.0 libwebpdemux >= 0.5.0], have_webpmux=yes, have_webpmux=no)
2932 if test "$have_webp" = 'yes'; then
2933 AC_DEFINE(WEBP_DELEGATE,1,Define if you have WEBP library)
2934 CFLAGS="$WEBP_CFLAGS $CFLAGS"
2937 if test "$have_webpmux" = 'yes'; then
2938 AC_DEFINE(WEBPMUX_DELEGATE,1,Define if you have WEBPMUX library)
2939 CFLAGS="$WEBPMUX_CFLAGS $CFLAGS"
2942 AM_CONDITIONAL(WEBP_DELEGATE, test "$have_webp" = 'yes')
2943 AM_CONDITIONAL(WEBPMUX_DELEGATE, test "$have_webpmux" = 'yes')
2944 AC_SUBST(WEBPMUX_CFLAGS)
2945 AC_SUBST(WEBPMUX_LIBS)
2946 AC_SUBST(WEBP_CFLAGS)
2949 dnl ===========================================================================
2952 # Set Windows font directory.
2954 AC_ARG_WITH([windows-font-dir],
2955 [AC_HELP_STRING([--with-windows-font-dir=DIR],
2956 [Windows font directory])],
2957 [with_windows_font_dir=$withval],
2958 [with_windows_font_dir='default'])
2960 if test "$with_windows_font_dir" != 'default'; then
2961 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-windows-font-dir=$with_windows_font_dir "
2964 dnl ===========================================================================
2967 # Check for WMF delegate library.
2970 [AC_HELP_STRING([--with-wmf],
2971 [enable WMF support])],
2972 [with_wmf=$withval],
2975 if test "$with_wmf" != 'yes'; then
2976 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-wmf=$with_wmf "
2983 if test "$with_wmf" != 'no'; then
2984 AC_MSG_CHECKING([for WMF support ])
2987 have_libwmflite='no'
2988 have_libwmf_ipa_h='no'
2990 AC_CHECK_HEADER([libwmf/ipa.h],[have_libwmf_ipa_h='yes'],[],[$FT2BUILD_H])
2991 if test "$have_libwmf_ipa_h" = 'yes'; then
2992 AC_CHECK_LIB([wmflite],[wmf_lite_create],[have_libwmflite='yes'],[],[])
2993 if test "$have_libwmflite" = 'yes'; then
2994 AC_DEFINE(WMF_DELEGATE,1,Define if you have WMF library)
2995 WMF_LIBS='-lwmflite'
2996 LIBS="$WMF_LIBS $LIBS"
2999 AC_MSG_RESULT([no -- some components failed test])
3000 have_wmf='no (failed tests)'
3001 have_wmflite='no (failed tests)'
3007 AC_MSG_CHECKING([if WMF package is complete ])
3008 if test "$have_wmf" = 'yes'; then
3009 AC_MSG_RESULT([yes])
3013 AM_CONDITIONAL([WMF_DELEGATE], [test "$have_wmf" = 'yes'])
3014 AC_SUBST([WMF_CFLAGS])
3015 AC_SUBST([WMF_LIBS])
3017 dnl ===========================================================================
3020 # Check for XML delegate library.
3023 [AC_HELP_STRING([--without-xml],
3024 [disable XML support])],
3025 [with_xml=$withval],
3028 if test "$with_xml" != 'yes' ; then
3029 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-xml=$with_xml "
3036 if test "x$with_xml" = "xyes"; then
3037 AC_MSG_RESULT([-------------------------------------------------------------])
3038 PKG_CHECK_MODULES(XML,[libxml-2.0 >= 2.0.0], have_xml=yes, have_xml=no)
3042 if test "$have_xml" = 'yes'; then
3043 AC_DEFINE(XML_DELEGATE,1,Define if you have XML library)
3044 CFLAGS="$XML_CFLAGS $CFLAGS"
3047 AM_CONDITIONAL(XML_DELEGATE, test "$have_xml" = 'yes')
3048 AC_SUBST(XML_CFLAGS)
3051 dnl ===========================================================================
3053 # Check for functions
3055 AC_CHECK_FUNCS([acosh _aligned_malloc asinh atanh atoll atexit cabs carg cimag creal clock clock_getres clock_gettime ctime_r directio erf _exit execvp fchmod floor fork ftime ftruncate getc_unlocked getcwd getpid getexecname getdtablesize getpagesize getrlimit getrusage gettimeofday gmtime_r isnan j0 j1 lltostr localtime_r lstat memmove memset mkstemp munmap nanosleep newlocale _NSGetExecutablePath pclose _pclose poll popen _popen posix_fadvise posix_fallocate posix_madvise posix_memalign posix_spawnp pow pread pwrite qsort_r raise rand_r readlink realpath select seekdir sendfile setlocale socket sqrt setvbuf stat strcasestr strchr strrchr strcspn strdup strpbrk strspn strstr strtod strtod_l strtol strtoul symlink sysconf sigemptyset sigaction spawnvp strerror strlcat strlcpy strcasecmp strncasecmp telldir tempnam times ulltostr uselocale usleep utime vfprintf vfprintf_l vsprintf vsnprintf vsnprintf_l waitpid _wfopen _wstat])
3057 # Substitute compiler name to build/link PerlMagick
3059 AC_SUBST([PERLMAINCC])
3062 # Configure install Paths
3065 # Path to ImageMagick header files
3066 INCLUDE_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
3067 INCLUDE_PATH="${INCLUDE_DIR}/${INCLUDE_RELATIVE_PATH}"
3068 DEFINE_INCLUDE_PATH="${INCLUDE_DIR}/${INCLUDE_RELATIVE_PATH}/"
3069 case "${build_os}" in
3071 DEFINE_INCLUDE_PATH=`$WinPathScript "$DEFINE_INCLUDE_PATH" 1`
3074 AC_DEFINE_UNQUOTED(INCLUDE_PATH,"$DEFINE_INCLUDE_PATH",[Directory where ImageMagick headers live.])
3075 AC_SUBST(INCLUDE_PATH)
3077 # Path to ImageMagick header files (arch part)
3078 INCLUDEARCH_PATH="${INCLUDEARCH_DIR}/${INCLUDE_RELATIVE_PATH}"
3079 DEFINE_INCLUDEARCH_PATH="${INCLUDEARCH_DIR}/${INCLUDE_RELATIVE_PATH}/"
3080 case "${build_os}" in
3082 DEFINE_INCLUDEARCH_PATH=`$WinPathScript "$DEFINE_INCLUDEARCH_PATH" 1`
3085 AC_DEFINE_UNQUOTED(INCLUDEARCH_PATH,"$DEFINE_INCLUDE_PATH",[Directory where ImageMagick architecture headers live.])
3086 AC_SUBST(INCLUDEARCH_PATH)
3088 # Subdirectory under lib to place ImageMagick lib files
3089 LIBRARY_RELATIVE_PATH="${PACKAGE_NAME}-${PACKAGE_VERSION}"
3090 AC_DEFINE_UNQUOTED(LIBRARY_RELATIVE_PATH,"$LIBRARY_RELATIVE_PATH",[Subdirectory of lib where ImageMagick architecture dependent files are installed.])
3092 # Path to ImageMagick bin directory
3093 EXECUTABLE_PATH="${BIN_DIR}"
3094 DEFINE_EXECUTABLE_PATH="${BIN_DIR}/"
3095 case "${build_os}" in
3097 DEFINE_EXECUTABLE_PATH=`$WinPathScript "$DEFINE_EXECUTABLE_PATH" 1`
3100 AC_DEFINE_UNQUOTED(EXECUTABLE_PATH,"$DEFINE_EXECUTABLE_PATH",[Directory where executables are installed.])
3101 AC_SUBST(EXECUTABLE_PATH)
3103 # Path to ImageMagick lib
3104 LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}"
3105 DEFINE_LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}/"
3106 case "${build_os}" in
3108 DEFINE_LIBRARY_PATH=`$WinPathScript "$DEFINE_LIBRARY_PATH" 1`
3111 AC_DEFINE_UNQUOTED(LIBRARY_PATH,"$DEFINE_LIBRARY_PATH",[Directory where architecture-dependent files live.])
3112 AC_SUBST(LIBRARY_PATH)
3115 # path to local binaries
3116 if test "x$LIB_BIN_BASEDIRNAME" = "x"; then
3117 LIB_BIN_BASEDIRNAME="bin"
3119 AC_DEFINE_UNQUOTED(LIB_BIN_BASEDIRNAME,"$LIB_BIN_BASEDIRNAME",[Binaries in libraries path base name (will be during install linked to bin)])
3120 AC_SUBST(LIB_BIN_BASEDIRNAME)
3122 if test "x$LIB_BIN_DIR" = "x"; then
3123 LIB_BIN_DIR=${LIB_BIN_BASEDIRNAME}-${MAGICK_ABI_SUFFIX}
3125 AC_SUBST(LIB_BIN_DIR)
3127 LIB_BIN_DIR_RELATIVE_PATH=$LIB_BIN_DIR
3128 AC_SUBST(LIB_BIN_DIR_RELATIVE_PATH)
3129 LIB_BIN_DIR_PATH="${LIBRARY_PATH}/${LIB_BIN_DIR_RELATIVE_PATH}"
3130 AC_SUBST(LIB_BIN_DIR_PATH)
3133 # path to modules lib
3134 if test "x$MODULES_BASEDIRNAME" = "x"; then
3135 MODULES_BASEDIRNAME="modules"
3137 AC_DEFINE_UNQUOTED(MODULES_BASEDIRNAME,"$MODULES_BASEDIRNAME",[Module directory name without ABI part.])
3138 AC_SUBST(MODULES_BASEDIRNAME)
3140 if test "x$MODULES_DIRNAME" = "x"; then
3141 MODULES_DIRNAME=${MODULES_BASEDIRNAME}-${MAGICK_ABI_SUFFIX}
3143 AC_DEFINE_UNQUOTED(MODULES_DIRNAME,"$MODULES_DIRNAME",[Module directory dirname])
3145 AC_SUBST(MODULES_DIRNAME)
3147 MODULES_RELATIVE_PATH="${MODULES_DIRNAME}"
3148 AC_SUBST(MODULES_RELATIVE_PATH)
3149 MODULES_PATH="${LIBRARY_PATH}/${MODULES_RELATIVE_PATH}"
3150 AC_SUBST(MODULES_PATH)
3153 # path to coders lib
3154 if test "x$CODER_DIRNAME" = "x"; then
3155 CODER_DIRNAME="coders"
3157 AC_DEFINE_UNQUOTED(CODER_DIRNAME,"$CODER_DIRNAME",[coders subdirectory.])
3158 AC_SUBST(CODER_DIRNAME)
3160 CODER_RELATIVE_PATH="${CODER_DIRNAME}"
3161 CODER_PATH="${MODULES_PATH}/${CODER_DIRNAME}"
3162 AC_SUBST(CODER_PATH)
3165 # Subdirectory under lib to place ImageMagick filter module files
3167 # path to coders lib
3168 if test "x$FILTER_DIRNAME" = "x"; then
3169 FILTER_DIRNAME="filters"
3171 AC_DEFINE_UNQUOTED(FILTER_DIRNAME,"$FILTER_DIRNAME",[filter subdirectory.])
3172 AC_SUBST(FILTER_DIRNAME)
3174 FILTER_RELATIVE_PATH="${FILTER_DIRNAME}"
3175 FILTER_PATH="${MODULES_PATH}/${FILTER_DIRNAME}"
3176 AC_SUBST(FILTER_PATH)
3179 # Path to ImageMagick documentation files
3180 DOCUMENTATION_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
3181 DOCUMENTATION_PATH="${DOC_DIR}/${DOCUMENTATION_RELATIVE_PATH}"
3182 DEFINE_DOCUMENTATION_PATH="${DOC_DIR}/${DOCUMENTATION_RELATIVE_PATH}/"
3183 case "${build_os}" in
3185 DEFINE_DOCUMENTATION_PATH=`$WinPathScript "$DEFINE_DOCUMENTATION_PATH" 1`
3188 AC_DEFINE_UNQUOTED(DOCUMENTATION_PATH,"$DEFINE_DOCUMENTATION_PATH",[Directory where ImageMagick documents live.])
3189 AC_SUBST(DOCUMENTATION_PATH)
3192 # Enable/Disable documentation
3193 AC_ARG_ENABLE([docs],
3194 [AS_HELP_STRING([--disable-docs],
3195 [disable building of documentation])],
3196 wantdocs=$enableval, wantdocs=yes)
3197 AM_CONDITIONAL([INSTALL_DOC], [test "$wantdocs" = "yes"])
3199 # Subdirectory to place architecture-dependent configuration files
3200 CONFIGURE_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
3201 AC_DEFINE_UNQUOTED(CONFIGURE_RELATIVE_PATH,"$CONFIGURE_RELATIVE_PATH",[Subdirectory of lib where architecture-dependent configuration files live.])
3202 CONFIGURE_PATH="${SYSCONF_DIR}/${CONFIGURE_RELATIVE_PATH}/"
3203 DEFINE_CONFIGURE_PATH="${SYSCONF_DIR}/${CONFIGURE_RELATIVE_PATH}/"
3204 case "${build_os}" in
3206 DEFINE_CONFIGURE_PATH=`$WinPathScript "$DEFINE_CONFIGURE_PATH" 1`
3209 AC_DEFINE_UNQUOTED(CONFIGURE_PATH,"$DEFINE_CONFIGURE_PATH",[Directory where architecture-dependent configuration files live.])
3210 AC_SUBST(CONFIGURE_PATH)
3212 # Subdirectory to place architecture-independent configuration files
3213 SHARE_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
3214 AC_DEFINE_UNQUOTED(SHARE_RELATIVE_PATH,"$SHARE_RELATIVE_PATH",[Subdirectory of lib where architecture-independent configuration files live.])
3215 SHARE_PATH="${DATA_DIR}/${SHARE_RELATIVE_PATH}"
3216 DEFINE_SHARE_PATH="${DATA_DIR}/${SHARE_RELATIVE_PATH}/"
3217 case "${build_os}" in
3219 DEFINE_SHARE_PATH=`$WinPathScript "$DEFINE_SHARE_PATH" 1`
3222 AC_DEFINE_UNQUOTED(SHARE_PATH,"$DEFINE_SHARE_PATH",[Directory where architecture-independent configuration files live.])
3223 AC_SUBST(SHARE_PATH)
3226 # Subdirectory to place architecture-dependent configuration files.
3227 if test "x$SHAREARCH_BASEDIRNAME" = "x"; then
3228 SHAREARCH_BASEDIRNAME="config"
3230 AC_DEFINE_UNQUOTED(SHAREARCH_BASEDIRNAME,"$SHAREARCH_BASEDIRNAME",[Sharearch directory name without ABI part.])
3231 AC_SUBST(SHAREARCH_BASEDIRNAME)
3233 if test "x$SHAREARCH_DIRNAME" = "x"; then
3234 SHAREARCH_DIRNAME=${SHAREARCH_BASEDIRNAME}-${MAGICK_ABI_SUFFIX}
3236 AC_DEFINE_UNQUOTED(SHAREARCH_DIRNAME,"$SHAREARCH_DIRNAME",[Sharearch directory dirname])
3238 AC_SUBST(SHAREARCH_DIRNAME)
3240 SHAREARCH_RELATIVE_PATH="${SHAREARCH_DIRNAME}"
3241 AC_SUBST(SHAREARCH_RELATIVE_PATH)
3242 SHAREARCH_PATH="${LIBRARY_PATH}/${SHAREARCH_RELATIVE_PATH}"
3243 AC_SUBST(SHAREARCH_PATH)
3246 # program_transform_name is formed for use in a Makefile, so create a
3247 # modified version for use in a shell script.
3248 configure_transform_name=`echo ${program_transform_name} | sed 's,\\$\\$,$,'`
3250 # Default delegate definitions
3251 AC_MSG_RESULT([-------------------------------------------------------------])
3252 AC_MSG_CHECKING([for ImageMagick delegate programs])
3254 BPGDecodeDelegateDefault='bpgdec'
3255 BPGEncodeDelegateDefault='bpgenc'
3256 BlenderDecodeDelegateDefault='blender'
3257 BrowseDelegateDefault='xdg-open'
3258 DNGDecodeDelegateDefault='ufraw-batch'
3259 DOCDecodeDelegateDefault='soffice'
3260 GVCDecodeDelegateDefault='dot'
3261 DVIDecodeDelegateDefault='dvips'
3262 EditorDelegateDefault='xterm'
3263 ConvertDelegateDefault=`echo magick | sed ${configure_transform_name}`
3264 DisplayDelegateDefault=`echo magick | sed ${configure_transform_name}`
3265 MogrifyDelegateDefault=`echo magick | sed ${configure_transform_name}`
3266 HPGLDecodeDelegateDefault='hp2xx'
3267 HTMLDecodeDelegateDefault='html2ps'
3268 ILBMDecodeDelegateDefault='ilbmtoppm'
3269 ILBMEncodeDelegateDefault='ppmtoilbm'
3270 JXRDecodeDelegateDefault='JxrDecApp'
3271 JXREncodeDelegateDefault='JxrEncApp'
3272 LEPDelegateDefault='lepton'
3273 LPDelegateDefault='lp'
3274 LPRDelegateDefault='lpr'
3275 LaunchDelegateDefault='gimp'
3276 MPEGDecodeDelegateDefault='avconv'
3277 MPEGEncodeDelegateDefault='avconv'
3278 MrSIDDecodeDelegateDefault='mrsidgeodecode'
3279 MVDelegateDefault='mv'
3280 PCLDelegateDefault='pcl6'
3281 if test "$native_win32_build" = 'yes'; then
3282 PSDelegateDefault='gswin32c'
3283 elif test "$gslib_framework" = 'yes'; then
3284 PSDelegateDefault='gsc'
3286 PSDelegateDefault='gs'
3288 RMDelegateDefault='rm'
3289 RSVGDecodeDelegateDefault='rsvg-convert'
3290 SVGDecodeDelegateDefault='inkscape'
3291 TraceEncodeDelegateDefault='potrace'
3292 UniconvertorDelegateDefault='uniconvertor'
3293 WebPDecodeDelegateDefault='dwebp'
3294 WebPEncodeDelegateDefault='cwebp'
3295 WWWDecodeDelegateDefault='curl'
3296 XPSDelegateDefault='gxps'
3298 # Search for delegates
3299 AC_PATH_PROG(BPGDecodeDelegate, "$BPGDecodeDelegateDefault", "$BPGDecodeDelegateDefault")
3300 AC_PATH_PROG(BPGEncodeDelegate, "$BPGEncodeDelegateDefault", "$BPGEncodeDelegateDefault")
3301 AC_PATH_PROG(BlenderDecodeDelegate, "$BlenderDecodeDelegateDefault", "$BlenderDecodeDelegateDefault")
3302 AC_PATH_PROGS(BrowseDelegate, "$BrowseDelegateDefault" google-chrome firefox konqueror mozilla lynx, "$BrowseDelegateDefault")
3303 AC_PATH_PROG(DNGDecodeDelegate, "$DNGDecodeDelegateDefault", "$DNGDecodeDelegateDefault")
3304 AC_PATH_PROG(DOCDecodeDelegate, "$DOCDecodeDelegateDefault", "$DOCDecodeDelegateDefault")
3305 AC_PATH_PROG(DVIDecodeDelegate, "$DVIDecodeDelegateDefault", "$DVIDecodeDelegateDefault")
3306 AC_PATH_PROG(ConvertDelegate, "$ConvertDelegateDefault", "$ConvertDelegateDefault")
3307 AC_PATH_PROG(DisplayDelegate, "$DisplayDelegateDefault", "$DisplayDelegateDefault")
3308 AC_PATH_PROG(EditorDelegate, "$EditorDelegateDefault", "$EditorDelegateDefault")
3309 AC_PATH_PROG(GVCDecodeDelegate, "$GVCDecodeDelegateDefault", "$GVCDecodeDelegateDefault")
3310 AC_PATH_PROG(HPGLDecodeDelegate, "$HPGLDecodeDelegateDefault", "$HPGLDecodeDelegateDefault")
3311 AC_PATH_PROG(HTMLDecodeDelegate, "$HTMLDecodeDelegateDefault", "$HTMLDecodeDelegateDefault")
3312 AC_PATH_PROG(ILBMDecodeDelegate, "$ILBMDecodeDelegateDefault", "$ILBMDecodeDelegateDefault")
3313 AC_PATH_PROG(ILBMEncodeDelegate, "$ILBMEncodeDelegateDefault", "$ILBMEncodeDelegateDefault")
3314 AC_PATH_PROG(JXRDecodeDelegate, "$JXRDecodeDelegateDefault", "$JXRDecodeDelegateDefault")
3315 AC_PATH_PROG(JXREncodeDelegate, "$JXREncodeDelegateDefault", "$JXREncodeDelegateDefault")
3316 AC_PATH_PROG(LEPDelegate, "$LEPDelegateDefault", "$LEPDelegateDefault")
3317 AC_PATH_PROG(LPDelegate, "$LPDelegateDefault", no)
3318 AC_PATH_PROG(LPRDelegate, "$LPRDelegateDefault", "$LPRDelegateDefault")
3319 AC_PATH_PROG(LaunchDelegate, "$LaunchDelegateDefault", "$LaunchDelegateDefault")
3320 AC_PATH_PROG(MogrifyDelegate, "$MogrifyDelegateDefault", "$MogrifyDelegateDefault")
3321 AC_PATH_PROG(MPEGDecodeDelegate, "$MPEGDecodeDelegateDefault", "$MPEGDecodeDelegateDefault")
3322 if test "$MPEGDecodeDelegate" = "$MPEGDecodeDelegateDefault" ; then
3323 MPEGDecodeDelegateDefault='ffmpeg'
3324 AC_PATH_PROG(MPEGDecodeDelegate, "$MPEGDecodeDelegateDefault", "$MPEGDecodeDelegateDefault")
3326 AC_PATH_PROG(MPEGEncodeDelegate, "$MPEGEncodeDelegateDefault", "$MPEGEncodeDelegateDefault")
3327 if test "$MPEGEncodeDelegate" = "$MPEGEncodeDelegateDefault" ; then
3328 MPEGEncodeDelegateDefault='ffmpeg'
3329 AC_PATH_PROG(MPEGEncodeDelegate, "$MPEGEncodeDelegateDefault", "$MPEGEncodeDelegateDefault")
3331 AC_PATH_PROG(MrSIDDecodeDelegate, "$MrSIDDecodeDelegateDefault", "$MrSIDDecodeDelegateDefault")
3332 AC_PATH_PROG(MVDelegate, "$MVDelegateDefault", "$MVDelegateDefault")
3333 AC_PATH_PROG(PCLDelegate, "$PCLDelegateDefault", "$PCLDelegateDefault")
3334 AC_PATH_PROGS(PSDelegate, gsx gsc "$PSDelegateDefault", "$PSDelegateDefault")
3335 AC_PATH_PROG(RMDelegate, "$RMDelegateDefault", "$RMDelegateDefault")
3336 AC_PATH_PROG(RSVGDecodeDelegate, "$RSVGDecodeDelegateDefault", "$RSVGDecodeDelegateDefault")
3337 AC_PATH_PROG(SVGDecodeDelegate, "$SVGDecodeDelegateDefault", "$SVGDecodeDelegateDefault")
3338 AC_PATH_PROG(TraceEncodeDelegate, "$TraceEncodeDelegateDefault", "$TraceEncodeDelegateDefault")
3339 AC_PATH_PROG(UniconvertorDelegate, "$UniconvertorDelegateDefault", "$UniconvertorDelegateDefault")
3340 AC_PATH_PROG(WebPDecodeDelegate, "$WebPDecodeDelegateDefault", "$WebPDecodeDelegateDefault")
3341 AC_PATH_PROG(WebPEncodeDelegate, "$WebPEncodeDelegateDefault", "$WebPEncodeDelegateDefault")
3342 AC_PATH_PROG(WWWDecodeDelegate, "$WWWDecodeDelegateDefault", "$WWWDecodeDelegateDelegateDefault")
3343 AC_PATH_PROG(XPSDelegate, "$XPSDelegateDefault", "$XPSDelegateDefault")
3345 # Prefer lpr to lp; lp needs options tacked on.
3346 if test "$LPRDelegate" != no; then
3347 PrintDelegate="$LPRDelegate"
3349 PrintDelegate="$LPDelegate -c -s"
3351 AC_SUBST(PrintDelegate)
3353 # Installed ImageMagick utiltity paths
3354 ConvertDelegate="${BIN_DIR}/${ConvertDelegateDefault}"
3355 DisplayDelegate="${BIN_DIR}/${DisplayDelegateDefault}"
3356 MogrifyDelegate="${BIN_DIR}/${MogrifyDelegateDefault}"
3358 # Set delegate booleans
3359 have_avconv='no'; if test "$MPEGDecodeDelegate" != "$MPEGDecodeDelegateDefault" ; then have_avconv='yes'; fi
3360 have_gs='no' ; if test "$PSDelegate" != "$PSDelegateDefault"; then have_gs='yes'; fi
3361 have_hp2xx='no' ; if test "$HPGLDecodeDelegate" != "$HPGLDecodeDelegateDefault" ; then have_hp2xx='yes'; fi
3362 have_ilbmtoppm='no' ; if test "$ILBMDecodeDelegate" != "$ILBMDecodeDelegateDefault" ; then have_ilbmtoppm='yes'; fi
3363 have_mrsid='no'; if test "$MrSIDDecodeDelegate" != "$MrSIDDecodeDelegateDefault" ; then have_mrsid='yes'; fi
3364 have_pcl='no' ; if test "$PCLDelegate" != "$PCLDelegateDefault"; then have_pcl='yes'; fi
3365 have_ppmtoilbm='no' ; if test "$ILBMEncodeDelegate" != "$ILBMEncodeDelegateDefault" ; then have_ppmtoilbm='yes'; fi
3366 have_xps='no' ; if test "$XPSDelegate" != "$XPSDelegateDefault"; then have_xps='yes'; fi
3369 # Test for font directories
3371 type_include_files=''
3374 AC_MSG_CHECKING(for Apple fonts directory)
3376 if test "${with_apple_font_dir}" != 'default'; then
3377 apple_font_dir="${with_apple_font_dir}/"
3379 for font_dir in '/Library/Fonts/'; do
3380 if test -f "${font_dir}Arial.ttf"; then
3381 apple_font_dir="${font_dir}"
3386 if test "${apple_font_dir}x" != 'x'; then
3387 type_include_files="${type_include_files} "'<include file="type-apple.xml" />'
3388 AC_MSG_RESULT([$apple_font_dir])
3390 AC_MSG_RESULT([not found!]);
3392 AC_SUBST(apple_font_dir)
3395 AC_MSG_CHECKING(for Dejavu fonts directory)
3397 if test "${with_dejavu_font_dir}" != 'default'; then
3398 dejavu_font_dir="${with_dejavu_font_dir}/"
3400 for font_dir in "${prefix}/share/dejavu/fonts/" '/usr/share/fonts/dejavu/'; do
3401 if test -f "${font_dir}DejaVuSerif.ttf"; then
3402 dejavu_font_dir="${font_dir}"
3407 if test "${dejavu_font_dir}x" != 'x'; then
3408 type_include_files="${type_include_files} "'<include file="type-dejavu.xml" />'
3409 AC_MSG_RESULT([$dejavu_font_dir])
3411 AC_MSG_RESULT([not found!]);
3413 AC_SUBST(dejavu_font_dir)
3416 AC_MSG_CHECKING(for Ghostscript fonts directory)
3417 ghostscript_font_dir=''
3418 if test "${with_gs_font_dir}" != 'default'; then
3419 ghostscript_font_dir="${with_gs_font_dir}/"
3421 if test "${native_win32_build}" = 'yes'; then
3422 # Native Windows Build
3423 for font_dir in "c:\\Program Files\\gs\\fonts\\" "c:\\Program Files \(x86\)\\gs\\fonts\\" "c:\\gs\\fonts\\"; do
3424 if test -f "${font_dir}a010013l.pfb"; then
3425 ghostscript_font_dir="$font_dir"
3429 if test "${PSDelegate}" != 'gswin32c'; then
3430 ghostscript_font_dir=`echo "${PSDelegate}" | sed -e 's:/gs/.*:/gs:;s:^/::;s/./&:/;s:/:\\\\:g'`"\\fonts\\"
3433 # Linux / Mac OS X / Unix Build
3434 for font_dir in "${prefix}/share/ghostscript/fonts/" '/usr/share/fonts/default/Type1/' '/usr/share/ghostscript/fonts/' '/usr/share/fonts/ghostscript/' '/usr/share/fonts/type1/gsfonts/' '/opt/local/share/ghostscript/fonts/' '/sw/share/ghostscript/fonts/' '/System/Library/Frameworks/Ghostscript.framework/Resources/fonts/'; do
3435 if test -f "${font_dir}a010013l.pfb"; then
3436 ghostscript_font_dir="${font_dir}"
3440 if test "${ghostscript_font_dir}x" = 'x'; then
3441 if test "$PSDelegate" != 'gs'; then
3442 ghostscript_font_dir=`echo "$PSDelegate" | sed -e 's:/bin/gs:/share/ghostscript/fonts:'`"/"
3447 if test "${ghostscript_font_dir}x" != 'x'; then
3448 type_include_files="${type_include_files} "'<include file="type-ghostscript.xml" />'
3449 AC_MSG_RESULT([$ghostscript_font_dir])
3451 AC_MSG_RESULT([not found!]);
3453 AC_SUBST(ghostscript_font_dir)
3454 case "${build_os}" in
3456 PSDelegate=`$WinPathScript "$PSDelegate" 1`
3461 AC_MSG_CHECKING(for URW-base35 fonts directory)
3462 urw_base35_font_dir=''
3463 if test "${with_urw_base35_font_dir}" != 'default'; then
3464 urw_base35_font_dir="${with_urw_base35_font_dir}/"
3466 for font_dir in "${prefix}/share/urw-base35/fonts/" '/usr/share/fonts/urw-base35/'; do
3467 if test -f "${font_dir}StandardSymbolsPS.t1"; then
3468 urw_base35_font_dir="${font_dir}"
3473 if test "${urw_base35_font_dir}x" != 'x'; then
3474 type_include_files="${type_include_files} "'<include file="type-urw-base35.xml" />'
3475 AC_MSG_RESULT([$urw_base35_font_dir])
3477 AC_MSG_RESULT([not found!]);
3479 AC_SUBST(urw_base35_font_dir)
3482 AC_MSG_CHECKING(for Windows fonts directory)
3484 if test "${with_windows_font_dir}" != 'default'; then
3485 windows_font_dir="${with_windows_font_dir}/"
3487 for font_dir in '/usr/X11R6/lib/X11/fonts/truetype/' '/usr/X11R7/lib/X11/fonts/truetype/' '/usr/share/fonts/msttcore/' '/usr/share/fonts/microsoft/' '/usr/share/fonts/truetype/msttcorefonts/'; do
3488 if test -f "${font_dir}arial.ttf"; then
3489 windows_font_dir="${font_dir}"
3494 if test "${windows_font_dir}x" != 'x'; then
3495 type_include_files="${type_include_files} "'<include file="type-windows.xml" />'
3496 AC_MSG_RESULT([$windows_font_dir])
3498 AC_MSG_RESULT([not found!]);
3500 AC_SUBST(windows_font_dir)
3502 AC_SUBST(type_include_files)
3505 # Handle case where user doesn't want frozen paths
3507 if test "$with_frozenpaths" != 'yes'; then
3508 # Re-set delegate definitions to default (no paths)
3509 BPGDecodeDelegate="$BPGDecodeDelegateDefault"
3510 BPGEncodeDelegate="$BPGEncodeDelegateDefault"
3511 BlenderDecodeDelegate="$BlenderDecodeDelegateDefault"
3512 BrowseDelegate="$BrowseDelegateDefault"
3513 ConvertDelegate="$ConvertDelegateDefault"
3514 DisplayDelegate="$DisplayDelegateDefault"
3515 DNGDecodeDelegate="$DNGDecodeDelegateDefault"
3516 DOCDecodeDelegate="$DOCDecodeDelegateDefault"
3517 DVIDecodeDelegate="$DVIDecodeDelegateDefault"
3518 EditorDelegate="$EditorDelegateDefault"
3519 GVCDecodeDelegate="$GVCDecodeDelegateDefault"
3520 HPGLDecodeDelegate="$HPGLDecodeDelegateDefault"
3521 HTMLDecodeDelegate="$HTMLDecodeDelegateDefault"
3522 ILBMDecodeDelegate="$ILBMDecodeDelegateDefault"
3523 ILBMEncodeDelegate="$ILBMEncodeDelegateDefault"
3524 JXRDecodeDelegate="$JXRDecodeDelegateDefault"
3525 JXREncodeDelegate="$JXREncodeDelegateDefault"
3526 LEPDelegate="$LEPDelegateDefault"
3527 LPDelegate="$LPDelegateDefault"
3528 LaunchDelegate="$LaunchDelegateDefault"
3529 MPEGDecodeDelegate="$MPEGDecodeDelegateDefault"
3530 MPEGEncodeDelegate="$MPEGEncodeDelegateDefault"
3531 MogrifyDelegate="$MogrifyDelegateDefault"
3532 MrSIDDecodeDelegate="$MrSIDDecodeDelegateDefault"
3533 PCLDelegate="$PCLDelegateDefault"
3534 PSDelegate="$PSDelegateDefault"
3535 RSVGDecodeDelegate="$RSVGDecodeDelegateDefault"
3536 SVGDecodeDelegate="$SVGDecodeDelegateDefault"
3537 ShowImageDelegate="$ShowImageDelegateDefault"
3538 TraceEncodeDelegate="$TraceEncodeDelegateDefault"
3539 UniconvertorDelegate="$UniconvertorDelegateDefault"
3540 WebPDecodeDelegate="$WebPDecodeDelegateDefault"
3541 WebPEncodeDelegate="$WebPEncodeDelegateDefault"
3542 WWWDecodeDelegate="$WWWDecodeDelegateDefault"
3543 XPSDelegate="$XPSDelegateDefault"
3546 # Delegate substitutions
3547 AC_SUBST(BPGDecodeDelegate)
3548 AC_SUBST(BPGEncodeDelegate)
3549 AC_SUBST(BlenderDecodeDelegate)
3550 AC_SUBST(BrowseDelegate)
3551 AC_SUBST(ConvertDelegate)
3552 AC_SUBST(GVCDecodeDelegate)
3553 AC_SUBST(DVIDecodeDelegate)
3554 AC_SUBST(EditorDelegate)
3555 AC_SUBST(HPGLDecodeDelegate)
3556 AC_SUBST(HTMLDecodeDelegate)
3557 AC_SUBST(ILBMDecodeDelegate)
3558 AC_SUBST(ILBMEncodeDelegate)
3559 AC_SUBST(JXRDecodeDelegate)
3560 AC_SUBST(JXREncodeDelegate)
3561 AC_SUBST(LaunchDelegate)
3562 AC_SUBST(LEPDelegate)
3563 AC_SUBST(LPDelegate)
3564 AC_SUBST(MPEGDecodeDelegate)
3565 AC_SUBST(MPEGEncodeDelegate)
3566 AC_SUBST(MogrifyDelegate)
3567 AC_SUBST(MrSIDDecodeDelegate)
3568 AC_SUBST(PCLDelegate)
3569 AC_SUBST(PSDelegate)
3570 AC_SUBST(ShowImageDelegate)
3571 AC_SUBST(TraceEncodeDelegate)
3572 AC_SUBST(UniconvertorDelegate)
3573 AC_SUBST(WebPDecodeDelegate)
3574 AC_SUBST(WebPEncodeDelegate)
3575 AC_SUBST(WWWDecodeDelegate)
3576 AC_SUBST(XPSDelegate)
3582 AC_CHECK_PROGS(TAR,gnutar gtar tar)
3583 AC_CHECK_PROGS(PERL,perl)
3584 AC_CHECK_PROGS(RPM,rpmbuild rpm)
3585 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
3586 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
3587 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
3588 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
3590 AM_CONDITIONAL(RPM_DELEGATE, test "x$RPM" != "x" )
3593 # 7ZIP support (http://p7zip.sourceforge.net/)
3596 AC_CHECK_PROGS(P7ZIP,[7za])
3598 AM_CONDITIONAL(P7ZIP_DELEGATE, test "x$P7ZIP" != "x" )
3601 # ZIP support (http://www.info-zip.org/Zip.html)
3604 AC_CHECK_PROGS(ZIP,[zip])
3606 AM_CONDITIONAL(ZIP_DELEGATE, test "x$ZIP" != "x" )
3609 # GhostPCL related configuration.
3611 PCLColorDevice=ppmraw
3612 PCLCMYKDevice=pamcmyk32
3613 PCLMonoDevice=pbmraw
3614 if test -z "$PCLVersion"; then
3615 PCLVersion='unknown'
3617 if test $have_pcl = 'yes'; then
3618 AC_MSG_RESULT([-------------------------------------------------------------])
3619 AC_MSG_CHECKING([for PCL])
3622 AC_MSG_CHECKING([for pcl color device])
3623 if $PCLDelegate -dBATCH -sDEVICE=$PCLColorDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
3626 PCLColorDevice=ppmraw
3628 AC_MSG_RESULT([$PCLColorDevice])
3631 AC_MSG_CHECKING([for pcl CMYK device])
3632 if $PCLDelegate -dBATCH -sDEVICE=$PCLColorDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
3635 PCLCMYKDevice=$PCLColorDevice
3637 AC_MSG_RESULT([$PCLCMYKDevice])
3640 AC_MSG_CHECKING([for pcl mono device])
3641 if $PCLDelegate -dBATCH -sDEVICE=$PCLMonoDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
3644 PCLMonoDevice=$PCLColorDevice
3646 AC_MSG_RESULT([$PCLMonoDevice])
3649 AC_SUBST(PCLMonoDevice)
3650 AC_SUBST(PCLColorDevice)
3651 AC_SUBST(PCLCMYKDevice)
3652 AC_SUBST(PCLVersion)
3655 # GhostXPS related configuration.
3657 XPSColorDevice=ppmraw
3658 XPSCMYKDevice=bmpsep8
3659 XPSMonoDevice=pbmraw
3660 if test -z "$XPSVersion"; then
3661 XPSVersion='unknown'
3663 if test $have_xps = 'yes'; then
3664 AC_MSG_RESULT([-------------------------------------------------------------])
3665 AC_MSG_CHECKING([for XPS])
3668 AC_MSG_CHECKING([for xps color device])
3669 if $XPSDelegate -dBATCH -sDEVICE=$XPSColorDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
3672 XPSColorDevice=ppmraw
3674 AC_MSG_RESULT([$XPSColorDevice])
3677 AC_MSG_CHECKING([for xps CMYK device])
3678 if $XPSDelegate -dBATCH -sDEVICE=$XPSColorDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
3681 XPSCMYKDevice=$XPSColorDevice
3683 AC_MSG_RESULT([$XPSCMYKDevice])
3686 AC_MSG_CHECKING([for xps mono device])
3687 if $XPSDelegate -dBATCH -sDEVICE=$XPSMonoDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
3690 XPSMonoDevice=$XPSColorDevice
3692 AC_MSG_RESULT([$XPSMonoDevice])
3695 AC_SUBST(XPSMonoDevice)
3696 AC_SUBST(XPSColorDevice)
3697 AC_SUBST(XPSCMYKDevice)
3698 AC_SUBST(XPSVersion)
3701 # Ghostscript related configuration.
3703 GSAlphaDevice=pngalpha
3704 GSColorDevice=pnmraw
3705 GSCMYKDevice=pamcmyk32
3707 GSPDFDevice=pdfwrite
3709 GSEPSDevice=eps2write
3711 if test $have_gs = 'yes'; then
3712 AC_MSG_RESULT([-------------------------------------------------------------])
3713 AC_MSG_CHECKING([for Ghostscript])
3715 AC_MSG_CHECKING([for Ghostscript version])
3716 if GSVersion=`$PSDelegate --version`; then
3719 GSVersion=`$PSDelegate --help | sed -e '1q' | awk '{ print $3 }'`
3721 AC_MSG_RESULT([$GSVersion])
3724 AC_MSG_CHECKING([for gs color device])
3725 if $PSDelegate -q -dBATCH -sDEVICE=$GSColorDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
3728 GSColorDevice=ppmraw
3730 AC_MSG_RESULT([$GSColorDevice])
3733 AC_MSG_CHECKING([for gs alpha device])
3734 if $PSDelegate -q -dBATCH -sDEVICE=$GSAlphaDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
3737 GSAlphaDevice=$GSColorDevice
3739 AC_MSG_RESULT([$GSAlphaDevice])
3742 AC_MSG_CHECKING([for gs CMYK device])
3743 if $PSDelegate -q -dBATCH -sDEVICE=$GSCMYKDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
3748 AC_MSG_RESULT([$GSCMYKDevice])
3751 AC_MSG_CHECKING([for gs mono device])
3752 if $PSDelegate -q -dBATCH -sDEVICE=$GSMonoDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
3755 GSMonoDevice=$GSColorDevice
3757 AC_MSG_RESULT([$GSMonoDevice])
3760 AC_MSG_CHECKING([for gs PDF writing device])
3761 if $PSDelegate -q -dBATCH -sDEVICE=$GSPDFDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
3764 GSPDFDevice=nodevice
3766 AC_MSG_RESULT([$GSPDFDevice])
3769 AC_MSG_CHECKING([for gs PS writing device])
3770 if $PSDelegate -q -dBATCH -sDEVICE=$GSPSDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
3775 AC_MSG_RESULT([$GSPSDevice])
3778 AC_MSG_CHECKING([for gs EPS writing device])
3779 if $PSDelegate -q -dBATCH -sDEVICE=$GSEPSDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
3782 GSEPSDevice=epswrite
3784 AC_MSG_RESULT([$GSEPSDevice])
3787 AC_SUBST(GSAlphaDevice)
3788 AC_SUBST(GSCMYKDevice)
3789 AC_SUBST(GSColorDevice)
3790 AC_SUBST(GSEPSDevice)
3791 AC_SUBST(GSMonoDevice)
3792 AC_SUBST(GSPDFDevice)
3793 AC_SUBST(GSPSDevice)
3797 # PerlMagick-related configuration
3800 # Look for PERL if PerlMagick requested
3801 # If name/path of desired PERL interpreter is specified, look for that one first
3803 if test "$with_perl" != 'no'; then
3804 AC_MSG_RESULT([-------------------------------------------------------------])
3805 AC_MSG_CHECKING([for Perl])
3807 if test "$with_perl" != 'yes'; then
3808 AC_CACHE_CHECK(for perl,ac_cv_path_PERL,ac_cv_path_PERL="$with_perl");
3809 PERL=$ac_cv_path_PERL
3811 have_perl="$ac_cv_path_PERL"
3813 AC_PATH_PROGS(PERL,perl perl5,)dnl
3814 if test "$ac_cv_path_PERL"; then
3815 have_perl="$ac_cv_path_PERL"
3820 if test "$with_perl" != 'yes' ; then
3821 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-perl=$with_perl "
3824 PERL_SUPPORTS_DESTDIR='no'
3826 with_perl_static='no'
3827 with_perl_dynamic='no'
3828 if test "$have_perl" != 'no'; then
3829 if test "$with_perl" != 'no' && test "$libtool_build_shared_libs" = 'no'; then
3830 with_perl_static='yes'
3832 if test "$with_perl" != 'no' && test "$libtool_build_shared_libs" = 'yes'; then
3833 with_perl_dynamic='yes'
3835 # Is PERL's MakeMaker new enough to support DESTDIR?
3836 AX_PROG_PERL_VERSION(5.8.1,[PERL_SUPPORTS_DESTDIR='yes'],[PERL_SUPPORTS_DESTDIR='no'])
3838 AM_CONDITIONAL(WITH_PERL, test "$have_perl" != 'no')
3839 AM_CONDITIONAL(WITH_PERL_STATIC, test $with_perl_static = 'yes')
3840 AM_CONDITIONAL(WITH_PERL_DYNAMIC, test $with_perl_dynamic = 'yes')
3841 AC_SUBST(PERL_SUPPORTS_DESTDIR)
3843 # Determine path to pick up MagickCore library from for use with building PerlMagick
3844 MAGICKCORE_PATH="${LIB_DIR}"
3845 if test $with_perl_static = 'yes'; then
3846 # Find out where libtool hides its uninstalled libraries (as libtool_objdir)
3847 libtool_objdir=$objdir
3849 # Linker search path to library, followed by -lMagickCore
3850 MAGICKCORE_PATH="${builddir}/MagickCore/${libtool_objdir}"
3852 AC_SUBST(MAGICKCORE_PATH)
3854 # Create a simple string containing format names for all delegate libraries.
3856 if test "$have_autotrace" = 'yes' ; then
3857 MAGICK_DELEGATES="$MAGICK_DELEGATES autotrace"
3859 if test "$have_bzlib" = 'yes' ; then
3860 MAGICK_DELEGATES="$MAGICK_DELEGATES bzlib"
3862 if test "$have_dps" = 'yes' ; then
3863 MAGICK_DELEGATES="$MAGICK_DELEGATES dps"
3865 if test "$have_djvu" = 'yes' ; then
3866 MAGICK_DELEGATES="$MAGICK_DELEGATES djvu"
3868 if test "$have_avconv" = 'yes' ; then
3869 MAGICK_DELEGATES="$MAGICK_DELEGATES mpeg"
3871 if test "$have_fftw" = 'yes' ; then
3872 MAGICK_DELEGATES="$MAGICK_DELEGATES fftw"
3874 if test "$have_flif" = 'yes' ; then
3875 MAGICK_DELEGATES="$MAGICK_DELEGATES flif"
3877 if test "$have_fpx" = 'yes' ; then
3878 MAGICK_DELEGATES="$MAGICK_DELEGATES fpx"
3880 if test "$have_fontconfig" = 'yes' ; then
3881 MAGICK_DELEGATES="$MAGICK_DELEGATES fontconfig"
3883 if test "$have_freetype" = 'yes' ; then
3884 MAGICK_DELEGATES="$MAGICK_DELEGATES freetype"
3886 if test "$have_gslib" = 'yes' ; then
3887 MAGICK_DELEGATES="$MAGICK_DELEGATES gslib"
3889 if test "$have_heic" = 'yes' ; then
3890 MAGICK_DELEGATES="$MAGICK_DELEGATES heic"
3892 if test "$have_jbig" = 'yes' ; then
3893 MAGICK_DELEGATES="$MAGICK_DELEGATES jbig"
3895 if test "$have_png$have_jpeg" = 'yesyes' ; then
3896 MAGICK_DELEGATES="$MAGICK_DELEGATES jng"
3898 if test "$have_jpeg" = 'yes' ; then
3899 MAGICK_DELEGATES="$MAGICK_DELEGATES jpeg"
3901 if test "$have_jxl" = 'yes' ; then
3902 MAGICK_DELEGATES="$MAGICK_DELEGATES jxl"
3904 if test "$have_lcms" = 'yes' || test "$have_lcms2" = 'yes' ; then
3905 MAGICK_DELEGATES="$MAGICK_DELEGATES lcms"
3907 if test "$have_lqr" = 'yes' ; then
3908 MAGICK_DELEGATES="$MAGICK_DELEGATES lqr"
3910 if test "$have_lzma" = 'yes' ; then
3911 MAGICK_DELEGATES="$MAGICK_DELEGATES lzma"
3913 if test "$have_openexr" = 'yes' ; then
3914 MAGICK_DELEGATES="$MAGICK_DELEGATES openexr"
3916 if test "$have_openjp2" = 'yes' ; then
3917 MAGICK_DELEGATES="$MAGICK_DELEGATES openjp2"
3919 if test "$have_pango" = 'yes' ; then
3920 MAGICK_DELEGATES="$MAGICK_DELEGATES pango"
3922 if test "$have_png" = 'yes' ; then
3923 MAGICK_DELEGATES="$MAGICK_DELEGATES png"
3926 if test "$have_dps" = 'yes' || \
3927 test "$have_gs" = 'yes' || \
3928 test "${native_win32_build}" = 'yes' ; then
3931 if test "$have_ps" = 'yes' ; then
3932 MAGICK_DELEGATES="$MAGICK_DELEGATES ps"
3934 if test "$have_raqm" = 'yes' ; then
3935 MAGICK_DELEGATES="$MAGICK_DELEGATES raqm"
3937 if test "$have_raw" = 'yes' ; then
3938 MAGICK_DELEGATES="$MAGICK_DELEGATES raw"
3940 if test "$have_ra_ppm" = 'yes' ; then
3941 MAGICK_DELEGATES="$MAGICK_DELEGATES rad"
3943 if test "$have_rsvg" = 'yes' ; then
3944 MAGICK_DELEGATES="$MAGICK_DELEGATES rsvg"
3946 if test "$have_tiff" = 'yes' ; then
3947 MAGICK_DELEGATES="$MAGICK_DELEGATES tiff"
3949 if test "$have_ttf" = 'yes' ; then
3950 MAGICK_DELEGATES="$MAGICK_DELEGATES ttf"
3952 if test "$have_webp" = 'yes' ; then
3953 MAGICK_DELEGATES="$MAGICK_DELEGATES webp"
3955 if test "$have_wmf" = 'yes' ; then
3956 MAGICK_DELEGATES="$MAGICK_DELEGATES wmf"
3958 if test "$have_x" = 'yes' ; then
3959 MAGICK_DELEGATES="$MAGICK_DELEGATES x"
3961 if test "$have_xml" = 'yes' ; then
3962 MAGICK_DELEGATES="$MAGICK_DELEGATES xml"
3964 if test "$have_zlib" = 'yes' ; then
3965 MAGICK_DELEGATES="$MAGICK_DELEGATES zlib"
3967 if test "$have_zstd" = 'yes' ; then
3968 MAGICK_DELEGATES="$MAGICK_DELEGATES zstd"
3971 # Remove extraneous spaces from output variables (asthetic)
3972 MAGICK_DELEGATES=`echo $MAGICK_DELEGATES | sed -e 's/ */ /g'`
3973 MAGICK_FEATURES=`echo $MAGICK_FEATURES | sed -e 's/ */ /g'`
3974 AC_SUBST(MAGICK_DELEGATES)
3975 AC_SUBST(MAGICK_FEATURES)
3978 # Handle special compiler flags
3981 # Add '-p' if prof source profiling support enabled
3982 if test "$enable_prof" = 'yes'; then
3984 CXXFLAGS="-p $CXXFLAGS"
3985 LDFLAGS="-p $LDFLAGS"
3988 # Add '-pg' if gprof source profiling support enabled
3989 if test "$enable_gprof" = 'yes'; then
3990 CFLAGS="-pg $CFLAGS"
3991 CXXFLAGS="-pg $CXXFLAGS"
3992 LDFLAGS="-pg $LDFLAGS"
3995 # Add '-ftest-coverage -fprofile-arcs' if gcov source profiling support enabled
3996 # This is a gcc-specific feature
3997 if test "$enable_gcov" = 'yes'; then
3998 AC_CHECK_LIB(gcov,_gcov_init)
3999 AC_CHECK_LIB(gcov,__gcov_init)
4000 case "$target_os" in
4002 OSX_GCOV_LDFLAG="-Wl,-single_module"
4008 AC_SUBST(OSX_GCOV_LDFLAG)
4009 CFLAGS="-ftest-coverage -fprofile-arcs $CFLAGS"
4010 CXXFLAGS="-ftest-coverage -fprofile-arcs $CXXFLAGS"
4011 LDFLAGS="-ftest-coverage -fprofile-arcs $LDFLAGS"
4015 # Build library dependency list for libMagickCore
4018 if test "$build_modules" != 'no'; then
4019 MAGICK_DEP_LIBS="$USER_LIBS $LCMS_LIBS $FREETYPE_LIBS $RAQM_LIBS $LQR_LIBS $FFTW_LIBS $XML_LIBS $FLIF_LIBS $FONTCONFIG_LIBS $XEXT_LIBS $IPC_LIBS $X11_LIBS $XT_LIBS $LZMA_LIBS $BZLIB_LIBS $ZLIB_LIBS $ZSTD_LIBS $LTDL_LIBS $GDI32_LIBS $WS2_32_LIBS $MATH_LIBS $CL_LIBS $UMEM_LIBS $JEMALLOC_LIBS $THREAD_LIBS $TCMALLOC_LIBS"
4021 MAGICK_DEP_LIBS="$USER_LIBS $JBIG_LIBS $LCMS_LIBS $TIFF_LIBS $FREETYPE_LIBS $RAQM_LIBS $JPEG_LIBS $JXL_LIBS $GS_LIBS $LQR_LIBS $PNG_LIBS $AUTOTRACE_LIBS $DJVU_LIBS $FFTW_LIBS $FLIF_LIBS $FPX_LIBS $FONTCONFIG_LIBS $HEIF_LIBS $WEBPMUX_LIBS $WEBP_LIBS $WMF_LIBS $DPS_LIBS $XEXT_LIBS $XT_LIBS $IPC_LIBS $X11_LIBS $LZMA_LIBS $BZLIB_LIBS $OPENEXR_LIBS $LIBOPENJP2_LIBS $PANGO_LIBS $RAW_R_LIBS $RSVG_LIBS $XML_LIBS $GVC_LIBS $ZLIB_LIBS $ZSTD_LIBS $LTDL_LIBS $GDI32_LIBS $WS2_32_LIBS $MATH_LIBS $CL_LIBS $UMEM_LIBS $JEMALLOC_LIBS $THREAD_LIBS $TCMALLOC_LIBS"
4023 MAGICK_EXTRA_DEP_LIBS="$GOMP_LIBS"
4024 AC_SUBST(MAGICK_DEP_LIBS)
4025 AC_SUBST(MAGICK_EXTRA_DEP_LIBS)
4027 # Pass only user-provided LIBS as "global" libraries
4033 #AC_SUBST(X_PRE_LIBS)
4035 #AC_SUBST(X_EXTRA_LIBS)
4037 MAGICK_CFLAGS=$CFLAGS
4038 MAGICK_CXXFLAGS="$CXXFLAGS"
4039 MAGICK_CPPFLAGS=`echo $MAGICK_CPPFLAGS | sed -e 's/ */ /g'`
4040 MAGICK_PCFLAGS=`echo $MAGICK_PCFLAGS | sed -e 's/ */ /g'`
4041 MAGICK_LDFLAGS="-L$LIB_DIR $LDFLAGS"
4042 MAGICK_LIBS="$MAGICK_DEP_LIBS $MAGICK_EXTRA_DEP_LIBS"
4044 AC_SUBST(MAGICK_CFLAGS)
4045 AC_SUBST(MAGICK_CXXFLAGS)
4046 AC_SUBST(MAGICK_CPPFLAGS)
4047 AC_SUBST(MAGICK_PCFLAGS)
4048 AC_SUBST(MAGICK_LDFLAGS)
4049 AC_SUBST(MAGICK_LIBS)
4051 # Set configured scripts to executable.
4052 AC_CONFIG_COMMANDS([default],[],[])
4053 AC_CONFIG_COMMANDS([magick.sh.in],[chmod +x magick.sh])
4054 AC_CONFIG_COMMANDS([MagickCore-config.in],[chmod +x MagickCore/MagickCore-config])
4055 AC_CONFIG_COMMANDS([MagickWand-config.in],[chmod +x MagickWand/MagickWand-config])
4056 AC_CONFIG_COMMANDS([Magick++-config.in],[chmod +x Magick++/bin/Magick++-config])
4057 AC_CONFIG_COMMANDS([PerlMagick/check.sh.in],[chmod +x PerlMagick/check.sh])
4059 AC_MSG_RESULT([-------------------------------------------------------------])
4060 AC_MSG_RESULT([Update ImageMagick configuration])
4062 rm -f magick-version
4064 result_dejavu_font_dir='none'
4065 if test "${dejavu_font_dir}x" != 'x'; then
4066 result_dejavu_font_dir=$dejavu_font_dir
4069 result_ghostscript_font_dir='none'
4070 if test "${ghostscript_font_dir}x" != 'x'; then
4071 result_ghostscript_font_dir=$ghostscript_font_dir
4074 result_urw_base35_font_dir='none'
4075 if test "${urw_base35_font_dir}x" != 'x'; then
4076 result_urw_base35_font_dir=$urw_base35_font_dir
4079 result_windows_font_dir='none'
4080 if test "${windows_font_dir}x" != 'x'; then
4081 result_windows_font_dir=${windows_font_dir}
4084 # ==============================================================================
4085 # Generate build environment
4086 # ==============================================================================
4089 config/configure.xml \
4090 config/delegates.xml \
4091 config/ImageMagick.rdf \
4092 config/MagickCore.dox \
4093 config/MagickWand.dox \
4094 config/Magick++.dox \
4095 config/type-apple.xml \
4096 config/type-dejavu.xml \
4097 config/type-ghostscript.xml \
4098 config/type-urw-base35.xml \
4099 config/type-windows.xml \
4102 Magick++/bin/Magick++-config \
4103 MagickCore/ImageMagick.pc \
4104 Magick++/lib/Magick++.pc \
4105 MagickCore/MagickCore-config \
4106 MagickCore/MagickCore.pc \
4107 MagickCore/version.h \
4110 PerlMagick/check.sh \
4111 PerlMagick/default/Magick.pm \
4112 PerlMagick/Makefile.PL \
4113 PerlMagick/default/Makefile.PL \
4114 PerlMagick/quantum/Makefile.PL \
4115 PerlMagick/quantum/quantum.pm \
4116 PerlMagick/quantum/quantum.xs \
4117 PerlMagick/quantum/typemap \
4118 utilities/animate.1 \
4119 utilities/compare.1 \
4120 utilities/composite.1 \
4121 utilities/conjure.1 \
4122 utilities/convert.1 \
4123 utilities/display.1 \
4124 utilities/identify.1 \
4125 utilities/ImageMagick.1 \
4126 utilities/import.1 \
4127 utilities/magick.1 \
4128 utilities/magick-script.1 \
4129 utilities/mogrify.1 \
4130 utilities/montage.1 \
4131 utilities/stream.1 \
4132 MagickWand/MagickWand-config \
4133 MagickWand/MagickWand.pc ])
4136 # ==============================================================================
4137 # ImageMagick Configuration
4138 # ==============================================================================
4140 ==============================================================================
4141 ${PACKAGE_NAME} ${PACKAGE_VERSION}${PACKAGE_VERSION_ADDENDUM} is configured as follows. Please verify that this
4142 configuration matches your expectations.
4144 Host system type: $host
4145 Build system type: $build
4148 ------------------------------------------------------------------------------
4149 Shared libraries --enable-shared=$enable_shared $libtool_build_shared_libs
4150 Static libraries --enable-static=$enable_static $libtool_build_static_libs
4151 Build utilities --with-utilities=$with_utilities $with_utilities
4152 Module support --with-modules=$build_modules $build_modules
4153 GNU ld --with-gnu-ld=$with_gnu_ld $lt_cv_prog_gnu_ld
4154 Quantum depth --with-quantum-depth=$with_quantum_depth $with_quantum_depth
4155 High Dynamic Range Imagery
4156 --enable-hdri=$enable_hdri $enable_hdri
4158 Install documentation: $wantdocs
4160 Memory allocation library:
4161 JEMalloc --with-jemalloc=$with_jemalloc $have_jemalloc
4162 TCMalloc --with-tcmalloc=$with_tcmalloc $have_tcmalloc
4163 UMem --with-umem=$with_umem $have_umem
4165 Delegate library configuration:
4166 BZLIB --with-bzlib=$with_bzlib $have_bzlib
4167 Autotrace --with-autotrace=$with_autotrace $have_autotrace
4168 DJVU --with-djvu=$with_djvu $have_djvu
4169 DPS --with-dps=$with_dps $have_dps
4170 FFTW --with-fftw=$with_fftw $have_fftw
4171 FLIF --with-flif=$with_flif $have_flif
4172 FlashPIX --with-fpx=$with_fpx $have_fpx
4173 FontConfig --with-fontconfig=$with_fontconfig $have_fontconfig
4174 FreeType --with-freetype=$with_freetype $have_freetype
4175 Ghostscript lib --with-gslib=$with_gslib $have_gslib
4176 Graphviz --with-gvc=$with_gvc $have_gvc
4177 HEIC --with-heic=$with_heic $have_heic
4178 JBIG --with-jbig=$with_jbig $have_jbig
4179 JPEG v1 --with-jpeg=$with_jpeg $have_jpeg
4180 JPEG XL --with-jxl=$with_jxl $have_jxl
4181 LCMS --with-lcms=$with_lcms $have_lcms
4182 LQR --with-lqr=$with_lqr $have_lqr
4183 LTDL --with-ltdl=$with_ltdl $have_ltdl
4184 LZMA --with-lzma=$with_lzma $have_lzma
4185 Magick++ --with-magick-plus-plus=$with_magick_plus_plus $have_magick_plus_plus
4186 OpenEXR --with-openexr=$with_openexr $have_openexr
4187 OpenJP2 --with-openjp2=$with_openjp2 $have_openjp2
4188 PANGO --with-pango=$with_pango $have_pango
4189 PERL --with-perl=$with_perl $have_perl
4190 PNG --with-png=$with_png $have_png
4191 RAQM --with-raqm=$with_raqm $have_raqm
4192 RAW --with-raw=$with_raw $have_raw
4193 RSVG --with-rsvg=$with_rsvg $have_rsvg
4194 TIFF --with-tiff=$with_tiff $have_tiff
4195 WEBP --with-webp=$with_webp $have_webp
4196 WMF --with-wmf=$with_wmf $have_wmf
4197 X11 --with-x=$with_x $have_x
4198 XML --with-xml=$with_xml $have_xml
4199 ZLIB --with-zlib=$with_zlib $have_zlib
4200 ZSTD --with-zstd=$with_zstd $have_zstd
4202 Delegate program configuration:
4203 GhostPCL None $PCLDelegate ($PCLVersion)
4204 GhostXPS None $XPSDelegate ($XPSVersion)
4205 Ghostscript None $PSDelegate ($GSVersion)
4208 Apple fonts --with-apple-font-dir=$with_apple_font_dir $result_apple_font_dir
4209 Dejavu fonts --with-dejavu-font-dir=$with_dejavu_font_dir $result_dejavu_font_dir
4210 Ghostscript fonts --with-gs-font-dir=$with_gs_font_dir $result_ghostscript_font_dir
4211 URW-base35 fonts --with-urw-base35-font-dir=$with_urw_base35_font_dir $result_urw_base35_font_dir
4212 Windows fonts --with-windows-font-dir=$with_windows_font_dir $result_windows_font_dir
4215 X_CFLAGS = $X_CFLAGS
4216 X_PRE_LIBS = $X_PRE_LIBS
4218 X_EXTRA_LIBS = $X_EXTRA_LIBS
4220 Options used to compile and link:
4221 PREFIX = $PREFIX_DIR
4222 EXEC-PREFIX = $EXEC_PREFIX_DIR
4223 VERSION = $PACKAGE_VERSION
4226 CPPFLAGS = $CPPFLAGS
4230 LIBS = $MAGICK_DEP_LIBS
4232 CXXFLAGS = $CXXFLAGS
4233 FEATURES = $MAGICK_FEATURES
4234 DELEGATES = $MAGICK_DELEGATES
4235 ==============================================================================