1 # Copyright 1999-2013 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 # http://www.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.
23 m4_define([magick_major_version], [7])
24 m4_define([magick_minor_version], [0])
25 m4_define([magick_micro_version], [0])
26 m4_define([magick_patchlevel_version], [0])
27 m4_define([magick_version],
28 [magick_major_version.magick_minor_version.magick_micro_version-magick_patchlevel_version])
29 m4_define([magick_svn_revision], esyscmd([sh -c "(svnversion .) | awk '{ print \$1 }' | tr -d '\n'"]))
31 AC_INIT([ImageMagick],[magick_version],[http://www.imagemagick.org],[ImageMagick])
32 AC_CONFIG_SRCDIR([MagickCore/MagickCore.h])
33 AC_CONFIG_AUX_DIR([config])
34 AC_REQUIRE_AUX_FILE([tap-driver.sh])
35 AC_CONFIG_MACRO_DIR([m4])
36 AC_CONFIG_HEADERS([config/config.h])
37 AX_PREFIX_CONFIG_H([MagickCore/magick-baseconfig.h],[MagickCore])
40 config/configure.xml \
41 config/delegates.xml \
42 config/ImageMagick.rdf \
43 config/MagickCore.dox \
44 config/MagickWand.dox \
46 config/type-dejavu.xml \
47 config/type-ghostscript.xml \
48 config/type-windows.xml \
51 Magick++/bin/Magick++-config \
52 MagickCore/ImageMagick.pc \
53 Magick++/lib/Magick++.pc \
54 MagickCore/MagickCore-config \
55 MagickCore/MagickCore.pc \
56 MagickCore/version.h \
60 PerlMagick/default/Magick.pm \
61 PerlMagick/Makefile.PL \
62 PerlMagick/default/Makefile.PL \
63 PerlMagick/quantum/Makefile.PL \
64 PerlMagick/quantum/quantum.pm \
65 PerlMagick/quantum/quantum.xs \
66 PerlMagick/quantum/typemap \
69 utilities/composite.1 \
73 utilities/identify.1 \
74 utilities/ImageMagick.1 \
79 MagickWand/MagickWand-config \
80 MagickWand/MagickWand.pc ])
83 # Save initial user-tunable values
86 for var in CC CFLAGS CPPFLAGS CXX CXXCPP LDFLAGS LIBS ; do
87 eval isset=\${$var+set}
88 if test "$isset" = 'set'; then
90 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS}'${var}=${val}' "
93 AC_SUBST(DISTCHECK_CONFIG_FLAGS)
95 CONFIGURE_ARGS="$0 ${ac_configure_args}"
96 AC_SUBST(CONFIGURE_ARGS)
98 # Source file containing package/library versioning information.
99 . ${srcdir}/version.sh
101 echo "configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}${PACKAGE_VERSION_ADDENDUM}"
107 MAGICK_TARGET_CPU=$host_cpu
108 AC_SUBST(MAGICK_TARGET_CPU)
109 AC_DEFINE_UNQUOTED(MAGICK_TARGET_CPU,$MAGICK_TARGET_CPU,[Target Host CPU])
111 MAGICK_TARGET_VENDOR=$host_vendor
112 AC_SUBST(MAGICK_TARGET_VENDOR)
113 AC_DEFINE_UNQUOTED(MAGICK_TARGET_VENDOR,$MAGICK_TARGET_VENDOR,[Target Host Vendor])
115 MAGICK_TARGET_OS=$host_os
116 AC_SUBST(MAGICK_TARGET_OS)
117 AC_DEFINE_UNQUOTED(MAGICK_TARGET_OS,$MAGICK_TARGET_OS,[Target Host OS])
120 # Substitute versioning
121 AC_SUBST([MAGICK_MAJOR_VERSION],[magick_major_version])
122 AC_SUBST([MAGICK_MINOR_VERSION],[magick_minor_version])
123 AC_SUBST([MAGICK_MICRO_VERSION],[magick_micro_version])
124 AC_SUBST([MAGICK_PATCHLEVEL_VERSION],[magick_patchlevel_version])
125 AC_SUBST([MAGICK_VERSION],[magick_version])
126 AC_SUBST([MAGICK_SVN_REVISION],[magick_svn_revision])
128 # Substitute library versioning
129 AC_SUBST(MAGICK_LIBRARY_CURRENT)dnl
130 AC_SUBST(MAGICK_LIBRARY_REVISION)dnl
131 AC_SUBST(MAGICK_LIBRARY_AGE)dnl
132 AC_SUBST([MAGICK_LIBRARY_CURRENT_MIN],
133 [`expr $MAGICK_LIBRARY_CURRENT - $MAGICK_LIBRARY_AGE`])
134 AC_SUBST([MAGICK_LIBRARY_VERSION_INFO],
135 [$MAGICK_LIBRARY_CURRENT:$MAGICK_LIBRARY_REVISION:$MAGICK_LIBRARY_AGE])
137 AC_SUBST(MAGICKPP_LIBRARY_CURRENT)dnl
138 AC_SUBST(MAGICKPP_LIBRARY_REVISION)dnl
139 AC_SUBST(MAGICKPP_LIBRARY_AGE)dnl
140 AC_SUBST([MAGICKPP_LIBRARY_CURRENT_MIN],
141 [`expr $MAGICKPP_LIBRARY_CURRENT - $MAGICKPP_LIBRARY_AGE`])
142 AC_SUBST([MAGICKPP_LIBRARY_VERSION_INFO],
143 [$MAGICKPP_LIBRARY_CURRENT:$MAGICKPP_LIBRARY_REVISION:$MAGICKPP_LIBRARY_AGE])
145 AC_SUBST(PACKAGE_NAME)dnl
146 AC_SUBST(PACKAGE_VERSION)dnl
147 AC_SUBST(PACKAGE_PERL_VERSION)dnl
148 AC_SUBST(PACKAGE_RELEASE)dnl
149 AC_SUBST(PACKAGE_CHANGE_DATE)dnl
150 AC_SUBST(PACKAGE_LIB_VERSION)dnl
151 AC_SUBST(PACKAGE_LIB_VERSION_NUMBER)dnl
152 AC_SUBST(PACKAGE_RELEASE_DATE)dnl
153 AC_SUBST(PACKAGE_VERSION_ADDENDUM)dnl
155 # Ensure that make can run correctly
158 AM_INIT_AUTOMAKE([1.11 color-tests foreign parallel-tests silent-rules subdir-objects dist-bzip2 dist-lzip dist-xz dist-zip])
160 # Enable support for silent build rules
161 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
163 # versionning of library
164 MAGICK_LIB_VERSION="0x"
165 if test ${MAGICK_LIBRARY_CURRENT} -lt 10 ; then
166 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
168 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_CURRENT}
169 if test ${MAGICK_LIBRARY_AGE} -lt 10 ; then
170 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
172 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_AGE}
173 if test ${MAGICK_LIBRARY_REVISION} -lt 10 ; then
174 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
176 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_REVISION}
177 AC_SUBST(MAGICK_LIB_VERSION)
179 # Definition used to define MagickLibVersionText in version.h
180 MAGICK_LIB_VERSION_TEXT="${PACKAGE_VERSION}"
181 AC_SUBST(MAGICK_LIB_VERSION_TEXT)
183 # Definition used to define MagickLibVersionNumber in version.h
184 MAGICK_LIB_VERSION_NUMBER="${MAGICK_LIBRARY_CURRENT},${MAGICK_LIBRARY_AGE},${MAGICK_LIBRARY_REVISION}"
185 AC_SUBST(MAGICK_LIB_VERSION_NUMBER)
187 MAGICKPP_LIB_VERSION="0x"
188 if test ${MAGICKPP_LIBRARY_CURRENT} -lt 10 ; then
189 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}0
191 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}${MAGICKPP_LIBRARY_CURRENT}
192 if test ${MAGICKPP_LIBRARY_AGE} -lt 10 ; then
193 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}0
195 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}${MAGICKPP_LIBRARY_AGE}
196 if test ${MAGICKPP_LIBRARY_REVISION} -lt 10 ; then
197 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}0
199 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}${MAGICKPP_LIBRARY_REVISION}
200 AC_SUBST(MAGICKPP_LIB_VERSION)
202 # Definition used to define MagickLibVersionText in version.h
203 MAGICKPP_LIB_VERSION_TEXT="${PACKAGE_VERSION}"
204 AC_SUBST(MAGICKPP_LIB_VERSION_TEXT)
206 # Definition used to define MagickLibVersionNumber in version.h
207 MAGICK_LIB_VERSION_NUMBER="${MAGICK_LIBRARY_CURRENT},${MAGICK_LIBRARY_AGE},${MAGICK_LIBRARY_REVISION}"
208 AC_SUBST(MAGICK_LIB_VERSION_NUMBER)
212 # Regenerate config.status if ChangeLog or version.sh is updated.
213 AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/version.sh'])
218 MAGICK_CPPFLAGS=$CPPFLAGS_USER
219 MAGICK_PCFLAGS=$CPPFLAGS_USER
225 # Evaluate shell variable equivalents to Makefile directory variables
227 if test "x$prefix" = xNONE; then
228 prefix=$ac_default_prefix
230 # Let make expand exec_prefix.
231 if test "x$exec_prefix" = xNONE; then
232 exec_prefix='${prefix}'
236 eval "eval PREFIX_DIR=${prefix}"
238 eval "eval EXEC_PREFIX_DIR=${exec_prefix}"
239 AC_SUBST(EXEC_PREFIX_DIR)
240 eval "eval BIN_DIR=$bindir"
242 eval "eval SBIN_DIR=$sbindir"
244 eval "eval LIBEXEC_DIR=$libexecdir"
245 AC_SUBST(LIBEXEC_DIR)
246 eval "eval DATA_DIR=$datadir"
248 eval "eval DOC_DIR=$datadir/doc"
250 eval "eval SYSCONF_DIR=$sysconfdir"
251 AC_SUBST(SYSCONF_DIR)
252 eval "eval SHAREDSTATE_DIR=$sharedstatedir"
253 AC_SUBST(SHAREDSTATE_DIR)
254 eval "eval LOCALSTATE_DIR=$localstatedir"
255 AC_SUBST(LOCALSTATE_DIR)
256 eval "eval LIB_DIR=$libdir"
258 eval "eval INCLUDE_DIR=$includedir"
259 AC_SUBST(INCLUDE_DIR)
260 eval "eval PERSISTINCLUDE_DIR=$oldincludedir"
261 AC_SUBST(PERSISTINCLUDE_DIR)
262 eval "eval INFO_DIR=$infodir"
264 eval "eval MAN_DIR=$mandir"
267 # Get full paths to source and build directories
268 srcdirfull="`cd $srcdir && pwd`"
272 # Compute variables useful for running uninstalled software.
274 MAGICK_CODER_MODULE_PATH="${builddir}/coders"
275 MAGICK_CONFIGURE_SRC_PATH="${srcdirfull}/config"
276 MAGICK_CONFIGURE_BUILD_PATH="${builddir}/config"
277 MAGICK_FILTER_MODULE_PATH="${builddir}/filters"
279 case "${build_os}" in
281 MAGICK_CODER_MODULE_PATH=`$WinPathScript "${MAGICK_CODER_MODULE_PATH}" 0`
282 MAGICK_CONFIGURE_SRC_PATH=`$WinPathScript "${MAGICK_CONFIGURE_SRC_PATH}" 0`
283 MAGICK_CONFIGURE_BUILD_PATH=`$WinPathScript "${MAGICK_CONFIGURE_BUILD_PATH}" 0`
284 MAGICK_FILTER_MODULE_PATH=`$WinPathScript "${MAGICK_FILTER_MODULE_PATH}" 0`
293 AC_SUBST(MAGICK_CODER_MODULE_PATH)
294 AC_SUBST(MAGICK_CONFIGURE_SRC_PATH)
295 AC_SUBST(MAGICK_CONFIGURE_BUILD_PATH)
296 AC_SUBST(MAGICK_FILTER_MODULE_PATH)
301 # Enable OS features.
303 AC_USE_SYSTEM_EXTENSIONS
323 AX_GCC_ARCHFLAG([no])
326 # Check for linker script support
330 # Enable run-time checking.
332 AC_ARG_ENABLE([bounds-checking],
333 [AC_HELP_STRING([--enable-bounds-checking],
334 [enable run-time bounds-checking])],
335 [enable_bounds_checking=$enableval],
336 [enable_bounds_checking='no'])
338 if test "$enable_bounds_checking" = yes; then
339 AC_DEFINE([_FORTIFY_SOURCE], [2],
340 [enable run-time bounds-checking])
350 native_win32_build='no'
358 native_win32_build='yes'
362 if test "${GDI32_LIBS}x" != 'x'; then
363 AC_DEFINE(WINGDI32_DELEGATE,1,Define to use the Windows GDI32 library)
366 AM_CONDITIONAL(WINGDI32_DELEGATE, test "${GDI32_LIBS}x" != 'x' )
367 AM_CONDITIONAL(WIN32_NATIVE_BUILD, test "${native_win32_build}" = 'yes' )
368 AM_CONDITIONAL(CYGWIN_BUILD, test "${cygwin_build}" = 'yes' )
369 AM_CONDITIONAL(USING_CL, test "x${CC}" = 'xcl.exe' )
371 WinPathScript="${srcdirfull}/winpath.sh"
372 AC_SUBST(WinPathScript)
375 # Compiler flags tweaks
377 if test "${GCC}" != "yes"; then
380 # aCC: HP ANSI C++ B3910B A.03.34
381 CFLAGS="${CFLAGS} -Wp,-H30000"
382 if test -n "${CXXFLAGS}"; then
385 CXXFLAGS="${CXXFLAGS} -AA"
389 # Compaq alphaev68-dec-osf5.1 compiler
390 if test -n "${CXXFLAGS}"; then
391 CXXFLAGS='-std strict_ansi -noimplicit_include'
393 CXXFLAGS="${CXXFLAGS} -std strict_ansi -noimplicit_include"
398 # Check for lazy-loading.
399 AC_CACHE_CHECK([for linker lazyload option],[im_cv_ld_lazyload],
401 im_cv_ld_lazyload='none'
403 *-*-solaris2.8 | *-*-solaris2.9 | *-*-solaris2.1? )
404 if test "$lt_cv_prog_gnu_ld" != 'yes' ; then
405 im_cv_ld_lazyload='-Wl,-zlazyload'
410 if test "${im_cv_ld_lazyload}" != 'none' ; then
411 if test -z "${LDFLAGS}" ; then
412 LDFLAGS="${im_cv_ld_lazyload}"
414 LDFLAGS="${im_cv_ld_lazyload} ${LDFLAGS}"
418 dnl Platform-specific stuff
420 *darwin* | *-macos10*)
421 dnl Disable FORTIFY_SOURCE to fix a bug in LVVM / OpenMP support
422 CFLAGS="${CFLAGS} -D_FORTIFY_SOURCE=0"
423 dnl OS X universal binary support, requires --disable-dependency-tracking
424 AC_ARG_ENABLE([osx-universal-binary],
425 AC_HELP_STRING([--enable-osx-universal-binary],
426 [build universal binary on OS X [[default=no]]]),
427 [build_osxuniversal="${enableval}"], [build_osxuniversal=no])
429 if test "${build_osxuniversal}" != no ; then
430 if test "$enable_dependency_tracking" != no ; then
431 AC_MSG_ERROR([--enable-osx-universal-binary requires --disable-dependency-tracking.
432 Please re-run configure with these options:
433 --disable-dependency-tracking --enable-osx-universal-binary
436 CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
437 CXXFLAGS="$CXXFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
438 LDFLAGS="$LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
444 # ARCH specific include directory
446 AC_ARG_WITH([includearch-dir],
447 [AC_HELP_STRING([--includearch-dir=DIR],
448 [ARCH specific include directory])],
449 [includearch_dir=$withval],
450 [includearch_dir=$INCLUDE_DIR])
452 eval "eval INCLUDEARCH_DIR=$includearch_dir"
453 AC_SUBST(INCLUDEARCH_DIR)
456 # ARCH specific configuration directory
458 AC_ARG_WITH([sharearch-dir],
459 [AC_HELP_STRING([--sharearch-dir=DIR],
460 [ARCH specific config directory])],
461 [sharearch_dir=$withval],
462 [sharearch_dir="${LIB_DIR}"])
464 eval "eval SHAREARCH_DIR=$sharearch_dir"
465 AC_SUBST(SHAREARCH_DIR)
467 # Path to the pkgconfig folder
468 AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=DIR],
469 [Path to the pkgconfig directory @<:@LIBDIR/pkgconfig@:>@]),
470 [pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
471 AC_SUBST([pkgconfigdir])
474 # Enable support for threads
476 # Find Posix threads library
478 AC_ARG_WITH([threads],
479 [AC_HELP_STRING([--without-threads], [disable threads support])],
480 [with_threads=$withval],
481 [with_threads='yes'])
485 if test "$with_threads" != 'no'; then
487 if test "$ax_pthread_ok" = yes; then
489 DEF_THREAD="$PTHREAD_CFLAGS"
490 CFLAGS="$CFLAGS $DEF_THREAD"
491 CXXFLAGS="$CXXFLAGS $DEF_THREAD"
492 THREAD_LIBS="$PTHREAD_LIBS"
493 if test "$CC" != "$PTHREAD_CC"; then
494 AC_MSG_WARN([Replacing compiler $CC with compiler $PTHREAD_CC to support pthreads.])
497 AC_DEFINE(THREAD_SUPPORT,1,[Define if you have POSIX threads libraries and header files.])
500 LIBS="$LIBS $THREAD_LIBS"
501 AC_SUBST(THREAD_LIBS)
503 # Enable support for OpenMP
504 if test "$have_threads" != 'yes'; then
505 ac_cv_prog_c_openmp=unsupported
508 CFLAGS="$OPENMP_CFLAGS $CFLAGS"
509 MAGICK_PCFLAGS="$MAGICK_PCFLAGS $OPENMP_CFLAGS"
510 AC_SUBST(OPENMP_CFLAGS)
511 if test "$enable_openmp" != no; then
512 if test "$ac_cv_prog_c_openmp" != 'unsupported'; then
513 MAGICK_FEATURES="OpenMP $MAGICK_FEATURES"
517 # Enable support for OpenCL
519 CFLAGS="$CL_CFLAGS $CFLAGS"
520 LIBS="$CL_LIBS $LIBS"
522 if test "$enable_opencl" != no; then
523 if test "X$ax_cv_check_cl_libcl" != Xno; then :
524 MAGICK_FEATURES="OpenCL $MAGICK_FEATURES"
530 # Check for large file support
536 if test "$enable_largefile" != no; then
537 case $ac_cv_sys_file_offset_bits in
539 # nothing to do here as the host supports LFS fine
542 AC_MSG_CHECKING([for native large file support])
543 AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>
545 exit(!(sizeof(off_t) == 8));
547 [ac_cv_sys_file_offset_bits=64; AC_DEFINE(_FILE_OFFSET_BITS,64)
548 AC_MSG_RESULT([yes])],
549 [AC_MSG_RESULT([no])])
552 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
555 if test "$ac_cv_sys_large_files" != 'no'; then
556 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGE_FILES=1"
558 if test "$ac_cv_sys_largefile_source" != 'no'; then
559 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGEFILE_SOURCE=1"
562 AC_SUBST(LFS_CPPFLAGS)
568 AC_SUBST(LIBTOOL_DEPS)
570 # Check to see if building shared libraries
571 libtool_build_shared_libs='no'
572 if test "$enable_shared" = 'yes'; then
573 libtool_build_shared_libs='yes'
576 # Check to see if building static libraries
577 libtool_build_static_libs='no'
578 if test "$enable_static" = 'yes'; then
579 libtool_build_static_libs='yes'
582 AM_CONDITIONAL(WITH_SHARED_LIBS, test "${libtool_build_shared_libs}" = 'yes')
584 # Enable support for building loadable modules
587 AC_ARG_WITH([modules],
588 [AC_HELP_STRING([--with-modules],
589 [enable building dynamically loadable modules])],
590 [with_modules=$withval],
593 # Only allow building loadable modules if we are building shared libraries
594 if test "$with_modules" != 'no' ; then
595 if test "$libtool_build_shared_libs" = 'no'; then
596 AC_MSG_WARN([Modules may only be built if building shared libraries is enabled.])
602 if test "$build_modules" != 'no' ; then
603 AC_DEFINE(BUILD_MODULES,1,Define if coders and filters are to be built as modules.)
604 MAGICK_FEATURES="$MAGICK_FEATURES Modules"
606 AM_CONDITIONAL(WITH_MODULES, test "$build_modules" != 'no')
608 # Enable build using delegate libraries built in subdirectories rather than installed
609 # delegate libraries (bzlib fftw fpx gslib jp2 jbig jpeg lcms lzma png tiff ttf wmf xml zlib)
610 AC_ARG_ENABLE([delegate-build],
611 [AC_HELP_STRING([--enable-delegate-build],
612 [look for delegate libraries in build directory])],
613 [enable_delegate_build=$enableval],
614 [enable_delegate_build='no'])
616 AC_ARG_ENABLE([deprecated],
617 [AC_HELP_STRING([--disable-deprecated],
618 [exclude deprecated methods in MagickCore and MagickWand APIs])],
619 [enable_deprecated=$enableval],
620 [enable_deprecated='no'])
622 if test "$enable_deprecated" = 'yes'; then
623 AC_DEFINE(EXCLUDE_DEPRECATED,1,[exclude deprecated methods in MagickCore API])
625 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-deprecated "
628 # Build a version of ImageMagick which operates uninstalled.
629 # Used to build distributions located via MAGICK_HOME / executable path
630 AC_ARG_ENABLE([installed],
631 [AC_HELP_STRING([--disable-installed],
632 [Formally install ImageMagick under PREFIX])],
633 [enable_installed=$enableval],
634 [enable_installed='yes'])
636 if test "$enable_installed" = 'yes'; then
637 AC_DEFINE(INSTALLED_SUPPORT,1,[ImageMagick is formally installed under prefix])
639 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-installed "
642 # Permit enciphering and deciphering image pixels.
643 AC_ARG_ENABLE([cipher],
644 [AC_HELP_STRING([--disable-cipher],
645 [disable enciphering and deciphering image pixels])],
646 [enable_cipher=$enableval],
647 [enable_cipher='yes'])
649 if test "$enable_cipher" = 'yes'; then
650 AC_DEFINE(CIPHER_SUPPORT,1,[permit enciphering and deciphering image pixels])
653 # Build a zero-configuration version of ImageMagick.
654 AC_ARG_ENABLE([zero-configuration],
655 [AC_HELP_STRING([--enable-zero-configuration],
656 [enable self-contained, embeddable, zero-configuration ImageMagick])],
657 [enable_zero_configuration=$enableval],
658 [enable_zero_configuration='no'])
660 if test "$enable_zero_configuration" = 'yes'; then
661 AC_DEFINE(ZERO_CONFIGURATION_SUPPORT,1,[Build self-contained, embeddable, zero-configuration ImageMagick])
662 MAGICK_FEATURES="Zero-Configuration $MAGICK_FEATURES"
665 # Build a high dynamic range version of ImageMagick.
666 AC_ARG_ENABLE([hdri],
667 [AC_HELP_STRING([--enable-hdri],
668 [accurately represent the wide range of intensity levels found in real scenes])],
669 [enable_hdri=$enableval],
673 if test "$enable_hdri" = 'yes'; then
675 magick_hdri_enable='1';
676 MAGICK_FEATURES="HDRI $MAGICK_FEATURES"
678 magick_hdri_enable='0'
680 AC_DEFINE_UNQUOTED(HDRI_ENABLE_OBSOLETE_IN_H,$magick_hdri_enable,[Whether hdri is enabled or not])
681 AC_SUBST(MAGICK_HDRI)dnl
682 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -DMAGICKCORE_HDRI_ENABLE=$magick_hdri_enable"
683 CFLAGS="$CFLAGS -DMAGICKCORE_HDRI_ENABLE=$magick_hdri_enable"
684 CPPFLAGS="$CPPFLAGS -DMAGICKCORE_HDRI_ENABLE=$magick_hdri_enable"
686 # Build a version of ImageMagick with assert statements.
687 AC_ARG_ENABLE([assert],
688 [AC_HELP_STRING([--disable-assert],
689 [disable assert() statements in build])],
690 [enable_assert=$enableval],
691 [enable_assert='yes'])
693 if test "$enable_assert" = 'no'; then
694 AC_DEFINE(NDEBUG,1,[Turn off assert statements])
697 # Don't emit "rebuild rules" for configure, Makefile.ins, etc.
700 # Enable hugepages support
701 AC_ARG_ENABLE([hugepages],
702 [AC_HELP_STRING([--enable-hugepages],
703 [enable 'huge pages' support])],
704 [enable_hugepages=$enableval],
705 [enable_hugepages='no'])
707 # Enable ccmalloc memory debugging support
708 AC_ARG_ENABLE([ccmalloc],
709 [AC_HELP_STRING([--enable-ccmalloc],
710 [enable 'ccmalloc' memory debug support])],
711 [enable_ccmalloc=$enableval],
712 [enable_ccmalloc='no'])
714 # Enable Electric Fence memory debugging support
715 AC_ARG_ENABLE([efence],
716 [AC_HELP_STRING([--enable-efence],
717 [enable 'efence' memory debug support])],
718 [enable_efence=$enableval],
719 [enable_efence='no'])
721 # Enable prof-based profiling support
722 AC_ARG_ENABLE([prof],
723 [AC_HELP_STRING([--enable-prof],
724 [enable 'prof' profiling support])],
725 [enable_prof=$enableval],
728 # Enable gprof-based profiling support
729 AC_ARG_ENABLE([gprof],
730 [AC_HELP_STRING([--enable-gprof],
731 [enable 'gprof' profiling support])],
732 [enable_gprof=$enableval],
735 # Enable gcov-based profiling support
736 AC_ARG_ENABLE([gcov],
737 [AC_HELP_STRING([--enable-gcov],
738 [enable 'gcov' profiling support])],
739 [enable_gcov=$enableval],
742 enable_profiling='no'
743 if test "$enable_prof" = 'yes' || test "$enable_gprof" = 'yes' || test "$enable_gcov" = 'yes'; then
744 enable_profiling='yes'
745 if test "$libtool_build_shared_libs" = 'yes'; then
746 echo "Warning: Can not profile code using shared libraries"
750 # Magick API method prefix
751 AC_ARG_WITH([method-prefix],
752 [AC_HELP_STRING([--with-method-prefix=PREFIX],
753 [prefix MagickCore API methods])],
754 [with_method_prefix=$withval],
755 [with_method_prefix='no'])
757 if test "$with_method_prefix" != 'no'; then
758 AC_DEFINE_UNQUOTED(NAMESPACE_PREFIX,$with_method_prefix,[Magick API method prefix])
759 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-method-prefix "
762 # Enable legacy support (default no)
763 AC_ARG_ENABLE(legacy-support,
764 [ --enable-legacy-support install legacy command-line utilities (default disabled)],
765 [with_legacy_support=$enableval],
766 [with_legacy_support='no'])
767 AM_CONDITIONAL(LEGACY_SUPPORT, test "$with_legacy_support" != 'no')
769 # Number of bits in a Quantum
770 AC_ARG_WITH([quantum-depth],
771 [AC_HELP_STRING([--with-quantum-depth=DEPTH],
772 [number of bits in a pixel quantum (default 16)])],
773 [with_quantum_depth=$withval],
774 [with_quantum_depth=16])
776 if test "$with_quantum_depth" != '8'; then
777 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-quantum-depth=$with_quantum_depth "
780 case "${with_quantum_depth}" in
785 * ) AC_MSG_ERROR("Pixel quantum depth must have value of 8, 16, 32, or 64") ;;
787 QUANTUM_DEPTH="$with_quantum_depth"
788 AC_DEFINE_UNQUOTED(QUANTUM_DEPTH_OBSOLETE_IN_H,$QUANTUM_DEPTH,[Number of bits in a pixel Quantum (8/16/32/64)])
789 AC_SUBST(QUANTUM_DEPTH)dnl
790 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -DMAGICKCORE_QUANTUM_DEPTH=$QUANTUM_DEPTH"
791 CFLAGS="$CFLAGS -DMAGICKCORE_QUANTUM_DEPTH=$QUANTUM_DEPTH"
792 CPPFLAGS="$CPPFLAGS -DMAGICKCORE_QUANTUM_DEPTH=$QUANTUM_DEPTH"
794 # define a lib suffix for abi purpose
795 MAGICK_ABI_SUFFIX="Q${QUANTUM_DEPTH}"
796 if test "$enable_hdri" = 'yes'; then
797 MAGICK_ABI_SUFFIX="Q${QUANTUM_DEPTH}${MAGICK_HDRI}"
799 AC_SUBST(MAGICK_ABI_SUFFIX)
801 # Set pixel cache threshold
803 [AC_HELP_STRING([--with-cache=THRESHOLD],
804 [set pixel cache threshhold in MB (default available memory)])],
805 [with_cache=$withval],
808 if test "$with_cache" != ''; then
809 AC_DEFINE_UNQUOTED(PixelCacheThreshold,$with_cache,[Pixel cache threshold in MB (defaults to available memory)])
810 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-cache=$with_cache "
813 # Disable/Enable support for full delegate paths
814 AC_ARG_WITH([frozenpaths],
815 [AC_HELP_STRING([--with-frozenpaths],
816 [freeze delegate paths])],
817 [with_frozenpaths=$withval],
818 [with_frozenpaths='no'])
820 # Enable build/install of Magick++
821 AC_ARG_WITH([magick-plus-plus],
822 [AC_HELP_STRING([--without-magick-plus-plus],
823 [disable build/install of Magick++])],
824 [with_magick_plus_plus=$withval],
825 [with_magick_plus_plus='yes'])
827 # Encode the this name into the shared library.
828 AC_ARG_WITH([package-release-name],
829 [AC_HELP_STRING([--with-package-release-name=NAME],
830 [encode this name into the shared library])],
831 [MAGICK_LT_RELEASE_OPTS="-release $withval"])
832 AC_SUBST(MAGICK_LT_RELEASE_OPTS)
834 # Disable build/install of PerlMagick.
836 [AC_HELP_STRING([--with-perl],
837 [enable build/install of PerlMagick])],
838 [with_perl=$withval],
841 # Options to pass when configuring PerlMagick
842 AC_ARG_WITH([perl-options],
843 [AC_HELP_STRING([--with-perl-options=OPTIONS],
844 [options to pass on command-line when generating PerlMagick build file])],
845 PERL_MAKE_OPTIONS=$withval)
846 AC_SUBST(PERL_MAKE_OPTIONS)
848 # Enable umem, object-caching memory allocation library.
850 [ --with-umem enable umem memory allocation library support],
851 [with_umem=$withval],
853 if test "$with_umem" != 'yes' ; then
854 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-umem=$with_umem "
858 # Specify path to shared libstdc++ if not in normal location
860 AC_ARG_WITH([libstdc],
861 [AC_HELP_STRING([--with-libstdc=DIR],
862 [ use libstdc++ in DIR (for GNU C++)])],
863 [with_libstdc=$withval],
866 if test "$with_libstdc" != ''; then
867 if test -d "$with_libstdc"; then
868 LIBSTDCLDFLAGS="-L$with_libstdc"
871 AC_SUBST(LIBSTDCLDFLAGS)
873 # Does gcc required -traditional?
874 AC_PROG_GCC_TRADITIONAL
878 # Set defines required to build DLLs and modules using MinGW
881 # These options are set for multi-thread DLL module build
882 # libMagickCore: _DLL _MAGICKMOD_ _MAGICKLIB_
884 # executable/Magick++: _DLL _MAGICKMOD_
885 MODULE_EXTRA_CPPFLAGS=''
886 LIBRARY_EXTRA_CPPFLAGS=''
887 if test "${native_win32_build}" = 'yes'; then
888 if test "${libtool_build_shared_libs}" = 'yes'; then
889 CPPFLAGS="$CPPFLAGS -D_DLL"
890 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_DLL"
891 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_DLL"
892 LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKLIB_"
893 if test "$build_modules" = 'yes'; then
894 LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKMOD_"
896 MODULE_EXTRA_CPPFLAGS="$MODULE_EXTRA_CPPFLAGS -D_MAGICKLIB_"
899 CPPFLAGS="$CPPFLAGS -D_LIB"
900 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_LIB"
901 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_LIB"
903 if test "$with_threads" = 'yes'; then
904 CPPFLAGS="$CPPFLAGS -D_MT"
905 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_MT"
906 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_MT"
909 AC_SUBST(MODULE_EXTRA_CPPFLAGS)
910 AC_SUBST(LIBRARY_EXTRA_CPPFLAGS)
912 # Check standard headers
914 if ! test x"$ac_cv_header_stdc" = x"yes"; then
915 AC_MSG_WARN([configure has detected that you do not have the ANSI standard C
916 header files. Compilation cannot proceed. Please install the ANSI C
917 headers and rerun this script.]);
922 # Check additional headers
923 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/socket.h sys/syslimits.h sys/time.h sys/timeb.h sys/times.h sys/wait.h wchar.h xlocale.h)
927 # Checks for typedefs, structures, and compiler characteristics.
941 # Checks for language qualifiers and semantics.
949 # If words are stored with the most significant byte first (like
950 # Motorola and SPARC CPUs), define `WORDS_BIGENDIAN'.
953 # Define to a suitable type, if standard headers do not define it.
961 AC_TYPE_LONG_DOUBLE_WIDER
962 AC_TYPE_LONG_LONG_INT
976 AC_TYPE_UNSIGNED_LONG_LONG_INT
978 # Float_t and double_t are intended to be the the most efficient type.
979 AC_CHECK_TYPES([float_t], [], [], [[#include <math.h>]])
980 AC_CHECK_TYPES([double_t], [], [], [[#include <math.h>]])
981 AC_CHECK_SIZEOF([float_t], [], [[#include <math.h>]])
982 AC_CHECK_SIZEOF([double_t], [], [[#include <math.h>]])
984 # Get size of float, double and long double for comparaison.
985 AC_CHECK_SIZEOF([float])
986 AC_CHECK_SIZEOF([double])
987 AC_CHECK_SIZEOF([long double])
989 # Obtain size of an 'signed short' and define as SIZEOF_SIGNED_SHORT
990 AC_CHECK_SIZEOF(signed short)
992 # Obtain size of an 'unsigned short' and define as SIZEOF_UNSIGNED_SHORT
993 AC_CHECK_SIZEOF(unsigned short)
995 # Obtain size of an 'signed int' and define as SIZEOF_SIGNED_INT
996 AC_CHECK_SIZEOF(signed int)
998 # Obtain size of an 'unsigned int' and define as SIZEOF_UNSIGNED_INT
999 AC_CHECK_SIZEOF(unsigned int)
1001 # Obtain size of a 'signed long' and define as SIZEOF_SIGNED_LONG
1002 AC_CHECK_SIZEOF(signed long)
1004 # Obtain size of a 'unsigned long' and define as SIZEOF_UNSIGNED_LONG
1005 AC_CHECK_SIZEOF(unsigned long)
1007 # Obtain size of a 'long long' and define as SIZEOF_SIGNED_LONG_LONG. If
1008 # 'signed long long' is not supported then the value defined is zero.
1009 AC_CHECK_SIZEOF(signed long long)
1011 # Obtain size of a 'unsigned long long' and define as
1012 # SIZEOF_UNSIGNED_LONG_LONG. If 'unsigned long long' is not
1013 # supported then the value defined is zero.
1014 AC_CHECK_SIZEOF(unsigned long long)
1016 # Obtain size of off_t and define as SIZEOF_OFF_T
1017 AC_CHECK_SIZEOF(off_t)
1019 # Obtain size of size_t and define as SIZEOF_SIZE_T
1020 AC_CHECK_SIZEOF(size_t)
1022 # Obtain size of ssize_t and define as SIZEOF_SSIZE_T
1023 AC_CHECK_SIZEOF(ssize_t)
1025 # Obtain size of an unsigned int pointer and define as SIZEOF_UNSIGNED_INTP
1026 AC_CHECK_SIZEOF(unsigned int*)
1029 # Compute sized types for current CPU and compiler options.
1032 AC_MSG_CHECKING(for signed 8-bit type)
1033 INT8_T='signed char'
1034 AC_MSG_RESULT($INT8_T)
1037 AC_MSG_CHECKING(for unsigned 8-bit type)
1038 UINT8_T='unsigned char'
1039 AC_MSG_RESULT($UINT8_T)
1042 AC_MSG_CHECKING(for signed 16-bit type)
1043 INT16_T='signed short'
1044 AC_MSG_RESULT($INT16_T)
1047 AC_MSG_CHECKING(for unsigned 16-bit type)
1048 UINT16_T='unsigned short'
1049 AC_MSG_RESULT($UINT16_T)
1052 AC_MSG_CHECKING(for signed 32-bit type)
1055 if test $ac_cv_sizeof_signed_int -eq 4; then
1056 INT32_T='signed int'
1058 elif test $ac_cv_sizeof_signed_long -eq 4; then
1059 INT32_T='signed long'
1062 AC_MSG_RESULT($INT32_T)
1066 AC_MSG_CHECKING(for unsigned 32-bit type)
1069 if test $ac_cv_sizeof_unsigned_int -eq 4; then
1070 UINT32_T='unsigned int'
1072 elif test $ac_cv_sizeof_unsigned_long -eq 4; then
1073 UINT32_T='unsigned long'
1076 AC_MSG_RESULT($UINT32_T)
1080 AC_MSG_CHECKING(for signed 64-bit type)
1083 if test $ac_cv_sizeof_signed_long -eq 8; then
1084 INT64_T='signed long'
1086 elif test $ac_cv_sizeof_signed_long_long -eq 8; then
1087 INT64_T='signed long long'
1090 case "${host_os}" in
1095 AC_MSG_RESULT($INT64_T)
1099 AC_MSG_CHECKING(for unsigned 64-bit type)
1102 if test $ac_cv_sizeof_unsigned_long -eq 8; then
1103 UINT64_T='unsigned long'
1105 elif test $ac_cv_sizeof_unsigned_long_long -eq 8; then
1106 UINT64_T='unsigned long long'
1109 case "${host_os}" in
1114 AC_MSG_RESULT($UINT64_T)
1118 AC_MSG_CHECKING(for unsigned maximum type)
1121 if test "$UINT64_T" != 'none'; then
1124 elif test "$UINT32_T" != 'none'; then
1128 AC_MSG_RESULT($UINTMAX_T)
1132 AC_MSG_CHECKING(for pointer difference type)
1135 if test $ac_cv_sizeof_unsigned_long -eq $ac_cv_sizeof_unsigned_intp; then
1136 UINTPTR_T='unsigned long'
1138 elif test $ac_cv_sizeof_unsigned_long_long -eq $ac_cv_sizeof_unsigned_intp; then
1139 UINTPTR_T='unsigned long long'
1142 AC_MSG_RESULT($UINTPTR_T)
1146 AC_MSG_CHECKING([whether our compiler supports __func__])
1148 [{ const char *func = __func__; return(func != 0 ? 0 : 1); }],
1149 AC_MSG_RESULT([yes]),
1151 AC_MSG_CHECKING([whether our compiler supports __FUNCTION__])
1153 [{ const char *func = __FUNCTION__; return(func != 0 ? 0 : 1); }],
1154 AC_MSG_RESULT([yes])
1155 AC_DEFINE(__func__, __FUNCTION__,
1156 [Define to appropriate substitue if compiler does not have __func__]),
1158 AC_DEFINE(__func__, __FILE__,
1159 [Define to appropriate substitue if compiler does not have __func__])))
1163 # Check for functions
1166 AC_FUNC_CLOSEDIR_VOID
1170 AC_FUNC_SELECT_ARGTYPES
1171 AC_FUNC_SETVBUF_REVERSED
1181 AC_CHECK_LIB(m,sqrt,MATH_LIBS="-lm",,)
1182 LIBS="$MATH_LIBS $LIBS"
1186 # Find socket library
1188 AC_SEARCH_LIBS(gethostbyname, resolv nsl)
1189 AC_SEARCH_LIBS(socket, socket,
1191 AC_DEFINE([HAVE_SOCKET],[1],[Define to 1 if you have socket support.])
1192 MAGICK_FEATURES="DPC $MAGICK_FEATURES"
1195 AC_CHECK_FUNCS([acosh _aligned_malloc asinh atanh atoll atexit cabs carg cimag creal clock ctime_r directio _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 readdir_r realpath select seekdir setlocale socket sqrt setvbuf stat 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])
1198 # Check for clock_gettime().
1200 AC_SEARCH_LIBS(clock_gettime, rt,
1202 AC_DEFINE([HAVE_CLOCK_GETTIME],[1],[Define to 1 if you have clock_gettime.])
1203 AC_MSG_CHECKING([whether clock_gettime supports CLOCK_REALTIME])
1206 [[#include <time.h>]],
1207 [[clockid_t clockType = CLOCK_REALTIME;]])],
1210 AC_DEFINE([HAVE_CLOCK_REALTIME],[1],
1211 [Define to 1 if clock_gettime supports CLOCK_REALTIME.])
1217 AC_CHECK_FUNCS([gettimeofday ftime], [break])
1223 # Check for function prototypes
1227 AC_CHECK_DECLS([pread, pwrite],[],[],[
1228 #include <unistd.h>])
1230 AC_CHECK_DECLS([strlcpy],[],[],[
1231 #include <strings.h>])
1233 AC_CHECK_DECLS([vsnprintf],[],[],[
1235 #include <stdarg.h>])
1239 # C++ Support Tests (For Magick++)
1242 have_magick_plus_plus='no'
1243 if test "$with_magick_plus_plus" = 'yes'; then
1248 # Full set of headers used...
1249 # algorithm cctype cerrno cmath cstdio cstdlib cstring ctime exception
1250 # functional iomanip iosfwd iostream iterator list string strstream utility
1255 AX_CXX_NAMESPACE_STD
1256 AC_CXX_HAVE_STD_LIBS
1260 AC_MSG_CHECKING([whether C++ compiler is sufficient for Magick++])
1262 test $ax_cv_cxx_bool = 'yes' && \
1263 test $ax_cv_cxx_namespaces = 'yes' && \
1264 test $ac_cv_cxx_have_std_libs = 'yes' && \
1265 test $ax_cv_cxx_have_std_namespace = 'yes'; then
1266 have_magick_plus_plus='yes'
1268 have_magick_plus_plus='no (failed tests)'
1270 AC_MSG_RESULT([$have_magick_plus_plus])
1273 AM_CONDITIONAL(WITH_MAGICK_PLUS_PLUS, test "$have_magick_plus_plus" = 'yes')
1275 # Only check for delegate libraries in subdirectories if requested.
1276 if test "$enable_delegate_build" != 'no'; then
1277 # Check for delegate sub-directories and add -I & -L options as required.
1278 # This presumes that delegates are installed as detailed in the ImageMagick
1279 # README. If delegates are installed in a standard location where the
1280 # compiler will automatically find them then these options should not be
1284 # Most delegates have includes in the same directory as the library, but not all...
1287 for dir in bzlib fftw fpx gslib/src jp2 jp2/src/libjasper/include jbig/libjbig jpeg lcms/include lzma magick png tiff/libtiff ttf/include wand webp wmf/include xml/include zlib; do
1288 if test -d "$builddir/$dir"; then
1289 CPPFLAGS="$CPPFLAGS -I$builddir/$dir"
1291 if test -d "$srcdirfull/$dir"; then
1292 CPPFLAGS="$CPPFLAGS -I$srcdirfull/$dir"
1298 for dir in bzlib fftw fpx gslib/src jp2 jp2/src/libjasper jbig/libjbig jpeg lcms/src lzma magick png tiff/libtiff ttf/objs wand webp wmf/src xml zlib; do
1299 if test -d "$builddir/$dir/.libs"; then
1300 LDFLAGS="$LDFLAGS -L$builddir/$dir/.libs"
1302 if test -d "$srcdirfull/$dir/.libs"; then
1303 LDFLAGS="$LDFLAGS -L$srcdirfull/$dir/.libs"
1306 if test -d "$builddir/$dir"; then
1307 LDFLAGS="$LDFLAGS -L$builddir/$dir"
1309 if test -d "$srcdirfull/$dir"; then
1310 LDFLAGS="$LDFLAGS -L$srcdirfull/$dir"
1316 # Assume that delegate headers reside under same directory as ImageMagick
1317 # installation prefix.
1318 MAGICK_CPPFLAGS="-I$INCLUDE_DIR/${PACKAGE_NAME}-$MAGICK_MAJOR_VERSION $MAGICK_CPPFLAGS"
1321 # Find the X11 RGB database
1323 AC_CACHE_CHECK(for X11 configure files,im_cv_x_configure,
1324 [# Look for the header file in a standard set of common directories.
1325 # Check X11 before X11Rn because it is often a symlink to the current release.
1334 /usr/XFree86/lib/X11 \
1342 /usr/local/X11/lib \
1343 /usr/local/X11R4/lib \
1344 /usr/local/X11R5/lib \
1345 /usr/local/X11R6/lib \
1347 /usr/local/lib/X11 \
1348 /usr/local/lib/X11R4 \
1349 /usr/local/lib/X11R5 \
1350 /usr/local/lib/X11R6 \
1351 /usr/local/lib/X11R7 \
1352 /usr/local/x11r5/lib \
1353 /usr/lpp/Xamples/lib \
1355 /usr/openwin/share/lib \
1356 /usr/unsupported/lib \
1359 if test -f "$ac_dir/X11/rgb.txt"; then
1360 im_cv_x_configure="$ac_dir/X11/"
1362 elif test -f "$ac_dir/rgb.txt"; then
1363 im_cv_x_configure="$ac_dir/"
1368 X11_CONFIGURE_PATH="$im_cv_x_configure"
1369 case "${build_os}" in
1371 X11ConfigurePath=`$WinPathScript "$X11ConfigurePath=" 1`
1374 AC_DEFINE_UNQUOTED(X11_CONFIGURE_PATH,"$X11ConfigurePath",[Location of X11 configure files])
1377 # Find OpenMP library
1380 if test "$enable_openmp" != 'no'; then
1381 if test "${GCC}" = "yes"; then
1382 # Open64 (passes for GCC but uses different OpenMP implementation)
1383 if test "x$GOMP_LIBS" = x ; then
1384 if $CC --version 2>&1 | grep Open64 > /dev/null ; then
1385 AC_CHECK_LIB(openmp,omp_get_num_procs,GOMP_LIBS="-lopenmp",,)
1389 if test "x$GOMP_LIBS" = x ; then
1390 AC_CHECK_LIB(gomp,GOMP_parallel_start,GOMP_LIBS="-lgomp",,)
1394 if test "x$GOMP_LIBS" = x ; then
1395 AC_CHECK_LIB(mtsk,sunw_mp_register_warn,GOMP_LIBS="-lmtsk",,)
1398 if test "x$GOMP_LIBS" = x ; then
1399 AC_CHECK_LIB(xlsmp,_xlsmpFlush,GOMP_LIBS="-lxlsmp",,)
1401 # SGI IRIX 6.5 MIPSpro C/C++
1402 if test "x$GOMP_LIBS" = x ; then
1403 AC_CHECK_LIB(mp,mp_destroy,GOMP_LIBS="-lmp",,)
1406 LIBS="$GOMP_LIBS $LIBS"
1417 if test "$with_umem" != 'no'; then
1418 AC_MSG_CHECKING(for UMEM support )
1422 AC_CHECK_HEADER(umem.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1423 AC_CHECK_LIB(umem,umem_alloc,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1424 AC_CHECK_LIB(umem,umem_free,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1425 AC_MSG_CHECKING(if umem memory allocation library is complete)
1426 if test $passed -gt 0; then
1427 if test $failed -gt 0; then
1428 AC_MSG_RESULT(no -- some components failed test)
1429 have_umem='no (failed tests)'
1432 LIBS="$UMEM_LIBS $LIBS"
1433 AC_DEFINE(HasUMEM,1,Define if you have umem memory allocation library)
1441 AM_CONDITIONAL(HasUMEM, test "$have_umem" = 'yes')
1445 # Add support for ccmalloc memory debugging library if requested
1449 if test "$enable_ccmalloc" = 'yes'; then
1450 AC_PATH_PROG(CCMALLOCDelegate,ccmalloc,)
1451 if test -n "$CCMALLOCDelegate"; then
1452 eval `grep PREFIX= $CCMALLOCDelegate | sed -e 's/PREFIX/CCMALLOC_PREFIX/'`
1454 # Assume that gcc is used with ccmalloc.
1455 LIBS="$LIBS $CCMALLOC_PREFIX/lib/ccmalloc-gcc.o"
1456 AC_CHECK_LIB(ccmalloc,ccmalloc_malloc,CCMALLOC_LIBS="$CCMALLOC_PREFIX/lib/ccmalloc-gcc.o -lccmalloc -ldl",,-ldl)
1457 if test -n "$CCMALLOC_LIBS"; then
1459 LIBS="$LIBS $CCMALLOC_LIBS"
1468 # Add support for 'huge pages' if requested
1470 AS_IF([test "x$enable_hugepages" != "xno"],[
1471 AC_DEFINE(HAVE_HUGEPAGES, 1, [Compile with hugepage support])
1475 # Add support for efence memory debugging library if requested
1477 if test "$enable_efence" = 'yes'; then
1478 EFENCE_LIBS='-lefence'
1479 LIBS="$EFENCE_LIBS $LIBS"
1482 dnl ===========================================================================
1488 AC_ARG_WITH([bzlib],
1489 [AC_HELP_STRING([--without-bzlib],
1490 [disable BZLIB support])],
1491 [with_bzlib=$withval],
1494 if test "$with_bzlib" != 'yes'; then
1495 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-bzlib=$with_bzlib "
1499 if test "$with_bzlib" != 'no'; then
1501 AC_MSG_RESULT([-------------------------------------------------------------])
1502 AC_MSG_CHECKING([for BZLIB])
1507 AC_CHECK_HEADER(bzlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1508 AC_CHECK_LIB(bz2,BZ2_bzDecompress,found_libbz=`expr $found_libbz + 1`,,)
1509 if test "$native_win32_build" = 'yes'; then
1510 AC_CHECK_LIB(bz2,_imp__BZ2_decompress,found_libbz=`expr $found_libbz + 1`,,)
1512 if test $found_libbz -gt 0; then
1513 passed=`expr $passed + 1`
1515 failed=`expr $failed + 1`
1517 AC_MSG_CHECKING(if BZLIB package is complete)
1518 if test $passed -gt 0; then
1519 if test $failed -gt 0; then
1520 AC_MSG_RESULT(no -- some components failed test)
1521 have_bzlib='no (failed tests)'
1524 LIBS="$BZLIB_LIBS $LIBS"
1525 AC_DEFINE(BZLIB_DELEGATE,1,Define if you have the bzip2 library)
1533 AM_CONDITIONAL(BZLIB_DELEGATE, test "$have_bzlib" = 'yes')
1534 AC_SUBST(BZLIB_LIBS)
1537 # Find the X11 include and library directories.
1544 if test "$no_x" != 'yes'; then
1545 AC_MSG_RESULT([-------------------------------------------------------------])
1546 AC_MSG_CHECKING([for X11])
1548 LDFLAGS="$LDFLAGS $X_LIBS"
1549 X11_LIBS="$X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
1550 LIBS="$X11_LIBS $LIBS"
1551 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1553 AC_DEFINE(X11_DELEGATE,1,Define if you have X11 library)dnl
1556 # Check for X11 shared memory extension
1558 # shmctl is required to support the shared memory extension
1559 AC_CHECK_FUNC([shmctl],[have_shmctl='yes'],[])
1560 if test "$have_shmctl" != 'yes'; then
1562 LIBS="$LIBS -lcygipc"
1563 AC_TRY_LINK_FUNC([shmctl],[have_shmctl='yes'; IPC_LIBS='-lcygipc'],[])
1567 if test "$have_shmctl" = 'yes'; then
1568 AC_CHECK_LIB([Xext],[XShmAttach],[XEXT_LIBS='-lXext' ; AC_DEFINE(HAVE_SHARED_MEMORY,1,X11 server supports shared memory extension)],[],[])
1572 # Check for X11 shape extension
1574 AC_CHECK_LIB([Xext],[XShapeCombineMask],[XEXT_LIBS='-lXext' ; AC_DEFINE(HAVE_SHAPE,1,X11 server supports shape extension)],[],[])
1575 AC_CHECK_LIB(Xt,XtSetEventDispatcher,XT_LIBS='-lXt',,)
1576 LIBS="$XEXT_LIBS $XT_LIBS $LIBS"
1578 if test "$no_x" != 'yes'; then
1583 AM_CONDITIONAL(X11_DELEGATE, test "$have_x" = 'yes')
1587 dnl ===========================================================================
1593 [AC_HELP_STRING([--without-zlib],
1594 [disable ZLIB support])],
1595 [with_zlib=$withval],
1598 if test "$with_zlib" != 'yes'; then
1599 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-zlib=$with_zlib "
1604 dnl PNG requires zlib so enable zlib check if PNG is requested
1605 if test "$with_zlib" != 'no' || test "$with_png" != 'no'; then
1606 AC_MSG_RESULT([-------------------------------------------------------------])
1607 AC_MSG_CHECKING([for ZLIB])
1612 AC_CHECK_HEADER(zconf.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1613 AC_CHECK_HEADER(zlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1614 AC_CHECK_LIB(z,compress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1615 AC_CHECK_LIB(z,uncompress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1616 AC_CHECK_LIB(z,deflate,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1617 AC_CHECK_LIB(z,inflate,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1618 AC_CHECK_LIB(z,gzseek,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1619 AC_CHECK_LIB(z,gztell,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1620 AC_MSG_CHECKING([if ZLIB 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_zlib='no (failed tests)'
1627 LIBS="$ZLIB_LIBS $LIBS"
1628 AC_DEFINE(ZLIB_DELEGATE,1,Define if you have zlib compression library)
1629 AC_MSG_RESULT([yes])
1636 AM_CONDITIONAL(ZLIB_DELEGATE, test "$have_zlib" = 'yes')
1639 # whether modules are built or not.
1643 if test "$build_modules" != 'no' ; then
1644 AC_MSG_RESULT([-------------------------------------------------------------])
1645 AC_MSG_CHECKING([for libltdl])
1649 AC_CHECK_HEADER([ltdl.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
1650 AC_CHECK_LIB([ltdl],[lt_dlinit],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
1651 AC_MSG_CHECKING([if libltdl package is complete])
1652 if test $passed -gt 0 ; then
1653 if test $failed -gt 0 ; then
1654 AC_MSG_RESULT([no -- some components failed test])
1655 have_ltdl='no (failed tests)'
1658 LIBS="$LTDL_LIBS $LIBS"
1659 AC_DEFINE(LTDL_DELEGATE,1,[Define if using libltdl to support dynamically loadable modules])
1660 AC_MSG_RESULT([yes])
1666 if test "$have_ltdl" != 'yes' ; then
1667 AC_MSG_FAILURE([libltdl is required for modules build],[1])
1670 AM_CONDITIONAL(WITH_LTDL, test "$have_ltdl" != 'no')
1673 # If profiling, then check for -ldl and dlopen (required for Solaris & gcc)
1676 if test "$enable_profiling" = 'yes'; then
1677 AC_CHECK_LIB(dl,dlopen,LIB_DL='-ldl',,)
1678 LIBS="$LIB_DL $LIBS"
1682 dnl ===========================================================================
1685 # Check for Autotrace delegate library.
1687 AC_ARG_WITH([autotrace],
1688 [AC_HELP_STRING([--with-autotrace],
1689 [enable autotrace support])],
1690 [with_autotrace=$withval],
1691 [with_autotrace='no'])
1693 if test "$with_autotrace" != 'yes'; then
1694 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-autotrace=$with_autotrace "
1701 if test "x$with_autotrace" = "xyes"; then
1702 AC_MSG_RESULT([-------------------------------------------------------------])
1703 PKG_CHECK_MODULES(AUTOTRACE,[autotrace >= 0.31.1], have_autotrace=yes, have_autotrace=no)
1707 if test "$have_autotrace" = 'yes'; then
1709 AC_DEFINE(AUTOTRACE_DELEGATE,1,Define if you have AUTOTRACE library)
1710 if test "$build_modules" = 'no'; then
1711 CPPFLAGS="$AUTOTRACE_CFLAGS $CPPFLAGS"
1715 AM_CONDITIONAL(AUTOTRACE_DELEGATE,test "$have_autotrace" = 'yes')
1716 AC_SUBST(AUTOTRACE_CFLAGS)
1717 AC_SUBST(AUTOTRACE_LIBS)
1719 dnl ===========================================================================
1722 # Check for Display Postscript delegate library.
1725 [AC_HELP_STRING([--without-dps],
1726 [disable Display Postscript support])],
1727 [with_dps=$withval],
1730 if test "$with_dps" != 'yes'; then
1731 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-dps=$with_dps "
1736 if test "$with_dps" != 'no' && test "$with_x" != 'no'; then
1737 AC_MSG_RESULT([-------------------------------------------------------------])
1738 AC_MSG_CHECKING([for DPS])
1742 PERSIST_CPPFLAGS="$CPPFLAGS"
1743 CPPFLAGS="$CPPFLAGS -I${ac_x_includes}/X11"
1744 AC_CHECK_HEADER(DPS/dpsXclient.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1746 # XFree86-4.x needs -lXt to provide XtMalloc for -ldps.
1747 # Cygwin doesn't deliver -lXt as a DLL, which prevents a DLL build.
1748 # Adobe DPS (as delivered on Solaris) doesn't require -lXt.
1749 # ImageMagick itself doesn't use -lXt.
1752 AC_CHECK_LIB(dps,DPSInitialize,have_libdps='yes',have_libdps='no',)
1753 if test "$have_libdps" != 'yes'; then
1754 # Unset cache variable so we can try again.
1755 unset ac_cv_lib_dps_DPSInitialize
1756 AC_CHECK_LIB(dps,DPSInitialize,have_libdps='yes',have_libdps='no',-lXt)
1757 if test "$have_libdps" = 'yes'; then
1761 if test "$have_libdps" = 'yes'; then
1762 passed=`expr $passed + 1`
1764 failed=`expr $failed + 1`
1766 AC_CHECK_LIB(dpstk,XDPSPixelsPerPoint,passed=`expr $passed + 1`,failed=`expr $failed + 1`,-ldps $LIBDPS_XT)
1767 AC_MSG_CHECKING([if DPS package is complete])
1768 if test $passed -gt 0; then
1769 if test $failed -gt 0; then
1770 AC_MSG_RESULT([no -- some components failed test])
1771 have_dps='no (failed tests)'
1772 CPPFLAGS="$PERSIST_CPPFLAGS"
1774 DPS_LIBS="-ldpstk -ldps ${LIBDPS_XT}"
1775 LIBS="$DPS_LIBS $LIBS"
1776 AC_DEFINE(DPS_DELEGATE,1,Define if you have Display Postscript)
1777 AC_MSG_RESULT([yes])
1782 CPPFLAGS=$PERSIST_CPPFLAGS
1785 AM_CONDITIONAL(DPS_DELEGATE, test "$have_dps" = 'yes')
1788 dnl ===========================================================================
1791 # Check for DJVU delegate library.
1794 [AC_HELP_STRING([--without-djvu],
1795 [disable DjVu support])],
1796 [with_djvu=$withval],
1799 if test "$with_djvu" != 'yes'; then
1800 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-djvu=$with_djvu "
1805 if test "$with_djvu" != 'no'; then
1806 AC_MSG_RESULT([-------------------------------------------------------------])
1807 AC_MSG_CHECKING([for DJVU])
1811 AC_CHECK_HEADER(libdjvu/ddjvuapi.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1812 AC_CHECK_LIB(djvulibre,ddjvu_context_create,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1813 AC_MSG_CHECKING([if DJVU package is complete])
1814 if test $passed -gt 0; then
1815 if test $failed -gt 0; then
1816 AC_MSG_RESULT([no -- some components failed test])
1817 have_djvu='no (failed tests)'
1819 DJVU_LIBS='-ldjvulibre'
1820 LIBS="$DJVU_LIBS $LIBS"
1821 AC_DEFINE(DJVU_DELEGATE,1,Define if you have DJVU library)
1822 AC_MSG_RESULT([yes])
1829 AM_CONDITIONAL(DJVU_DELEGATE, test "$have_djvu" = 'yes')
1832 dnl ===========================================================================
1835 # Set DejaVu font directory.
1837 AC_ARG_WITH([dejavu-font-dir],
1838 [AC_HELP_STRING([--with-dejavu-font-dir=DIR],
1839 [DejaVu font directory])],
1840 [with_dejavu_font_dir=$withval],
1841 [with_dejavu_font_dir='default'])
1843 if test "$with_dejavu_font_dir" != 'default'; then
1844 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-dejavu-font-dir=$with_dejavu_font_dir "
1847 dnl ===========================================================================
1850 # Check for FFTW delegate library.
1853 [AC_HELP_STRING([--without-fftw],
1854 [disable FFTW support])],
1855 [with_fftw=$withval],
1858 if test "$with_fftw" != 'yes'; then
1859 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fftw=$with_fftw "
1864 if test "$with_fftw" != 'no'; then
1865 AC_MSG_RESULT([-------------------------------------------------------------])
1866 AC_MSG_CHECKING([for FFTW])
1870 AC_CHECK_HEADER(fftw3.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1871 AC_CHECK_LIB(fftw3,fftw_execute,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1872 AC_MSG_CHECKING([if FFTW package is complete])
1873 if test $passed -gt 0; then
1874 if test $failed -gt 0; then
1875 AC_MSG_RESULT([no -- some components failed test])
1876 have_fftw='no (failed tests)'
1879 LIBS="$FFTW_LIBS $LIBS"
1880 AC_DEFINE(FFTW_DELEGATE,1,Define if you have FFTW library)
1881 AC_MSG_RESULT([yes])
1888 AM_CONDITIONAL(FFTW_DELEGATE, test "$have_fftw" = 'yes')
1891 dnl ===========================================================================
1894 # Check for FlashPIX delegate library.
1897 [AC_HELP_STRING([--without-fpx],
1898 [disable FlashPIX support])],
1899 [with_fpx=$withval],
1902 if test "$with_fpx" != 'yes'; then
1903 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fpx=$with_fpx "
1908 if test "$with_fpx" != 'no'; then
1909 AC_MSG_RESULT([-------------------------------------------------------------])
1910 AC_MSG_CHECKING([for FlashPIX])
1915 AC_CHECK_HEADER(fpxlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1916 AC_CHECK_LIB(fpx,FPX_OpenImageByFilename,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1918 AC_MSG_CHECKING([if FlashPIX package is complete])
1919 if test $passed -gt 0; then
1920 if test $failed -gt 0; then
1921 AC_MSG_RESULT([no -- some components failed test])
1922 have_fpx='no (failed tests)'
1925 AC_DEFINE(FPX_DELEGATE,1,Define if you have FlashPIX library)
1926 AC_MSG_RESULT([yes])
1934 AM_CONDITIONAL(FPX_DELEGATE, test "$have_fpx" = 'yes')
1937 dnl ===========================================================================
1940 # Check for fontconfig delegate library.
1942 AC_ARG_WITH([fontconfig],
1943 [AC_HELP_STRING([--without-fontconfig],
1944 [disable fontconfig support])],
1945 [with_fontconfig=$withval],
1946 [with_fontconfig='yes'])
1948 if test "$with_fontconfig" != 'yes'; then
1949 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontconfig=$with_fontconfig "
1952 have_fontconfig='no'
1953 FONTCONFIG_CFLAGS=""
1956 if test "x$with_fontconfig" = "xyes"; then
1957 AC_MSG_RESULT([-------------------------------------------------------------])
1958 PKG_CHECK_MODULES(FONTCONFIG,[fontconfig >= 2.1.0], have_fontconfig=yes, have_fontconfig=no)
1962 if test "$have_fontconfig" = 'yes'; then
1963 AC_DEFINE(FONTCONFIG_DELEGATE,1,Define if you have FONTCONFIG library)
1964 if test "$build_modules" = 'no'; then
1965 CPPFLAGS="$FONTCONFIG_CFLAGS $CPPFLAGS"
1969 AM_CONDITIONAL(FONTCONFIG_DELEGATE,test "$have_fontconfig" = 'yes')
1970 AC_SUBST(FONTCONFIG_CFLAGS)
1971 AC_SUBST(FONTCONFIG_LIBS)
1973 dnl ===========================================================================
1976 # Check for the Freetype delegate library.
1978 AC_ARG_WITH([freetype],
1979 [AC_HELP_STRING([--without-freetype],
1980 [disable Freetype support])],
1981 [with_freetype=$withval],
1982 [with_freetype='yes'])
1984 if test "$with_freetype" != 'yes'; then
1985 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-freetype=$with_freetype "
1992 if test "x$with_freetype" = "xyes"; then
1993 AC_MSG_RESULT([-------------------------------------------------------------])
1994 PKG_CHECK_MODULES(FREETYPE,[freetype2], have_freetype=yes, have_freetype=no)
1998 if test "$have_freetype" = 'yes'; then
1999 AC_DEFINE(FREETYPE_DELEGATE,1,Define if you have FREETYPE library)
2000 CFLAGS="$FREETYPE_CFLAGS $CFLAGS"
2003 AM_CONDITIONAL(FREETYPE_DELEGATE, test "$have_freetype" = 'yes')
2004 AC_SUBST(FREETYPE_CFLAGS)
2005 AC_SUBST(FREETYPE_LIBS)
2007 dnl ===========================================================================
2010 # Check for Ghostscript library or framework.
2012 # Test for iapi.h & test for gsapi_new_instance in -lgs
2013 # or -framework Ghostscript
2015 AC_ARG_WITH([gslib],
2016 [AC_HELP_STRING([--with-gslib],
2017 [enable Ghostscript library support])],
2018 [with_gslib=$withval],
2021 gslib_framework='no'
2022 if test "$with_gslib" != 'yes'; then
2023 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gslib=$with_gslib "
2028 if test "$with_gslib" != 'no'; then
2029 AC_MSG_RESULT([-------------------------------------------------------------])
2030 AC_MSG_CHECKING([for Ghostscript])
2035 AC_CHECK_HEADER(ghostscript/iapi.h,passed=`expr $passed + 1`,
2036 failed=`expr $failed + 1`,)
2037 AC_CHECK_HEADER(ghostscript/ierrors.h,passed=`expr $passed + 1`,
2038 failed=`expr $failed + 1`,)
2039 AC_CHECK_FRAMEWORK(Ghostscript,gsapi_new_instance,framework=`expr $framework + 1`,
2040 AC_CHECK_LIB(gs,gsapi_new_instance,passed=`expr $passed + 1`,failed=`expr $failed + 1`,),)
2041 AC_MSG_CHECKING([if Ghostscript package is complete])
2042 if test $passed -gt 0; then
2043 if test $failed -gt 0; then
2044 AC_MSG_RESULT([no -- some components failed test])
2045 have_gslib='no (failed tests)'
2047 if test $framework -gt 0; then
2048 GS_LIBS='-framework Ghostscript'
2049 gslib_framework='yes'
2050 AC_MSG_RESULT([yes, using framework.])
2052 AC_MSG_RESULT([yes, using library.])
2055 LIBS="$GS_LIBS $LIBS"
2056 AC_DEFINE(GS_DELEGATE,1,Define if you have Ghostscript library or framework)
2063 AM_CONDITIONAL(GS_DELEGATE, test "$have_gslib" = 'yes')
2066 # Set default font search path
2067 AC_ARG_WITH([fontpath],
2068 [AC_HELP_STRING([--with-fontpath=DIR],
2069 [prepend to default font search path])],
2070 [with_fontpath=$withval],
2073 if test "$with_fontpath" != "yes" && test -z "$with_fontpath"; then
2076 AC_DEFINE_UNQUOTED(MAGICK_FONT_PATH,"$with_fontpath",[Define to prepend to default font search path.])
2078 if test "$with_fontpath=" != ''; then
2079 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontpath=$with_fontpath "
2082 # Set Ghostscript font directory
2083 AC_ARG_WITH([gs-font-dir],
2084 [AC_HELP_STRING([--with-gs-font-dir=DIR],
2085 [Ghostscript font directory])],
2086 [with_gs_font_dir=$withval],
2087 [with_gs_font_dir='default'])
2089 if test "$with_gs_font_dir" != 'default'; then
2090 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gs-font-dir=$with_gs_font_dir "
2093 dnl ===========================================================================
2096 # Check for GVC delegate library.
2099 [AC_HELP_STRING([--with-gvc],
2100 [enable GVC support])],
2101 [with_gvc=$withval],
2104 if test "$with_gvc" != 'yes'; then
2105 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gvc=$with_gvc "
2109 if test "x$with_gvc" = "xyes"; then
2110 AC_MSG_RESULT([-------------------------------------------------------------])
2111 PKG_CHECK_MODULES(GVC,[libgvc >= 2.9.0], have_gvc=yes, have_gvc=no)
2115 if test "$have_gvc" = 'yes'; then
2116 AC_DEFINE(GVC_DELEGATE,1,Define if you have GVC library)
2117 if test "$build_modules" = 'no'; then
2118 CPPFLAGS="$GVC_CFLAGS $CPPFLAGS"
2122 AM_CONDITIONAL(GVC_DELEGATE, test "$have_gvc" = 'yes')
2123 AC_SUBST(GVC_CFLAGS)
2126 dnl ===========================================================================
2129 # Check for JBIG delegate library.
2133 [AC_HELP_STRING([--without-jbig],
2134 [disable JBIG support])],
2135 [with_jbig=$withval],
2140 if test "$with_jbig" != 'no'; then
2141 AC_MSG_RESULT([-------------------------------------------------------------])
2142 AC_MSG_CHECKING([for JBIG])
2146 AC_CHECK_HEADER(jbig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2147 AC_CHECK_LIB(jbig,jbg_dec_init,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2148 AC_MSG_CHECKING([if JBIG package is complete])
2149 if test $passed -gt 0; then
2150 if test $failed -gt 0; then
2151 AC_MSG_RESULT([no -- some components failed test])
2152 have_jbig='no (failed tests)'
2155 LIBS="$JBIG_LIBS $LIBS"
2156 AC_DEFINE(JBIG_DELEGATE,1,Define if you have JBIG library)
2157 AC_MSG_RESULT([yes])
2164 AM_CONDITIONAL(JBIG_DELEGATE, test "$have_jbig" = 'yes')
2167 dnl ===========================================================================
2170 # Check for JPEG delegate library.
2173 [AC_HELP_STRING([--without-jpeg],
2174 [disable JPEG support])],
2175 [with_jpeg=$withval],
2178 if test "$with_jpeg" != 'yes'; then
2179 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jpeg=$with_jpeg "
2184 if test "$with_jpeg" != 'no'; then
2185 AC_MSG_RESULT([-------------------------------------------------------------])
2186 AC_MSG_CHECKING([for JPEG])
2190 AC_CHECK_HEADER(jconfig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2191 AC_CHECK_HEADER(jerror.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2192 AC_CHECK_HEADER(jmorecfg.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2193 AC_CHECK_HEADER(jpeglib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2194 AC_CHECK_LIB(jpeg,jpeg_read_header,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2196 # Test for compatible JPEG library
2197 if test "$ac_cv_jpeg_version_ok" != 'yes'; then
2198 AC_CACHE_CHECK(for JPEG library is version 6b or later, ac_cv_jpeg_version_ok,
2202 #include <jpeglib.h>
2204 changequote(<<, >>)dnl
2206 #if JPEG_LIB_VERSION < 62
2207 #error IJG JPEG library must be version 6b or newer!
2211 changequote([, ])dnl
2212 ac_cv_jpeg_version_ok='yes'; passed=`expr $passed + 1`,
2213 ac_cv_jpeg_version_ok='no'; failed=`expr $failed + 1`)])
2215 AC_MSG_CHECKING([if JPEG package is complete])
2216 if test $passed -gt 0; then
2217 if test $failed -gt 0; then
2218 AC_MSG_RESULT([no -- some components failed test])
2219 have_jpeg='no (failed tests)'
2222 LIBS="$JPEG_LIBS $LIBS"
2223 AC_DEFINE(JPEG_DELEGATE,1,Define if you have JPEG library)
2224 AC_MSG_RESULT([yes])
2231 AM_CONDITIONAL(JPEG_DELEGATE, test "$have_jpeg" = 'yes')
2234 dnl ===========================================================================
2237 # Check for JPEG Version 2 delegate library.
2240 [AC_HELP_STRING([--without-jp2],
2241 [disable JPEG-2000 support])],
2242 [with_jp2=$withval],
2245 if test "$with_jp2" != 'yes'; then
2246 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jp2=$with_jp2 "
2251 if test "$with_jp2" != 'no'; then
2252 AC_MSG_RESULT([-------------------------------------------------------------])
2253 AC_MSG_CHECKING([for JPEG Version 2])
2257 AC_CHECK_HEADER(jasper/jasper.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2258 AC_CHECK_LIB(jasper,jas_stream_fopen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2259 AC_MSG_CHECKING([if JPEG version 2 support package is complete])
2260 if test $passed -gt 0; then
2261 if test $failed -gt 0; then
2262 AC_MSG_RESULT([no -- some components failed test])
2263 have_jp2='no (failed tests)'
2266 LIBS="$JP2_LIBS $LIBS"
2267 AC_DEFINE(JP2_DELEGATE,1,Define if you have JPEG version 2 "Jasper" library)
2268 AC_MSG_RESULT([yes])
2275 AM_CONDITIONAL(JP2_DELEGATE, test "$have_jp2" = 'yes')
2278 dnl ===========================================================================
2281 # Check for LCMS delegate library.
2285 [ --without-lcms disable lcms (v1.1X) support],
2286 [with_lcms=$withval],
2288 if test "$with_lcms" != 'yes' ; then
2289 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lcms=$with_lcms "
2294 [ --without-lcms2 disable lcms (v2.X) support],
2295 [with_lcms2=$withval],
2297 if test "$with_lcms2" != 'yes' ; then
2298 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lcms2=$with_lcms2 "
2303 if test "$with_lcms2" != 'no'; then
2304 AC_MSG_RESULT([-------------------------------------------------------------])
2305 AC_MSG_CHECKING([for LCMS v2])
2309 have_lcms_header='no'
2311 # Check for <lcms2.h>
2312 AC_CHECK_HEADER(lcms2.h,have_lcms_header='yes',,)
2313 if test "$have_lcms_header" = 'yes'; then
2314 AC_DEFINE(HAVE_LCMS2_H,1,Define if you have the <lcms2.h> header file.)
2315 passed=`expr $passed + 1`
2318 # Check for <lcms2/lcms2.h)
2319 if test "$have_lcms_header" != 'yes'; then
2320 AC_CHECK_HEADER(lcms2/lcms2.h,have_lcms_header='yes',,)
2321 if test "$have_lcms_header" = 'yes'; then
2322 passed=`expr $passed + 1`
2323 AC_DEFINE(HAVE_LCMS2_LCMS2_H,1,Define if you have the <lcms2/lcms2.h> header file.)
2327 # Failed to find lcms header?
2328 if test "$have_lcms_header" != 'yes'; then
2329 failed=`expr $failed + 1`
2332 AC_CHECK_LIB(lcms2,cmsSetLogErrorHandler,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2333 AC_MSG_CHECKING(if LCMS v2 package is complete)
2334 if test $passed -gt 0; then
2335 if test $failed -gt 0; then
2336 AC_MSG_RESULT(no -- some components failed test)
2337 have_lcms2='no (failed tests)'
2340 LIBS="$LCMS_LIBS $LIBS"
2350 # Check for LCMS v1 (1.11 or later)
2352 if test $have_lcms2 = 'yes'; then
2357 if test "$with_lcms" != 'no'; then
2358 AC_MSG_RESULT([-------------------------------------------------------------])
2359 AC_MSG_CHECKING([for LCMS v1.1X])
2363 have_lcms_header='no'
2365 # Check for <lcms.h>
2366 if test "$have_lcms_header" != 'yes'; then
2367 AC_CHECK_HEADER(lcms.h,have_lcms_header='yes',,)
2368 if test "$have_lcms_header" = 'yes'; then
2369 passed=`expr $passed + 1`
2370 AC_DEFINE(HAVE_LCMS_H,1,Define if you have the <lcms.h> header file.)
2374 # Check for <lcms/lcms.h>
2375 if test "$have_lcms_header" != 'yes'; then
2376 AC_CHECK_HEADER(lcms/lcms.h,have_lcms_header='yes',,)
2377 if test "$have_lcms_header" = 'yes'; then
2378 passed=`expr $passed + 1`
2379 AC_DEFINE(HAVE_LCMS_LCMS_H,1,Define if you have the <lcms/lcms.h> header file.)
2383 # Failed to find lcms header?
2384 if test "$have_lcms_header" != 'yes'; then
2385 failed=`expr $failed + 1`
2388 AC_CHECK_LIB(lcms,cmsSetErrorHandler,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2389 AC_MSG_CHECKING(if LCMS package is complete)
2390 if test $passed -gt 0; then
2391 if test $failed -gt 0; then
2392 AC_MSG_RESULT(no -- some components failed test)
2393 have_lcms='no (failed tests)'
2396 LIBS="$LCMS_LIBS $LIBS"
2405 AM_CONDITIONAL(LCMS_DELEGATE, test "$have_lcms2" = 'yes' -o "$have_lcms" = 'yes')
2406 if test "$have_lcms2" = 'yes' -o "$have_lcms" = 'yes'; then
2407 AC_DEFINE(LCMS_DELEGATE,1,[Define if you have LCMS (v1.11 or later) library])
2412 dnl ===========================================================================
2415 # Check for the LQR (Liquid Rescale) delegate library.
2418 [AC_HELP_STRING([--without-lqr],
2419 [disable Liquid Rescale support])],
2420 [with_lqr=$withval],
2423 if test "$with_lqr" != 'yes'; then
2424 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lqr=$with_lqr "
2431 if test "x$with_lqr" = "xyes"; then
2432 AC_MSG_RESULT([-------------------------------------------------------------])
2433 PKG_CHECK_MODULES(LQR,[lqr-1 >= 0.1.0], have_lqr=yes, have_lqr=no)
2437 if test "$have_lqr" = 'yes'; then
2438 AC_DEFINE(LQR_DELEGATE,1,Define if you have LQR library)
2439 CFLAGS="$LQR_CFLAGS $CFLAGS"
2442 AM_CONDITIONAL(LQR_DELEGATE, test "$have_lqr" = 'yes')
2443 AC_SUBST(LQR_CFLAGS)
2446 dnl ===========================================================================
2448 # Disable LZMA (lzma library)
2450 [ --without-lzma disable LZMA support],
2451 [with_lzma=$withval],
2453 if test "$with_lzma" != 'yes' ; then
2454 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lzma=$with_lzma "
2458 if test "x$with_lzma" = "xyes"; then
2459 AC_MSG_RESULT([-------------------------------------------------------------])
2460 PKG_CHECK_MODULES(LZMA,[liblzma >= 2.9.0], have_lzma=yes, have_lzma=no)
2464 if test "$have_lzma" = 'yes'; then
2465 AC_DEFINE(LZMA_DELEGATE,1,Define if you have LZMA library)
2466 if test "$build_modules" = 'no'; then
2467 CPPFLAGS="$LZMA_CFLAGS $CPPFLAGS"
2471 AM_CONDITIONAL(LZMA_DELEGATE, test "$have_lzma" = 'yes')
2472 AC_SUBST(LZMA_CFLAGS)
2475 dnl ===========================================================================
2478 # Check for the OpenEXR delegate library.
2480 AC_ARG_WITH([openexr],
2481 [AC_HELP_STRING([--without-openexr],
2482 [disable OpenEXR support])],
2483 [with_openexr=$withval],
2484 [with_openexr='yes'])
2486 if test "$with_openexr" != 'yes'; then
2487 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-openexr=$with_openexr "
2494 if test "x$with_openexr" = "xyes"; then
2495 AC_MSG_RESULT([-------------------------------------------------------------])
2496 PKG_CHECK_MODULES(OPENEXR,[OpenEXR >= 1.0.6], have_openexr=yes, have_openexr=no)
2500 if test "$have_openexr" = 'yes'; then
2501 AC_DEFINE(OPENEXR_DELEGATE,1,Define if you have OPENEXR library)
2502 if test "$build_modules" = 'no'; then
2503 CFLAGS="$OPENEXR_CFLAGS $CFLAGS"
2507 AM_CONDITIONAL(OPENEXR_DELEGATE, test "$have_openexr" = 'yes')
2508 AC_SUBST(OPENEXR_CFLAGS)
2509 AC_SUBST(OPENEXR_LIBS)
2511 dnl ===========================================================================
2514 # Check for PANGO delegate library.
2516 AC_ARG_WITH([pango],
2517 [AC_HELP_STRING([--without-pango],
2518 [disable PANGO support])],
2519 [with_pango=$withval],
2522 if test "$with_pango" != 'yes'; then
2523 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-pango=$with_pango "
2527 have_pangocairo='no'
2531 if test "x$with_pango" = "xyes"; then
2532 AC_MSG_RESULT([-------------------------------------------------------------])
2533 PKG_CHECK_MODULES(PANGO, [pangocairo >= 1.28.1], have_pangocairo=yes, have_pangocairo=no)
2535 PKG_CHECK_MODULES(PANGO, [pango >= 1.28.1], have_pango=yes, have_pango=no)
2539 if test "$have_pango" = 'yes'; then
2540 AC_DEFINE(PANGO_DELEGATE,1,Define if you have PANGO library)
2541 if test "$build_modules" = 'no'; then
2542 CPPFLAGS="$PANGO_CFLAGS $CPPFLAGS"
2546 if test "$have_pangocairo" = 'yes'; then
2547 AC_DEFINE(PANGOCAIRO_DELEGATE,1,Define if you have PANGOCAIRO library)
2548 if test "$build_modules" = 'no'; then
2549 CPPFLAGS="$PANGOCAIRO_CFLAGS $CPPFLAGS"
2553 AM_CONDITIONAL(PANGO_DELEGATE, test "$have_pango" = 'yes')
2554 AM_CONDITIONAL(PANGOCAIRO_DELEGATE, test "$have_pangocairo" = 'yes')
2555 AC_SUBST(PANGO_CFLAGS)
2556 AC_SUBST(PANGO_LIBS)
2558 dnl ===========================================================================
2561 # Check for PNG delegate library.
2564 [AC_HELP_STRING([--without-png],
2565 [disable PNG support])],
2566 [with_png=$withval],
2569 if test "$with_png" != 'yes'; then
2570 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-png=$with_png "
2576 if test "$with_png" != 'no' -a "$have_zlib" != 'no' ; then
2577 AC_MSG_RESULT([-------------------------------------------------------------])
2578 AC_MSG_CHECKING(for PNG support )
2582 AC_CHECK_HEADER(png.h,passed=`expr $passed + 1`,
2583 failed=`expr $failed + 1`,)
2585 if test $passed -gt 0; then
2586 for var in 7 6 5 4 2 '' ; do
2587 if test "$have_png" = 'no' ; then
2588 if test "x${var}" = 'x' ; then
2594 # Test for compatible LIBPNG library
2597 if test "$with_png" = 'yes' -o "$with_png" = "libpng1${var}" ; then
2598 if test "${pnglib}" != 'png' ; then
2599 AC_MSG_CHECKING(for LIBPNG1${var} support )
2605 changequote(<<, >>)dnl
2607 #if PNG_LIBPNG_VER_MINOR != ${var}
2608 #error LIBPNG library must be version 1${var}!
2613 changequote([, ])dnl
2614 ac_cv_libpng_ok='yes',
2615 ac_cv_libpng_ok='no')
2616 if test "$ac_cv_libpng_ok" = 'yes' ; then
2617 passed=`expr $passed + 1`
2620 failed=`expr $failed + 1`
2624 passed=`expr $passed + 1`
2629 if test $passed -gt 0 -a $failed -le 0; then
2630 if test "1${var}" = '17' ; then
2631 AC_CHECK_LIB(png17,png_get_io_ptr,passed=`expr $passed + 1`,
2632 failed=`expr $failed + 1`,)
2633 AC_CHECK_LIB(png17,png_longjmp,passed=`expr $passed + 1`,
2634 failed=`expr $failed + 1`,)
2636 if test "1${var}" = '16' ; then
2637 AC_CHECK_LIB(png16,png_get_io_ptr,passed=`expr $passed + 1`,
2638 failed=`expr $failed + 1`,)
2639 AC_CHECK_LIB(png16,png_longjmp,passed=`expr $passed + 1`,
2640 failed=`expr $failed + 1`,)
2642 if test "1${var}" = '15' ; then
2643 AC_CHECK_LIB(png15,png_get_io_ptr,passed=`expr $passed + 1`,
2644 failed=`expr $failed + 1`,)
2645 AC_CHECK_LIB(png15,png_longjmp,passed=`expr $passed + 1`,
2646 failed=`expr $failed + 1`,)
2648 if test "1${var}" = '14' ; then
2649 AC_CHECK_LIB(png14,png_get_io_ptr,passed=`expr $passed + 1`,
2650 failed=`expr $failed + 1`,)
2651 AC_CHECK_LIB(png14,png_get_io_state,passed=`expr $passed + 1`,
2652 failed=`expr $failed + 1`,)
2654 if test "1${var}" = '12' ; then
2655 AC_CHECK_LIB(png12,png_get_io_ptr,passed=`expr $passed + 1`,
2656 failed=`expr $failed + 1`,)
2658 if test "1${var}" = '1' ; then
2659 AC_CHECK_LIB(png,png_get_io_ptr,passed=`expr $passed + 1`,
2660 failed=`expr $failed + 1`,)
2662 if test $passed -gt 0 -a $failed -le 0 ; then
2663 AC_MSG_CHECKING(if ${pnglib} package is complete)
2664 if test $passed -gt 0 ; then
2665 if test $failed -gt 0 ; then
2666 AC_MSG_RESULT(no -- some components failed test)
2667 have_png='no (failed tests)'
2669 PNG_LIBS="-l${pnglib}"
2670 LIBS="$PNG_LIBS $LIBS"
2671 AC_DEFINE(PNG_DELEGATE,1,Define if you have PNG library)
2683 AM_CONDITIONAL(PNG_DELEGATE,test "$have_png" = 'yes')
2687 dnl ===========================================================================
2690 # Check for RSVG delegate library.
2693 [AC_HELP_STRING([--with-rsvg],
2694 [enable RSVG support])],
2695 [with_rsvg=$withval],
2698 if test "$with_rsvg" != 'yes'; then
2699 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-rsvg=$with_rsvg "
2707 if test "x$with_rsvg" = "xyes"; then
2708 AC_MSG_RESULT([-------------------------------------------------------------])
2709 PKG_CHECK_MODULES(RSVG,[librsvg-2.0 >= 2.9.0], have_rsvg=yes, have_rsvg=no)
2711 PKG_CHECK_MODULES(CAIRO_SVG, cairo-svg, have_cairo=yes, have_cairo=no)
2715 if test "$have_rsvg" = 'yes'; then
2716 AC_DEFINE(RSVG_DELEGATE,1,Define if you have RSVG library)
2717 if test "$build_modules" = 'no'; then
2718 CPPFLAGS="$RSVG_CFLAGS $CPPFLAGS"
2722 if test "$have_cairo" = 'yes'; then
2723 AC_DEFINE(CAIRO_DELEGATE,1,Define if you have CAIRO library)
2724 if test "$build_modules" = 'no'; then
2725 CPPFLAGS="$CAIRO_SVG_CFLAGS $CPPFLAGS"
2729 AM_CONDITIONAL(RSVG_DELEGATE, test "$have_rsvg" = 'yes')
2730 AM_CONDITIONAL(CAIRO_DELEGATE, test "$have_cairo" = 'yes')
2731 AC_SUBST(RSVG_CFLAGS)
2734 dnl ===========================================================================
2737 # Check for TIFF delegate library.
2740 [AC_HELP_STRING([--without-tiff],
2741 [disable TIFF support])],
2742 [with_tiff=$withval],
2745 if test "$with_tiff" != 'yes'; then
2746 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-tiff=$with_tiff "
2751 if test "$with_tiff" != 'no'; then
2752 AC_MSG_RESULT([-------------------------------------------------------------])
2753 AC_MSG_CHECKING([for TIFF])
2757 AC_CHECK_HEADER(tiff.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2758 AC_CHECK_HEADER(tiffio.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2759 AC_CHECK_LIB(tiff,TIFFOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2760 AC_CHECK_LIB(tiff,TIFFClientOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2761 AC_CHECK_LIB(tiff,TIFFIsByteSwapped,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2762 AC_CHECK_LIB(tiff,TIFFReadRGBATile,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2763 AC_CHECK_LIB(tiff,TIFFReadRGBAStrip,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2764 AC_MSG_CHECKING([if TIFF package is complete])
2765 if test $passed -gt 0; then
2766 if test $failed -gt 0; then
2767 AC_MSG_RESULT([no -- some components failed test])
2768 have_tiff='no (failed tests)'
2771 LIBS="$TIFF_LIBS $LIBS"
2772 AC_DEFINE(TIFF_DELEGATE,1,Define if you have TIFF library)
2773 AC_MSG_RESULT([yes])
2775 AC_CHECK_HEADERS(tiffconf.h)
2776 AC_CHECK_FUNCS([TIFFIsCODECConfigured TIFFMergeFieldInfo \
2777 TIFFIsBigEndian TIFFReadEXIFDirectory TIFFSetErrorHandlerExt \
2778 TIFFSetTagExtender TIFFSetWarningHandlerExt \
2779 TIFFSwabArrayOfTriples])
2785 AM_CONDITIONAL(TIFF_DELEGATE, test "$have_tiff" = 'yes')
2788 dnl ===========================================================================
2791 # Check for WEBP delegate library.
2794 [AC_HELP_STRING([--without-webp],
2795 [disable WEBP support])],
2796 [with_webp=$withval],
2799 if test "$with_webp" != 'yes'; then
2800 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-webp=$with_webp "
2805 if test "$with_webp" != 'no'; then
2806 AC_MSG_RESULT([-------------------------------------------------------------])
2807 AC_MSG_CHECKING([for WEBP])
2811 AC_CHECK_HEADER(webp/decode.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2812 AC_CHECK_LIB(webp,WebPPictureInitInternal,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2813 AC_MSG_CHECKING([if WEBP package is complete])
2814 if test $passed -gt 0; then
2815 if test $failed -gt 0; then
2816 AC_MSG_RESULT([no -- some components failed test])
2817 have_webp='no (failed tests)'
2820 LIBS="$WEBP_LIBS $LIBS"
2821 AC_DEFINE(WEBP_DELEGATE,1,Define if you have WEBP library)
2822 AC_MSG_RESULT([yes])
2829 AM_CONDITIONAL(WEBP_DELEGATE,test "$have_webp" = 'yes')
2832 dnl ===========================================================================
2835 # Set Windows font directory.
2837 AC_ARG_WITH([windows-font-dir],
2838 [AC_HELP_STRING([--with-windows-font-dir=DIR],
2839 [directory containing MS-Windows fonts])],
2840 [with_windows_font_dir=$withval],
2841 [with_windows_font_dir=''])
2842 if test "$with_windows_font_dir" != '' ; then
2843 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-windows-font-dir=$with_windows_font_dir "
2846 dnl ===========================================================================
2849 # Check for WMF delegate library.
2852 [AC_HELP_STRING([--with-wmf],
2853 [enable WMF support])],
2854 [with_wmf=$withval],
2857 if test "$with_wmf" != 'yes'; then
2858 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-wmf=$with_wmf "
2865 if test "$with_wmf" != 'no'; then
2866 AC_MSG_RESULT([-------------------------------------------------------------])
2867 AC_MSG_CHECKING([for WMF])
2870 have_libwmflite='no'
2871 have_libwmf_ipa_h='no'
2873 AC_CHECK_HEADER([libwmf/ipa.h],[have_libwmf_ipa_h='yes'],,[$FT2BUILD_H])
2874 if test "$have_libwmf_ipa_h" = 'yes'; then
2875 AC_CHECK_LIB(wmflite,wmf_lite_create,have_libwmflite='yes',,)
2876 if test "$have_libwmflite" = 'yes'; then
2877 AC_DEFINE(WMFLITE_DELEGATE,1,Define if you have wmflite library)
2878 WMF_LIBS='-lwmflite'
2879 LIBS="$WMF_LIBS $LIBS"
2883 WMF_CONFIG_LIBS=`libwmf-config --libs`
2884 for lib in xml2 expat freetype jpeg png z; do
2886 echo "$WMF_CONFIG_LIBS" | grep -- "$testlib" > /dev/null && WMF_LIBS_DEPS="$WMF_LIBS_DEPS $testlib"
2888 AC_CHECK_LIB(wmf,wmf_api_create,have_libwmf='yes',,$WMF_LIBS_DEPS)
2889 if test "$have_libwmf" = 'yes'; then
2890 AC_DEFINE(WMF_DELEGATE,1,Define if you have wmf library)
2892 LIBS="$WMF_LIBS $LIBS"
2895 AC_MSG_RESULT([no -- some components failed test])
2896 have_wmf='no (failed tests)'
2897 have_wmflite='no (failed tests)'
2903 AC_MSG_CHECKING([if WMF package is complete])
2904 if test "$have_wmf" = 'yes'; then
2905 AC_MSG_RESULT([yes])
2910 AM_CONDITIONAL(WMF_DELEGATE, test "$have_wmf" = 'yes')
2912 AC_SUBST(WMF_LIBS_DEPS)
2915 dnl ===========================================================================
2918 # Check for XML delegate library.
2921 [AC_HELP_STRING([--without-xml],
2922 [disable XML support])],
2923 [with_xml=$withval],
2926 if test "$with_xml" != 'yes' ; then
2927 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-xml=$with_xml "
2932 if test "$with_xml" != 'no'; then
2933 AC_MSG_RESULT([-------------------------------------------------------------])
2934 AC_MSG_CHECKING([for XML])
2936 PERSIST_LDFLAGS=$LDFLAGS
2937 PERSIST_CPPFLAGS=$CPPFLAGS
2939 AC_PATH_PROG(xml2_config,xml2-config,)dnl
2940 if test -n "$xml2_config"; then
2941 # Debian installs libxml headers under /usr/include/libxml2/libxml with
2942 # the shared library installed under /usr/lib, whereas the package
2943 # installs itself under $prefix/libxml and $prefix/lib.
2944 xml2_prefix=`xml2-config --prefix`
2945 if test -d "${xml2_prefix}/include/libxml2"; then
2946 CPPFLAGS="$CPPFLAGS -I${xml2_prefix}/include/libxml2"
2948 if test "${xml2_prefix}" != '/usr'; then
2949 LDFLAGS="$LDFLAGS -L${xml2_prefix}/lib"
2954 AC_CHECK_HEADER(libxml/parser.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2955 AC_CHECK_LIB(xml2,xmlSAXVersion,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2956 AC_CHECK_LIB(xml2,xmlParseChunk,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2957 AC_CHECK_LIB(xml2,xmlCreatePushParserCtxt,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2958 AC_MSG_CHECKING([if XML package is complete])
2959 if test $passed -gt 0; then
2960 if test $failed -gt 0; then
2961 AC_MSG_RESULT([no -- some components failed test])
2962 have_xml='no (failed tests)'
2963 LDFLAGS="$PERSIST_LDFLAGS"
2964 CPPFLAGS="$PERSIST_CPPFLAGS"
2967 LIBS="$XML_LIBS $LIBS"
2968 AC_DEFINE(XML_DELEGATE,1,Define if you have XML library)
2969 AC_MSG_RESULT([yes])
2976 AM_CONDITIONAL(XML_DELEGATE,test "$have_xml" = 'yes')
2979 dnl ===========================================================================
2981 # Substitute compiler name to build/link PerlMagick
2983 AC_SUBST(PERLMAINCC)
2986 # Configure install Paths
2989 # Path to ImageMagick header files
2990 INCLUDE_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
2991 INCLUDE_PATH="${INCLUDE_DIR}/${INCLUDE_RELATIVE_PATH}"
2992 DEFINE_INCLUDE_PATH="${INCLUDE_DIR}/${INCLUDE_RELATIVE_PATH}/"
2993 case "${build_os}" in
2995 DEFINE_INCLUDE_PATH=`$WinPathScript "$DEFINE_INCLUDE_PATH" 1`
2998 AC_DEFINE_UNQUOTED(INCLUDE_PATH,"$DEFINE_INCLUDE_PATH",[Directory where ImageMagick headers live.])
2999 AC_SUBST(INCLUDE_PATH)
3001 # Path to ImageMagick header files (arch part)
3002 INCLUDEARCH_PATH="${INCLUDEARCH_DIR}/${INCLUDE_RELATIVE_PATH}"
3003 DEFINE_INCLUDEARCH_PATH="${INCLUDEARCH_DIR}/${INCLUDE_RELATIVE_PATH}/"
3004 case "${build_os}" in
3006 DEFINE_INCLUDEARCH_PATH=`$WinPathScript "$DEFINE_INCLUDEARCH_PATH" 1`
3009 AC_DEFINE_UNQUOTED(INCLUDEARCH_PATH,"$DEFINE_INCLUDE_PATH",[Directory where ImageMagick architecture headers live.])
3010 AC_SUBST(INCLUDEARCH_PATH)
3012 # Subdirectory under lib to place ImageMagick lib files
3013 LIBRARY_RELATIVE_PATH="${PACKAGE_NAME}-${PACKAGE_VERSION}"
3014 AC_DEFINE_UNQUOTED(LIBRARY_RELATIVE_PATH,"$LIBRARY_RELATIVE_PATH",[Subdirectory of lib where ImageMagick architecture dependent files are installed.])
3016 # Path to ImageMagick bin directory
3017 EXECUTABLE_PATH="${BIN_DIR}"
3018 DEFINE_EXECUTABLE_PATH="${BIN_DIR}/"
3019 case "${build_os}" in
3021 DEFINE_EXECUTABLE_PATH=`$WinPathScript "$DEFINE_EXECUTABLE_PATH" 1`
3024 AC_DEFINE_UNQUOTED(EXECUTABLE_PATH,"$DEFINE_EXECUTABLE_PATH",[Directory where executables are installed.])
3025 AC_SUBST(EXECUTABLE_PATH)
3027 # Path to ImageMagick lib
3028 LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}"
3029 DEFINE_LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}/"
3030 case "${build_os}" in
3032 DEFINE_LIBRARY_PATH=`$WinPathScript "$DEFINE_LIBRARY_PATH" 1`
3035 AC_DEFINE_UNQUOTED(LIBRARY_PATH,"$DEFINE_LIBRARY_PATH",[Directory where architecture-dependent files live.])
3036 AC_SUBST(LIBRARY_PATH)
3039 # path to local binaries
3040 if test "x$LIB_BIN_BASEDIRNAME" = "x"; then
3041 LIB_BIN_BASEDIRNAME="bin"
3043 AC_DEFINE_UNQUOTED(LIB_BIN_BASEDIRNAME,"$LIB_BIN_BASEDIRNAME",[Binaries in libraries path base name (will be during install linked to bin)])
3044 AC_SUBST(LIB_BIN_BASEDIRNAME)
3046 if test "x$LIB_BIN_DIR" = "x"; then
3047 LIB_BIN_DIR=${LIB_BIN_BASEDIRNAME}-${MAGICK_ABI_SUFFIX}
3049 AC_SUBST(LIB_BIN_DIR)
3051 LIB_BIN_DIR_RELATIVE_PATH=$LIB_BIN_DIR
3052 AC_SUBST(LIB_BIN_DIR_RELATIVE_PATH)
3053 LIB_BIN_DIR_PATH="${LIBRARY_PATH}/${LIB_BIN_DIR_RELATIVE_PATH}"
3054 AC_SUBST(LIB_BIN_DIR_PATH)
3057 # path to modules lib
3058 if test "x$MODULES_BASEDIRNAME" = "x"; then
3059 MODULES_BASEDIRNAME="modules"
3061 AC_DEFINE_UNQUOTED(MODULES_BASEDIRNAME,"$MODULES_BASEDIRNAME",[Module directory name without ABI part.])
3062 AC_SUBST(MODULES_BASEDIRNAME)
3064 if test "x$MODULES_DIRNAME" = "x"; then
3065 MODULES_DIRNAME=${MODULES_BASEDIRNAME}-${MAGICK_ABI_SUFFIX}
3067 AC_DEFINE_UNQUOTED(MODULES_DIRNAME,"$MODULES_DIRNAME",[Module directory dirname])
3069 AC_SUBST(MODULES_DIRNAME)
3071 MODULES_RELATIVE_PATH="${MODULES_DIRNAME}"
3072 AC_SUBST(MODULES_RELATIVE_PATH)
3073 MODULES_PATH="${LIBRARY_PATH}/${MODULES_RELATIVE_PATH}"
3074 AC_SUBST(MODULES_PATH)
3077 # path to coders lib
3078 if test "x$CODER_DIRNAME" = "x"; then
3079 CODER_DIRNAME="coders"
3081 AC_DEFINE_UNQUOTED(CODER_DIRNAME,"$CODER_DIRNAME",[coders subdirectory.])
3082 AC_SUBST(CODER_DIRNAME)
3084 CODER_RELATIVE_PATH="${CODER_DIRNAME}"
3085 CODER_PATH="${MODULES_PATH}/${CODER_DIRNAME}"
3086 AC_SUBST(CODER_PATH)
3089 # Subdirectory under lib to place ImageMagick filter module files
3091 # path to coders lib
3092 if test "x$FILTER_DIRNAME" = "x"; then
3093 FILTER_DIRNAME="filters"
3095 AC_DEFINE_UNQUOTED(FILTER_DIRNAME,"$FILTER_DIRNAME",[filter subdirectory.])
3096 AC_SUBST(FILTER_DIRNAME)
3098 FILTER_RELATIVE_PATH="${FILTER_DIRNAME}"
3099 FILTER_PATH="${MODULES_PATH}/${FILTER_DIRNAME}"
3100 AC_SUBST(FILTER_PATH)
3103 # Path to ImageMagick documentation files
3104 DOCUMENTATION_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
3105 DOCUMENTATION_PATH="${DOC_DIR}/${DOCUMENTATION_RELATIVE_PATH}"
3106 DEFINE_DOCUMENTATION_PATH="${DOC_DIR}/${DOCUMENTATION_RELATIVE_PATH}/"
3107 case "${build_os}" in
3109 DEFINE_DOCUMENTATION_PATH=`$WinPathScript "$DEFINE_DOCUMENTATION_PATH" 1`
3112 AC_DEFINE_UNQUOTED(DOCUMENTATION_PATH,"$DEFINE_DOCUMENTATION_PATH",[Directory where ImageMagick documents live.])
3113 AC_SUBST(DOCUMENTATION_PATH)
3115 # Subdirectory to place architecture-dependent configuration files
3116 CONFIGURE_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
3117 AC_DEFINE_UNQUOTED(CONFIGURE_RELATIVE_PATH,"$CONFIGURE_RELATIVE_PATH",[Subdirectory of lib where architecture-dependent configuration files live.])
3118 CONFIGURE_PATH="${SYSCONF_DIR}/${CONFIGURE_RELATIVE_PATH}/"
3119 DEFINE_CONFIGURE_PATH="${SYSCONF_DIR}/${CONFIGURE_RELATIVE_PATH}/"
3120 case "${build_os}" in
3122 DEFINE_CONFIGURE_PATH=`$WinPathScript "$DEFINE_CONFIGURE_PATH" 1`
3125 AC_DEFINE_UNQUOTED(CONFIGURE_PATH,"$DEFINE_CONFIGURE_PATH",[Directory where architecture-dependent configuration files live.])
3126 AC_SUBST(CONFIGURE_PATH)
3128 # Subdirectory to place architecture-independent configuration files
3129 SHARE_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
3130 AC_DEFINE_UNQUOTED(SHARE_RELATIVE_PATH,"$SHARE_RELATIVE_PATH",[Subdirectory of lib where architecture-independent configuration files live.])
3131 SHARE_PATH="${DATA_DIR}/${SHARE_RELATIVE_PATH}"
3132 DEFINE_SHARE_PATH="${DATA_DIR}/${SHARE_RELATIVE_PATH}/"
3133 case "${build_os}" in
3135 DEFINE_SHARE_PATH=`$WinPathScript "$DEFINE_SHARE_PATH" 1`
3138 AC_DEFINE_UNQUOTED(SHARE_PATH,"$DEFINE_SHARE_PATH",[Directory where architecture-independent configuration files live.])
3139 AC_SUBST(SHARE_PATH)
3142 # Subdirectory to place architecture-dependent configuration files.
3143 if test "x$SHAREARCH_BASEDIRNAME" = "x"; then
3144 SHAREARCH_BASEDIRNAME="config"
3146 AC_DEFINE_UNQUOTED(SHAREARCH_BASEDIRNAME,"$SHAREARCH_BASEDIRNAME",[Sharearch directory name without ABI part.])
3147 AC_SUBST(SHAREARCH_BASEDIRNAME)
3149 if test "x$SHAREARCH_DIRNAME" = "x"; then
3150 SHAREARCH_DIRNAME=${SHAREARCH_BASEDIRNAME}-${MAGICK_ABI_SUFFIX}
3152 AC_DEFINE_UNQUOTED(SHAREARCH_DIRNAME,"$SHAREARCH_DIRNAME",[Sharearch directory dirname])
3154 AC_SUBST(SHAREARCH_DIRNAME)
3156 SHAREARCH_RELATIVE_PATH="${SHAREARCH_DIRNAME}"
3157 AC_SUBST(SHAREARCH_RELATIVE_PATH)
3158 SHAREARCH_PATH="${LIBRARY_PATH}/${SHAREARCH_RELATIVE_PATH}"
3159 AC_SUBST(SHAREARCH_PATH)
3162 # program_transform_name is formed for use in a Makefile, so create a
3163 # modified version for use in a shell script.
3164 configure_transform_name=`echo ${program_transform_name} | sed 's,\\$\\$,$,'`
3166 # Default delegate definitions
3167 AC_MSG_RESULT([-------------------------------------------------------------])
3168 AC_MSG_CHECKING([for ImageMagick delegate programs])
3170 AutotraceDecodeDelegateDefault='autotrace'
3171 BlenderDecodeDelegateDefault='blender'
3172 BZIPDelegateDefault='bzip2'
3173 BrowseDelegateDefault='xdg-open'
3174 CGMDecodeDelegateDefault='ralcgm'
3175 CatDelegateDefault='cat'
3176 DNGDecodeDelegateDefault='ufraw-batch'
3177 GVCDecodeDelegateDefault='dot'
3178 DVIDecodeDelegateDefault='dvips'
3179 EchoDelegateDefault='echo'
3180 EditorDelegateDefault='xterm'
3181 FIGDecodeDelegateDefault='fig2dev'
3182 ConvertDelegateDefault=`echo convert | sed ${configure_transform_name}`
3183 DisplayDelegateDefault=`echo display | sed ${configure_transform_name}`
3184 MogrifyDelegateDefault=`echo mogrify | sed ${configure_transform_name}`
3185 GnuplotDecodeDelegateDefault='gnuplot'
3186 HPGLDecodeDelegateDefault='hp2xx'
3187 HTMLDecodeDelegateDefault='html2ps'
3188 ILBMDecodeDelegateDefault='ilbmtoppm'
3189 ILBMEncodeDelegateDefault='ppmtoilbm'
3190 JXRDecodeDelegateDefault='JxrDecApp'
3191 JXREncodeDelegateDefault='JxrEncApp'
3192 LPDelegateDefault='lp'
3193 LPRDelegateDefault='lpr'
3194 LaunchDelegateDefault='gimp'
3195 MANDelegateDefault='groff'
3196 MPEGDecodeDelegateDefault='ffmpeg'
3197 MPEGEncodeDelegateDefault='ffmpeg'
3198 MrSIDDecodeDelegateDefault='mrsidgeodecode'
3199 MVDelegateDefault='mv'
3200 PCLDelegateDefault='pcl6'
3201 PGPDecodeDelegateDefault='pgpv'
3202 POVDelegateDefault='povray'
3203 if test "$native_win32_build" = 'yes'; then
3204 PSDelegateDefault='gswin32c'
3205 elif test "$gslib_framework" = 'yes'; then
3206 PSDelegateDefault='gsc'
3208 PSDelegateDefault='gs'
3210 RLEEncodeDelegateDefault='rawtorle'
3211 RMDelegateDefault='rm'
3212 RSVGDecodeDelegateDefault='rsvg-convert'
3213 SCANDecodeDelegateDefault='scanimage'
3214 SVGDecodeDelegateDefault='inkscape'
3215 TXTDelegateDefault='enscript'
3216 UniconvertorDelegateDefault='uniconvertor'
3217 WMFDecodeDelegateDefault='wmf2eps'
3218 WWWDecodeDelegateDefault='curl'
3219 XPSDelegateDefault='gxps'
3220 ZipDelegateDefault='gzip'
3222 # Search for delegates
3223 AC_PATH_PROG(AutotraceDecodeDelegate, "$AutotraceDecodeDelegateDefault", "$AutotraceDecodeDelegateDefault")
3224 AC_PATH_PROG(BlenderDecodeDelegate, "$BlenderDecodeDelegateDefault", "$BlenderDecodeDelegateDefault")
3225 AC_PATH_PROG(BZIPDelegate, "$BZIPDelegateDefault", "$BZIPDelegateDefault")
3226 AC_PATH_PROGS(BrowseDelegate, "$BrowseDelegateDefault" google-chrome firefox konqueror mozilla lynx, "$BrowseDelegateDefault")
3227 AC_PATH_PROG(CGMDecodeDelegate, "$CGMDecodeDelegateDefault", "$CGMDecodeDelegateDefault")
3228 AC_PATH_PROG(CatDelegate, "$CatDelegateDefault", "$CatDelegateDefault")
3229 AC_PATH_PROG(DNGDecodeDelegate, "$DNGDecodeDelegateDefault", "$DNGDecodeDelegateDefault")
3230 AC_PATH_PROG(GVCDecodeDelegate, "$GVCDecodeDelegateDefault", "$GVCDecodeDelegateDefault")
3231 AC_PATH_PROG(DVIDecodeDelegate, "$DVIDecodeDelegateDefault", "$DVIDecodeDelegateDefault")
3232 AC_PATH_PROG(EchoDelegate, "$EchoDelegateDefault", "$EchoDelegateDefault")
3233 AC_PATH_PROG(EditorDelegate, "$EditorDelegateDefault", "$EditorDelegateDefault")
3234 AC_PATH_PROG(FIGDecodeDelegate, "$FIGDecodeDelegateDefault", "$FIGDecodeDelegateDefault")
3235 AC_PATH_PROG(ConvertDelegate, "$ConvertDelegateDefault", "$ConvertDelegateDefault")
3236 AC_PATH_PROG(DisplayDelegate, "$DisplayDelegateDefault", "$DisplayDelegateDefault")
3237 AC_PATH_PROG(MogrifyDelegate, "$MogrifyDelegateDefault", "$MogrifyDelegateDefault")
3238 AC_PATH_PROG(GnuplotDecodeDelegate, "$GnuplotDecodeDelegateDefault", "$GnuplotDecodeDelegateDefault")
3239 AC_PATH_PROG(HPGLDecodeDelegate, "$HPGLDecodeDelegateDefault", "$HPGLDecodeDelegateDefault")
3240 AC_PATH_PROG(HTMLDecodeDelegate, "$HTMLDecodeDelegateDefault", "$HTMLDecodeDelegateDefault")
3241 AC_PATH_PROG(ILBMDecodeDelegate, "$ILBMDecodeDelegateDefault", "$ILBMDecodeDelegateDefault")
3242 AC_PATH_PROG(ILBMEncodeDelegate, "$ILBMEncodeDelegateDefault", "$ILBMEncodeDelegateDefault")
3243 AC_PATH_PROG(JXRDecodeDelegate, "$JXRDecodeDelegateDefault", "$JXRDecodeDelegateDefault")
3244 AC_PATH_PROG(JXREncodeDelegate, "$JXREncodeDelegateDefault", "$JXREncodeDelegateDefault")
3245 AC_PATH_PROG(LPDelegate, "$LPDelegateDefault", no)
3246 AC_PATH_PROG(LPRDelegate, "$LPRDelegateDefault", "$LPRDelegateDefault")
3247 AC_PATH_PROG(LaunchDelegate, "$LaunchDelegateDefault", "$LaunchDelegateDefault")
3248 AC_PATH_PROG(MANDelegate, "$MANDelegateDefault", "$MANDelegateDefault")
3249 AC_PATH_PROG(MPEGDecodeDelegate, "$MPEGDecodeDelegateDefault", "$MPEGDecodeDelegateDefault")
3250 AC_PATH_PROG(MPEGEncodeDelegate, "$MPEGEncodeDelegateDefault", "$MPEGEncodeDelegateDefault")
3251 AC_PATH_PROG(MrSIDDecodeDelegate, "$MrSIDDecodeDelegateDefault", "$MrSIDDecodeDelegateDefault")
3252 AC_PATH_PROG(MVDelegate, "$MVDelegateDefault", "$MVDelegateDefault")
3253 AC_PATH_PROG(PCLDelegate, "$PCLDelegateDefault", "$PCLDelegateDefault")
3254 AC_PATH_PROG(PGPDecodeDelegate, "$PGPDecodeDelegateDefault", "$PGPDecodeDelegateDefault")
3255 AC_PATH_PROG(POVDelegate, "$POVDelegateDefault", "$POVDelegateDefault")
3256 AC_PATH_PROGS(PSDelegate, gsx gsc "$PSDelegateDefault", "$PSDelegateDefault")
3257 AC_PATH_PROG(RLEEncodeDelegate, "$RLEEncodeDelegateDefault", "$RLEEncodeDelegateDefault")
3258 AC_PATH_PROG(RMDelegate, "$RMDelegateDefault", "$RMDelegateDefault")
3259 AC_PATH_PROG(RSVGDecodeDelegate, "$RSVGDecodeDelegateDefault", "$RSVGDecodeDelegateDefault")
3260 AC_PATH_PROG(SCANDecodeDelegate, "$SCANDecodeDelegateDefault", "$SCANDecodeDelegateDefault")
3261 AC_PATH_PROG(SVGDecodeDelegate, "$SVGDecodeDelegateDefault", "$SVGDecodeDelegateDefault")
3262 AC_PATH_PROG(TXTDelegate, "$TXTDelegateDefault", "$TXTDelegateDefault")
3263 AC_PATH_PROG(UniconvertorDelegate, "$UniconvertorDelegateDefault", "$UniconvertorDelegateDefault")
3264 AC_PATH_PROG(WMFDecodeDelegate, "$WMFDecodeDelegateDefault", "$WMFDecodeDelegateDefault")
3265 AC_PATH_PROG(WWWDecodeDelegate, "$WWWDecodeDelegateDefault", "$WWWDecodeDelegateDefault")
3266 AC_PATH_PROG(XPSDelegate, "$XPSDelegateDefault", "$XPSDelegateDefault")
3267 AC_PATH_PROG(ZipDelegate, "$ZipDelegateDefault", "$ZipDelegateDefault")
3269 # Prefer lpr to lp; lp needs options tacked on.
3270 if test "$LPRDelegate" != no; then
3271 PrintDelegate="$LPRDelegate"
3273 PrintDelegate="$LPDelegate -c -s"
3275 AC_SUBST(PrintDelegate)
3277 # Installed ImageMagick utiltity paths
3278 ConvertDelegate="${BIN_DIR}/${ConvertDelegateDefault}"
3279 DisplayDelegate="${BIN_DIR}/${DisplayDelegateDefault}"
3280 MogrifyDelegate="${BIN_DIR}/${MogrifyDelegateDefault}"
3282 # Set delegate booleans
3283 have_ffmpeg='no'; if test "$MPEGDecodeDelegate" != "$MPEGDecodeDelegateDefault" ; then have_ffmpeg='yes'; fi
3284 have_fig2dev='no' ; if test "$FIGDecodeDelegate" != "$FIGDecodeDelegateDefault" ; then have_fig2dev='yes'; fi
3285 have_gs='no' ; if test "$PSDelegate" != "$PSDelegateDefault"; then have_gs='yes'; fi
3286 have_hp2xx='no' ; if test "$HPGLDecodeDelegate" != "$HPGLDecodeDelegateDefault" ; then have_hp2xx='yes'; fi
3287 have_ilbmtoppm='no' ; if test "$ILBMDecodeDelegate" != "$ILBMDecodeDelegateDefault" ; then have_ilbmtoppm='yes'; fi
3288 have_mrsid='no'; if test "$MrSIDDecodeDelegate" != "$MrSIDDecodeDelegateDefault" ; then have_mrsid='yes'; fi
3289 have_pcl='no' ; if test "$PCLDelegate" != "$PCLDelegateDefault"; then have_pcl='yes'; fi
3290 have_ppmtoilbm='no' ; if test "$ILBMEncodeDelegate" != "$ILBMEncodeDelegateDefault" ; then have_ppmtoilbm='yes'; fi
3291 have_ralcgm='no' ; if test "$CGMDecodeDelegate" != "$CGMDecodeDelegateDefault" ; then have_ralcgm='yes'; fi
3292 have_xps='no' ; if test "$XPSDelegate" != "$XPSDelegateDefault"; then have_xps='yes'; fi
3295 # Test for font directories
3297 type_include_files=''
3300 AC_MSG_CHECKING(for Dejavu fonts directory)
3302 if test "${with_dejavu_font_dir}" != 'default'; then
3303 dejavu_font_dir="${with_dejavu_font_dir}/"
3305 for font_dir in "${prefix}/share/dejavu/fonts/" '/usr/share/fonts/dejavu/'; do
3306 if test -f "${font_dir}DejaVuSerif.ttf"; then
3307 dejavu_font_dir="${font_dir}"
3312 if test "${dejavu_font_dir}x" != 'x'; then
3313 type_include_files="${type_include_files} "'<include file="type-dejavu.xml" />'
3314 AC_MSG_RESULT([$dejavu_font_dir])
3316 AC_MSG_RESULT([not found!]);
3318 AC_SUBST(dejavu_font_dir)
3322 if test "$with_windows_font_dir" != "no" && test -n "$with_windows_font_dir"; then
3323 windows_font_dir="${with_windows_font_dir}/"
3325 if test "${windows_font_dir}x" != 'x'; then
3326 if test -f '/usr/X11R6/lib/X11/fonts/truetype/arial.ttf'; then
3327 windows_font_dir='/usr/X11R6/lib/X11/fonts/truetype/'
3329 if test -f '/usr/X11R7/lib/X11/fonts/truetype/arial.ttf'; then
3330 windows_font_dir='/usr/X11R7/lib/X11/fonts/truetype/'
3332 if test -f '/usr/share/fonts/msttcore/arial.ttf'; then
3333 windows_font_dir='/usr/share/fonts/msttcore/truetype/'
3336 if test "${windows_font_dir}x" != 'x'; then
3337 type_include_files="$type_include_files "'<include file="type-windows.xml" />'
3339 AC_SUBST(windows_font_dir)
3342 AC_MSG_CHECKING(for Ghostscript fonts directory)
3343 ghostscript_font_dir=''
3344 if test "${with_gs_font_dir}" != 'default'; then
3345 ghostscript_font_dir="${with_gs_font_dir}/"
3347 if test "${native_win32_build}" = 'yes'; then
3348 # Native Windows Build
3349 for font_dir in "c:\\Program Files\\gs\\fonts\\" "c:\\Program Files \(x86\)\\gs\\fonts\\" "c:\\gs\\fonts\\"; do
3350 if test -f "${font_dir}a010013l.pfb"; then
3351 ghostscript_font_dir="$font_dir"
3355 if test "${PSDelegate}" != 'gswin32c'; then
3356 ghostscript_font_dir=`echo "${PSDelegate}" | sed -e 's:/gs/.*:/gs:;s:^/::;s/./&:/;s:/:\\\\:g'`"\\fonts\\"
3359 # Linux / Mac OS X / Unix Build
3360 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
3361 if test -f "${font_dir}a010013l.pfb"; then
3362 ghostscript_font_dir="${font_dir}"
3366 if test "${ghostscript_font_dir}x" = 'x'; then
3367 if test "$PSDelegate" != 'gs'; then
3368 ghostscript_font_dir=`echo "$PSDelegate" | sed -e 's:/bin/gs:/share/ghostscript/fonts:'`"/"
3373 if test "${ghostscript_font_dir}x" != 'x'; then
3374 type_include_files="${type_include_files} "'<include file="type-ghostscript.xml" />'
3375 AC_MSG_RESULT([$ghostscript_font_dir])
3377 AC_MSG_RESULT([not found!]);
3379 AC_SUBST(ghostscript_font_dir)
3380 case "${build_os}" in
3382 PSDelegate=`$WinPathScript "$PSDelegate" 1`
3386 AC_SUBST(type_include_files)
3389 # Handle case where user doesn't want frozen paths
3391 if test "$with_frozenpaths" != 'yes'; then
3392 # Re-set delegate definitions to default (no paths)
3393 AutotraceDecodeDelegate="$AutotraceDecodeDelegateDefault"
3394 BlenderDecodeDelegate="$BlenderDecodeDelegateDefault"
3395 BZIPDelegate="$BZIPDelegateDefault"
3396 BrowseDelegate="$BrowseDelegateDefault"
3397 CGMDecodeDelegate="$CGMDecodeDelegateDefault"
3398 CatDelegate="$CatDelegateDefault"
3399 ConvertDelegate="$ConvertDelegateDefault"
3400 DisplayDelegate="$DisplayDelegateDefault"
3401 DNGDecodeDelegate="$DNGDecodeDelegateDefault"
3402 DVIDecodeDelegate="$DVIDecodeDelegateDefault"
3403 EchoDelegate="$EchoDelegateDefault"
3404 EditorDelegate="$EditorDelegateDefault"
3405 FIGDecodeDelegate="$FIGDecodeDelegateDefault"
3406 GnuplotDecodeDelegate="$GnuplotDecodeDelegateDefault"
3407 GVCDecodeDelegate="$GVCDecodeDelegateDefault"
3408 HPGLDecodeDelegate="$HPGLDecodeDelegateDefault"
3409 HTMLDecodeDelegate="$HTMLDecodeDelegateDefault"
3410 ILBMDecodeDelegate="$ILBMDecodeDelegateDefault"
3411 ILBMEncodeDelegate="$ILBMEncodeDelegateDefault"
3412 JXRDecodeDelegate="$JXRDecodeDelegateDefault"
3413 JXREncodeDelegate="$JXREncodeDelegateDefault"
3414 LPDelegate="$LPDelegateDefault"
3415 LaunchDelegate="$LaunchDelegateDefault"
3416 MANDelegate="$MANDelegateDefault"
3417 MPEGDecodeDelegate="$MPEGDecodeDelegateDefault"
3418 MPEGEncodeDelegate="$MPEGEncodeDelegateDefault"
3419 MogrifyDelegate="$MogrifyDelegateDefault"
3420 MrSIDDecodeDelegate="$MrSIDDecodeDelegateDefault"
3421 MVDelegate="$MVDelegateDefault"
3422 PCLDelegate="$PCLDelegateDefault"
3423 PGPDecodeDelegate="$PGPDecodeDelegateDefault"
3424 POVDelegate="$POVDelegateDefault"
3425 PSDelegate="$PSDelegateDefault"
3426 RLEEncodeDelegate="$RLEEncodeDelegateDefault"
3427 RMDelegate="$RMDelegateDefault"
3428 RSVGDecodeDelegate="$RSVGDecodeDelegateDefault"
3429 SCANDecodeDelegate="$SCANDecodeDelegateDefault"
3430 SVGDecodeDelegate="$SVGDecodeDelegateDefault"
3431 ShowImageDelegate="$ShowImageDelegateDefault"
3432 TXTDelegate="$TXTDelegateDefault"
3433 UniconvertorDelegate="$UniconvertorDelegateDefault"
3434 WMFDecodeDelegate="$WMFDecodeDelegateDefault"
3435 WWWDecodeDelegate="$WWWDecodeDelegateDefault"
3436 XPSDelegate="$XPSDelegateDefault"
3437 ZipDelegate="$ZipDelegateDefault"
3440 # Delegate substitutions
3441 AC_SUBST(AutotraceDecodeDelegate)
3442 AC_SUBST(BlenderDecodeDelegate)
3443 AC_SUBST(BZIPDelegate)
3444 AC_SUBST(BrowseDelegate)
3445 AC_SUBST(CGMDecodeDelegate)
3446 AC_SUBST(CatDelegate)
3447 AC_SUBST(ConvertDelegate)
3448 AC_SUBST(GVCDecodeDelegate)
3449 AC_SUBST(DVIDecodeDelegate)
3450 AC_SUBST(EchoDelegate)
3451 AC_SUBST(EditorDelegate)
3452 AC_SUBST(FIGDecodeDelegate)
3453 AC_SUBST(GnuplotDecodeDelegate)
3454 AC_SUBST(HPGLDecodeDelegate)
3455 AC_SUBST(HTMLDecodeDelegate)
3456 AC_SUBST(ILBMDecodeDelegate)
3457 AC_SUBST(ILBMEncodeDelegate)
3458 AC_SUBST(JXRDecodeDelegate)
3459 AC_SUBST(JXREncodeDelegate)
3460 AC_SUBST(LPDelegate)
3461 AC_SUBST(LaunchDelegate)
3462 AC_SUBST(MANDelegate)
3463 AC_SUBST(MPEGDecodeDelegate)
3464 AC_SUBST(MPEGEncodeDelegate)
3465 AC_SUBST(MogrifyDelegate)
3466 AC_SUBST(MrSIDDecodeDelegate)
3467 AC_SUBST(MVDelegate)
3468 AC_SUBST(PCLDelegate)
3469 AC_SUBST(PGPDecodeDelegate)
3470 AC_SUBST(POVDelegate)
3471 AC_SUBST(PSDelegate)
3472 AC_SUBST(RLEEncodeDelegate)
3473 AC_SUBST(RMDelegate)
3474 AC_SUBST(SCANDecodeDelegate)
3475 AC_SUBST(ShowImageDelegate)
3476 AC_SUBST(TXTDelegate)
3477 AC_SUBST(UniconvertorDelegate)
3478 AC_SUBST(WMFDecodeDelegate)
3479 AC_SUBST(WWWDecodeDelegate)
3480 AC_SUBST(XPSDelegate)
3481 AC_SUBST(ZipDelegate)
3487 AC_CHECK_PROGS(TAR,gnutar gtar tar)
3488 AC_CHECK_PROGS(PERL,perl)
3489 AC_CHECK_PROGS(RPM,rpmbuild rpm)
3490 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
3491 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
3492 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
3493 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
3495 AM_CONDITIONAL(RPM_DELEGATE, test "x$RPM" != "x" )
3498 # 7ZIP support (http://p7zip.sourceforge.net/)
3501 AC_CHECK_PROGS(P7ZIP,[7za])
3503 AM_CONDITIONAL(P7ZIP_DELEGATE, test "x$P7ZIP" != "x" )
3506 # ZIP support (http://www.info-zip.org/Zip.html)
3509 AC_CHECK_PROGS(ZIP,[zip])
3511 AM_CONDITIONAL(ZIP_DELEGATE, test "x$ZIP" != "x" )
3514 # GhostPCL related configuration.
3516 PCLColorDevice=ppmraw
3517 PCLCMYKDevice=pamcmyk32
3518 PCLMonoDevice=pbmraw
3519 if test -z "$PCLVersion"; then
3520 PCLVersion='unknown'
3522 if test $have_pcl = 'yes'; then
3523 AC_MSG_RESULT([-------------------------------------------------------------])
3524 AC_MSG_CHECKING([for PCL])
3527 AC_MSG_CHECKING([for pcl color device])
3528 if $PCLDelegate -dBATCH -sDEVICE=$PCLColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3531 PCLColorDevice=ppmraw
3533 AC_MSG_RESULT([$PCLColorDevice])
3536 AC_MSG_CHECKING([for pcl CMYK device])
3537 if $PCLDelegate -dBATCH -sDEVICE=$PCLColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3540 PCLCMYKDevice=$PCLColorDevice
3542 AC_MSG_RESULT([$PCLCMYKDevice])
3545 AC_MSG_CHECKING([for pcl mono device])
3546 if $PCLDelegate -dBATCH -sDEVICE=$PCLMonoDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3549 PCLMonoDevice=$PCLColorDevice
3551 AC_MSG_RESULT([$PCLMonoDevice])
3554 AC_SUBST(PCLMonoDevice)
3555 AC_SUBST(PCLColorDevice)
3556 AC_SUBST(PCLCMYKDevice)
3557 AC_SUBST(PCLVersion)
3560 # GhostXPS related configuration.
3562 XPSColorDevice=ppmraw
3563 XPSCMYKDevice=bmpsep8
3564 XPSMonoDevice=pbmraw
3565 if test -z "$XPSVersion"; then
3566 XPSVersion='unknown'
3568 if test $have_xps = 'yes'; then
3569 AC_MSG_RESULT([-------------------------------------------------------------])
3570 AC_MSG_CHECKING([for XPS])
3573 AC_MSG_CHECKING([for xps color device])
3574 if $XPSDelegate -dBATCH -sDEVICE=$XPSColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3577 XPSColorDevice=ppmraw
3579 AC_MSG_RESULT([$XPSColorDevice])
3582 AC_MSG_CHECKING([for xps CMYK device])
3583 if $XPSDelegate -dBATCH -sDEVICE=$XPSColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3586 XPSCMYKDevice=$XPSColorDevice
3588 AC_MSG_RESULT([$XPSCMYKDevice])
3591 AC_MSG_CHECKING([for xps mono device])
3592 if $XPSDelegate -dBATCH -sDEVICE=$XPSMonoDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3595 XPSMonoDevice=$XPSColorDevice
3597 AC_MSG_RESULT([$XPSMonoDevice])
3600 AC_SUBST(XPSMonoDevice)
3601 AC_SUBST(XPSColorDevice)
3602 AC_SUBST(XPSCMYKDevice)
3603 AC_SUBST(XPSVersion)
3606 # Ghostscript related configuration.
3608 GSAlphaDevice=pngalpha
3609 GSColorDevice=pnmraw
3612 GSPDFDevice=pdfwrite
3614 GSEPSDevice=epswrite
3616 if test $have_gs = 'yes'; then
3617 AC_MSG_RESULT([-------------------------------------------------------------])
3618 AC_MSG_CHECKING([for Ghostscript])
3620 AC_MSG_CHECKING([for Ghostscript version])
3621 if GSVersion=`$PSDelegate --version`; then
3624 GSVersion=`$PSDelegate --help | sed -e '1q' | awk '{ print $3 }'`
3626 AC_MSG_RESULT([$GSVersion])
3629 AC_MSG_CHECKING([for gs alpha device])
3630 if $PSDelegate -q -dBATCH -sDEVICE=$GSAlphaDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3633 GSAlphaDevice=pnmraw
3635 AC_MSG_RESULT([$GSAlphaDevice])
3638 AC_MSG_CHECKING([for gs color device])
3639 if $PSDelegate -q -dBATCH -sDEVICE=$GSColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3642 GSColorDevice=pnmraw
3644 AC_MSG_RESULT([$GSColorDevice])
3647 AC_MSG_CHECKING([for gs CMYK device])
3648 if $PSDelegate -q -dBATCH -sDEVICE=$GSCMYKDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3651 GSCMYKDevice=bmpsep8
3653 AC_MSG_RESULT([$GSCMYKDevice])
3656 AC_MSG_CHECKING([for gs mono device])
3657 if $PSDelegate -q -dBATCH -sDEVICE=$GSMonoDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3660 GSMonoDevice=$GSColorDevice
3662 AC_MSG_RESULT([$GSMonoDevice])
3665 AC_MSG_CHECKING([for gs PDF writing device])
3666 if $PSDelegate -q -dBATCH -sDEVICE=$GSPDFDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3669 GSPDFDevice=nodevice
3671 AC_MSG_RESULT([$GSPDFDevice])
3674 AC_MSG_CHECKING([for gs PS writing device])
3675 if $PSDelegate -q -dBATCH -sDEVICE=$GSPSDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3680 AC_MSG_RESULT([$GSPSDevice])
3683 AC_MSG_CHECKING([for gs EPS writing device])
3684 if $PSDelegate -q -dBATCH -sDEVICE=$GSEPSDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3687 GSEPSDevice=nodevice
3689 AC_MSG_RESULT([$GSEPSDevice])
3692 AC_SUBST(GSAlphaDevice)
3693 AC_SUBST(GSCMYKDevice)
3694 AC_SUBST(GSColorDevice)
3695 AC_SUBST(GSEPSDevice)
3696 AC_SUBST(GSMonoDevice)
3697 AC_SUBST(GSPDFDevice)
3698 AC_SUBST(GSPSDevice)
3702 # PerlMagick-related configuration
3705 # Look for PERL if PerlMagick requested
3706 # If name/path of desired PERL interpreter is specified, look for that one first
3708 if test "$with_perl" != 'no'; then
3709 AC_MSG_RESULT([-------------------------------------------------------------])
3710 AC_MSG_CHECKING([for Perl])
3712 if test "$with_perl" != 'yes'; then
3713 AC_CACHE_CHECK(for perl,ac_cv_path_PERL,ac_cv_path_PERL="$with_perl");
3714 PERL=$ac_cv_path_PERL
3716 have_perl="$ac_cv_path_PERL"
3718 AC_PATH_PROGS(PERL,perl perl5,)dnl
3719 if test "$ac_cv_path_PERL"; then
3720 have_perl="$ac_cv_path_PERL"
3725 if test "$with_perl" != 'yes' ; then
3726 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-perl=$with_perl "
3729 PERL_SUPPORTS_DESTDIR='no'
3731 with_perl_static='no'
3732 with_perl_dynamic='no'
3733 if test "$have_perl" != 'no'; then
3734 if test "$with_perl" != 'no' && test "$libtool_build_shared_libs" = 'no'; then
3735 with_perl_static='yes'
3737 if test "$with_perl" != 'no' && test "$libtool_build_shared_libs" = 'yes'; then
3738 with_perl_dynamic='yes'
3740 # Is PERL's MakeMaker new enough to support DESTDIR?
3741 AX_PROG_PERL_VERSION(5.8.1,[PERL_SUPPORTS_DESTDIR='yes'],[PERL_SUPPORTS_DESTDIR='no'])
3743 AM_CONDITIONAL(WITH_PERL, test "$have_perl" != 'no')
3744 AM_CONDITIONAL(WITH_PERL_STATIC, test $with_perl_static = 'yes')
3745 AM_CONDITIONAL(WITH_PERL_DYNAMIC, test $with_perl_dynamic = 'yes')
3746 AC_SUBST(PERL_SUPPORTS_DESTDIR)
3748 # Determine path to pick up MagickCore library from for use with building PerlMagick
3749 MAGICKCORE_PATH="${LIB_DIR}"
3750 if test $with_perl_static = 'yes'; then
3751 # Find out where libtool hides its uninstalled libraries (as libtool_objdir)
3752 libtool_objdir=$objdir
3754 # Linker search path to library, followed by -lMagickCore
3755 MAGICKCORE_PATH="${builddir}/MagickCore/${libtool_objdir}"
3757 AC_SUBST(MAGICKCORE_PATH)
3759 # Create a simple string containing format names for all delegate libraries.
3761 if test "$have_autotrace" = 'yes' ; then
3762 MAGICK_DELEGATES="$MAGICK_DELEGATES autotrace"
3764 if test "$have_bzlib" = 'yes' ; then
3765 MAGICK_DELEGATES="$MAGICK_DELEGATES bzlib"
3767 if test "$have_dps" = 'yes' ; then
3768 MAGICK_DELEGATES="$MAGICK_DELEGATES dps"
3770 if test "$have_djvu" = 'yes' ; then
3771 MAGICK_DELEGATES="$MAGICK_DELEGATES djvu"
3773 if test "$have_ffmpeg" = 'yes' ; then
3774 MAGICK_DELEGATES="$MAGICK_DELEGATES mpeg"
3776 if test "$have_fftw" = 'yes' ; then
3777 MAGICK_DELEGATES="$MAGICK_DELEGATES fftw"
3779 if test "$have_fig2dev" = 'yes' && test "$have_ps" = 'yes' ; then
3780 MAGICK_DELEGATES="$MAGICK_DELEGATES xfig"
3782 if test "$have_fpx" = 'yes' ; then
3783 MAGICK_DELEGATES="$MAGICK_DELEGATES fpx"
3785 if test "$have_fontconfig" = 'yes' ; then
3786 MAGICK_DELEGATES="$MAGICK_DELEGATES fontconfig"
3788 if test "$have_freetype" = 'yes' ; then
3789 MAGICK_DELEGATES="$MAGICK_DELEGATES freetype"
3791 if test "$have_gslib" = 'yes' ; then
3792 MAGICK_DELEGATES="$MAGICK_DELEGATES gslib"
3794 if test "$have_jbig" = 'yes' ; then
3795 MAGICK_DELEGATES="$MAGICK_DELEGATES jbig"
3797 if test "$have_png$have_jpeg" = 'yesyes' ; then
3798 MAGICK_DELEGATES="$MAGICK_DELEGATES jng"
3800 if test "$have_jp2" = 'yes' ; then
3801 MAGICK_DELEGATES="$MAGICK_DELEGATES jp2"
3803 if test "$have_jpeg" = 'yes' ; then
3804 MAGICK_DELEGATES="$MAGICK_DELEGATES jpeg"
3806 if test "$have_lcms" = 'yes' || test "$have_lcms2" = 'yes' ; then
3807 MAGICK_DELEGATES="$MAGICK_DELEGATES lcms"
3809 if test "$have_lqr" = 'yes' ; then
3810 MAGICK_DELEGATES="$MAGICK_DELEGATES lqr"
3812 if test "$have_lzma" = 'yes' ; then
3813 MAGICK_DELEGATES="$MAGICK_DELEGATES lzma"
3815 if test "$have_openexr" = 'yes' ; then
3816 MAGICK_DELEGATES="$MAGICK_DELEGATES openexr"
3818 if test "$have_pango" = 'yes' ; then
3819 MAGICK_DELEGATES="$MAGICK_DELEGATES pango"
3821 if test "$have_png" = 'yes' ; then
3822 MAGICK_DELEGATES="$MAGICK_DELEGATES png"
3825 if test "$have_dps" = 'yes' || \
3826 test "$have_gs" = 'yes' || \
3827 test "${native_win32_build}" = 'yes' ; then
3830 if test "$have_ps" = 'yes' ; then
3831 MAGICK_DELEGATES="$MAGICK_DELEGATES ps"
3833 if test "$have_ralcgm" = 'yes' ; then
3834 MAGICK_DELEGATES="$MAGICK_DELEGATES cgm"
3836 if test "$have_ra_ppm" = 'yes' ; then
3837 MAGICK_DELEGATES="$MAGICK_DELEGATES rad"
3839 if test "$have_rsvg" = 'yes' ; then
3840 MAGICK_DELEGATES="$MAGICK_DELEGATES rsvg"
3842 if test "$have_tiff" = 'yes' ; then
3843 MAGICK_DELEGATES="$MAGICK_DELEGATES tiff"
3845 if test "$have_ttf" = 'yes' ; then
3846 MAGICK_DELEGATES="$MAGICK_DELEGATES ttf"
3848 if test "$have_webp" = 'yes' ; then
3849 MAGICK_DELEGATES="$MAGICK_DELEGATES webp"
3851 if test "$have_wmf" = 'yes' ; then
3852 MAGICK_DELEGATES="$MAGICK_DELEGATES wmf"
3854 if test "$have_x" = 'yes' ; then
3855 MAGICK_DELEGATES="$MAGICK_DELEGATES x"
3857 if test "$have_xml" = 'yes' ; then
3858 MAGICK_DELEGATES="$MAGICK_DELEGATES xml"
3860 if test "$have_zlib" = 'yes' ; then
3861 MAGICK_DELEGATES="$MAGICK_DELEGATES zlib"
3863 # Remove extraneous spaces from output variables (asthetic)
3864 MAGICK_DELEGATES=`echo $MAGICK_DELEGATES | sed -e 's/ */ /g'`
3865 MAGICK_FEATURES=`echo $MAGICK_FEATURES | sed -e 's/ */ /g'`
3866 AC_SUBST(MAGICK_DELEGATES)
3867 AC_SUBST(MAGICK_FEATURES)
3870 # Handle special compiler flags
3873 # Add '-p' if prof source profiling support enabled
3874 if test "$enable_prof" = 'yes'; then
3876 CXXFLAGS="-p $CXXFLAGS"
3877 LDFLAGS="-p $LDFLAGS"
3880 # Add '-pg' if gprof source profiling support enabled
3881 if test "$enable_gprof" = 'yes'; then
3882 CFLAGS="-pg $CFLAGS"
3883 CXXFLAGS="-pg $CXXFLAGS"
3884 LDFLAGS="-pg $LDFLAGS"
3887 # Add '-ftest-coverage -fprofile-arcs' if gcov source profiling support enabled
3888 # This is a gcc-specific feature
3889 if test "$enable_gcov" = 'yes'; then
3890 AC_CHECK_LIB(gcov,_gcov_init)
3891 AC_CHECK_LIB(gcov,__gcov_init)
3892 case "$target_os" in
3894 OSX_GCOV_LDFLAG="-Wl,-single_module"
3900 AC_SUBST(OSX_GCOV_LDFLAG)
3901 CFLAGS="-ftest-coverage -fprofile-arcs $CFLAGS"
3902 CXXFLAGS="-ftest-coverage -fprofile-arcs $CXXFLAGS"
3903 LDFLAGS="-ftest-coverage -fprofile-arcs $LDFLAGS"
3907 # Build library dependency list for libMagickCore
3910 if test "$build_modules" != 'no'; then
3911 MAGICK_DEP_LIBS="$LCMS_LIBS $FREETYPE_LIBS $LQR_LIBS $FFTW_LIBS $FONTCONFIG_LIBS $XEXT_LIBS $IPC_LIBS $X11_LIBS $XT_LIBS $LZMA_LIBS $BZLIB_LIBS $ZLIB_LIBS $LTDL_LIBS $GDI32_LIBS $MATH_LIBS $GOMP_LIBS $CL_LIBS $UMEM_LIBS $THREAD_LIBS"
3913 MAGICK_DEP_LIBS="$JBIG_LIBS $LCMS_LIBS $TIFF_LIBS $FREETYPE_LIBS $JP2_LIBS $JPEG_LIBS $GS_LIBS $LQR_LIBS $PNG_LIBS $AUTOTRACE_LIBS $DJVU_LIBS $FFTW_LIBS $FPX_LIBS $FONTCONFIG_LIBS $WEBP_LIBS $WMF_LIBS $DPS_LIBS $XEXT_LIBS $XT_LIBS $IPC_LIBS $X11_LIBS $LZMA_LIBS $BZLIB_LIBS $OPENEXR_LIBS $PANGO_LIBS $RSVG_LIBS $XML_LIBS $GVC_LIBS $ZLIB_LIBS $GDI32_LIBS $MATH_LIBS $GOMP_LIBS $CL_LIBS $UMEM_LIBS $THREAD_LIBS"
3915 AC_SUBST(MAGICK_DEP_LIBS)
3918 # Remove extraneous spaces from output variables (asthetic)
3920 X_CFLAGS=`echo $X_CFLAGS | sed -e 's/ */ /g'`
3921 X_PRE_LIBS=`echo $X_PRE_LIBS | sed -e 's/ */ /g'`
3922 X_LIBS=`echo $X_LIBS | sed -e 's/ */ /g'`
3923 X_EXTRA_LIBS=`echo $X_EXTRA_LIBS | sed -e 's/ */ /g'`
3925 CC=`echo $CC | sed -e 's/ */ /g'`
3926 CFLAGS=`echo $CFLAGS | sed -e 's/ */ /g'`
3927 CPPFLAGS=`echo $CPPFLAGS | sed -e 's/ */ /g'`
3928 CXXFLAGS=`echo $CXXFLAGS | sed -e 's/ */ /g'`
3929 DISTCHECK_CONFIG_FLAGS=`echo $DISTCHECK_CONFIG_FLAGS | sed -e 's/ */ /g'`
3930 LDFLAGS=`echo $LDFLAGS | sed -e 's/ */ /g'`
3931 TESTED_LIBS=`echo $LIBS | sed -e 's/ */ /g'`
3932 MAGICK_DEP_LIBS=`echo $MAGICK_DEP_LIBS | sed -e 's/ */ /g'`
3933 #LIBS=`echo $LIBS | sed -e 's/ */ /g'`
3935 # Pass only user-provided LIBS as "global" libraries
3941 #AC_SUBST(X_PRE_LIBS)
3943 #AC_SUBST(X_EXTRA_LIBS)
3945 MAGICK_CFLAGS=$CFLAGS
3946 MAGICK_CXXFLAGS="$CXXFLAGS"
3947 MAGICK_CPPFLAGS=`echo $MAGICK_CPPFLAGS | sed -e 's/ */ /g'`
3948 MAGICK_PCFLAGS=`echo $MAGICK_PCFLAGS | sed -e 's/ */ /g'`
3949 MAGICK_LDFLAGS="-L$LIB_DIR $LDFLAGS"
3950 MAGICK_LIBS="-lMagickCore $MAGICK_DEP_LIBS"
3952 AC_SUBST(MAGICK_CFLAGS)
3953 AC_SUBST(MAGICK_CXXFLAGS)
3954 AC_SUBST(MAGICK_CPPFLAGS)
3955 AC_SUBST(MAGICK_PCFLAGS)
3956 AC_SUBST(MAGICK_LDFLAGS)
3957 AC_SUBST(MAGICK_LIBS)
3959 # Set configured scripts to executable.
3960 AC_CONFIG_COMMANDS([default],[],[])
3961 AC_CONFIG_COMMANDS([magick.sh.in],[chmod +x magick.sh])
3962 AC_CONFIG_COMMANDS([MagickCore-config.in],[chmod +x MagickCore/MagickCore-config])
3963 AC_CONFIG_COMMANDS([MagickWand-config.in],[chmod +x MagickWand/MagickWand-config])
3964 AC_CONFIG_COMMANDS([Magick++-config.in],[chmod +x Magick++/bin/Magick++-config])
3965 AC_CONFIG_COMMANDS([PerlMagick/check.sh.in],[chmod +x PerlMagick/check.sh])
3967 AC_MSG_RESULT([-------------------------------------------------------------])
3968 AC_MSG_RESULT([Update ImageMagick configuration])
3971 rm -f magick-version
3973 result_dejavu_font_dir='none'
3974 if test "${dejavu_font_dir}x" != 'x'; then
3975 result_dejavu_font_dir=$dejavu_font_dir
3978 result_ghostscript_font_dir='none'
3979 if test "${ghostscript_font_dir}x" != 'x'; then
3980 result_ghostscript_font_dir=$ghostscript_font_dir
3983 result_windows_font_dir='none'
3984 if test "${windows_font_dir}x" != 'x'; then
3985 result_windows_font_dir=${windows_font_dir}
3989 ImageMagick is configured as follows. Please verify that this configuration
3990 matches your expectations.
3992 Host system type: $host
3993 Build system type: $build
3996 -------------------------------------------------------------------------------
3997 Shared libraries --enable-shared=$enable_shared $libtool_build_shared_libs
3998 Static libraries --enable-static=$enable_static $libtool_build_static_libs
3999 Module support --with-modules=$build_modules $build_modules
4000 GNU ld --with-gnu-ld=$with_gnu_ld $lt_cv_prog_gnu_ld
4001 Quantum depth --with-quantum-depth=$with_quantum_depth $with_quantum_depth
4002 High Dynamic Range Imagery
4003 --enable-hdri=$enable_hdri $enable_hdri
4005 Delegate Configuration:
4006 BZLIB --with-bzlib=$with_bzlib $have_bzlib
4007 Autotrace --with-autotrace=$with_autotrace $have_autotrace
4008 Dejavu fonts --with-dejavu-font-dir=$with_dejavu_font_dir $result_dejavu_font_dir
4009 DJVU --with-djvu=$with_djvu $have_djvu
4010 DPS --with-dps=$with_dps $have_dps
4011 FFTW --with-fftw=$with_fftw $have_fftw
4012 FlashPIX --with-fpx=$with_fpx $have_fpx
4013 FontConfig --with-fontconfig=$with_fontconfig $have_fontconfig
4014 FreeType --with-freetype=$with_freetype $have_freetype
4015 GhostPCL None $PCLDelegate ($PCLVersion)
4016 GhostXPS None $XPSDelegate ($XPSVersion)
4017 Ghostscript None $PSDelegate ($GSVersion)
4018 Ghostscript fonts --with-gs-font-dir=$with_gs_font_dir $result_ghostscript_font_dir
4019 Ghostscript lib --with-gslib=$with_gslib $have_gslib
4020 Graphviz --with-gvc=$with_gvc $have_gvc
4021 JBIG --with-jbig=$with_jbig $have_jbig
4022 JPEG v1 --with-jpeg=$with_jpeg $have_jpeg
4023 JPEG-2000 --with-jp2=$with_jp2 $have_jp2
4024 LCMS v1 --with-lcms=$with_lcms $have_lcms
4025 LCMS v2 --with-lcms2=$with_lcms2 $have_lcms2
4026 LQR --with-lqr=$with_lqr $have_lqr
4027 LTDL --with-ltdl=$with_ltdl $have_ltdl
4028 LZMA --with-lzma=$with_lzma $have_lzma
4029 Magick++ --with-magick-plus-plus=$with_magick_plus_plus $have_magick_plus_plus
4030 OpenEXR --with-openexr=$with_openexr $have_openexr
4031 PANGO --with-pango=$with_pango $have_pango
4032 PERL --with-perl=$with_perl $have_perl
4033 PNG --with-png=$with_png $have_png
4034 RSVG --with-rsvg=$with_rsvg $have_rsvg
4035 TIFF --with-tiff=$with_tiff $have_tiff
4036 WEBP --with-webp=$with_webp $have_webp
4037 Windows fonts --with-windows-font-dir=$with_windows_font_dir $result_windows_font_dir
4038 WMF --with-wmf=$with_wmf $have_wmf
4039 X11 --with-x=$with_x $have_x
4040 XML --with-xml=$with_xml $have_xml
4041 ZLIB --with-zlib=$with_zlib $have_zlib
4044 X_CFLAGS = $X_CFLAGS
4045 X_PRE_LIBS = $X_PRE_LIBS
4047 X_EXTRA_LIBS = $X_EXTRA_LIBS
4049 Options used to compile and link:
4050 PREFIX = $PREFIX_DIR
4051 EXEC-PREFIX = $EXEC_PREFIX_DIR
4052 VERSION = $PACKAGE_VERSION
4055 CPPFLAGS = $MAGICK_CPPFLAGS
4056 PCFLAGS = $MAGICK_PCFLAGS
4059 MAGICK_LDFLAGS = $MAGICK_LDFLAGS
4062 CXXFLAGS = $CXXFLAGS
4063 FEATURES = $MAGICK_FEATURES
4064 DELEGATES = $MAGICK_DELEGATES