1 # Copyright 1999-2014 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
322 AX_GCC_ARCHFLAG([no])
325 # Test for 64-bit build.
326 AC_CHECK_SIZEOF([size_t])
329 # The AX_CFLAGS_WARN_ALL macro doesn't currently work for sunpro
331 if test "$ax_cv_c_compiler_vendor" != "sun"; then
335 if test "x$GCC" = "xyes"; then
336 CFLAGS="$CFLAGS -fexceptions"
339 cat > local.exp <<EOF
340 set CC_FOR_TARGET "$CC"
344 # Check for linker script support
348 # Enable run-time checking.
350 AC_ARG_ENABLE([bounds-checking],
351 [AC_HELP_STRING([--enable-bounds-checking],
352 [enable run-time bounds-checking])],
353 [enable_bounds_checking=$enableval],
354 [enable_bounds_checking='no'])
356 if test "$enable_bounds_checking" = yes; then
357 AC_DEFINE([_FORTIFY_SOURCE], [2],
358 [enable run-time bounds-checking])
368 native_win32_build='no'
376 native_win32_build='yes'
380 if test "${GDI32_LIBS}x" != 'x'; then
381 AC_DEFINE(WINGDI32_DELEGATE,1,Define to use the Windows GDI32 library)
384 AM_CONDITIONAL(WINGDI32_DELEGATE, test "${GDI32_LIBS}x" != 'x' )
385 AM_CONDITIONAL(WIN32_NATIVE_BUILD, test "${native_win32_build}" = 'yes' )
386 AM_CONDITIONAL(CYGWIN_BUILD, test "${cygwin_build}" = 'yes' )
387 AM_CONDITIONAL(USING_CL, test "x${CC}" = 'xcl.exe' )
389 WinPathScript="${srcdirfull}/winpath.sh"
390 AC_SUBST(WinPathScript)
393 # Compiler flags tweaks
395 if test "${GCC}" != "yes"; then
398 # aCC: HP ANSI C++ B3910B A.03.34
399 CFLAGS="${CFLAGS} -Wp,-H30000"
400 if test -n "${CXXFLAGS}"; then
403 CXXFLAGS="${CXXFLAGS} -AA"
407 # Compaq alphaev68-dec-osf5.1 compiler
408 if test -n "${CXXFLAGS}"; then
409 CXXFLAGS='-std strict_ansi -noimplicit_include'
411 CXXFLAGS="${CXXFLAGS} -std strict_ansi -noimplicit_include"
416 # Check for lazy-loading.
417 AC_CACHE_CHECK([for linker lazyload option],[im_cv_ld_lazyload],
419 im_cv_ld_lazyload='none'
421 *-*-solaris2.8 | *-*-solaris2.9 | *-*-solaris2.1? )
422 if test "$lt_cv_prog_gnu_ld" != 'yes' ; then
423 im_cv_ld_lazyload='-Wl,-zlazyload'
428 if test "${im_cv_ld_lazyload}" != 'none' ; then
429 if test -z "${LDFLAGS}" ; then
430 LDFLAGS="${im_cv_ld_lazyload}"
432 LDFLAGS="${im_cv_ld_lazyload} ${LDFLAGS}"
436 dnl Platform-specific stuff
438 *darwin* | *-macos10*)
439 dnl Disable FORTIFY_SOURCE to fix a bug in LVVM / OpenMP support
440 CFLAGS="${CFLAGS} -D_FORTIFY_SOURCE=0"
441 dnl OS X universal binary support, requires --disable-dependency-tracking
442 AC_ARG_ENABLE([osx-universal-binary],
443 AC_HELP_STRING([--enable-osx-universal-binary],
444 [build universal binary on OS X [[default=no]]]),
445 [build_osxuniversal="${enableval}"], [build_osxuniversal=no])
447 if test "${build_osxuniversal}" != no ; then
448 if test "$enable_dependency_tracking" != no ; then
449 AC_MSG_ERROR([--enable-osx-universal-binary requires --disable-dependency-tracking.
450 Please re-run configure with these options:
451 --disable-dependency-tracking --enable-osx-universal-binary
454 CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
455 CXXFLAGS="$CXXFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
456 LDFLAGS="$LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
462 # ARCH specific include directory
464 AC_ARG_WITH([includearch-dir],
465 [AC_HELP_STRING([--includearch-dir=DIR],
466 [ARCH specific include directory])],
467 [includearch_dir=$withval],
468 [includearch_dir=$INCLUDE_DIR])
470 eval "eval INCLUDEARCH_DIR=$includearch_dir"
471 AC_SUBST(INCLUDEARCH_DIR)
474 # ARCH specific configuration directory
476 AC_ARG_WITH([sharearch-dir],
477 [AC_HELP_STRING([--sharearch-dir=DIR],
478 [ARCH specific config directory])],
479 [sharearch_dir=$withval],
480 [sharearch_dir="${LIB_DIR}"])
482 eval "eval SHAREARCH_DIR=$sharearch_dir"
483 AC_SUBST(SHAREARCH_DIR)
485 # Path to the pkgconfig folder
486 AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=DIR],
487 [Path to the pkgconfig directory @<:@LIBDIR/pkgconfig@:>@]),
488 [pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
489 AC_SUBST([pkgconfigdir])
492 # Enable support for threads
494 # Find Posix threads library
496 AC_ARG_WITH([threads],
497 [AC_HELP_STRING([--without-threads], [disable threads support])],
498 [with_threads=$withval],
499 [with_threads='yes'])
503 if test "$with_threads" != 'no'; then
505 if test "$ax_pthread_ok" = yes; then
507 DEF_THREAD="$PTHREAD_CFLAGS"
508 CFLAGS="$CFLAGS $DEF_THREAD"
509 CXXFLAGS="$CXXFLAGS $DEF_THREAD"
510 THREAD_LIBS="$PTHREAD_LIBS"
511 if test "$CC" != "$PTHREAD_CC"; then
512 AC_MSG_WARN([Replacing compiler $CC with compiler $PTHREAD_CC to support pthreads.])
515 AC_DEFINE(THREAD_SUPPORT,1,[Define if you have POSIX threads libraries and header files.])
518 LIBS="$LIBS $THREAD_LIBS"
519 AC_SUBST(THREAD_LIBS)
521 # Enable support for OpenMP
522 if test "$have_threads" != 'yes'; then
523 ac_cv_prog_c_openmp=unsupported
526 CFLAGS="$OPENMP_CFLAGS $CFLAGS"
527 MAGICK_PCFLAGS="$MAGICK_PCFLAGS $OPENMP_CFLAGS"
528 AC_SUBST(OPENMP_CFLAGS)
529 if test "$enable_openmp" != no; then
530 if test "$ac_cv_prog_c_openmp" != 'unsupported'; then
531 MAGICK_FEATURES="OpenMP $MAGICK_FEATURES"
535 # Enable support for OpenCL
537 CFLAGS="$CL_CFLAGS $CFLAGS"
538 CPPFLAGS="$CL_CFLAGS $CPPFLAGS"
539 LIBS="$CL_LIBS $LIBS"
541 if test "$enable_opencl" != no; then
542 if test "X$ax_cv_check_cl_libcl" != Xno; then :
543 MAGICK_FEATURES="OpenCL $MAGICK_FEATURES"
549 # Check for large file support
555 if test "$enable_largefile" != no; then
556 case $ac_cv_sys_file_offset_bits in
558 # nothing to do here as the host supports LFS fine
561 AC_MSG_CHECKING([for native large file support])
562 AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>
564 exit(!(sizeof(off_t) == 8));
566 [ac_cv_sys_file_offset_bits=64; AC_DEFINE(_FILE_OFFSET_BITS,64)
567 AC_MSG_RESULT([yes])],
568 [AC_MSG_RESULT([no])])
571 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
574 if test "$ac_cv_sys_large_files" != 'no'; then
575 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGE_FILES=1"
577 if test "$ac_cv_sys_largefile_source" != 'no'; then
578 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGEFILE_SOURCE=1"
581 AC_SUBST(LFS_CPPFLAGS)
587 AC_SUBST(LIBTOOL_DEPS)
589 # Check to see if building shared libraries
590 libtool_build_shared_libs='no'
591 if test "$enable_shared" = 'yes'; then
592 libtool_build_shared_libs='yes'
595 # Check to see if building static libraries
596 libtool_build_static_libs='no'
597 if test "$enable_static" = 'yes'; then
598 libtool_build_static_libs='yes'
601 AM_CONDITIONAL(WITH_SHARED_LIBS, test "${libtool_build_shared_libs}" = 'yes')
603 # Enable support for building loadable modules
606 AC_ARG_WITH([modules],
607 [AC_HELP_STRING([--with-modules],
608 [enable building dynamically loadable modules])],
609 [with_modules=$withval],
612 # Only allow building loadable modules if we are building shared libraries
613 if test "$with_modules" != 'no' ; then
614 if test "$libtool_build_shared_libs" = 'no'; then
615 AC_MSG_WARN([Modules may only be built if building shared libraries is enabled.])
621 if test "$build_modules" != 'no' ; then
622 AC_DEFINE(BUILD_MODULES,1,Define if coders and filters are to be built as modules.)
623 MAGICK_FEATURES="$MAGICK_FEATURES Modules"
625 AM_CONDITIONAL(WITH_MODULES, test "$build_modules" != 'no')
627 # Enable build using delegate libraries built in subdirectories rather than installed
628 # delegate libraries (bzlib fftw fpx gslib jp2 jbig jpeg lcms lzma png tiff ttf wmf xml zlib)
629 AC_ARG_ENABLE([delegate-build],
630 [AC_HELP_STRING([--enable-delegate-build],
631 [look for delegate libraries in build directory])],
632 [enable_delegate_build=$enableval],
633 [enable_delegate_build='no'])
635 AC_ARG_ENABLE([deprecated],
636 [AC_HELP_STRING([--disable-deprecated],
637 [exclude deprecated methods in MagickCore and MagickWand APIs])],
638 [enable_deprecated=$enableval],
639 [enable_deprecated='no'])
641 if test "$enable_deprecated" = 'yes'; then
642 AC_DEFINE(EXCLUDE_DEPRECATED,1,[exclude deprecated methods in MagickCore API])
644 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-deprecated "
647 # Build a version of ImageMagick which operates uninstalled.
648 # Used to build distributions located via MAGICK_HOME / executable path
649 AC_ARG_ENABLE([installed],
650 [AC_HELP_STRING([--disable-installed],
651 [Formally install ImageMagick under PREFIX])],
652 [enable_installed=$enableval],
653 [enable_installed='yes'])
655 if test "$enable_installed" = 'yes'; then
656 AC_DEFINE(INSTALLED_SUPPORT,1,[ImageMagick is formally installed under prefix])
658 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-installed "
661 # Permit enciphering and deciphering image pixels.
662 AC_ARG_ENABLE([cipher],
663 [AC_HELP_STRING([--disable-cipher],
664 [disable enciphering and deciphering image pixels])],
665 [enable_cipher=$enableval],
666 [enable_cipher='yes'])
668 if test "$enable_cipher" = 'yes'; then
669 AC_DEFINE(CIPHER_SUPPORT,1,[permit enciphering and deciphering image pixels])
672 # Build a zero-configuration version of ImageMagick.
673 AC_ARG_ENABLE([zero-configuration],
674 [AC_HELP_STRING([--enable-zero-configuration],
675 [enable self-contained, embeddable, zero-configuration ImageMagick])],
676 [enable_zero_configuration=$enableval],
677 [enable_zero_configuration='no'])
679 if test "$enable_zero_configuration" = 'yes'; then
680 AC_DEFINE(ZERO_CONFIGURATION_SUPPORT,1,[Build self-contained, embeddable, zero-configuration ImageMagick])
681 MAGICK_FEATURES="Zero-Configuration $MAGICK_FEATURES"
684 # Build a high dynamic range version of ImageMagick.
685 AC_ARG_ENABLE([hdri],
686 [AC_HELP_STRING([--enable-hdri],
687 [accurately represent the wide range of intensity levels found in real scenes])],
688 [enable_hdri=$enableval],
692 if test "$enable_hdri" = 'yes'; then
694 magick_hdri_enable='1';
695 MAGICK_FEATURES="HDRI $MAGICK_FEATURES"
697 magick_hdri_enable='0'
699 AC_DEFINE_UNQUOTED(HDRI_ENABLE_OBSOLETE_IN_H,$magick_hdri_enable,[Whether hdri is enabled or not])
700 AC_SUBST(MAGICK_HDRI)dnl
701 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -DMAGICKCORE_HDRI_ENABLE=$magick_hdri_enable"
702 CFLAGS="$CFLAGS -DMAGICKCORE_HDRI_ENABLE=$magick_hdri_enable"
703 CPPFLAGS="$CPPFLAGS -DMAGICKCORE_HDRI_ENABLE=$magick_hdri_enable"
705 # Build a version of ImageMagick with assert statements.
706 AC_ARG_ENABLE([assert],
707 [AC_HELP_STRING([--disable-assert],
708 [disable assert() statements in build])],
709 [enable_assert=$enableval],
710 [enable_assert='yes'])
712 if test "$enable_assert" = 'no'; then
713 AC_DEFINE(NDEBUG,1,[Turn off assert statements])
716 # Don't emit "rebuild rules" for configure, Makefile.ins, etc.
719 # Enable hugepages support
720 AC_ARG_ENABLE([hugepages],
721 [AC_HELP_STRING([--enable-hugepages],
722 [enable 'huge pages' support])],
723 [enable_hugepages=$enableval],
724 [enable_hugepages='no'])
726 # Enable ccmalloc memory debugging support
727 AC_ARG_ENABLE([ccmalloc],
728 [AC_HELP_STRING([--enable-ccmalloc],
729 [enable 'ccmalloc' memory debug support])],
730 [enable_ccmalloc=$enableval],
731 [enable_ccmalloc='no'])
733 # Enable Electric Fence memory debugging support
734 AC_ARG_ENABLE([efence],
735 [AC_HELP_STRING([--enable-efence],
736 [enable 'efence' memory debug support])],
737 [enable_efence=$enableval],
738 [enable_efence='no'])
740 # Enable prof-based profiling support
741 AC_ARG_ENABLE([prof],
742 [AC_HELP_STRING([--enable-prof],
743 [enable 'prof' profiling support])],
744 [enable_prof=$enableval],
747 # Enable gprof-based profiling support
748 AC_ARG_ENABLE([gprof],
749 [AC_HELP_STRING([--enable-gprof],
750 [enable 'gprof' profiling support])],
751 [enable_gprof=$enableval],
754 # Enable gcov-based profiling support
755 AC_ARG_ENABLE([gcov],
756 [AC_HELP_STRING([--enable-gcov],
757 [enable 'gcov' profiling support])],
758 [enable_gcov=$enableval],
761 enable_profiling='no'
762 if test "$enable_prof" = 'yes' || test "$enable_gprof" = 'yes' || test "$enable_gcov" = 'yes'; then
763 enable_profiling='yes'
764 if test "$libtool_build_shared_libs" = 'yes'; then
765 echo "Warning: Can not profile code using shared libraries"
769 # Magick API method prefix
770 AC_ARG_WITH([method-prefix],
771 [AC_HELP_STRING([--with-method-prefix=PREFIX],
772 [prefix MagickCore API methods])],
773 [with_method_prefix=$withval],
774 [with_method_prefix='no'])
776 if test "$with_method_prefix" != 'no'; then
777 AC_DEFINE_UNQUOTED(NAMESPACE_PREFIX,$with_method_prefix,[Magick API method prefix])
778 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-method-prefix "
781 # Enable legacy support (default no)
782 AC_ARG_ENABLE(legacy-support,
783 [ --enable-legacy-support install legacy command-line utilities (default disabled)],
784 [with_legacy_support=$enableval],
785 [with_legacy_support='no'])
786 AM_CONDITIONAL(LEGACY_SUPPORT, test "$with_legacy_support" != 'no')
788 # Number of bits in a Quantum
789 AC_ARG_WITH([quantum-depth],
790 [AC_HELP_STRING([--with-quantum-depth=DEPTH],
791 [number of bits in a pixel quantum (default 16)])],
792 [with_quantum_depth=$withval],
793 [with_quantum_depth=16])
795 if test "$with_quantum_depth" != '8'; then
796 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-quantum-depth=$with_quantum_depth "
799 case "${with_quantum_depth}" in
804 * ) AC_MSG_ERROR("Pixel quantum depth must have value of 8, 16, 32, or 64") ;;
806 QUANTUM_DEPTH="$with_quantum_depth"
807 AC_DEFINE_UNQUOTED(QUANTUM_DEPTH_OBSOLETE_IN_H,$QUANTUM_DEPTH,[Number of bits in a pixel Quantum (8/16/32/64)])
808 AC_SUBST(QUANTUM_DEPTH)dnl
809 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -DMAGICKCORE_QUANTUM_DEPTH=$QUANTUM_DEPTH"
810 CFLAGS="$CFLAGS -DMAGICKCORE_QUANTUM_DEPTH=$QUANTUM_DEPTH"
811 CPPFLAGS="$CPPFLAGS -DMAGICKCORE_QUANTUM_DEPTH=$QUANTUM_DEPTH"
813 # define a lib suffix for abi purpose
814 MAGICK_ABI_SUFFIX="Q${QUANTUM_DEPTH}"
815 if test "$enable_hdri" = 'yes'; then
816 MAGICK_ABI_SUFFIX="Q${QUANTUM_DEPTH}${MAGICK_HDRI}"
818 AC_SUBST(MAGICK_ABI_SUFFIX)
820 # Set pixel cache threshold
822 [AC_HELP_STRING([--with-cache=THRESHOLD],
823 [set pixel cache threshhold in MB (default available memory)])],
824 [with_cache=$withval],
827 if test "$with_cache" != ''; then
828 AC_DEFINE_UNQUOTED(PixelCacheThreshold,$with_cache,[Pixel cache threshold in MB (defaults to available memory)])
829 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-cache=$with_cache "
832 # Disable/Enable support for full delegate paths
833 AC_ARG_WITH([frozenpaths],
834 [AC_HELP_STRING([--with-frozenpaths],
835 [freeze delegate paths])],
836 [with_frozenpaths=$withval],
837 [with_frozenpaths='no'])
839 # Enable build/install of Magick++
840 AC_ARG_WITH([magick-plus-plus],
841 [AC_HELP_STRING([--without-magick-plus-plus],
842 [disable build/install of Magick++])],
843 [with_magick_plus_plus=$withval],
844 [with_magick_plus_plus='yes'])
846 # Encode the this name into the shared library.
847 AC_ARG_WITH([package-release-name],
848 [AC_HELP_STRING([--with-package-release-name=NAME],
849 [encode this name into the shared library])],
850 [MAGICK_LT_RELEASE_OPTS="-release $withval"])
851 AC_SUBST(MAGICK_LT_RELEASE_OPTS)
853 # Disable build/install of PerlMagick.
855 [AC_HELP_STRING([--with-perl],
856 [enable build/install of PerlMagick])],
857 [with_perl=$withval],
860 # Options to pass when configuring PerlMagick
861 AC_ARG_WITH([perl-options],
862 [AC_HELP_STRING([--with-perl-options=OPTIONS],
863 [options to pass on command-line when generating PerlMagick build file])],
864 PERL_MAKE_OPTIONS=$withval)
865 AC_SUBST(PERL_MAKE_OPTIONS)
867 # Enable umem, object-caching memory allocation library.
869 [ --with-umem enable umem memory allocation library support],
870 [with_umem=$withval],
872 if test "$with_umem" != 'yes' ; then
873 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-umem=$with_umem "
877 # Specify path to shared libstdc++ if not in normal location
879 AC_ARG_WITH([libstdc],
880 [AC_HELP_STRING([--with-libstdc=DIR],
881 [ use libstdc++ in DIR (for GNU C++)])],
882 [with_libstdc=$withval],
885 if test "$with_libstdc" != ''; then
886 if test -d "$with_libstdc"; then
887 LIBSTDCLDFLAGS="-L$with_libstdc"
890 AC_SUBST(LIBSTDCLDFLAGS)
892 # Does gcc required -traditional?
893 AC_PROG_GCC_TRADITIONAL
897 # Set defines required to build DLLs and modules using MinGW
900 # These options are set for multi-thread DLL module build
901 # libMagickCore: _DLL _MAGICKMOD_ _MAGICKLIB_
903 # executable/Magick++: _DLL _MAGICKMOD_
904 MODULE_EXTRA_CPPFLAGS=''
905 LIBRARY_EXTRA_CPPFLAGS=''
906 if test "${native_win32_build}" = 'yes'; then
907 if test "${libtool_build_shared_libs}" = 'yes'; then
908 CPPFLAGS="$CPPFLAGS -D_DLL"
909 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_DLL"
910 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_DLL"
911 LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKLIB_"
912 if test "$build_modules" = 'yes'; then
913 LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKMOD_"
915 MODULE_EXTRA_CPPFLAGS="$MODULE_EXTRA_CPPFLAGS -D_MAGICKLIB_"
918 CPPFLAGS="$CPPFLAGS -D_LIB"
919 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_LIB"
920 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_LIB"
922 if test "$with_threads" = 'yes'; then
923 CPPFLAGS="$CPPFLAGS -D_MT"
924 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_MT"
925 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_MT"
928 AC_SUBST(MODULE_EXTRA_CPPFLAGS)
929 AC_SUBST(LIBRARY_EXTRA_CPPFLAGS)
931 # Check standard headers
933 if ! test x"$ac_cv_header_stdc" = x"yes"; then
934 AC_MSG_WARN([configure has detected that you do not have the ANSI standard C
935 header files. Compilation cannot proceed. Please install the ANSI C
936 headers and rerun this script.]);
941 # Check additional headers
942 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)
946 # Checks for typedefs, structures, and compiler characteristics.
960 # Checks for language qualifiers and semantics.
968 # If words are stored with the most significant byte first (like
969 # Motorola and SPARC CPUs), define `WORDS_BIGENDIAN'.
972 # Define to a suitable type, if standard headers do not define it.
980 AC_TYPE_LONG_DOUBLE_WIDER
981 AC_TYPE_LONG_LONG_INT
995 AC_TYPE_UNSIGNED_LONG_LONG_INT
997 # Float_t and double_t are intended to be the the most efficient type.
998 AC_CHECK_TYPES([float_t], [], [], [[#include <math.h>]])
999 AC_CHECK_TYPES([double_t], [], [], [[#include <math.h>]])
1000 AC_CHECK_SIZEOF([float_t], [], [[#include <math.h>]])
1001 AC_CHECK_SIZEOF([double_t], [], [[#include <math.h>]])
1003 # Get size of float, double and long double for comparaison.
1004 AC_CHECK_SIZEOF([float])
1005 AC_CHECK_SIZEOF([double])
1006 AC_CHECK_SIZEOF([long double])
1008 # Obtain size of an 'signed short' and define as SIZEOF_SIGNED_SHORT
1009 AC_CHECK_SIZEOF(signed short)
1011 # Obtain size of an 'unsigned short' and define as SIZEOF_UNSIGNED_SHORT
1012 AC_CHECK_SIZEOF(unsigned short)
1014 # Obtain size of an 'signed int' and define as SIZEOF_SIGNED_INT
1015 AC_CHECK_SIZEOF(signed int)
1017 # Obtain size of an 'unsigned int' and define as SIZEOF_UNSIGNED_INT
1018 AC_CHECK_SIZEOF(unsigned int)
1020 # Obtain size of a 'signed long' and define as SIZEOF_SIGNED_LONG
1021 AC_CHECK_SIZEOF(signed long)
1023 # Obtain size of a 'unsigned long' and define as SIZEOF_UNSIGNED_LONG
1024 AC_CHECK_SIZEOF(unsigned long)
1026 # Obtain size of a 'long long' and define as SIZEOF_SIGNED_LONG_LONG. If
1027 # 'signed long long' is not supported then the value defined is zero.
1028 AC_CHECK_SIZEOF(signed long long)
1030 # Obtain size of a 'unsigned long long' and define as
1031 # SIZEOF_UNSIGNED_LONG_LONG. If 'unsigned long long' is not
1032 # supported then the value defined is zero.
1033 AC_CHECK_SIZEOF(unsigned long long)
1035 # Obtain size of off_t and define as SIZEOF_OFF_T
1036 AC_CHECK_SIZEOF(off_t)
1038 # Obtain size of size_t and define as SIZEOF_SIZE_T
1039 AC_CHECK_SIZEOF(size_t)
1041 # Obtain size of ssize_t and define as SIZEOF_SSIZE_T
1042 AC_CHECK_SIZEOF(ssize_t)
1044 # Obtain size of an unsigned int pointer and define as SIZEOF_UNSIGNED_INTP
1045 AC_CHECK_SIZEOF(unsigned int*)
1048 # Compute sized types for current CPU and compiler options.
1051 AC_MSG_CHECKING(for signed 8-bit type)
1052 INT8_T='signed char'
1053 AC_MSG_RESULT($INT8_T)
1056 AC_MSG_CHECKING(for unsigned 8-bit type)
1057 UINT8_T='unsigned char'
1058 AC_MSG_RESULT($UINT8_T)
1061 AC_MSG_CHECKING(for signed 16-bit type)
1062 INT16_T='signed short'
1063 AC_MSG_RESULT($INT16_T)
1066 AC_MSG_CHECKING(for unsigned 16-bit type)
1067 UINT16_T='unsigned short'
1068 AC_MSG_RESULT($UINT16_T)
1071 AC_MSG_CHECKING(for signed 32-bit type)
1074 if test $ac_cv_sizeof_signed_int -eq 4; then
1075 INT32_T='signed int'
1077 elif test $ac_cv_sizeof_signed_long -eq 4; then
1078 INT32_T='signed long'
1081 AC_MSG_RESULT($INT32_T)
1085 AC_MSG_CHECKING(for unsigned 32-bit type)
1088 if test $ac_cv_sizeof_unsigned_int -eq 4; then
1089 UINT32_T='unsigned int'
1091 elif test $ac_cv_sizeof_unsigned_long -eq 4; then
1092 UINT32_T='unsigned long'
1095 AC_MSG_RESULT($UINT32_T)
1099 AC_MSG_CHECKING(for signed 64-bit type)
1102 if test $ac_cv_sizeof_signed_long -eq 8; then
1103 INT64_T='signed long'
1105 elif test $ac_cv_sizeof_signed_long_long -eq 8; then
1106 INT64_T='signed long long'
1109 case "${host_os}" in
1114 AC_MSG_RESULT($INT64_T)
1118 AC_MSG_CHECKING(for unsigned 64-bit type)
1121 if test $ac_cv_sizeof_unsigned_long -eq 8; then
1122 UINT64_T='unsigned long'
1124 elif test $ac_cv_sizeof_unsigned_long_long -eq 8; then
1125 UINT64_T='unsigned long long'
1128 case "${host_os}" in
1133 AC_MSG_RESULT($UINT64_T)
1137 AC_MSG_CHECKING(for unsigned maximum type)
1140 if test "$UINT64_T" != 'none'; then
1143 elif test "$UINT32_T" != 'none'; then
1147 AC_MSG_RESULT($UINTMAX_T)
1151 AC_MSG_CHECKING(for pointer difference type)
1154 if test $ac_cv_sizeof_unsigned_long -eq $ac_cv_sizeof_unsigned_intp; then
1155 UINTPTR_T='unsigned long'
1157 elif test $ac_cv_sizeof_unsigned_long_long -eq $ac_cv_sizeof_unsigned_intp; then
1158 UINTPTR_T='unsigned long long'
1161 AC_MSG_RESULT($UINTPTR_T)
1165 AC_MSG_CHECKING([whether our compiler supports __func__])
1167 [{ const char *func = __func__; return(func != 0 ? 0 : 1); }],
1168 AC_MSG_RESULT([yes]),
1170 AC_MSG_CHECKING([whether our compiler supports __FUNCTION__])
1172 [{ const char *func = __FUNCTION__; return(func != 0 ? 0 : 1); }],
1173 AC_MSG_RESULT([yes])
1174 AC_DEFINE(__func__, __FUNCTION__,
1175 [Define to appropriate substitue if compiler does not have __func__]),
1177 AC_DEFINE(__func__, __FILE__,
1178 [Define to appropriate substitue if compiler does not have __func__])))
1182 # Check for functions
1185 AC_FUNC_CLOSEDIR_VOID
1189 AC_FUNC_SELECT_ARGTYPES
1190 AC_FUNC_SETVBUF_REVERSED
1200 AC_CHECK_LIB(m,sqrt,MATH_LIBS="-lm",,)
1201 LIBS="$MATH_LIBS $LIBS"
1205 # Find socket library
1207 AC_SEARCH_LIBS(gethostbyname, resolv nsl)
1208 AC_SEARCH_LIBS(socket, socket,
1210 AC_DEFINE([HAVE_SOCKET],[1],[Define to 1 if you have socket support.])
1211 MAGICK_FEATURES="DPC $MAGICK_FEATURES"
1214 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])
1217 # Check for clock_gettime().
1219 AC_SEARCH_LIBS(clock_gettime, rt,
1221 AC_DEFINE([HAVE_CLOCK_GETTIME],[1],[Define to 1 if you have clock_gettime.])
1222 AC_MSG_CHECKING([whether clock_gettime supports CLOCK_REALTIME])
1225 [[#include <time.h>]],
1226 [[clockid_t clockType = CLOCK_REALTIME;]])],
1229 AC_DEFINE([HAVE_CLOCK_REALTIME],[1],
1230 [Define to 1 if clock_gettime supports CLOCK_REALTIME.])
1236 AC_CHECK_FUNCS([gettimeofday ftime], [break])
1242 # Check for function prototypes
1246 AC_CHECK_DECLS([pread, pwrite],[],[],[
1247 #include <unistd.h>])
1249 AC_CHECK_DECLS([strlcpy],[],[],[
1250 #include <strings.h>])
1252 AC_CHECK_DECLS([vsnprintf],[],[],[
1254 #include <stdarg.h>])
1258 # C++ Support Tests (For Magick++)
1261 have_magick_plus_plus='no'
1262 if test "$with_magick_plus_plus" = 'yes'; then
1267 # Full set of headers used...
1268 # algorithm cctype cerrno cmath cstdio cstdlib cstring ctime exception
1269 # functional iomanip iosfwd iostream iterator list string strstream utility
1274 AX_CXX_NAMESPACE_STD
1275 AC_CXX_HAVE_STD_LIBS
1279 AC_MSG_CHECKING([whether C++ compiler is sufficient for Magick++])
1281 test $ax_cv_cxx_bool = 'yes' && \
1282 test $ax_cv_cxx_namespaces = 'yes' && \
1283 test $ac_cv_cxx_have_std_libs = 'yes' && \
1284 test $ax_cv_cxx_have_std_namespace = 'yes'; then
1285 have_magick_plus_plus='yes'
1287 have_magick_plus_plus='no (failed tests)'
1289 AC_MSG_RESULT([$have_magick_plus_plus])
1292 AM_CONDITIONAL(WITH_MAGICK_PLUS_PLUS, test "$have_magick_plus_plus" = 'yes')
1294 # Only check for delegate libraries in subdirectories if requested.
1295 if test "$enable_delegate_build" != 'no'; then
1296 # Check for delegate sub-directories and add -I & -L options as required.
1297 # This presumes that delegates are installed as detailed in the ImageMagick
1298 # README. If delegates are installed in a standard location where the
1299 # compiler will automatically find them then these options should not be
1303 # Most delegates have includes in the same directory as the library, but not all...
1306 for dir in bzlib fftw fpx gslib/src jp2 jp2/src/libjasper/include jbig/libjbig jpeg lcms/include lzma magick mupdf openjp2/include png tiff/libtiff ttf/include wand webp/src wmf/include xml/include zlib; do
1307 if test -d "$builddir/$dir"; then
1308 CPPFLAGS="$CPPFLAGS -I$builddir/$dir"
1310 if test -d "$srcdirfull/$dir"; then
1311 CPPFLAGS="$CPPFLAGS -I$srcdirfull/$dir"
1317 for dir in bzlib fftw fpx gslib/src jp2 jp2/src/libjasper jbig/libjbig jpeg lcms/src lzma magick mupdf openjp2 png tiff/libtiff ttf/objs wand webp wmf/src xml zlib; do
1318 if test -d "$builddir/$dir/.libs"; then
1319 LDFLAGS="$LDFLAGS -L$builddir/$dir/.libs"
1321 if test -d "$srcdirfull/$dir/.libs"; then
1322 LDFLAGS="$LDFLAGS -L$srcdirfull/$dir/.libs"
1325 if test -d "$builddir/$dir"; then
1326 LDFLAGS="$LDFLAGS -L$builddir/$dir"
1328 if test -d "$srcdirfull/$dir"; then
1329 LDFLAGS="$LDFLAGS -L$srcdirfull/$dir"
1335 # Assume that delegate headers reside under same directory as ImageMagick
1336 # installation prefix.
1337 MAGICK_CPPFLAGS="-I$INCLUDE_DIR/${PACKAGE_NAME}-$MAGICK_MAJOR_VERSION $MAGICK_CPPFLAGS"
1340 # Find the X11 RGB database
1342 AC_CACHE_CHECK(for X11 configure files,im_cv_x_configure,
1343 [# Look for the header file in a standard set of common directories.
1344 # Check X11 before X11Rn because it is often a symlink to the current release.
1353 /usr/XFree86/lib/X11 \
1361 /usr/local/X11/lib \
1362 /usr/local/X11R4/lib \
1363 /usr/local/X11R5/lib \
1364 /usr/local/X11R6/lib \
1366 /usr/local/lib/X11 \
1367 /usr/local/lib/X11R4 \
1368 /usr/local/lib/X11R5 \
1369 /usr/local/lib/X11R6 \
1370 /usr/local/lib/X11R7 \
1371 /usr/local/x11r5/lib \
1372 /usr/lpp/Xamples/lib \
1374 /usr/openwin/share/lib \
1375 /usr/unsupported/lib \
1378 if test -f "$ac_dir/X11/rgb.txt"; then
1379 im_cv_x_configure="$ac_dir/X11/"
1381 elif test -f "$ac_dir/rgb.txt"; then
1382 im_cv_x_configure="$ac_dir/"
1387 X11_CONFIGURE_PATH="$im_cv_x_configure"
1388 case "${build_os}" in
1390 X11ConfigurePath=`$WinPathScript "$X11ConfigurePath=" 1`
1393 AC_DEFINE_UNQUOTED(X11_CONFIGURE_PATH,"$X11ConfigurePath",[Location of X11 configure files])
1396 # Find OpenMP library
1399 if test "$enable_openmp" != 'no'; then
1400 if test "${GCC}" = "yes"; then
1401 # Open64 (passes for GCC but uses different OpenMP implementation)
1402 if test "x$GOMP_LIBS" = x ; then
1403 if $CC --version 2>&1 | grep Open64 > /dev/null ; then
1404 AC_CHECK_LIB(openmp,omp_get_num_procs,GOMP_LIBS="-lopenmp",,)
1408 if test "x$GOMP_LIBS" = x ; then
1409 AC_CHECK_LIB(gomp,GOMP_parallel_start,GOMP_LIBS="-lgomp",,)
1413 if test "x$GOMP_LIBS" = x ; then
1414 AC_CHECK_LIB(mtsk,sunw_mp_register_warn,GOMP_LIBS="-lmtsk",,)
1417 if test "x$GOMP_LIBS" = x ; then
1418 AC_CHECK_LIB(xlsmp,_xlsmpFlush,GOMP_LIBS="-lxlsmp",,)
1420 # SGI IRIX 6.5 MIPSpro C/C++
1421 if test "x$GOMP_LIBS" = x ; then
1422 AC_CHECK_LIB(mp,mp_destroy,GOMP_LIBS="-lmp",,)
1425 LIBS="$GOMP_LIBS $LIBS"
1436 if test "$with_umem" != 'no'; then
1437 AC_MSG_CHECKING(for UMEM support )
1441 AC_CHECK_HEADER(umem.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1442 AC_CHECK_LIB(umem,umem_alloc,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1443 AC_CHECK_LIB(umem,umem_free,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1444 AC_MSG_CHECKING(if umem memory allocation library is complete)
1445 if test $passed -gt 0; then
1446 if test $failed -gt 0; then
1447 AC_MSG_RESULT(no -- some components failed test)
1448 have_umem='no (failed tests)'
1451 LIBS="$UMEM_LIBS $LIBS"
1452 AC_DEFINE(HasUMEM,1,Define if you have umem memory allocation library)
1460 AM_CONDITIONAL(HasUMEM, test "$have_umem" = 'yes')
1464 # Add support for ccmalloc memory debugging library if requested
1468 if test "$enable_ccmalloc" = 'yes'; then
1469 AC_PATH_PROG(CCMALLOCDelegate,ccmalloc,)
1470 if test -n "$CCMALLOCDelegate"; then
1471 eval `grep PREFIX= $CCMALLOCDelegate | sed -e 's/PREFIX/CCMALLOC_PREFIX/'`
1473 # Assume that gcc is used with ccmalloc.
1474 LIBS="$LIBS $CCMALLOC_PREFIX/lib/ccmalloc-gcc.o"
1475 AC_CHECK_LIB(ccmalloc,ccmalloc_malloc,CCMALLOC_LIBS="$CCMALLOC_PREFIX/lib/ccmalloc-gcc.o -lccmalloc -ldl",,-ldl)
1476 if test -n "$CCMALLOC_LIBS"; then
1478 LIBS="$LIBS $CCMALLOC_LIBS"
1487 # Add support for 'huge pages' if requested
1489 AS_IF([test "x$enable_hugepages" != "xno"],[
1490 AC_DEFINE(HAVE_HUGEPAGES, 1, [Compile with hugepage support])
1494 # Add support for efence memory debugging library if requested
1496 if test "$enable_efence" = 'yes'; then
1497 EFENCE_LIBS='-lefence'
1498 LIBS="$EFENCE_LIBS $LIBS"
1501 dnl ===========================================================================
1507 AC_ARG_WITH([bzlib],
1508 [AC_HELP_STRING([--without-bzlib],
1509 [disable BZLIB support])],
1510 [with_bzlib=$withval],
1513 if test "$with_bzlib" != 'yes'; then
1514 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-bzlib=$with_bzlib "
1518 if test "$with_bzlib" != 'no'; then
1520 AC_MSG_RESULT([-------------------------------------------------------------])
1521 AC_MSG_CHECKING([for BZLIB])
1526 AC_CHECK_HEADER(bzlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1527 AC_CHECK_LIB(bz2,BZ2_bzDecompress,found_libbz=`expr $found_libbz + 1`,,)
1528 if test "$native_win32_build" = 'yes'; then
1529 AC_CHECK_LIB(bz2,_imp__BZ2_decompress,found_libbz=`expr $found_libbz + 1`,,)
1531 if test $found_libbz -gt 0; then
1532 passed=`expr $passed + 1`
1534 failed=`expr $failed + 1`
1536 AC_MSG_CHECKING(if BZLIB package is complete)
1537 if test $passed -gt 0; then
1538 if test $failed -gt 0; then
1539 AC_MSG_RESULT(no -- some components failed test)
1540 have_bzlib='no (failed tests)'
1543 LIBS="$BZLIB_LIBS $LIBS"
1544 AC_DEFINE(BZLIB_DELEGATE,1,Define if you have the bzip2 library)
1552 AM_CONDITIONAL(BZLIB_DELEGATE, test "$have_bzlib" = 'yes')
1553 AC_SUBST(BZLIB_LIBS)
1556 # Find the X11 include and library directories.
1563 if test "$no_x" != 'yes'; then
1564 AC_MSG_RESULT([-------------------------------------------------------------])
1565 AC_MSG_CHECKING([for X11])
1567 LDFLAGS="$LDFLAGS $X_LIBS"
1568 X11_LIBS="$X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
1569 LIBS="$X11_LIBS $LIBS"
1570 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1572 AC_DEFINE(X11_DELEGATE,1,Define if you have X11 library)dnl
1575 # Check for X11 shared memory extension
1577 # shmctl is required to support the shared memory extension
1578 AC_CHECK_FUNC([shmctl],[have_shmctl='yes'],[])
1579 if test "$have_shmctl" != 'yes'; then
1581 LIBS="$LIBS -lcygipc"
1582 AC_TRY_LINK_FUNC([shmctl],[have_shmctl='yes'; IPC_LIBS='-lcygipc'],[])
1586 if test "$have_shmctl" = 'yes'; then
1587 AC_CHECK_LIB([Xext],[XShmAttach],[XEXT_LIBS='-lXext' ; AC_DEFINE(HAVE_SHARED_MEMORY,1,X11 server supports shared memory extension)],[],[])
1591 # Check for X11 shape extension
1593 AC_CHECK_LIB([Xext],[XShapeCombineMask],[XEXT_LIBS='-lXext' ; AC_DEFINE(HAVE_SHAPE,1,X11 server supports shape extension)],[],[])
1594 AC_CHECK_LIB(Xt,XtSetEventDispatcher,XT_LIBS='-lXt',,)
1595 LIBS="$XEXT_LIBS $XT_LIBS $LIBS"
1597 if test "$no_x" != 'yes'; then
1602 AM_CONDITIONAL(X11_DELEGATE, test "$have_x" = 'yes')
1606 dnl ===========================================================================
1612 [AC_HELP_STRING([--without-zlib],
1613 [disable ZLIB support])],
1614 [with_zlib=$withval],
1617 if test "$with_zlib" != 'yes'; then
1618 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-zlib=$with_zlib "
1623 dnl PNG requires zlib so enable zlib check if PNG is requested
1624 if test "$with_zlib" != 'no' || test "$with_png" != 'no'; then
1625 AC_MSG_RESULT([-------------------------------------------------------------])
1626 AC_MSG_CHECKING([for ZLIB])
1631 AC_CHECK_HEADER(zconf.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1632 AC_CHECK_HEADER(zlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1633 AC_CHECK_LIB(z,compress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1634 AC_CHECK_LIB(z,uncompress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1635 AC_CHECK_LIB(z,deflate,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1636 AC_CHECK_LIB(z,inflate,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1637 AC_CHECK_LIB(z,gzseek,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1638 AC_CHECK_LIB(z,gztell,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1639 AC_MSG_CHECKING([if ZLIB package is complete])
1640 if test $passed -gt 0; then
1641 if test $failed -gt 0; then
1642 AC_MSG_RESULT([no -- some components failed test])
1643 have_zlib='no (failed tests)'
1646 LIBS="$ZLIB_LIBS $LIBS"
1647 AC_DEFINE(ZLIB_DELEGATE,1,Define if you have zlib compression library)
1648 AC_MSG_RESULT([yes])
1655 AM_CONDITIONAL(ZLIB_DELEGATE, test "$have_zlib" = 'yes')
1658 # whether modules are built or not.
1662 if test "$build_modules" != 'no' ; then
1663 AC_MSG_RESULT([-------------------------------------------------------------])
1664 AC_MSG_CHECKING([for libltdl])
1668 AC_CHECK_HEADER([ltdl.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
1669 AC_CHECK_LIB([ltdl],[lt_dlinit],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
1670 AC_MSG_CHECKING([if libltdl package is complete])
1671 if test $passed -gt 0 ; then
1672 if test $failed -gt 0 ; then
1673 AC_MSG_RESULT([no -- some components failed test])
1674 have_ltdl='no (failed tests)'
1677 LIBS="$LTDL_LIBS $LIBS"
1678 AC_DEFINE(LTDL_DELEGATE,1,[Define if using libltdl to support dynamically loadable modules])
1679 AC_MSG_RESULT([yes])
1685 if test "$have_ltdl" != 'yes' ; then
1686 AC_MSG_FAILURE([libltdl is required for modules build],[1])
1689 AM_CONDITIONAL(WITH_LTDL, test "$have_ltdl" != 'no')
1692 # If profiling, then check for -ldl and dlopen (required for Solaris & gcc)
1695 if test "$enable_profiling" = 'yes'; then
1696 AC_CHECK_LIB(dl,dlopen,LIB_DL='-ldl',,)
1697 LIBS="$LIB_DL $LIBS"
1701 dnl ===========================================================================
1704 # Check for Autotrace delegate library.
1706 AC_ARG_WITH([autotrace],
1707 [AC_HELP_STRING([--with-autotrace],
1708 [enable autotrace support])],
1709 [with_autotrace=$withval],
1710 [with_autotrace='no'])
1712 if test "$with_autotrace" != 'yes'; then
1713 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-autotrace=$with_autotrace "
1720 if test "x$with_autotrace" = "xyes"; then
1721 AC_MSG_RESULT([-------------------------------------------------------------])
1722 PKG_CHECK_MODULES(AUTOTRACE,[autotrace >= 0.31.1], have_autotrace=yes, have_autotrace=no)
1726 if test "$have_autotrace" = 'yes'; then
1728 AC_DEFINE(AUTOTRACE_DELEGATE,1,Define if you have AUTOTRACE library)
1729 if test "$build_modules" = 'no'; then
1730 CPPFLAGS="$AUTOTRACE_CFLAGS $CPPFLAGS"
1734 AM_CONDITIONAL(AUTOTRACE_DELEGATE,test "$have_autotrace" = 'yes')
1735 AC_SUBST(AUTOTRACE_CFLAGS)
1736 AC_SUBST(AUTOTRACE_LIBS)
1738 dnl ===========================================================================
1741 # Check for Display Postscript delegate library.
1744 [AC_HELP_STRING([--without-dps],
1745 [disable Display Postscript support])],
1746 [with_dps=$withval],
1749 if test "$with_dps" != 'yes'; then
1750 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-dps=$with_dps "
1755 if test "$with_dps" != 'no' && test "$with_x" != 'no'; then
1756 AC_MSG_RESULT([-------------------------------------------------------------])
1757 AC_MSG_CHECKING([for DPS])
1761 PERSIST_CPPFLAGS="$CPPFLAGS"
1762 CPPFLAGS="$CPPFLAGS -I${ac_x_includes}/X11"
1763 AC_CHECK_HEADER(DPS/dpsXclient.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1765 # XFree86-4.x needs -lXt to provide XtMalloc for -ldps.
1766 # Cygwin doesn't deliver -lXt as a DLL, which prevents a DLL build.
1767 # Adobe DPS (as delivered on Solaris) doesn't require -lXt.
1768 # ImageMagick itself doesn't use -lXt.
1771 AC_CHECK_LIB(dps,DPSInitialize,have_libdps='yes',have_libdps='no',)
1772 if test "$have_libdps" != 'yes'; then
1773 # Unset cache variable so we can try again.
1774 unset ac_cv_lib_dps_DPSInitialize
1775 AC_CHECK_LIB(dps,DPSInitialize,have_libdps='yes',have_libdps='no',-lXt)
1776 if test "$have_libdps" = 'yes'; then
1780 if test "$have_libdps" = 'yes'; then
1781 passed=`expr $passed + 1`
1783 failed=`expr $failed + 1`
1785 AC_CHECK_LIB(dpstk,XDPSPixelsPerPoint,passed=`expr $passed + 1`,failed=`expr $failed + 1`,-ldps $LIBDPS_XT)
1786 AC_MSG_CHECKING([if DPS package is complete])
1787 if test $passed -gt 0; then
1788 if test $failed -gt 0; then
1789 AC_MSG_RESULT([no -- some components failed test])
1790 have_dps='no (failed tests)'
1791 CPPFLAGS="$PERSIST_CPPFLAGS"
1793 DPS_LIBS="-ldpstk -ldps ${LIBDPS_XT}"
1794 LIBS="$DPS_LIBS $LIBS"
1795 AC_DEFINE(DPS_DELEGATE,1,Define if you have Display Postscript)
1796 AC_MSG_RESULT([yes])
1801 CPPFLAGS=$PERSIST_CPPFLAGS
1804 AM_CONDITIONAL(DPS_DELEGATE, test "$have_dps" = 'yes')
1807 dnl ===========================================================================
1810 # Check for DJVU delegate library.
1813 [AC_HELP_STRING([--without-djvu],
1814 [disable DjVu support])],
1815 [with_djvu=$withval],
1818 if test "$with_djvu" != 'yes'; then
1819 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-djvu=$with_djvu "
1824 if test "$with_djvu" != 'no'; then
1825 AC_MSG_RESULT([-------------------------------------------------------------])
1826 AC_MSG_CHECKING([for DJVU])
1830 AC_CHECK_HEADER(libdjvu/ddjvuapi.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1831 AC_CHECK_LIB(djvulibre,ddjvu_context_create,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1832 AC_MSG_CHECKING([if DJVU package is complete])
1833 if test $passed -gt 0; then
1834 if test $failed -gt 0; then
1835 AC_MSG_RESULT([no -- some components failed test])
1836 have_djvu='no (failed tests)'
1838 DJVU_LIBS='-ldjvulibre'
1839 LIBS="$DJVU_LIBS $LIBS"
1840 AC_DEFINE(DJVU_DELEGATE,1,Define if you have DJVU library)
1841 AC_MSG_RESULT([yes])
1848 AM_CONDITIONAL(DJVU_DELEGATE, test "$have_djvu" = 'yes')
1851 dnl ===========================================================================
1854 # Set DejaVu font directory.
1856 AC_ARG_WITH([dejavu-font-dir],
1857 [AC_HELP_STRING([--with-dejavu-font-dir=DIR],
1858 [DejaVu font directory])],
1859 [with_dejavu_font_dir=$withval],
1860 [with_dejavu_font_dir='default'])
1862 if test "$with_dejavu_font_dir" != 'default'; then
1863 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-dejavu-font-dir=$with_dejavu_font_dir "
1866 dnl ===========================================================================
1869 # Check for FFTW delegate library.
1872 [AC_HELP_STRING([--without-fftw],
1873 [disable FFTW support])],
1874 [with_fftw=$withval],
1877 if test "$with_fftw" != 'yes'; then
1878 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fftw=$with_fftw "
1883 if test "$with_fftw" != 'no'; then
1884 AC_MSG_RESULT([-------------------------------------------------------------])
1885 AC_MSG_CHECKING([for FFTW])
1889 AC_CHECK_HEADER(fftw3.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1890 AC_CHECK_LIB(fftw3,fftw_execute,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1891 AC_MSG_CHECKING([if FFTW package is complete])
1892 if test $passed -gt 0; then
1893 if test $failed -gt 0; then
1894 AC_MSG_RESULT([no -- some components failed test])
1895 have_fftw='no (failed tests)'
1898 LIBS="$FFTW_LIBS $LIBS"
1899 AC_DEFINE(FFTW_DELEGATE,1,Define if you have FFTW library)
1900 AC_MSG_RESULT([yes])
1907 AM_CONDITIONAL(FFTW_DELEGATE, test "$have_fftw" = 'yes')
1910 dnl ===========================================================================
1913 # Check for FlashPIX delegate library.
1916 [AC_HELP_STRING([--without-fpx],
1917 [disable FlashPIX support])],
1918 [with_fpx=$withval],
1921 if test "$with_fpx" != 'yes'; then
1922 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fpx=$with_fpx "
1928 LIBS=${LIBS/-ldjvulibre/}
1929 if test "$with_fpx" != 'no'; then
1930 AC_MSG_RESULT([-------------------------------------------------------------])
1931 AC_MSG_CHECKING([for FlashPIX])
1936 AC_CHECK_HEADER(fpxlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1937 AC_CHECK_LIB(fpx,FPX_OpenImageByFilename,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1939 AC_MSG_CHECKING([if FlashPIX package is complete])
1940 if test $passed -gt 0; then
1941 if test $failed -gt 0; then
1942 AC_MSG_RESULT([no -- some components failed test])
1943 have_fpx='no (failed tests)'
1946 AC_DEFINE(FPX_DELEGATE,1,Define if you have FlashPIX library)
1947 AC_MSG_RESULT([yes])
1955 AM_CONDITIONAL(FPX_DELEGATE, test "$have_fpx" = 'yes')
1959 dnl ===========================================================================
1962 # Check for fontconfig delegate library.
1964 AC_ARG_WITH([fontconfig],
1965 [AC_HELP_STRING([--without-fontconfig],
1966 [disable fontconfig support])],
1967 [with_fontconfig=$withval],
1968 [with_fontconfig='yes'])
1970 if test "$with_fontconfig" != 'yes'; then
1971 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontconfig=$with_fontconfig "
1974 have_fontconfig='no'
1975 FONTCONFIG_CFLAGS=""
1978 if test "x$with_fontconfig" = "xyes"; then
1979 AC_MSG_RESULT([-------------------------------------------------------------])
1980 PKG_CHECK_MODULES(FONTCONFIG,[fontconfig >= 2.1.0], have_fontconfig=yes, have_fontconfig=no)
1984 if test "$have_fontconfig" = 'yes'; then
1985 AC_DEFINE(FONTCONFIG_DELEGATE,1,Define if you have FONTCONFIG library)
1986 if test "$build_modules" = 'no'; then
1987 CPPFLAGS="$FONTCONFIG_CFLAGS $CPPFLAGS"
1991 AM_CONDITIONAL(FONTCONFIG_DELEGATE,test "$have_fontconfig" = 'yes')
1992 AC_SUBST(FONTCONFIG_CFLAGS)
1993 AC_SUBST(FONTCONFIG_LIBS)
1995 dnl ===========================================================================
1998 # Check for the Freetype delegate library.
2000 AC_ARG_WITH([freetype],
2001 [AC_HELP_STRING([--without-freetype],
2002 [disable Freetype support])],
2003 [with_freetype=$withval],
2004 [with_freetype='yes'])
2006 if test "$with_freetype" != 'yes'; then
2007 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-freetype=$with_freetype "
2014 if test "x$with_freetype" = "xyes"; then
2015 AC_MSG_RESULT([-------------------------------------------------------------])
2016 PKG_CHECK_MODULES(FREETYPE,[freetype2], have_freetype=yes, have_freetype=no)
2020 if test "$have_freetype" = 'yes'; then
2021 AC_DEFINE(FREETYPE_DELEGATE,1,Define if you have FREETYPE library)
2022 CFLAGS="$FREETYPE_CFLAGS $CFLAGS"
2025 AM_CONDITIONAL(FREETYPE_DELEGATE, test "$have_freetype" = 'yes')
2026 AC_SUBST(FREETYPE_CFLAGS)
2027 AC_SUBST(FREETYPE_LIBS)
2029 dnl ===========================================================================
2032 # Check for Ghostscript library or framework.
2034 # Test for iapi.h & test for gsapi_new_instance in -lgs
2035 # or -framework Ghostscript
2037 AC_ARG_WITH([gslib],
2038 [AC_HELP_STRING([--with-gslib],
2039 [enable Ghostscript library support])],
2040 [with_gslib=$withval],
2043 gslib_framework='no'
2044 if test "$with_gslib" != 'yes'; then
2045 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gslib=$with_gslib "
2050 if test "$with_gslib" != 'no'; then
2051 AC_MSG_RESULT([-------------------------------------------------------------])
2052 AC_MSG_CHECKING([for Ghostscript])
2057 AC_CHECK_HEADER(ghostscript/iapi.h,passed=`expr $passed + 1`,
2058 failed=`expr $failed + 1`,)
2059 AC_CHECK_HEADER(ghostscript/ierrors.h,passed=`expr $passed + 1`,
2060 failed=`expr $failed + 1`,)
2061 AC_CHECK_FRAMEWORK(Ghostscript,gsapi_new_instance,framework=`expr $framework + 1`,
2062 AC_CHECK_LIB(gs,gsapi_new_instance,passed=`expr $passed + 1`,failed=`expr $failed + 1`,),)
2063 AC_MSG_CHECKING([if Ghostscript package is complete])
2064 if test $passed -gt 0; then
2065 if test $failed -gt 0; then
2066 AC_MSG_RESULT([no -- some components failed test])
2067 have_gslib='no (failed tests)'
2069 if test $framework -gt 0; then
2070 GS_LIBS='-framework Ghostscript'
2071 gslib_framework='yes'
2072 AC_MSG_RESULT([yes, using framework.])
2074 AC_MSG_RESULT([yes, using library.])
2077 LIBS="$GS_LIBS $LIBS"
2078 AC_DEFINE(GS_DELEGATE,1,Define if you have Ghostscript library or framework)
2085 AM_CONDITIONAL(GS_DELEGATE, test "$have_gslib" = 'yes')
2088 # Set default font search path
2089 AC_ARG_WITH([fontpath],
2090 [AC_HELP_STRING([--with-fontpath=DIR],
2091 [prepend to default font search path])],
2092 [with_fontpath=$withval],
2095 if test "$with_fontpath" != "yes" && test -z "$with_fontpath"; then
2098 AC_DEFINE_UNQUOTED(MAGICK_FONT_PATH,"$with_fontpath",[Define to prepend to default font search path.])
2100 if test "$with_fontpath=" != ''; then
2101 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontpath=$with_fontpath "
2104 # Set Ghostscript font directory
2105 AC_ARG_WITH([gs-font-dir],
2106 [AC_HELP_STRING([--with-gs-font-dir=DIR],
2107 [Ghostscript font directory])],
2108 [with_gs_font_dir=$withval],
2109 [with_gs_font_dir='default'])
2111 if test "$with_gs_font_dir" != 'default'; then
2112 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gs-font-dir=$with_gs_font_dir "
2115 dnl ===========================================================================
2118 # Check for GVC delegate library.
2121 [AC_HELP_STRING([--with-gvc],
2122 [enable GVC support])],
2123 [with_gvc=$withval],
2126 if test "$with_gvc" != 'yes'; then
2127 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gvc=$with_gvc "
2131 if test "x$with_gvc" = "xyes"; then
2132 AC_MSG_RESULT([-------------------------------------------------------------])
2133 PKG_CHECK_MODULES(GVC,[libgvc >= 2.9.0], have_gvc=yes, have_gvc=no)
2137 if test "$have_gvc" = 'yes'; then
2138 AC_DEFINE(GVC_DELEGATE,1,Define if you have GVC library)
2139 if test "$build_modules" = 'no'; then
2140 CPPFLAGS="$GVC_CFLAGS $CPPFLAGS"
2144 AM_CONDITIONAL(GVC_DELEGATE, test "$have_gvc" = 'yes')
2145 AC_SUBST(GVC_CFLAGS)
2148 dnl ===========================================================================
2151 # Check for JBIG delegate library.
2155 [AC_HELP_STRING([--without-jbig],
2156 [disable JBIG support])],
2157 [with_jbig=$withval],
2162 if test "$with_jbig" != 'no'; then
2163 AC_MSG_RESULT([-------------------------------------------------------------])
2164 AC_MSG_CHECKING([for JBIG])
2168 AC_CHECK_HEADER(jbig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2169 AC_CHECK_LIB(jbig,jbg_dec_init,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2170 AC_MSG_CHECKING([if JBIG package is complete])
2171 if test $passed -gt 0; then
2172 if test $failed -gt 0; then
2173 AC_MSG_RESULT([no -- some components failed test])
2174 have_jbig='no (failed tests)'
2177 LIBS="$JBIG_LIBS $LIBS"
2178 AC_DEFINE(JBIG_DELEGATE,1,Define if you have JBIG library)
2179 AC_MSG_RESULT([yes])
2186 AM_CONDITIONAL(JBIG_DELEGATE, test "$have_jbig" = 'yes')
2189 dnl ===========================================================================
2192 # Check for JPEG delegate library.
2195 [AC_HELP_STRING([--without-jpeg],
2196 [disable JPEG support])],
2197 [with_jpeg=$withval],
2200 if test "$with_jpeg" != 'yes'; then
2201 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jpeg=$with_jpeg "
2206 if test "$with_jpeg" != 'no'; then
2207 AC_MSG_RESULT([-------------------------------------------------------------])
2208 AC_MSG_CHECKING([for JPEG])
2212 AC_CHECK_HEADER(jconfig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2213 AC_CHECK_HEADER(jerror.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2214 AC_CHECK_HEADER(jmorecfg.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2215 AC_CHECK_HEADER(jpeglib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2216 AC_CHECK_LIB(jpeg,jpeg_read_header,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2218 # Test for compatible JPEG library
2219 if test "$ac_cv_jpeg_version_ok" != 'yes'; then
2220 AC_CACHE_CHECK(for JPEG library is version 6b or later, ac_cv_jpeg_version_ok,
2224 #include <jpeglib.h>
2226 changequote(<<, >>)dnl
2228 #if JPEG_LIB_VERSION < 62
2229 #error IJG JPEG library must be version 6b or newer!
2233 changequote([, ])dnl
2234 ac_cv_jpeg_version_ok='yes'; passed=`expr $passed + 1`,
2235 ac_cv_jpeg_version_ok='no'; failed=`expr $failed + 1`)])
2237 AC_MSG_CHECKING([if JPEG package is complete])
2238 if test $passed -gt 0; then
2239 if test $failed -gt 0; then
2240 AC_MSG_RESULT([no -- some components failed test])
2241 have_jpeg='no (failed tests)'
2244 LIBS="$JPEG_LIBS $LIBS"
2245 AC_DEFINE(JPEG_DELEGATE,1,Define if you have JPEG library)
2246 AC_MSG_RESULT([yes])
2253 AM_CONDITIONAL(JPEG_DELEGATE, test "$have_jpeg" = 'yes')
2256 dnl ===========================================================================
2259 # Check for LCMS delegate library.
2263 [ --without-lcms disable lcms (v1.1X) support],
2264 [with_lcms=$withval],
2266 if test "$with_lcms" != 'yes' ; then
2267 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lcms=$with_lcms "
2272 [ --without-lcms2 disable lcms (v2.X) support],
2273 [with_lcms2=$withval],
2275 if test "$with_lcms2" != 'yes' ; then
2276 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lcms2=$with_lcms2 "
2281 if test "$with_lcms2" != 'no'; then
2282 AC_MSG_RESULT([-------------------------------------------------------------])
2283 AC_MSG_CHECKING([for LCMS v2])
2287 have_lcms_header='no'
2289 # Check for <lcms2.h>
2290 AC_CHECK_HEADER(lcms2.h,have_lcms_header='yes',,)
2291 if test "$have_lcms_header" = 'yes'; then
2292 AC_DEFINE(HAVE_LCMS2_H,1,Define if you have the <lcms2.h> header file.)
2293 passed=`expr $passed + 1`
2296 # Check for <lcms2/lcms2.h)
2297 if test "$have_lcms_header" != 'yes'; then
2298 AC_CHECK_HEADER(lcms2/lcms2.h,have_lcms_header='yes',,)
2299 if test "$have_lcms_header" = 'yes'; then
2300 passed=`expr $passed + 1`
2301 AC_DEFINE(HAVE_LCMS2_LCMS2_H,1,Define if you have the <lcms2/lcms2.h> header file.)
2305 # Failed to find lcms header?
2306 if test "$have_lcms_header" != 'yes'; then
2307 failed=`expr $failed + 1`
2310 AC_CHECK_LIB(lcms2,cmsSetLogErrorHandler,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2311 AC_MSG_CHECKING(if LCMS v2 package is complete)
2312 if test $passed -gt 0; then
2313 if test $failed -gt 0; then
2314 AC_MSG_RESULT(no -- some components failed test)
2315 have_lcms2='no (failed tests)'
2318 LIBS="$LCMS_LIBS $LIBS"
2328 # Check for LCMS v1 (1.11 or later)
2330 if test $have_lcms2 = 'yes'; then
2335 if test "$with_lcms" != 'no'; then
2336 AC_MSG_RESULT([-------------------------------------------------------------])
2337 AC_MSG_CHECKING([for LCMS v1.1X])
2341 have_lcms_header='no'
2343 # Check for <lcms.h>
2344 if test "$have_lcms_header" != 'yes'; then
2345 AC_CHECK_HEADER(lcms.h,have_lcms_header='yes',,)
2346 if test "$have_lcms_header" = 'yes'; then
2347 passed=`expr $passed + 1`
2348 AC_DEFINE(HAVE_LCMS_H,1,Define if you have the <lcms.h> header file.)
2352 # Check for <lcms/lcms.h>
2353 if test "$have_lcms_header" != 'yes'; then
2354 AC_CHECK_HEADER(lcms/lcms.h,have_lcms_header='yes',,)
2355 if test "$have_lcms_header" = 'yes'; then
2356 passed=`expr $passed + 1`
2357 AC_DEFINE(HAVE_LCMS_LCMS_H,1,Define if you have the <lcms/lcms.h> header file.)
2361 # Failed to find lcms header?
2362 if test "$have_lcms_header" != 'yes'; then
2363 failed=`expr $failed + 1`
2366 AC_CHECK_LIB(lcms,cmsSetErrorHandler,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2367 AC_MSG_CHECKING(if LCMS package is complete)
2368 if test $passed -gt 0; then
2369 if test $failed -gt 0; then
2370 AC_MSG_RESULT(no -- some components failed test)
2371 have_lcms='no (failed tests)'
2374 LIBS="$LCMS_LIBS $LIBS"
2383 AM_CONDITIONAL(LCMS_DELEGATE, test "$have_lcms2" = 'yes' -o "$have_lcms" = 'yes')
2384 if test "$have_lcms2" = 'yes' -o "$have_lcms" = 'yes'; then
2385 AC_DEFINE(LCMS_DELEGATE,1,[Define if you have LCMS (v1.11 or later) library])
2390 dnl ===========================================================================
2393 # Check for the OpenJP2 delegate library.
2395 AC_ARG_WITH([openjp2],
2396 [AC_HELP_STRING([--without-openjp2],
2397 [disable OpenJP2 support])],
2398 [with_openjp2=$withval],
2399 [with_openjp2='yes'])
2401 if test "$with_openjp2" != 'yes'; then
2402 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-openjp2=$with_openjp2 "
2406 LIBOPENJP2_CFLAGS=""
2409 if test "x$with_openjp2" = "xyes"; then
2410 AC_MSG_RESULT([-------------------------------------------------------------])
2411 PKG_CHECK_MODULES(LIBOPENJP2,[libopenjp2 >= 2.0.0], have_openjp2=yes, have_openjp2=no)
2415 if test "$have_openjp2" = 'yes'; then
2416 AC_DEFINE(LIBOPENJP2_DELEGATE,1,Define if you have OPENJP2 library)
2417 if test "$build_modules" = 'no'; then
2418 CFLAGS="$LIBOPENJP2_CFLAGS $CFLAGS"
2422 AM_CONDITIONAL(LIBOPENJP2_DELEGATE, test "$have_openjp2" = 'yes')
2423 AC_SUBST(LIBOPENJP2_CFLAGS)
2424 AC_SUBST(LIBOPENJP2_LIBS)
2427 dnl ===========================================================================
2430 # Check for the LQR (Liquid Rescale) delegate library.
2433 [AC_HELP_STRING([--without-lqr],
2434 [disable Liquid Rescale support])],
2435 [with_lqr=$withval],
2438 if test "$with_lqr" != 'yes'; then
2439 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lqr=$with_lqr "
2446 if test "x$with_lqr" = "xyes"; then
2447 AC_MSG_RESULT([-------------------------------------------------------------])
2448 PKG_CHECK_MODULES(LQR,[lqr-1 >= 0.1.0], have_lqr=yes, have_lqr=no)
2452 if test "$have_lqr" = 'yes'; then
2453 AC_DEFINE(LQR_DELEGATE,1,Define if you have LQR library)
2454 CFLAGS="$LQR_CFLAGS $CFLAGS"
2457 AM_CONDITIONAL(LQR_DELEGATE, test "$have_lqr" = 'yes')
2458 AC_SUBST(LQR_CFLAGS)
2461 dnl ===========================================================================
2463 # Disable LZMA (lzma library)
2465 [ --without-lzma disable LZMA support],
2466 [with_lzma=$withval],
2468 if test "$with_lzma" != 'yes' ; then
2469 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lzma=$with_lzma "
2473 if test "x$with_lzma" = "xyes"; then
2474 AC_MSG_RESULT([-------------------------------------------------------------])
2475 PKG_CHECK_MODULES(LZMA,[liblzma >= 2.9.0], have_lzma=yes, have_lzma=no)
2479 if test "$have_lzma" = 'yes'; then
2480 AC_DEFINE(LZMA_DELEGATE,1,Define if you have LZMA library)
2481 if test "$build_modules" = 'no'; then
2482 CPPFLAGS="$LZMA_CFLAGS $CPPFLAGS"
2486 AM_CONDITIONAL(LZMA_DELEGATE, test "$have_lzma" = 'yes')
2487 AC_SUBST(LZMA_CFLAGS)
2490 dnl ===========================================================================
2493 # Check for MUPDF delegate library.
2496 [AC_HELP_STRING([--with-mupdf],
2497 [enable MUPDF support])],
2498 [with_mupdf=$withval],
2501 if test "$with_mupdf" != 'yes'; then
2502 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-mupdf=$with_mupdf "
2507 if test "$with_mupdf" != 'no'; then
2508 AC_MSG_RESULT([-------------------------------------------------------------])
2509 AC_MSG_CHECKING([for MUPDF])
2513 AC_CHECK_HEADER(mupdf/fitz.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2514 AC_CHECK_LIB(mupdf,fz_new_context,passed=`expr $passed + 1`,failed=`expr $failed + 1`,-lmupdf $FREETYPE_LIBS)
2515 AC_MSG_CHECKING([if MUPDF package is complete])
2516 if test $passed -gt 0; then
2517 if test $failed -gt 0; then
2518 AC_MSG_RESULT([no -- some components failed test])
2519 have_mupdf='no (failed tests)'
2521 MUPDF_LIBS='-lmupdf'
2522 LIBS="$MUPDF_LIBS $LIBS"
2523 AC_DEFINE(MUPDF_DELEGATE,1,Define if you have MUPDF library)
2524 AC_MSG_RESULT([yes])
2531 AM_CONDITIONAL(MUPDF_DELEGATE,test "$have_mupdf" = 'yes')
2532 AC_SUBST(MUPDF_LIBS)
2534 dnl ===========================================================================
2537 # Check for the OpenEXR delegate library.
2539 AC_ARG_WITH([openexr],
2540 [AC_HELP_STRING([--without-openexr],
2541 [disable OpenEXR support])],
2542 [with_openexr=$withval],
2543 [with_openexr='yes'])
2545 if test "$with_openexr" != 'yes'; then
2546 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-openexr=$with_openexr "
2553 if test "x$with_openexr" = "xyes"; then
2554 AC_MSG_RESULT([-------------------------------------------------------------])
2555 PKG_CHECK_MODULES(OPENEXR,[OpenEXR >= 1.0.6], have_openexr=yes, have_openexr=no)
2559 if test "$have_openexr" = 'yes'; then
2560 AC_DEFINE(OPENEXR_DELEGATE,1,Define if you have OPENEXR library)
2561 if test "$build_modules" = 'no'; then
2562 CFLAGS="$OPENEXR_CFLAGS $CFLAGS"
2566 AM_CONDITIONAL(OPENEXR_DELEGATE, test "$have_openexr" = 'yes')
2567 AC_SUBST(OPENEXR_CFLAGS)
2568 AC_SUBST(OPENEXR_LIBS)
2570 dnl ===========================================================================
2573 # Check for PANGO delegate library.
2575 AC_ARG_WITH([pango],
2576 [AC_HELP_STRING([--without-pango],
2577 [disable PANGO support])],
2578 [with_pango=$withval],
2581 if test "$with_pango" != 'yes'; then
2582 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-pango=$with_pango "
2586 have_pangocairo='no'
2590 if test "x$with_pango" = "xyes"; then
2591 AC_MSG_RESULT([-------------------------------------------------------------])
2592 PKG_CHECK_MODULES(PANGO, [pangocairo >= 1.28.1], have_pangocairo=yes, have_pangocairo=no)
2594 PKG_CHECK_MODULES(PANGO, [pango >= 1.28.1], have_pango=yes, have_pango=no)
2598 if test "$have_pango" = 'yes'; then
2599 AC_DEFINE(PANGO_DELEGATE,1,Define if you have PANGO library)
2600 if test "$build_modules" = 'no'; then
2601 CPPFLAGS="$PANGO_CFLAGS $CPPFLAGS"
2605 if test "$have_pangocairo" = 'yes'; then
2606 AC_DEFINE(PANGOCAIRO_DELEGATE,1,Define if you have PANGOCAIRO library)
2607 if test "$build_modules" = 'no'; then
2608 CPPFLAGS="$PANGOCAIRO_CFLAGS $CPPFLAGS"
2612 AM_CONDITIONAL(PANGO_DELEGATE, test "$have_pango" = 'yes')
2613 AM_CONDITIONAL(PANGOCAIRO_DELEGATE, test "$have_pangocairo" = 'yes')
2614 AC_SUBST(PANGO_CFLAGS)
2615 AC_SUBST(PANGO_LIBS)
2617 dnl ===========================================================================
2620 # Check for PNG delegate library.
2623 [AC_HELP_STRING([--without-png],
2624 [disable PNG support])],
2625 [with_png=$withval],
2628 if test "$with_png" != 'yes'; then
2629 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-png=$with_png "
2635 if test "$with_png" != 'no' -a "$have_zlib" != 'no' ; then
2636 AC_MSG_RESULT([-------------------------------------------------------------])
2637 AC_MSG_CHECKING(for PNG support )
2641 AC_CHECK_HEADER(png.h,passed=`expr $passed + 1`,
2642 failed=`expr $failed + 1`,)
2644 if test $passed -gt 0; then
2645 for var in 7 6 5 4 2 '' ; do
2646 if test "$have_png" = 'no' ; then
2647 if test "x${var}" = 'x' ; then
2653 # Test for compatible LIBPNG library
2656 if test "$with_png" = 'yes' -o "$with_png" = "libpng1${var}" ; then
2657 if test "${pnglib}" != 'png' ; then
2658 AC_MSG_CHECKING(for LIBPNG1${var} support )
2664 changequote(<<, >>)dnl
2666 #if PNG_LIBPNG_VER_MINOR != ${var}
2667 #error LIBPNG library must be version 1${var}!
2672 changequote([, ])dnl
2673 ac_cv_libpng_ok='yes',
2674 ac_cv_libpng_ok='no')
2675 if test "$ac_cv_libpng_ok" = 'yes' ; then
2676 passed=`expr $passed + 1`
2679 failed=`expr $failed + 1`
2683 passed=`expr $passed + 1`
2688 if test $passed -gt 0 -a $failed -le 0; then
2689 if test "1${var}" = '17' ; then
2690 AC_CHECK_LIB(png17,png_get_io_ptr,passed=`expr $passed + 1`,
2691 failed=`expr $failed + 1`,)
2692 AC_CHECK_LIB(png17,png_longjmp,passed=`expr $passed + 1`,
2693 failed=`expr $failed + 1`,)
2695 if test "1${var}" = '16' ; then
2696 AC_CHECK_LIB(png16,png_get_io_ptr,passed=`expr $passed + 1`,
2697 failed=`expr $failed + 1`,)
2698 AC_CHECK_LIB(png16,png_longjmp,passed=`expr $passed + 1`,
2699 failed=`expr $failed + 1`,)
2701 if test "1${var}" = '15' ; then
2702 AC_CHECK_LIB(png15,png_get_io_ptr,passed=`expr $passed + 1`,
2703 failed=`expr $failed + 1`,)
2704 AC_CHECK_LIB(png15,png_longjmp,passed=`expr $passed + 1`,
2705 failed=`expr $failed + 1`,)
2707 if test "1${var}" = '14' ; then
2708 AC_CHECK_LIB(png14,png_get_io_ptr,passed=`expr $passed + 1`,
2709 failed=`expr $failed + 1`,)
2710 AC_CHECK_LIB(png14,png_get_io_state,passed=`expr $passed + 1`,
2711 failed=`expr $failed + 1`,)
2713 if test "1${var}" = '12' ; then
2714 AC_CHECK_LIB(png12,png_get_io_ptr,passed=`expr $passed + 1`,
2715 failed=`expr $failed + 1`,)
2717 if test "1${var}" = '1' ; then
2718 AC_CHECK_LIB(png,png_get_io_ptr,passed=`expr $passed + 1`,
2719 failed=`expr $failed + 1`,)
2721 if test $passed -gt 0 -a $failed -le 0 ; then
2722 AC_MSG_CHECKING(if ${pnglib} package is complete)
2723 if test $passed -gt 0 ; then
2724 if test $failed -gt 0 ; then
2725 AC_MSG_RESULT(no -- some components failed test)
2726 have_png='no (failed tests)'
2728 PNG_LIBS="-l${pnglib}"
2729 LIBS="$PNG_LIBS $LIBS"
2730 AC_DEFINE(PNG_DELEGATE,1,Define if you have PNG library)
2742 AM_CONDITIONAL(PNG_DELEGATE,test "$have_png" = 'yes')
2746 dnl ===========================================================================
2749 # Check for RSVG delegate library.
2752 [AC_HELP_STRING([--with-rsvg],
2753 [enable RSVG support])],
2754 [with_rsvg=$withval],
2757 if test "$with_rsvg" != 'yes'; then
2758 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-rsvg=$with_rsvg "
2766 if test "x$with_rsvg" = "xyes"; then
2767 AC_MSG_RESULT([-------------------------------------------------------------])
2768 PKG_CHECK_MODULES(RSVG,[librsvg-2.0 >= 2.9.0], have_rsvg=yes, have_rsvg=no)
2770 PKG_CHECK_MODULES(CAIRO_SVG, cairo-svg, have_cairo=yes, have_cairo=no)
2774 if test "$have_rsvg" = 'yes'; then
2775 AC_DEFINE(RSVG_DELEGATE,1,Define if you have RSVG library)
2776 if test "$build_modules" = 'no'; then
2777 CPPFLAGS="$RSVG_CFLAGS $CPPFLAGS"
2781 if test "$have_cairo" = 'yes'; then
2782 AC_DEFINE(CAIRO_DELEGATE,1,Define if you have CAIRO library)
2783 if test "$build_modules" = 'no'; then
2784 CPPFLAGS="$CAIRO_SVG_CFLAGS $CPPFLAGS"
2788 AM_CONDITIONAL(RSVG_DELEGATE, test "$have_rsvg" = 'yes')
2789 AM_CONDITIONAL(CAIRO_DELEGATE, test "$have_cairo" = 'yes')
2790 AC_SUBST(RSVG_CFLAGS)
2793 dnl ===========================================================================
2796 # Check for TIFF delegate library.
2799 [AC_HELP_STRING([--without-tiff],
2800 [disable TIFF support])],
2801 [with_tiff=$withval],
2804 if test "$with_tiff" != 'yes'; then
2805 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-tiff=$with_tiff "
2810 if test "$with_tiff" != 'no'; then
2811 AC_MSG_RESULT([-------------------------------------------------------------])
2812 AC_MSG_CHECKING([for TIFF])
2816 AC_CHECK_HEADER(tiff.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2817 AC_CHECK_HEADER(tiffio.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2818 AC_CHECK_LIB(tiff,TIFFOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2819 AC_CHECK_LIB(tiff,TIFFClientOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2820 AC_CHECK_LIB(tiff,TIFFIsByteSwapped,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2821 AC_CHECK_LIB(tiff,TIFFReadRGBATile,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2822 AC_CHECK_LIB(tiff,TIFFReadRGBAStrip,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2823 AC_MSG_CHECKING([if TIFF package is complete])
2824 if test $passed -gt 0; then
2825 if test $failed -gt 0; then
2826 AC_MSG_RESULT([no -- some components failed test])
2827 have_tiff='no (failed tests)'
2830 LIBS="$TIFF_LIBS $LIBS"
2831 AC_DEFINE(TIFF_DELEGATE,1,Define if you have TIFF library)
2832 AC_MSG_RESULT([yes])
2834 AC_CHECK_HEADERS(tiffconf.h)
2835 AC_CHECK_FUNCS([TIFFIsCODECConfigured TIFFMergeFieldInfo \
2836 TIFFIsBigEndian TIFFReadEXIFDirectory TIFFSetErrorHandlerExt \
2837 TIFFSetTagExtender TIFFSetWarningHandlerExt \
2838 TIFFSwabArrayOfTriples])
2844 AM_CONDITIONAL(TIFF_DELEGATE, test "$have_tiff" = 'yes')
2847 dnl ===========================================================================
2850 # Check for WEBP delegate library.
2853 [AC_HELP_STRING([--without-webp],
2854 [disable WEBP support])],
2855 [with_webp=$withval],
2858 if test "$with_webp" != 'yes'; then
2859 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-webp=$with_webp "
2864 if test "$with_webp" != 'no'; then
2865 AC_MSG_RESULT([-------------------------------------------------------------])
2866 AC_MSG_CHECKING([for WEBP])
2870 AC_CHECK_HEADER(webp/decode.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2871 AC_CHECK_LIB(webp,WebPPictureInitInternal,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2872 AC_MSG_CHECKING([if WEBP package is complete])
2873 if test $passed -gt 0; then
2874 if test $failed -gt 0; then
2875 AC_MSG_RESULT([no -- some components failed test])
2876 have_webp='no (failed tests)'
2879 LIBS="$WEBP_LIBS $LIBS"
2880 AC_DEFINE(WEBP_DELEGATE,1,Define if you have WEBP library)
2881 AC_MSG_RESULT([yes])
2888 AM_CONDITIONAL(WEBP_DELEGATE,test "$have_webp" = 'yes')
2891 dnl ===========================================================================
2894 # Set Windows font directory.
2896 AC_ARG_WITH([windows-font-dir],
2897 [AC_HELP_STRING([--with-windows-font-dir=DIR],
2898 [directory containing MS-Windows fonts])],
2899 [with_windows_font_dir=$withval],
2900 [with_windows_font_dir=''])
2901 if test "$with_windows_font_dir" != '' ; then
2902 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-windows-font-dir=$with_windows_font_dir "
2905 dnl ===========================================================================
2908 # Check for WMF delegate library.
2911 [AC_HELP_STRING([--with-wmf],
2912 [enable WMF support])],
2913 [with_wmf=$withval],
2916 if test "$with_wmf" != 'yes'; then
2917 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-wmf=$with_wmf "
2924 if test "$with_wmf" != 'no'; then
2925 AC_MSG_RESULT([-------------------------------------------------------------])
2926 AC_MSG_CHECKING([for WMF])
2929 have_libwmflite='no'
2930 have_libwmf_ipa_h='no'
2932 AC_CHECK_HEADER([libwmf/ipa.h],[have_libwmf_ipa_h='yes'],,[$FT2BUILD_H])
2933 if test "$have_libwmf_ipa_h" = 'yes'; then
2934 AC_CHECK_LIB(wmflite,wmf_lite_create,have_libwmflite='yes',,)
2935 if test "$have_libwmflite" = 'yes'; then
2936 AC_DEFINE(WMFLITE_DELEGATE,1,Define if you have wmflite library)
2937 WMF_LIBS='-lwmflite'
2938 LIBS="$WMF_LIBS $LIBS"
2942 WMF_CONFIG_LIBS=`libwmf-config --libs`
2943 for lib in xml2 expat freetype jpeg png z; do
2945 echo "$WMF_CONFIG_LIBS" | grep -- "$testlib" > /dev/null && WMF_LIBS_DEPS="$WMF_LIBS_DEPS $testlib"
2947 AC_CHECK_LIB(wmf,wmf_api_create,have_libwmf='yes',,$WMF_LIBS_DEPS)
2948 if test "$have_libwmf" = 'yes'; then
2949 AC_DEFINE(WMF_DELEGATE,1,Define if you have wmf library)
2951 LIBS="$WMF_LIBS $LIBS"
2954 AC_MSG_RESULT([no -- some components failed test])
2955 have_wmf='no (failed tests)'
2956 have_wmflite='no (failed tests)'
2962 AC_MSG_CHECKING([if WMF package is complete])
2963 if test "$have_wmf" = 'yes'; then
2964 AC_MSG_RESULT([yes])
2969 AM_CONDITIONAL(WMF_DELEGATE, test "$have_wmf" = 'yes')
2971 AC_SUBST(WMF_LIBS_DEPS)
2974 dnl ===========================================================================
2977 # Check for XML delegate library.
2980 [AC_HELP_STRING([--without-xml],
2981 [disable XML support])],
2982 [with_xml=$withval],
2985 if test "$with_xml" != 'yes' ; then
2986 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-xml=$with_xml "
2991 if test "$with_xml" != 'no'; then
2992 AC_MSG_RESULT([-------------------------------------------------------------])
2993 AC_MSG_CHECKING([for XML])
2995 PERSIST_LDFLAGS=$LDFLAGS
2996 PERSIST_CPPFLAGS=$CPPFLAGS
2998 AC_PATH_PROG(xml2_config,xml2-config,)dnl
2999 if test -n "$xml2_config"; then
3000 # Debian installs libxml headers under /usr/include/libxml2/libxml with
3001 # the shared library installed under /usr/lib, whereas the package
3002 # installs itself under $prefix/libxml and $prefix/lib.
3003 xml2_prefix=`xml2-config --prefix`
3004 if test -d "${xml2_prefix}/include/libxml2"; then
3005 CPPFLAGS="$CPPFLAGS -I${xml2_prefix}/include/libxml2"
3007 if test "${xml2_prefix}" != '/usr'; then
3008 LDFLAGS="$LDFLAGS -L${xml2_prefix}/lib"
3013 AC_CHECK_HEADER(libxml/parser.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
3014 AC_CHECK_LIB(xml2,xmlSAXVersion,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
3015 AC_CHECK_LIB(xml2,xmlParseChunk,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
3016 AC_CHECK_LIB(xml2,xmlCreatePushParserCtxt,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
3017 AC_MSG_CHECKING([if XML package is complete])
3018 if test $passed -gt 0; then
3019 if test $failed -gt 0; then
3020 AC_MSG_RESULT([no -- some components failed test])
3021 have_xml='no (failed tests)'
3022 LDFLAGS="$PERSIST_LDFLAGS"
3023 CPPFLAGS="$PERSIST_CPPFLAGS"
3026 LIBS="$XML_LIBS $LIBS"
3027 AC_DEFINE(XML_DELEGATE,1,Define if you have XML library)
3028 AC_MSG_RESULT([yes])
3035 AM_CONDITIONAL(XML_DELEGATE,test "$have_xml" = 'yes')
3038 dnl ===========================================================================
3040 # Substitute compiler name to build/link PerlMagick
3042 AC_SUBST(PERLMAINCC)
3045 # Configure install Paths
3048 # Path to ImageMagick header files
3049 INCLUDE_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
3050 INCLUDE_PATH="${INCLUDE_DIR}/${INCLUDE_RELATIVE_PATH}"
3051 DEFINE_INCLUDE_PATH="${INCLUDE_DIR}/${INCLUDE_RELATIVE_PATH}/"
3052 case "${build_os}" in
3054 DEFINE_INCLUDE_PATH=`$WinPathScript "$DEFINE_INCLUDE_PATH" 1`
3057 AC_DEFINE_UNQUOTED(INCLUDE_PATH,"$DEFINE_INCLUDE_PATH",[Directory where ImageMagick headers live.])
3058 AC_SUBST(INCLUDE_PATH)
3060 # Path to ImageMagick header files (arch part)
3061 INCLUDEARCH_PATH="${INCLUDEARCH_DIR}/${INCLUDE_RELATIVE_PATH}"
3062 DEFINE_INCLUDEARCH_PATH="${INCLUDEARCH_DIR}/${INCLUDE_RELATIVE_PATH}/"
3063 case "${build_os}" in
3065 DEFINE_INCLUDEARCH_PATH=`$WinPathScript "$DEFINE_INCLUDEARCH_PATH" 1`
3068 AC_DEFINE_UNQUOTED(INCLUDEARCH_PATH,"$DEFINE_INCLUDE_PATH",[Directory where ImageMagick architecture headers live.])
3069 AC_SUBST(INCLUDEARCH_PATH)
3071 # Subdirectory under lib to place ImageMagick lib files
3072 LIBRARY_RELATIVE_PATH="${PACKAGE_NAME}-${PACKAGE_VERSION}"
3073 AC_DEFINE_UNQUOTED(LIBRARY_RELATIVE_PATH,"$LIBRARY_RELATIVE_PATH",[Subdirectory of lib where ImageMagick architecture dependent files are installed.])
3075 # Path to ImageMagick bin directory
3076 EXECUTABLE_PATH="${BIN_DIR}"
3077 DEFINE_EXECUTABLE_PATH="${BIN_DIR}/"
3078 case "${build_os}" in
3080 DEFINE_EXECUTABLE_PATH=`$WinPathScript "$DEFINE_EXECUTABLE_PATH" 1`
3083 AC_DEFINE_UNQUOTED(EXECUTABLE_PATH,"$DEFINE_EXECUTABLE_PATH",[Directory where executables are installed.])
3084 AC_SUBST(EXECUTABLE_PATH)
3086 # Path to ImageMagick lib
3087 LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}"
3088 DEFINE_LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}/"
3089 case "${build_os}" in
3091 DEFINE_LIBRARY_PATH=`$WinPathScript "$DEFINE_LIBRARY_PATH" 1`
3094 AC_DEFINE_UNQUOTED(LIBRARY_PATH,"$DEFINE_LIBRARY_PATH",[Directory where architecture-dependent files live.])
3095 AC_SUBST(LIBRARY_PATH)
3098 # path to local binaries
3099 if test "x$LIB_BIN_BASEDIRNAME" = "x"; then
3100 LIB_BIN_BASEDIRNAME="bin"
3102 AC_DEFINE_UNQUOTED(LIB_BIN_BASEDIRNAME,"$LIB_BIN_BASEDIRNAME",[Binaries in libraries path base name (will be during install linked to bin)])
3103 AC_SUBST(LIB_BIN_BASEDIRNAME)
3105 if test "x$LIB_BIN_DIR" = "x"; then
3106 LIB_BIN_DIR=${LIB_BIN_BASEDIRNAME}-${MAGICK_ABI_SUFFIX}
3108 AC_SUBST(LIB_BIN_DIR)
3110 LIB_BIN_DIR_RELATIVE_PATH=$LIB_BIN_DIR
3111 AC_SUBST(LIB_BIN_DIR_RELATIVE_PATH)
3112 LIB_BIN_DIR_PATH="${LIBRARY_PATH}/${LIB_BIN_DIR_RELATIVE_PATH}"
3113 AC_SUBST(LIB_BIN_DIR_PATH)
3116 # path to modules lib
3117 if test "x$MODULES_BASEDIRNAME" = "x"; then
3118 MODULES_BASEDIRNAME="modules"
3120 AC_DEFINE_UNQUOTED(MODULES_BASEDIRNAME,"$MODULES_BASEDIRNAME",[Module directory name without ABI part.])
3121 AC_SUBST(MODULES_BASEDIRNAME)
3123 if test "x$MODULES_DIRNAME" = "x"; then
3124 MODULES_DIRNAME=${MODULES_BASEDIRNAME}-${MAGICK_ABI_SUFFIX}
3126 AC_DEFINE_UNQUOTED(MODULES_DIRNAME,"$MODULES_DIRNAME",[Module directory dirname])
3128 AC_SUBST(MODULES_DIRNAME)
3130 MODULES_RELATIVE_PATH="${MODULES_DIRNAME}"
3131 AC_SUBST(MODULES_RELATIVE_PATH)
3132 MODULES_PATH="${LIBRARY_PATH}/${MODULES_RELATIVE_PATH}"
3133 AC_SUBST(MODULES_PATH)
3136 # path to coders lib
3137 if test "x$CODER_DIRNAME" = "x"; then
3138 CODER_DIRNAME="coders"
3140 AC_DEFINE_UNQUOTED(CODER_DIRNAME,"$CODER_DIRNAME",[coders subdirectory.])
3141 AC_SUBST(CODER_DIRNAME)
3143 CODER_RELATIVE_PATH="${CODER_DIRNAME}"
3144 CODER_PATH="${MODULES_PATH}/${CODER_DIRNAME}"
3145 AC_SUBST(CODER_PATH)
3148 # Subdirectory under lib to place ImageMagick filter module files
3150 # path to coders lib
3151 if test "x$FILTER_DIRNAME" = "x"; then
3152 FILTER_DIRNAME="filters"
3154 AC_DEFINE_UNQUOTED(FILTER_DIRNAME,"$FILTER_DIRNAME",[filter subdirectory.])
3155 AC_SUBST(FILTER_DIRNAME)
3157 FILTER_RELATIVE_PATH="${FILTER_DIRNAME}"
3158 FILTER_PATH="${MODULES_PATH}/${FILTER_DIRNAME}"
3159 AC_SUBST(FILTER_PATH)
3162 # Path to ImageMagick documentation files
3163 DOCUMENTATION_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
3164 DOCUMENTATION_PATH="${DOC_DIR}/${DOCUMENTATION_RELATIVE_PATH}"
3165 DEFINE_DOCUMENTATION_PATH="${DOC_DIR}/${DOCUMENTATION_RELATIVE_PATH}/"
3166 case "${build_os}" in
3168 DEFINE_DOCUMENTATION_PATH=`$WinPathScript "$DEFINE_DOCUMENTATION_PATH" 1`
3171 AC_DEFINE_UNQUOTED(DOCUMENTATION_PATH,"$DEFINE_DOCUMENTATION_PATH",[Directory where ImageMagick documents live.])
3172 AC_SUBST(DOCUMENTATION_PATH)
3175 # Enable/Disable documentation
3176 AC_ARG_ENABLE([docs],
3177 [AS_HELP_STRING([--disable-docs],
3178 [disable building of documentation])],
3179 wantdocs=$enableval, wantdocs=detect)
3180 AM_CONDITIONAL([INSTALL_DOC], [test "$wantdocs" = "xyes"])
3182 # Subdirectory to place architecture-dependent configuration files
3183 CONFIGURE_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
3184 AC_DEFINE_UNQUOTED(CONFIGURE_RELATIVE_PATH,"$CONFIGURE_RELATIVE_PATH",[Subdirectory of lib where architecture-dependent configuration files live.])
3185 CONFIGURE_PATH="${SYSCONF_DIR}/${CONFIGURE_RELATIVE_PATH}/"
3186 DEFINE_CONFIGURE_PATH="${SYSCONF_DIR}/${CONFIGURE_RELATIVE_PATH}/"
3187 case "${build_os}" in
3189 DEFINE_CONFIGURE_PATH=`$WinPathScript "$DEFINE_CONFIGURE_PATH" 1`
3192 AC_DEFINE_UNQUOTED(CONFIGURE_PATH,"$DEFINE_CONFIGURE_PATH",[Directory where architecture-dependent configuration files live.])
3193 AC_SUBST(CONFIGURE_PATH)
3195 # Subdirectory to place architecture-independent configuration files
3196 SHARE_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
3197 AC_DEFINE_UNQUOTED(SHARE_RELATIVE_PATH,"$SHARE_RELATIVE_PATH",[Subdirectory of lib where architecture-independent configuration files live.])
3198 SHARE_PATH="${DATA_DIR}/${SHARE_RELATIVE_PATH}"
3199 DEFINE_SHARE_PATH="${DATA_DIR}/${SHARE_RELATIVE_PATH}/"
3200 case "${build_os}" in
3202 DEFINE_SHARE_PATH=`$WinPathScript "$DEFINE_SHARE_PATH" 1`
3205 AC_DEFINE_UNQUOTED(SHARE_PATH,"$DEFINE_SHARE_PATH",[Directory where architecture-independent configuration files live.])
3206 AC_SUBST(SHARE_PATH)
3209 # Subdirectory to place architecture-dependent configuration files.
3210 if test "x$SHAREARCH_BASEDIRNAME" = "x"; then
3211 SHAREARCH_BASEDIRNAME="config"
3213 AC_DEFINE_UNQUOTED(SHAREARCH_BASEDIRNAME,"$SHAREARCH_BASEDIRNAME",[Sharearch directory name without ABI part.])
3214 AC_SUBST(SHAREARCH_BASEDIRNAME)
3216 if test "x$SHAREARCH_DIRNAME" = "x"; then
3217 SHAREARCH_DIRNAME=${SHAREARCH_BASEDIRNAME}-${MAGICK_ABI_SUFFIX}
3219 AC_DEFINE_UNQUOTED(SHAREARCH_DIRNAME,"$SHAREARCH_DIRNAME",[Sharearch directory dirname])
3221 AC_SUBST(SHAREARCH_DIRNAME)
3223 SHAREARCH_RELATIVE_PATH="${SHAREARCH_DIRNAME}"
3224 AC_SUBST(SHAREARCH_RELATIVE_PATH)
3225 SHAREARCH_PATH="${LIBRARY_PATH}/${SHAREARCH_RELATIVE_PATH}"
3226 AC_SUBST(SHAREARCH_PATH)
3229 # program_transform_name is formed for use in a Makefile, so create a
3230 # modified version for use in a shell script.
3231 configure_transform_name=`echo ${program_transform_name} | sed 's,\\$\\$,$,'`
3233 # Default delegate definitions
3234 AC_MSG_RESULT([-------------------------------------------------------------])
3235 AC_MSG_CHECKING([for ImageMagick delegate programs])
3237 AutotraceDecodeDelegateDefault='autotrace'
3238 BlenderDecodeDelegateDefault='blender'
3239 BZIPDelegateDefault='bzip2'
3240 BrowseDelegateDefault='xdg-open'
3241 CatDelegateDefault='cat'
3242 DNGDecodeDelegateDefault='ufraw-batch'
3243 GVCDecodeDelegateDefault='dot'
3244 DVIDecodeDelegateDefault='dvips'
3245 EchoDelegateDefault='echo'
3246 EditorDelegateDefault='xterm'
3247 ConvertDelegateDefault=`echo convert | sed ${configure_transform_name}`
3248 DisplayDelegateDefault=`echo display | sed ${configure_transform_name}`
3249 MogrifyDelegateDefault=`echo mogrify | sed ${configure_transform_name}`
3250 GnuplotDecodeDelegateDefault='gnuplot'
3251 HPGLDecodeDelegateDefault='hp2xx'
3252 HTMLDecodeDelegateDefault='html2ps'
3253 ILBMDecodeDelegateDefault='ilbmtoppm'
3254 ILBMEncodeDelegateDefault='ppmtoilbm'
3255 JXRDecodeDelegateDefault='JxrDecApp'
3256 JXREncodeDelegateDefault='JxrEncApp'
3257 LPDelegateDefault='lp'
3258 LPRDelegateDefault='lpr'
3259 LaunchDelegateDefault='gimp'
3260 MANDelegateDefault='groff'
3261 MPEGDecodeDelegateDefault='avconv'
3262 MPEGEncodeDelegateDefault='avconv'
3263 MrSIDDecodeDelegateDefault='mrsidgeodecode'
3264 MVDelegateDefault='mv'
3265 PCLDelegateDefault='pcl6'
3266 PGPDecodeDelegateDefault='pgpv'
3267 POVDelegateDefault='povray'
3268 if test "$native_win32_build" = 'yes'; then
3269 PSDelegateDefault='gswin32c'
3270 elif test "$gslib_framework" = 'yes'; then
3271 PSDelegateDefault='gsc'
3273 PSDelegateDefault='gs'
3275 RLEEncodeDelegateDefault='rawtorle'
3276 RMDelegateDefault='rm'
3277 RSVGDecodeDelegateDefault='rsvg-convert'
3278 SCANDecodeDelegateDefault='scanimage'
3279 SVGDecodeDelegateDefault='inkscape'
3280 TXTDelegateDefault='enscript'
3281 UniconvertorDelegateDefault='uniconvertor'
3282 WebPDecodeDelegateDefault='dwebp'
3283 WebPEncodeDelegateDefault='cwebp'
3284 WMFDecodeDelegateDefault='wmf2eps'
3285 WWWDecodeDelegateDefault='curl'
3286 XPSDelegateDefault='gxps'
3287 ZipDelegateDefault='gzip'
3289 # Search for delegates
3290 AC_PATH_PROG(AutotraceDecodeDelegate, "$AutotraceDecodeDelegateDefault", "$AutotraceDecodeDelegateDefault")
3291 AC_PATH_PROG(BlenderDecodeDelegate, "$BlenderDecodeDelegateDefault", "$BlenderDecodeDelegateDefault")
3292 AC_PATH_PROG(BZIPDelegate, "$BZIPDelegateDefault", "$BZIPDelegateDefault")
3293 AC_PATH_PROGS(BrowseDelegate, "$BrowseDelegateDefault" google-chrome firefox konqueror mozilla lynx, "$BrowseDelegateDefault")
3294 AC_PATH_PROG(CatDelegate, "$CatDelegateDefault", "$CatDelegateDefault")
3295 AC_PATH_PROG(DNGDecodeDelegate, "$DNGDecodeDelegateDefault", "$DNGDecodeDelegateDefault")
3296 AC_PATH_PROG(GVCDecodeDelegate, "$GVCDecodeDelegateDefault", "$GVCDecodeDelegateDefault")
3297 AC_PATH_PROG(DVIDecodeDelegate, "$DVIDecodeDelegateDefault", "$DVIDecodeDelegateDefault")
3298 AC_PATH_PROG(EchoDelegate, "$EchoDelegateDefault", "$EchoDelegateDefault")
3299 AC_PATH_PROG(EditorDelegate, "$EditorDelegateDefault", "$EditorDelegateDefault")
3300 AC_PATH_PROG(ConvertDelegate, "$ConvertDelegateDefault", "$ConvertDelegateDefault")
3301 AC_PATH_PROG(DisplayDelegate, "$DisplayDelegateDefault", "$DisplayDelegateDefault")
3302 AC_PATH_PROG(MogrifyDelegate, "$MogrifyDelegateDefault", "$MogrifyDelegateDefault")
3303 AC_PATH_PROG(GnuplotDecodeDelegate, "$GnuplotDecodeDelegateDefault", "$GnuplotDecodeDelegateDefault")
3304 AC_PATH_PROG(HPGLDecodeDelegate, "$HPGLDecodeDelegateDefault", "$HPGLDecodeDelegateDefault")
3305 AC_PATH_PROG(HTMLDecodeDelegate, "$HTMLDecodeDelegateDefault", "$HTMLDecodeDelegateDefault")
3306 AC_PATH_PROG(ILBMDecodeDelegate, "$ILBMDecodeDelegateDefault", "$ILBMDecodeDelegateDefault")
3307 AC_PATH_PROG(ILBMEncodeDelegate, "$ILBMEncodeDelegateDefault", "$ILBMEncodeDelegateDefault")
3308 AC_PATH_PROG(JXRDecodeDelegate, "$JXRDecodeDelegateDefault", "$JXRDecodeDelegateDefault")
3309 AC_PATH_PROG(JXREncodeDelegate, "$JXREncodeDelegateDefault", "$JXREncodeDelegateDefault")
3310 AC_PATH_PROG(LPDelegate, "$LPDelegateDefault", no)
3311 AC_PATH_PROG(LPRDelegate, "$LPRDelegateDefault", "$LPRDelegateDefault")
3312 AC_PATH_PROG(LaunchDelegate, "$LaunchDelegateDefault", "$LaunchDelegateDefault")
3313 AC_PATH_PROG(MANDelegate, "$MANDelegateDefault", "$MANDelegateDefault")
3314 AC_PATH_PROG(MPEGDecodeDelegate, "$MPEGDecodeDelegateDefault", "$MPEGDecodeDelegateDefault")
3315 if test "$MPEGDecodeDelegate" == "$MPEGDecodeDelegateDefault" ; then
3316 MPEGDecodeDelegateDefault='ffmpeg'
3317 AC_PATH_PROG(MPEGDecodeDelegate, "$MPEGDecodeDelegateDefault", "$MPEGDecodeDelegateDefault")
3319 AC_PATH_PROG(MPEGEncodeDelegate, "$MPEGEncodeDelegateDefault", "$MPEGEncodeDelegateDefault")
3320 if test "$MPEGEncodeDelegate" == "$MPEGEncodeDelegateDefault" ; then
3321 MPEGEncodeDelegateDefault='ffmpeg'
3322 AC_PATH_PROG(MPEGEncodeDelegate, "$MPEGEncodeDelegateDefault", "$MPEGEncodeDelegateDefault")
3324 AC_PATH_PROG(MrSIDDecodeDelegate, "$MrSIDDecodeDelegateDefault", "$MrSIDDecodeDelegateDefault")
3325 AC_PATH_PROG(MVDelegate, "$MVDelegateDefault", "$MVDelegateDefault")
3326 AC_PATH_PROG(PCLDelegate, "$PCLDelegateDefault", "$PCLDelegateDefault")
3327 AC_PATH_PROG(PGPDecodeDelegate, "$PGPDecodeDelegateDefault", "$PGPDecodeDelegateDefault")
3328 AC_PATH_PROG(POVDelegate, "$POVDelegateDefault", "$POVDelegateDefault")
3329 AC_PATH_PROGS(PSDelegate, gsx gsc "$PSDelegateDefault", "$PSDelegateDefault")
3330 AC_PATH_PROG(RLEEncodeDelegate, "$RLEEncodeDelegateDefault", "$RLEEncodeDelegateDefault")
3331 AC_PATH_PROG(RMDelegate, "$RMDelegateDefault", "$RMDelegateDefault")
3332 AC_PATH_PROG(RSVGDecodeDelegate, "$RSVGDecodeDelegateDefault", "$RSVGDecodeDelegateDefault")
3333 AC_PATH_PROG(SCANDecodeDelegate, "$SCANDecodeDelegateDefault", "$SCANDecodeDelegateDefault")
3334 AC_PATH_PROG(SVGDecodeDelegate, "$SVGDecodeDelegateDefault", "$SVGDecodeDelegateDefault")
3335 AC_PATH_PROG(TXTDelegate, "$TXTDelegateDefault", "$TXTDelegateDefault")
3336 AC_PATH_PROG(UniconvertorDelegate, "$UniconvertorDelegateDefault", "$UniconvertorDelegateDefault")
3337 AC_PATH_PROG(WebPDecodeDelegate, "$WebPDecodeDelegateDefault", "$WebPDecodeDelegateDefault")
3338 AC_PATH_PROG(WebPEncodeDelegate, "$WebPEncodeDelegateDefault", "$WebPEncodeDelegateDefault")
3339 AC_PATH_PROG(WMFDecodeDelegate, "$WMFDecodeDelegateDefault", "$WMFDecodeDelegateDefault")
3340 AC_PATH_PROG(WWWDecodeDelegate, "$WWWDecodeDelegateDefault", "$WWWDecodeDelegateDefault")
3341 AC_PATH_PROG(XPSDelegate, "$XPSDelegateDefault", "$XPSDelegateDefault")
3342 AC_PATH_PROG(ZipDelegate, "$ZipDelegateDefault", "$ZipDelegateDefault")
3344 # Prefer lpr to lp; lp needs options tacked on.
3345 if test "$LPRDelegate" != no; then
3346 PrintDelegate="$LPRDelegate"
3348 PrintDelegate="$LPDelegate -c -s"
3350 AC_SUBST(PrintDelegate)
3352 # Installed ImageMagick utiltity paths
3353 ConvertDelegate="${BIN_DIR}/${ConvertDelegateDefault}"
3354 DisplayDelegate="${BIN_DIR}/${DisplayDelegateDefault}"
3355 MogrifyDelegate="${BIN_DIR}/${MogrifyDelegateDefault}"
3357 # Set delegate booleans
3358 have_avconv='no'; if test "$MPEGDecodeDelegate" != "$MPEGDecodeDelegateDefault" ; then have_avconv='yes'; fi
3359 have_gs='no' ; if test "$PSDelegate" != "$PSDelegateDefault"; then have_gs='yes'; fi
3360 have_hp2xx='no' ; if test "$HPGLDecodeDelegate" != "$HPGLDecodeDelegateDefault" ; then have_hp2xx='yes'; fi
3361 have_ilbmtoppm='no' ; if test "$ILBMDecodeDelegate" != "$ILBMDecodeDelegateDefault" ; then have_ilbmtoppm='yes'; fi
3362 have_mrsid='no'; if test "$MrSIDDecodeDelegate" != "$MrSIDDecodeDelegateDefault" ; then have_mrsid='yes'; fi
3363 have_pcl='no' ; if test "$PCLDelegate" != "$PCLDelegateDefault"; then have_pcl='yes'; fi
3364 have_ppmtoilbm='no' ; if test "$ILBMEncodeDelegate" != "$ILBMEncodeDelegateDefault" ; then have_ppmtoilbm='yes'; fi
3365 have_xps='no' ; if test "$XPSDelegate" != "$XPSDelegateDefault"; then have_xps='yes'; fi
3368 # Test for font directories
3370 type_include_files=''
3373 AC_MSG_CHECKING(for Dejavu fonts directory)
3375 if test "${with_dejavu_font_dir}" != 'default'; then
3376 dejavu_font_dir="${with_dejavu_font_dir}/"
3378 for font_dir in "${prefix}/share/dejavu/fonts/" '/usr/share/fonts/dejavu/'; do
3379 if test -f "${font_dir}DejaVuSerif.ttf"; then
3380 dejavu_font_dir="${font_dir}"
3385 if test "${dejavu_font_dir}x" != 'x'; then
3386 type_include_files="${type_include_files} "'<include file="type-dejavu.xml" />'
3387 AC_MSG_RESULT([$dejavu_font_dir])
3389 AC_MSG_RESULT([not found!]);
3391 AC_SUBST(dejavu_font_dir)
3395 if test "$with_windows_font_dir" != "no" && test -n "$with_windows_font_dir"; then
3396 windows_font_dir="${with_windows_font_dir}/"
3398 if test "${windows_font_dir}x" != 'x'; then
3399 if test -f '/usr/X11R6/lib/X11/fonts/truetype/arial.ttf'; then
3400 windows_font_dir='/usr/X11R6/lib/X11/fonts/truetype/'
3402 if test -f '/usr/X11R7/lib/X11/fonts/truetype/arial.ttf'; then
3403 windows_font_dir='/usr/X11R7/lib/X11/fonts/truetype/'
3405 if test -f '/usr/share/fonts/msttcore/arial.ttf'; then
3406 windows_font_dir='/usr/share/fonts/msttcore/truetype/'
3409 if test "${windows_font_dir}x" != 'x'; then
3410 type_include_files="$type_include_files "'<include file="type-windows.xml" />'
3412 AC_SUBST(windows_font_dir)
3415 AC_MSG_CHECKING(for Ghostscript fonts directory)
3416 ghostscript_font_dir=''
3417 if test "${with_gs_font_dir}" != 'default'; then
3418 ghostscript_font_dir="${with_gs_font_dir}/"
3420 if test "${native_win32_build}" = 'yes'; then
3421 # Native Windows Build
3422 for font_dir in "c:\\Program Files\\gs\\fonts\\" "c:\\Program Files \(x86\)\\gs\\fonts\\" "c:\\gs\\fonts\\"; do
3423 if test -f "${font_dir}a010013l.pfb"; then
3424 ghostscript_font_dir="$font_dir"
3428 if test "${PSDelegate}" != 'gswin32c'; then
3429 ghostscript_font_dir=`echo "${PSDelegate}" | sed -e 's:/gs/.*:/gs:;s:^/::;s/./&:/;s:/:\\\\:g'`"\\fonts\\"
3432 # Linux / Mac OS X / Unix Build
3433 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
3434 if test -f "${font_dir}a010013l.pfb"; then
3435 ghostscript_font_dir="${font_dir}"
3439 if test "${ghostscript_font_dir}x" = 'x'; then
3440 if test "$PSDelegate" != 'gs'; then
3441 ghostscript_font_dir=`echo "$PSDelegate" | sed -e 's:/bin/gs:/share/ghostscript/fonts:'`"/"
3446 if test "${ghostscript_font_dir}x" != 'x'; then
3447 type_include_files="${type_include_files} "'<include file="type-ghostscript.xml" />'
3448 AC_MSG_RESULT([$ghostscript_font_dir])
3450 AC_MSG_RESULT([not found!]);
3452 AC_SUBST(ghostscript_font_dir)
3453 case "${build_os}" in
3455 PSDelegate=`$WinPathScript "$PSDelegate" 1`
3459 AC_SUBST(type_include_files)
3462 # Handle case where user doesn't want frozen paths
3464 if test "$with_frozenpaths" != 'yes'; then
3465 # Re-set delegate definitions to default (no paths)
3466 AutotraceDecodeDelegate="$AutotraceDecodeDelegateDefault"
3467 BlenderDecodeDelegate="$BlenderDecodeDelegateDefault"
3468 BZIPDelegate="$BZIPDelegateDefault"
3469 BrowseDelegate="$BrowseDelegateDefault"
3470 CatDelegate="$CatDelegateDefault"
3471 ConvertDelegate="$ConvertDelegateDefault"
3472 DisplayDelegate="$DisplayDelegateDefault"
3473 DNGDecodeDelegate="$DNGDecodeDelegateDefault"
3474 DVIDecodeDelegate="$DVIDecodeDelegateDefault"
3475 EchoDelegate="$EchoDelegateDefault"
3476 EditorDelegate="$EditorDelegateDefault"
3477 GnuplotDecodeDelegate="$GnuplotDecodeDelegateDefault"
3478 GVCDecodeDelegate="$GVCDecodeDelegateDefault"
3479 HPGLDecodeDelegate="$HPGLDecodeDelegateDefault"
3480 HTMLDecodeDelegate="$HTMLDecodeDelegateDefault"
3481 ILBMDecodeDelegate="$ILBMDecodeDelegateDefault"
3482 ILBMEncodeDelegate="$ILBMEncodeDelegateDefault"
3483 JXRDecodeDelegate="$JXRDecodeDelegateDefault"
3484 JXREncodeDelegate="$JXREncodeDelegateDefault"
3485 LPDelegate="$LPDelegateDefault"
3486 LaunchDelegate="$LaunchDelegateDefault"
3487 MANDelegate="$MANDelegateDefault"
3488 MPEGDecodeDelegate="$MPEGDecodeDelegateDefault"
3489 MPEGEncodeDelegate="$MPEGEncodeDelegateDefault"
3490 MogrifyDelegate="$MogrifyDelegateDefault"
3491 MrSIDDecodeDelegate="$MrSIDDecodeDelegateDefault"
3492 MVDelegate="$MVDelegateDefault"
3493 PCLDelegate="$PCLDelegateDefault"
3494 PGPDecodeDelegate="$PGPDecodeDelegateDefault"
3495 POVDelegate="$POVDelegateDefault"
3496 PSDelegate="$PSDelegateDefault"
3497 RLEEncodeDelegate="$RLEEncodeDelegateDefault"
3498 RMDelegate="$RMDelegateDefault"
3499 RSVGDecodeDelegate="$RSVGDecodeDelegateDefault"
3500 SCANDecodeDelegate="$SCANDecodeDelegateDefault"
3501 SVGDecodeDelegate="$SVGDecodeDelegateDefault"
3502 ShowImageDelegate="$ShowImageDelegateDefault"
3503 TXTDelegate="$TXTDelegateDefault"
3504 UniconvertorDelegate="$UniconvertorDelegateDefault"
3505 WebPDecodeDelegate="$WebPDecodeDelegateDefault"
3506 WebPEncodeDelegate="$WebPEncodeDelegateDefault"
3507 WMFDecodeDelegate="$WMFDecodeDelegateDefault"
3508 WWWDecodeDelegate="$WWWDecodeDelegateDefault"
3509 XPSDelegate="$XPSDelegateDefault"
3510 ZipDelegate="$ZipDelegateDefault"
3513 # Delegate substitutions
3514 AC_SUBST(AutotraceDecodeDelegate)
3515 AC_SUBST(BlenderDecodeDelegate)
3516 AC_SUBST(BZIPDelegate)
3517 AC_SUBST(BrowseDelegate)
3518 AC_SUBST(CatDelegate)
3519 AC_SUBST(ConvertDelegate)
3520 AC_SUBST(GVCDecodeDelegate)
3521 AC_SUBST(DVIDecodeDelegate)
3522 AC_SUBST(EchoDelegate)
3523 AC_SUBST(EditorDelegate)
3524 AC_SUBST(GnuplotDecodeDelegate)
3525 AC_SUBST(HPGLDecodeDelegate)
3526 AC_SUBST(HTMLDecodeDelegate)
3527 AC_SUBST(ILBMDecodeDelegate)
3528 AC_SUBST(ILBMEncodeDelegate)
3529 AC_SUBST(JXRDecodeDelegate)
3530 AC_SUBST(JXREncodeDelegate)
3531 AC_SUBST(LPDelegate)
3532 AC_SUBST(LaunchDelegate)
3533 AC_SUBST(MANDelegate)
3534 AC_SUBST(MPEGDecodeDelegate)
3535 AC_SUBST(MPEGEncodeDelegate)
3536 AC_SUBST(MogrifyDelegate)
3537 AC_SUBST(MrSIDDecodeDelegate)
3538 AC_SUBST(MVDelegate)
3539 AC_SUBST(PCLDelegate)
3540 AC_SUBST(PGPDecodeDelegate)
3541 AC_SUBST(POVDelegate)
3542 AC_SUBST(PSDelegate)
3543 AC_SUBST(RLEEncodeDelegate)
3544 AC_SUBST(RMDelegate)
3545 AC_SUBST(SCANDecodeDelegate)
3546 AC_SUBST(ShowImageDelegate)
3547 AC_SUBST(TXTDelegate)
3548 AC_SUBST(UniconvertorDelegate)
3549 AC_SUBST(WMFDecodeDelegate)
3550 AC_SUBST(WebPDecodeDelegate)
3551 AC_SUBST(WebPEncodeDelegate)
3552 AC_SUBST(WWWDecodeDelegate)
3553 AC_SUBST(XPSDelegate)
3554 AC_SUBST(ZipDelegate)
3560 AC_CHECK_PROGS(TAR,gnutar gtar tar)
3561 AC_CHECK_PROGS(PERL,perl)
3562 AC_CHECK_PROGS(RPM,rpmbuild rpm)
3563 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
3564 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
3565 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
3566 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
3568 AM_CONDITIONAL(RPM_DELEGATE, test "x$RPM" != "x" )
3571 # 7ZIP support (http://p7zip.sourceforge.net/)
3574 AC_CHECK_PROGS(P7ZIP,[7za])
3576 AM_CONDITIONAL(P7ZIP_DELEGATE, test "x$P7ZIP" != "x" )
3579 # ZIP support (http://www.info-zip.org/Zip.html)
3582 AC_CHECK_PROGS(ZIP,[zip])
3584 AM_CONDITIONAL(ZIP_DELEGATE, test "x$ZIP" != "x" )
3587 # GhostPCL related configuration.
3589 PCLColorDevice=ppmraw
3590 PCLCMYKDevice=pamcmyk32
3591 PCLMonoDevice=pbmraw
3592 if test -z "$PCLVersion"; then
3593 PCLVersion='unknown'
3595 if test $have_pcl = 'yes'; then
3596 AC_MSG_RESULT([-------------------------------------------------------------])
3597 AC_MSG_CHECKING([for PCL])
3600 AC_MSG_CHECKING([for pcl color device])
3601 if $PCLDelegate -dBATCH -sDEVICE=$PCLColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3604 PCLColorDevice=ppmraw
3606 AC_MSG_RESULT([$PCLColorDevice])
3609 AC_MSG_CHECKING([for pcl CMYK device])
3610 if $PCLDelegate -dBATCH -sDEVICE=$PCLColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3613 PCLCMYKDevice=$PCLColorDevice
3615 AC_MSG_RESULT([$PCLCMYKDevice])
3618 AC_MSG_CHECKING([for pcl mono device])
3619 if $PCLDelegate -dBATCH -sDEVICE=$PCLMonoDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3622 PCLMonoDevice=$PCLColorDevice
3624 AC_MSG_RESULT([$PCLMonoDevice])
3627 AC_SUBST(PCLMonoDevice)
3628 AC_SUBST(PCLColorDevice)
3629 AC_SUBST(PCLCMYKDevice)
3630 AC_SUBST(PCLVersion)
3633 # GhostXPS related configuration.
3635 XPSColorDevice=ppmraw
3636 XPSCMYKDevice=bmpsep8
3637 XPSMonoDevice=pbmraw
3638 if test -z "$XPSVersion"; then
3639 XPSVersion='unknown'
3641 if test $have_xps = 'yes'; then
3642 AC_MSG_RESULT([-------------------------------------------------------------])
3643 AC_MSG_CHECKING([for XPS])
3646 AC_MSG_CHECKING([for xps color device])
3647 if $XPSDelegate -dBATCH -sDEVICE=$XPSColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3650 XPSColorDevice=ppmraw
3652 AC_MSG_RESULT([$XPSColorDevice])
3655 AC_MSG_CHECKING([for xps CMYK device])
3656 if $XPSDelegate -dBATCH -sDEVICE=$XPSColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3659 XPSCMYKDevice=$XPSColorDevice
3661 AC_MSG_RESULT([$XPSCMYKDevice])
3664 AC_MSG_CHECKING([for xps mono device])
3665 if $XPSDelegate -dBATCH -sDEVICE=$XPSMonoDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3668 XPSMonoDevice=$XPSColorDevice
3670 AC_MSG_RESULT([$XPSMonoDevice])
3673 AC_SUBST(XPSMonoDevice)
3674 AC_SUBST(XPSColorDevice)
3675 AC_SUBST(XPSCMYKDevice)
3676 AC_SUBST(XPSVersion)
3679 # Ghostscript related configuration.
3681 GSAlphaDevice=pngalpha
3682 GSColorDevice=pnmraw
3685 GSPDFDevice=pdfwrite
3687 GSEPSDevice=epswrite
3689 if test $have_gs = 'yes'; then
3690 AC_MSG_RESULT([-------------------------------------------------------------])
3691 AC_MSG_CHECKING([for Ghostscript])
3693 AC_MSG_CHECKING([for Ghostscript version])
3694 if GSVersion=`$PSDelegate --version`; then
3697 GSVersion=`$PSDelegate --help | sed -e '1q' | awk '{ print $3 }'`
3699 AC_MSG_RESULT([$GSVersion])
3702 AC_MSG_CHECKING([for gs alpha device])
3703 if $PSDelegate -q -dBATCH -sDEVICE=$GSAlphaDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3706 GSAlphaDevice=pnmraw
3708 AC_MSG_RESULT([$GSAlphaDevice])
3711 AC_MSG_CHECKING([for gs color device])
3712 if $PSDelegate -q -dBATCH -sDEVICE=$GSColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3715 GSColorDevice=pnmraw
3717 AC_MSG_RESULT([$GSColorDevice])
3720 AC_MSG_CHECKING([for gs CMYK device])
3721 if $PSDelegate -q -dBATCH -sDEVICE=$GSCMYKDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3724 GSCMYKDevice=bmpsep8
3726 AC_MSG_RESULT([$GSCMYKDevice])
3729 AC_MSG_CHECKING([for gs mono device])
3730 if $PSDelegate -q -dBATCH -sDEVICE=$GSMonoDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3733 GSMonoDevice=$GSColorDevice
3735 AC_MSG_RESULT([$GSMonoDevice])
3738 AC_MSG_CHECKING([for gs PDF writing device])
3739 if $PSDelegate -q -dBATCH -sDEVICE=$GSPDFDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3742 GSPDFDevice=nodevice
3744 AC_MSG_RESULT([$GSPDFDevice])
3747 AC_MSG_CHECKING([for gs PS writing device])
3748 if $PSDelegate -q -dBATCH -sDEVICE=$GSPSDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3753 AC_MSG_RESULT([$GSPSDevice])
3756 AC_MSG_CHECKING([for gs EPS writing device])
3757 if $PSDelegate -q -dBATCH -sDEVICE=$GSEPSDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3760 GSEPSDevice=nodevice
3762 AC_MSG_RESULT([$GSEPSDevice])
3765 AC_SUBST(GSAlphaDevice)
3766 AC_SUBST(GSCMYKDevice)
3767 AC_SUBST(GSColorDevice)
3768 AC_SUBST(GSEPSDevice)
3769 AC_SUBST(GSMonoDevice)
3770 AC_SUBST(GSPDFDevice)
3771 AC_SUBST(GSPSDevice)
3775 # PerlMagick-related configuration
3778 # Look for PERL if PerlMagick requested
3779 # If name/path of desired PERL interpreter is specified, look for that one first
3781 if test "$with_perl" != 'no'; then
3782 AC_MSG_RESULT([-------------------------------------------------------------])
3783 AC_MSG_CHECKING([for Perl])
3785 if test "$with_perl" != 'yes'; then
3786 AC_CACHE_CHECK(for perl,ac_cv_path_PERL,ac_cv_path_PERL="$with_perl");
3787 PERL=$ac_cv_path_PERL
3789 have_perl="$ac_cv_path_PERL"
3791 AC_PATH_PROGS(PERL,perl perl5,)dnl
3792 if test "$ac_cv_path_PERL"; then
3793 have_perl="$ac_cv_path_PERL"
3798 if test "$with_perl" != 'yes' ; then
3799 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-perl=$with_perl "
3802 PERL_SUPPORTS_DESTDIR='no'
3804 with_perl_static='no'
3805 with_perl_dynamic='no'
3806 if test "$have_perl" != 'no'; then
3807 if test "$with_perl" != 'no' && test "$libtool_build_shared_libs" = 'no'; then
3808 with_perl_static='yes'
3810 if test "$with_perl" != 'no' && test "$libtool_build_shared_libs" = 'yes'; then
3811 with_perl_dynamic='yes'
3813 # Is PERL's MakeMaker new enough to support DESTDIR?
3814 AX_PROG_PERL_VERSION(5.8.1,[PERL_SUPPORTS_DESTDIR='yes'],[PERL_SUPPORTS_DESTDIR='no'])
3816 AM_CONDITIONAL(WITH_PERL, test "$have_perl" != 'no')
3817 AM_CONDITIONAL(WITH_PERL_STATIC, test $with_perl_static = 'yes')
3818 AM_CONDITIONAL(WITH_PERL_DYNAMIC, test $with_perl_dynamic = 'yes')
3819 AC_SUBST(PERL_SUPPORTS_DESTDIR)
3821 # Determine path to pick up MagickCore library from for use with building PerlMagick
3822 MAGICKCORE_PATH="${LIB_DIR}"
3823 if test $with_perl_static = 'yes'; then
3824 # Find out where libtool hides its uninstalled libraries (as libtool_objdir)
3825 libtool_objdir=$objdir
3827 # Linker search path to library, followed by -lMagickCore
3828 MAGICKCORE_PATH="${builddir}/MagickCore/${libtool_objdir}"
3830 AC_SUBST(MAGICKCORE_PATH)
3832 # Create a simple string containing format names for all delegate libraries.
3834 if test "$have_autotrace" = 'yes' ; then
3835 MAGICK_DELEGATES="$MAGICK_DELEGATES autotrace"
3837 if test "$have_bzlib" = 'yes' ; then
3838 MAGICK_DELEGATES="$MAGICK_DELEGATES bzlib"
3840 if test "$have_dps" = 'yes' ; then
3841 MAGICK_DELEGATES="$MAGICK_DELEGATES dps"
3843 if test "$have_djvu" = 'yes' ; then
3844 MAGICK_DELEGATES="$MAGICK_DELEGATES djvu"
3846 if test "$have_avconv" = 'yes' ; then
3847 MAGICK_DELEGATES="$MAGICK_DELEGATES mpeg"
3849 if test "$have_mupdf" = 'yes' ; then
3850 MAGICK_DELEGATES="$MAGICK_DELEGATES mupdf"
3852 if test "$have_fftw" = 'yes' ; then
3853 MAGICK_DELEGATES="$MAGICK_DELEGATES fftw"
3855 if test "$have_fpx" = 'yes' ; then
3856 MAGICK_DELEGATES="$MAGICK_DELEGATES fpx"
3858 if test "$have_fontconfig" = 'yes' ; then
3859 MAGICK_DELEGATES="$MAGICK_DELEGATES fontconfig"
3861 if test "$have_freetype" = 'yes' ; then
3862 MAGICK_DELEGATES="$MAGICK_DELEGATES freetype"
3864 if test "$have_gslib" = 'yes' ; then
3865 MAGICK_DELEGATES="$MAGICK_DELEGATES gslib"
3867 if test "$have_jbig" = 'yes' ; then
3868 MAGICK_DELEGATES="$MAGICK_DELEGATES jbig"
3870 if test "$have_png$have_jpeg" = 'yesyes' ; then
3871 MAGICK_DELEGATES="$MAGICK_DELEGATES jng"
3873 if test "$have_jp2" = 'yes' ; then
3874 MAGICK_DELEGATES="$MAGICK_DELEGATES jp2"
3876 if test "$have_jpeg" = 'yes' ; then
3877 MAGICK_DELEGATES="$MAGICK_DELEGATES jpeg"
3879 if test "$have_lcms" = 'yes' || test "$have_lcms2" = 'yes' ; then
3880 MAGICK_DELEGATES="$MAGICK_DELEGATES lcms"
3882 if test "$have_lqr" = 'yes' ; then
3883 MAGICK_DELEGATES="$MAGICK_DELEGATES lqr"
3885 if test "$have_lzma" = 'yes' ; then
3886 MAGICK_DELEGATES="$MAGICK_DELEGATES lzma"
3888 if test "$have_openexr" = 'yes' ; then
3889 MAGICK_DELEGATES="$MAGICK_DELEGATES openexr"
3891 if test "$have_openjp2" = 'yes' ; then
3892 MAGICK_DELEGATES="$MAGICK_DELEGATES openjp2"
3894 if test "$have_pango" = 'yes' ; then
3895 MAGICK_DELEGATES="$MAGICK_DELEGATES pango"
3897 if test "$have_png" = 'yes' ; then
3898 MAGICK_DELEGATES="$MAGICK_DELEGATES png"
3901 if test "$have_dps" = 'yes' || \
3902 test "$have_gs" = 'yes' || \
3903 test "${native_win32_build}" = 'yes' ; then
3906 if test "$have_ps" = 'yes' ; then
3907 MAGICK_DELEGATES="$MAGICK_DELEGATES ps"
3909 if test "$have_ra_ppm" = 'yes' ; then
3910 MAGICK_DELEGATES="$MAGICK_DELEGATES rad"
3912 if test "$have_rsvg" = 'yes' ; then
3913 MAGICK_DELEGATES="$MAGICK_DELEGATES rsvg"
3915 if test "$have_tiff" = 'yes' ; then
3916 MAGICK_DELEGATES="$MAGICK_DELEGATES tiff"
3918 if test "$have_ttf" = 'yes' ; then
3919 MAGICK_DELEGATES="$MAGICK_DELEGATES ttf"
3921 if test "$have_webp" = 'yes' ; then
3922 MAGICK_DELEGATES="$MAGICK_DELEGATES webp"
3924 if test "$have_wmf" = 'yes' ; then
3925 MAGICK_DELEGATES="$MAGICK_DELEGATES wmf"
3927 if test "$have_x" = 'yes' ; then
3928 MAGICK_DELEGATES="$MAGICK_DELEGATES x"
3930 if test "$have_xml" = 'yes' ; then
3931 MAGICK_DELEGATES="$MAGICK_DELEGATES xml"
3933 if test "$have_zlib" = 'yes' ; then
3934 MAGICK_DELEGATES="$MAGICK_DELEGATES zlib"
3936 # Remove extraneous spaces from output variables (asthetic)
3937 MAGICK_DELEGATES=`echo $MAGICK_DELEGATES | sed -e 's/ */ /g'`
3938 MAGICK_FEATURES=`echo $MAGICK_FEATURES | sed -e 's/ */ /g'`
3939 AC_SUBST(MAGICK_DELEGATES)
3940 AC_SUBST(MAGICK_FEATURES)
3943 # Handle special compiler flags
3946 # Add '-p' if prof source profiling support enabled
3947 if test "$enable_prof" = 'yes'; then
3949 CXXFLAGS="-p $CXXFLAGS"
3950 LDFLAGS="-p $LDFLAGS"
3953 # Add '-pg' if gprof source profiling support enabled
3954 if test "$enable_gprof" = 'yes'; then
3955 CFLAGS="-pg $CFLAGS"
3956 CXXFLAGS="-pg $CXXFLAGS"
3957 LDFLAGS="-pg $LDFLAGS"
3960 # Add '-ftest-coverage -fprofile-arcs' if gcov source profiling support enabled
3961 # This is a gcc-specific feature
3962 if test "$enable_gcov" = 'yes'; then
3963 AC_CHECK_LIB(gcov,_gcov_init)
3964 AC_CHECK_LIB(gcov,__gcov_init)
3965 case "$target_os" in
3967 OSX_GCOV_LDFLAG="-Wl,-single_module"
3973 AC_SUBST(OSX_GCOV_LDFLAG)
3974 CFLAGS="-ftest-coverage -fprofile-arcs $CFLAGS"
3975 CXXFLAGS="-ftest-coverage -fprofile-arcs $CXXFLAGS"
3976 LDFLAGS="-ftest-coverage -fprofile-arcs $LDFLAGS"
3980 # Build library dependency list for libMagickCore
3983 if test "$build_modules" != 'no'; then
3984 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"
3986 MAGICK_DEP_LIBS="$JBIG_LIBS $LCMS_LIBS $TIFF_LIBS $FREETYPE_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 $OPENJPEG_LIBS $PANGO_LIBS $RSVG_LIBS $XML_LIBS $GVC_LIBS $ZLIB_LIBS $GDI32_LIBS $MATH_LIBS $GOMP_LIBS $CL_LIBS $UMEM_LIBS $THREAD_LIBS"
3988 AC_SUBST(MAGICK_DEP_LIBS)
3991 # Remove extraneous spaces from output variables (asthetic)
3993 X_CFLAGS=`echo $X_CFLAGS | sed -e 's/ */ /g'`
3994 X_PRE_LIBS=`echo $X_PRE_LIBS | sed -e 's/ */ /g'`
3995 X_LIBS=`echo $X_LIBS | sed -e 's/ */ /g'`
3996 X_EXTRA_LIBS=`echo $X_EXTRA_LIBS | sed -e 's/ */ /g'`
3998 CC=`echo $CC | sed -e 's/ */ /g'`
3999 CFLAGS=`echo $CFLAGS | sed -e 's/ */ /g'`
4000 CPPFLAGS=`echo $CPPFLAGS | sed -e 's/ */ /g'`
4001 CXXFLAGS=`echo $CXXFLAGS | sed -e 's/ */ /g'`
4002 DISTCHECK_CONFIG_FLAGS=`echo $DISTCHECK_CONFIG_FLAGS | sed -e 's/ */ /g'`
4003 LDFLAGS=`echo $LDFLAGS | sed -e 's/ */ /g'`
4004 TESTED_LIBS=`echo $LIBS | sed -e 's/ */ /g'`
4005 MAGICK_DEP_LIBS=`echo $MAGICK_DEP_LIBS | sed -e 's/ */ /g'`
4006 #LIBS=`echo $LIBS | sed -e 's/ */ /g'`
4008 # Pass only user-provided LIBS as "global" libraries
4014 #AC_SUBST(X_PRE_LIBS)
4016 #AC_SUBST(X_EXTRA_LIBS)
4018 MAGICK_CFLAGS=$CFLAGS
4019 MAGICK_CXXFLAGS="$CXXFLAGS"
4020 MAGICK_CPPFLAGS=`echo $MAGICK_CPPFLAGS | sed -e 's/ */ /g'`
4021 MAGICK_PCFLAGS=`echo $MAGICK_PCFLAGS | sed -e 's/ */ /g'`
4022 MAGICK_LDFLAGS="-L$LIB_DIR $LDFLAGS"
4023 MAGICK_LIBS="$MAGICK_DEP_LIBS"
4025 AC_SUBST(MAGICK_CFLAGS)
4026 AC_SUBST(MAGICK_CXXFLAGS)
4027 AC_SUBST(MAGICK_CPPFLAGS)
4028 AC_SUBST(MAGICK_PCFLAGS)
4029 AC_SUBST(MAGICK_LDFLAGS)
4030 AC_SUBST(MAGICK_LIBS)
4032 # Set configured scripts to executable.
4033 AC_CONFIG_COMMANDS([default],[],[])
4034 AC_CONFIG_COMMANDS([magick.sh.in],[chmod +x magick.sh])
4035 AC_CONFIG_COMMANDS([MagickCore-config.in],[chmod +x MagickCore/MagickCore-config])
4036 AC_CONFIG_COMMANDS([MagickWand-config.in],[chmod +x MagickWand/MagickWand-config])
4037 AC_CONFIG_COMMANDS([Magick++-config.in],[chmod +x Magick++/bin/Magick++-config])
4038 AC_CONFIG_COMMANDS([PerlMagick/check.sh.in],[chmod +x PerlMagick/check.sh])
4040 AC_MSG_RESULT([-------------------------------------------------------------])
4041 AC_MSG_RESULT([Update ImageMagick configuration])
4044 rm -f magick-version
4046 result_dejavu_font_dir='none'
4047 if test "${dejavu_font_dir}x" != 'x'; then
4048 result_dejavu_font_dir=$dejavu_font_dir
4051 result_ghostscript_font_dir='none'
4052 if test "${ghostscript_font_dir}x" != 'x'; then
4053 result_ghostscript_font_dir=$ghostscript_font_dir
4056 result_windows_font_dir='none'
4057 if test "${windows_font_dir}x" != 'x'; then
4058 result_windows_font_dir=${windows_font_dir}
4062 ImageMagick is configured as follows. Please verify that this configuration
4063 matches your expectations.
4065 Host system type: $host
4066 Build system type: $build
4069 -------------------------------------------------------------------------------
4070 Shared libraries --enable-shared=$enable_shared $libtool_build_shared_libs
4071 Static libraries --enable-static=$enable_static $libtool_build_static_libs
4072 Module support --with-modules=$build_modules $build_modules
4073 GNU ld --with-gnu-ld=$with_gnu_ld $lt_cv_prog_gnu_ld
4074 Quantum depth --with-quantum-depth=$with_quantum_depth $with_quantum_depth
4075 High Dynamic Range Imagery
4076 --enable-hdri=$enable_hdri $enable_hdri
4078 Delegate Configuration:
4079 BZLIB --with-bzlib=$with_bzlib $have_bzlib
4080 Autotrace --with-autotrace=$with_autotrace $have_autotrace
4081 Dejavu fonts --with-dejavu-font-dir=$with_dejavu_font_dir $result_dejavu_font_dir
4082 DJVU --with-djvu=$with_djvu $have_djvu
4083 DPS --with-dps=$with_dps $have_dps
4084 FFTW --with-fftw=$with_fftw $have_fftw
4085 FlashPIX --with-fpx=$with_fpx $have_fpx
4086 FontConfig --with-fontconfig=$with_fontconfig $have_fontconfig
4087 FreeType --with-freetype=$with_freetype $have_freetype
4088 GhostPCL None $PCLDelegate ($PCLVersion)
4089 GhostXPS None $XPSDelegate ($XPSVersion)
4090 Ghostscript None $PSDelegate ($GSVersion)
4091 Ghostscript fonts --with-gs-font-dir=$with_gs_font_dir $result_ghostscript_font_dir
4092 Ghostscript lib --with-gslib=$with_gslib $have_gslib
4093 Graphviz --with-gvc=$with_gvc $have_gvc
4094 JBIG --with-jbig=$with_jbig $have_jbig
4095 JPEG v1 --with-jpeg=$with_jpeg $have_jpeg
4096 JPEG-2000 --with-jp2=$with_jp2 $have_jp2
4097 LCMS v1 --with-lcms=$with_lcms $have_lcms
4098 LCMS v2 --with-lcms2=$with_lcms2 $have_lcms2
4099 LIBJPEG2 --with-openjp2=$with_openjp2 $have_openjp2
4100 LQR --with-lqr=$with_lqr $have_lqr
4101 LTDL --with-ltdl=$with_ltdl $have_ltdl
4102 LZMA --with-lzma=$with_lzma $have_lzma
4103 Magick++ --with-magick-plus-plus=$with_magick_plus_plus $have_magick_plus_plus
4104 MUPDF --with-mupdf=$with_mupdf $have_mupdf
4105 OpenEXR --with-openexr=$with_openexr $have_openexr
4106 PANGO --with-pango=$with_pango $have_pango
4107 PERL --with-perl=$with_perl $have_perl
4108 PNG --with-png=$with_png $have_png
4109 RSVG --with-rsvg=$with_rsvg $have_rsvg
4110 TIFF --with-tiff=$with_tiff $have_tiff
4111 WEBP --with-webp=$with_webp $have_webp
4112 Windows fonts --with-windows-font-dir=$with_windows_font_dir $result_windows_font_dir
4113 WMF --with-wmf=$with_wmf $have_wmf
4114 X11 --with-x=$with_x $have_x
4115 XML --with-xml=$with_xml $have_xml
4116 ZLIB --with-zlib=$with_zlib $have_zlib
4119 X_CFLAGS = $X_CFLAGS
4120 X_PRE_LIBS = $X_PRE_LIBS
4122 X_EXTRA_LIBS = $X_EXTRA_LIBS
4124 Options used to compile and link:
4125 PREFIX = $PREFIX_DIR
4126 EXEC-PREFIX = $EXEC_PREFIX_DIR
4127 VERSION = $PACKAGE_VERSION
4130 CPPFLAGS = $MAGICK_CPPFLAGS
4131 PCFLAGS = $MAGICK_PCFLAGS
4134 MAGICK_LDFLAGS = $MAGICK_LDFLAGS
4137 CXXFLAGS = $CXXFLAGS
4138 FEATURES = $MAGICK_FEATURES
4139 DELEGATES = $MAGICK_DELEGATES