1 # Copyright 1999-2013 ImageMagick Studio LLC, a non-profit organization
2 # dedicated to making software imaging solutions freely available.
4 # You may not use this file except in compliance with the License. You may
5 # obtain a copy of the License at
7 # http://www.imagemagick.org/script/license.php
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 # Copyright (C) 2003 - 2008 GraphicsMagick Group
17 # Copying and distribution of this file, with or without modification,
18 # are permitted in any medium without royalty provided the copyright
19 # notice and this notice are preserved.
23 m4_define([magick_major_version], [7])
24 m4_define([magick_minor_version], [0])
25 m4_define([magick_micro_version], [0])
26 m4_define([magick_patchlevel_version], [0])
27 m4_define([magick_version],
28 [magick_major_version.magick_minor_version.magick_micro_version-magick_patchlevel_version])
29 m4_define([magick_svn_revision], esyscmd([sh -c "(svnversion .) | awk '{ print \$1 }' | tr -d '\n'"]))
31 AC_INIT([ImageMagick],[magick_version],[http://www.imagemagick.org],[ImageMagick])
32 AC_CONFIG_SRCDIR([MagickCore/MagickCore.h])
33 AC_CONFIG_AUX_DIR([config])
34 AC_REQUIRE_AUX_FILE([tap-driver.sh])
35 AC_CONFIG_MACRO_DIR([m4])
36 AC_CONFIG_HEADERS([config/config.h])
37 AX_PREFIX_CONFIG_H([MagickCore/magick-baseconfig.h],[MagickCore])
40 config/configure.xml \
41 config/delegates.xml \
42 config/ImageMagick.rdf \
43 config/MagickCore.dox \
44 config/MagickWand.dox \
46 config/type-dejavu.xml \
47 config/type-ghostscript.xml \
48 config/type-windows.xml \
51 Magick++/bin/Magick++-config \
52 MagickCore/ImageMagick.pc \
53 Magick++/lib/Magick++.pc \
54 MagickCore/MagickCore-config \
55 MagickCore/MagickCore.pc \
56 MagickCore/version.h \
60 PerlMagick/default/Magick.pm \
61 PerlMagick/Makefile.PL \
62 PerlMagick/default/Makefile.PL \
63 PerlMagick/quantum/Makefile.PL \
64 PerlMagick/quantum/quantum.pm \
65 PerlMagick/quantum/quantum.xs \
66 PerlMagick/quantum/typemap \
69 utilities/composite.1 \
73 utilities/identify.1 \
74 utilities/ImageMagick.1 \
79 MagickWand/MagickWand-config \
80 MagickWand/MagickWand.pc ])
83 # Save initial user-tunable values
86 for var in CC CFLAGS CPPFLAGS CXX CXXCPP LDFLAGS LIBS ; do
87 eval isset=\${$var+set}
88 if test "$isset" = 'set'; then
90 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS}'${var}=${val}' "
93 AC_SUBST(DISTCHECK_CONFIG_FLAGS)
95 CONFIGURE_ARGS="$0 ${ac_configure_args}"
96 AC_SUBST(CONFIGURE_ARGS)
98 # Source file containing package/library versioning information.
99 . ${srcdir}/version.sh
101 echo "configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}${PACKAGE_VERSION_ADDENDUM}"
107 MAGICK_TARGET_CPU=$host_cpu
108 AC_SUBST(MAGICK_TARGET_CPU)
109 AC_DEFINE_UNQUOTED(MAGICK_TARGET_CPU,$MAGICK_TARGET_CPU,[Target Host CPU])
111 MAGICK_TARGET_VENDOR=$host_vendor
112 AC_SUBST(MAGICK_TARGET_VENDOR)
113 AC_DEFINE_UNQUOTED(MAGICK_TARGET_VENDOR,$MAGICK_TARGET_VENDOR,[Target Host Vendor])
115 MAGICK_TARGET_OS=$host_os
116 AC_SUBST(MAGICK_TARGET_OS)
117 AC_DEFINE_UNQUOTED(MAGICK_TARGET_OS,$MAGICK_TARGET_OS,[Target Host OS])
120 # Substitute versioning
121 AC_SUBST([MAGICK_MAJOR_VERSION],[magick_major_version])
122 AC_SUBST([MAGICK_MINOR_VERSION],[magick_minor_version])
123 AC_SUBST([MAGICK_MICRO_VERSION],[magick_micro_version])
124 AC_SUBST([MAGICK_PATCHLEVEL_VERSION],[magick_patchlevel_version])
125 AC_SUBST([MAGICK_VERSION],[magick_version])
126 AC_SUBST([MAGICK_SVN_REVISION],[magick_svn_revision])
128 # Substitute library versioning
129 AC_SUBST(MAGICK_LIBRARY_CURRENT)dnl
130 AC_SUBST(MAGICK_LIBRARY_REVISION)dnl
131 AC_SUBST(MAGICK_LIBRARY_AGE)dnl
132 AC_SUBST([MAGICK_LIBRARY_CURRENT_MIN],
133 [`expr $MAGICK_LIBRARY_CURRENT - $MAGICK_LIBRARY_AGE`])
134 AC_SUBST([MAGICK_LIBRARY_VERSION_INFO],
135 [$MAGICK_LIBRARY_CURRENT:$MAGICK_LIBRARY_REVISION:$MAGICK_LIBRARY_AGE])
137 AC_SUBST(MAGICKPP_LIBRARY_CURRENT)dnl
138 AC_SUBST(MAGICKPP_LIBRARY_REVISION)dnl
139 AC_SUBST(MAGICKPP_LIBRARY_AGE)dnl
140 AC_SUBST([MAGICKPP_LIBRARY_CURRENT_MIN],
141 [`expr $MAGICKPP_LIBRARY_CURRENT - $MAGICKPP_LIBRARY_AGE`])
142 AC_SUBST([MAGICKPP_LIBRARY_VERSION_INFO],
143 [$MAGICKPP_LIBRARY_CURRENT:$MAGICKPP_LIBRARY_REVISION:$MAGICKPP_LIBRARY_AGE])
145 AC_SUBST(PACKAGE_NAME)dnl
146 AC_SUBST(PACKAGE_VERSION)dnl
147 AC_SUBST(PACKAGE_PERL_VERSION)dnl
148 AC_SUBST(PACKAGE_RELEASE)dnl
149 AC_SUBST(PACKAGE_CHANGE_DATE)dnl
150 AC_SUBST(PACKAGE_LIB_VERSION)dnl
151 AC_SUBST(PACKAGE_LIB_VERSION_NUMBER)dnl
152 AC_SUBST(PACKAGE_RELEASE_DATE)dnl
153 AC_SUBST(PACKAGE_VERSION_ADDENDUM)dnl
155 # Ensure that make can run correctly
158 AM_INIT_AUTOMAKE([1.11 color-tests foreign parallel-tests silent-rules subdir-objects dist-bzip2 dist-lzip dist-xz dist-zip])
160 # Enable support for silent build rules
161 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
163 # versionning of library
164 MAGICK_LIB_VERSION="0x"
165 if test ${MAGICK_LIBRARY_CURRENT} -lt 10 ; then
166 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
168 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_CURRENT}
169 if test ${MAGICK_LIBRARY_AGE} -lt 10 ; then
170 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
172 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_AGE}
173 if test ${MAGICK_LIBRARY_REVISION} -lt 10 ; then
174 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
176 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_REVISION}
177 AC_SUBST(MAGICK_LIB_VERSION)
179 # Definition used to define MagickLibVersionText in version.h
180 MAGICK_LIB_VERSION_TEXT="${PACKAGE_VERSION}"
181 AC_SUBST(MAGICK_LIB_VERSION_TEXT)
183 # Definition used to define MagickLibVersionNumber in version.h
184 MAGICK_LIB_VERSION_NUMBER="${MAGICK_LIBRARY_CURRENT},${MAGICK_LIBRARY_AGE},${MAGICK_LIBRARY_REVISION}"
185 AC_SUBST(MAGICK_LIB_VERSION_NUMBER)
187 MAGICKPP_LIB_VERSION="0x"
188 if test ${MAGICKPP_LIBRARY_CURRENT} -lt 10 ; then
189 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}0
191 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}${MAGICKPP_LIBRARY_CURRENT}
192 if test ${MAGICKPP_LIBRARY_AGE} -lt 10 ; then
193 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}0
195 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}${MAGICKPP_LIBRARY_AGE}
196 if test ${MAGICKPP_LIBRARY_REVISION} -lt 10 ; then
197 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}0
199 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}${MAGICKPP_LIBRARY_REVISION}
200 AC_SUBST(MAGICKPP_LIB_VERSION)
202 # Definition used to define MagickLibVersionText in version.h
203 MAGICKPP_LIB_VERSION_TEXT="${PACKAGE_VERSION}"
204 AC_SUBST(MAGICKPP_LIB_VERSION_TEXT)
206 # Definition used to define MagickLibVersionNumber in version.h
207 MAGICK_LIB_VERSION_NUMBER="${MAGICK_LIBRARY_CURRENT},${MAGICK_LIBRARY_AGE},${MAGICK_LIBRARY_REVISION}"
208 AC_SUBST(MAGICK_LIB_VERSION_NUMBER)
212 # Regenerate config.status if ChangeLog or version.sh is updated.
213 AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/version.sh'])
218 MAGICK_CPPFLAGS=$CPPFLAGS_USER
219 MAGICK_PCFLAGS=$CPPFLAGS_USER
225 # Evaluate shell variable equivalents to Makefile directory variables
227 if test "x$prefix" = xNONE; then
228 prefix=$ac_default_prefix
230 # Let make expand exec_prefix.
231 if test "x$exec_prefix" = xNONE; then
232 exec_prefix='${prefix}'
236 eval "eval PREFIX_DIR=${prefix}"
238 eval "eval EXEC_PREFIX_DIR=${exec_prefix}"
239 AC_SUBST(EXEC_PREFIX_DIR)
240 eval "eval BIN_DIR=$bindir"
242 eval "eval SBIN_DIR=$sbindir"
244 eval "eval LIBEXEC_DIR=$libexecdir"
245 AC_SUBST(LIBEXEC_DIR)
246 eval "eval DATA_DIR=$datadir"
248 eval "eval DOC_DIR=$datadir/doc"
250 eval "eval SYSCONF_DIR=$sysconfdir"
251 AC_SUBST(SYSCONF_DIR)
252 eval "eval SHAREDSTATE_DIR=$sharedstatedir"
253 AC_SUBST(SHAREDSTATE_DIR)
254 eval "eval LOCALSTATE_DIR=$localstatedir"
255 AC_SUBST(LOCALSTATE_DIR)
256 eval "eval LIB_DIR=$libdir"
258 eval "eval INCLUDE_DIR=$includedir"
259 AC_SUBST(INCLUDE_DIR)
260 eval "eval PERSISTINCLUDE_DIR=$oldincludedir"
261 AC_SUBST(PERSISTINCLUDE_DIR)
262 eval "eval INFO_DIR=$infodir"
264 eval "eval MAN_DIR=$mandir"
267 # Get full paths to source and build directories
268 srcdirfull="`cd $srcdir && pwd`"
272 # Compute variables useful for running uninstalled software.
274 MAGICK_CODER_MODULE_PATH="${builddir}/coders"
275 MAGICK_CONFIGURE_SRC_PATH="${srcdirfull}/config"
276 MAGICK_CONFIGURE_BUILD_PATH="${builddir}/config"
277 MAGICK_FILTER_MODULE_PATH="${builddir}/filters"
279 case "${build_os}" in
281 MAGICK_CODER_MODULE_PATH=`$WinPathScript "${MAGICK_CODER_MODULE_PATH}" 0`
282 MAGICK_CONFIGURE_SRC_PATH=`$WinPathScript "${MAGICK_CONFIGURE_SRC_PATH}" 0`
283 MAGICK_CONFIGURE_BUILD_PATH=`$WinPathScript "${MAGICK_CONFIGURE_BUILD_PATH}" 0`
284 MAGICK_FILTER_MODULE_PATH=`$WinPathScript "${MAGICK_FILTER_MODULE_PATH}" 0`
293 AC_SUBST(MAGICK_CODER_MODULE_PATH)
294 AC_SUBST(MAGICK_CONFIGURE_SRC_PATH)
295 AC_SUBST(MAGICK_CONFIGURE_BUILD_PATH)
296 AC_SUBST(MAGICK_FILTER_MODULE_PATH)
301 # Enable OS features.
303 AC_USE_SYSTEM_EXTENSIONS
323 AX_GCC_ARCHFLAG([no])
326 # Check for linker script support
330 # Enable run-time checking.
332 AC_ARG_ENABLE([bounds-checking],
333 [AC_HELP_STRING([--enable-bounds-checking],
334 [enable run-time bounds-checking])],
335 [enable_bounds_checking=$enableval],
336 [enable_bounds_checking='no'])
338 if test "$enable_bounds_checking" = yes; then
339 AC_DEFINE([_FORTIFY_SOURCE], [2],
340 [enable run-time bounds-checking])
350 native_win32_build='no'
358 native_win32_build='yes'
362 if test "${GDI32_LIBS}x" != 'x'; then
363 AC_DEFINE(WINGDI32_DELEGATE,1,Define to use the Windows GDI32 library)
366 AM_CONDITIONAL(WINGDI32_DELEGATE, test "${GDI32_LIBS}x" != 'x' )
367 AM_CONDITIONAL(WIN32_NATIVE_BUILD, test "${native_win32_build}" = 'yes' )
368 AM_CONDITIONAL(CYGWIN_BUILD, test "${cygwin_build}" = 'yes' )
369 AM_CONDITIONAL(USING_CL, test "x${CC}" = 'xcl.exe' )
371 WinPathScript="${srcdirfull}/winpath.sh"
372 AC_SUBST(WinPathScript)
375 # Compiler flags tweaks
377 if test "${GCC}" != "yes"; then
380 # aCC: HP ANSI C++ B3910B A.03.34
381 CFLAGS="${CFLAGS} -Wp,-H30000"
382 if test -n "${CXXFLAGS}"; then
385 CXXFLAGS="${CXXFLAGS} -AA"
389 # Compaq alphaev68-dec-osf5.1 compiler
390 if test -n "${CXXFLAGS}"; then
391 CXXFLAGS='-std strict_ansi -noimplicit_include'
393 CXXFLAGS="${CXXFLAGS} -std strict_ansi -noimplicit_include"
398 # Check for lazy-loading.
399 AC_CACHE_CHECK([for linker lazyload option],[im_cv_ld_lazyload],
401 im_cv_ld_lazyload='none'
403 *-*-solaris2.8 | *-*-solaris2.9 | *-*-solaris2.1? )
404 if test "$lt_cv_prog_gnu_ld" != 'yes' ; then
405 im_cv_ld_lazyload='-Wl,-zlazyload'
410 if test "${im_cv_ld_lazyload}" != 'none' ; then
411 if test -z "${LDFLAGS}" ; then
412 LDFLAGS="${im_cv_ld_lazyload}"
414 LDFLAGS="${im_cv_ld_lazyload} ${LDFLAGS}"
418 dnl Platform-specific stuff
420 *darwin* | *-macos10*)
421 dnl Disable FORTIFY_SOURCE to fix a bug in LVVM / OpenMP support
422 CFLAGS="${CFLAGS} -D_FORTIFY_SOURCE=0"
423 dnl OS X universal binary support, requires --disable-dependency-tracking
424 AC_ARG_ENABLE([osx-universal-binary],
425 AC_HELP_STRING([--enable-osx-universal-binary],
426 [build universal binary on OS X [[default=no]]]),
427 [build_osxuniversal="${enableval}"], [build_osxuniversal=no])
429 if test "${build_osxuniversal}" != no ; then
430 if test "$enable_dependency_tracking" != no ; then
431 AC_MSG_ERROR([--enable-osx-universal-binary requires --disable-dependency-tracking.
432 Please re-run configure with these options:
433 --disable-dependency-tracking --enable-osx-universal-binary
436 CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
437 CXXFLAGS="$CXXFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
438 LDFLAGS="$LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
444 # ARCH specific include directory
446 AC_ARG_WITH([includearch-dir],
447 [AC_HELP_STRING([--includearch-dir=DIR],
448 [ARCH specific include directory])],
449 [includearch_dir=$withval],
450 [includearch_dir=$INCLUDE_DIR])
452 eval "eval INCLUDEARCH_DIR=$includearch_dir"
453 AC_SUBST(INCLUDEARCH_DIR)
456 # ARCH specific configuration directory
458 AC_ARG_WITH([sharearch-dir],
459 [AC_HELP_STRING([--sharearch-dir=DIR],
460 [ARCH specific config directory])],
461 [sharearch_dir=$withval],
462 [sharearch_dir="${LIB_DIR}"])
464 eval "eval SHAREARCH_DIR=$sharearch_dir"
465 AC_SUBST(SHAREARCH_DIR)
467 # Path to the pkgconfig folder
468 AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=DIR],
469 [Path to the pkgconfig directory @<:@LIBDIR/pkgconfig@:>@]),
470 [pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
471 AC_SUBST([pkgconfigdir])
474 # Enable support for threads
476 # Find Posix threads library
478 AC_ARG_WITH([threads],
479 [AC_HELP_STRING([--without-threads], [disable threads support])],
480 [with_threads=$withval],
481 [with_threads='yes'])
485 if test "$with_threads" != 'no'; then
487 if test "$ax_pthread_ok" = yes; then
489 DEF_THREAD="$PTHREAD_CFLAGS"
490 CFLAGS="$CFLAGS $DEF_THREAD"
491 CXXFLAGS="$CXXFLAGS $DEF_THREAD"
492 THREAD_LIBS="$PTHREAD_LIBS"
493 if test "$CC" != "$PTHREAD_CC"; then
494 AC_MSG_WARN([Replacing compiler $CC with compiler $PTHREAD_CC to support pthreads.])
497 AC_DEFINE(THREAD_SUPPORT,1,[Define if you have POSIX threads libraries and header files.])
500 LIBS="$LIBS $THREAD_LIBS"
501 AC_SUBST(THREAD_LIBS)
503 # Enable support for OpenMP
504 if test "$have_threads" != 'yes'; then
505 ac_cv_prog_c_openmp=unsupported
508 CFLAGS="$OPENMP_CFLAGS $CFLAGS"
509 MAGICK_PCFLAGS="$MAGICK_PCFLAGS $OPENMP_CFLAGS"
510 AC_SUBST(OPENMP_CFLAGS)
511 if test "$enable_openmp" != no; then
512 if test "$ac_cv_prog_c_openmp" != 'unsupported'; then
513 MAGICK_FEATURES="OpenMP $MAGICK_FEATURES"
517 # Enable support for OpenCL
519 CFLAGS="$CL_CFLAGS $CFLAGS"
520 CPPFLAGS="$CL_CFLAGS $CPPFLAGS"
521 LIBS="$CL_LIBS $LIBS"
523 if test "$enable_opencl" != no; then
524 if test "X$ax_cv_check_cl_libcl" != Xno; then :
525 MAGICK_FEATURES="OpenCL $MAGICK_FEATURES"
531 # Check for large file support
537 if test "$enable_largefile" != no; then
538 case $ac_cv_sys_file_offset_bits in
540 # nothing to do here as the host supports LFS fine
543 AC_MSG_CHECKING([for native large file support])
544 AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>
546 exit(!(sizeof(off_t) == 8));
548 [ac_cv_sys_file_offset_bits=64; AC_DEFINE(_FILE_OFFSET_BITS,64)
549 AC_MSG_RESULT([yes])],
550 [AC_MSG_RESULT([no])])
553 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
556 if test "$ac_cv_sys_large_files" != 'no'; then
557 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGE_FILES=1"
559 if test "$ac_cv_sys_largefile_source" != 'no'; then
560 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGEFILE_SOURCE=1"
563 AC_SUBST(LFS_CPPFLAGS)
569 AC_SUBST(LIBTOOL_DEPS)
571 # Check to see if building shared libraries
572 libtool_build_shared_libs='no'
573 if test "$enable_shared" = 'yes'; then
574 libtool_build_shared_libs='yes'
577 # Check to see if building static libraries
578 libtool_build_static_libs='no'
579 if test "$enable_static" = 'yes'; then
580 libtool_build_static_libs='yes'
583 AM_CONDITIONAL(WITH_SHARED_LIBS, test "${libtool_build_shared_libs}" = 'yes')
585 # Enable support for building loadable modules
588 AC_ARG_WITH([modules],
589 [AC_HELP_STRING([--with-modules],
590 [enable building dynamically loadable modules])],
591 [with_modules=$withval],
594 # Only allow building loadable modules if we are building shared libraries
595 if test "$with_modules" != 'no' ; then
596 if test "$libtool_build_shared_libs" = 'no'; then
597 AC_MSG_WARN([Modules may only be built if building shared libraries is enabled.])
603 if test "$build_modules" != 'no' ; then
604 AC_DEFINE(BUILD_MODULES,1,Define if coders and filters are to be built as modules.)
605 MAGICK_FEATURES="$MAGICK_FEATURES Modules"
607 AM_CONDITIONAL(WITH_MODULES, test "$build_modules" != 'no')
609 # Enable build using delegate libraries built in subdirectories rather than installed
610 # delegate libraries (bzlib fftw fpx gslib jp2 jbig jpeg lcms lzma png tiff ttf wmf xml zlib)
611 AC_ARG_ENABLE([delegate-build],
612 [AC_HELP_STRING([--enable-delegate-build],
613 [look for delegate libraries in build directory])],
614 [enable_delegate_build=$enableval],
615 [enable_delegate_build='no'])
617 AC_ARG_ENABLE([deprecated],
618 [AC_HELP_STRING([--disable-deprecated],
619 [exclude deprecated methods in MagickCore and MagickWand APIs])],
620 [enable_deprecated=$enableval],
621 [enable_deprecated='no'])
623 if test "$enable_deprecated" = 'yes'; then
624 AC_DEFINE(EXCLUDE_DEPRECATED,1,[exclude deprecated methods in MagickCore API])
626 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-deprecated "
629 # Build a version of ImageMagick which operates uninstalled.
630 # Used to build distributions located via MAGICK_HOME / executable path
631 AC_ARG_ENABLE([installed],
632 [AC_HELP_STRING([--disable-installed],
633 [Formally install ImageMagick under PREFIX])],
634 [enable_installed=$enableval],
635 [enable_installed='yes'])
637 if test "$enable_installed" = 'yes'; then
638 AC_DEFINE(INSTALLED_SUPPORT,1,[ImageMagick is formally installed under prefix])
640 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-installed "
643 # Permit enciphering and deciphering image pixels.
644 AC_ARG_ENABLE([cipher],
645 [AC_HELP_STRING([--disable-cipher],
646 [disable enciphering and deciphering image pixels])],
647 [enable_cipher=$enableval],
648 [enable_cipher='yes'])
650 if test "$enable_cipher" = 'yes'; then
651 AC_DEFINE(CIPHER_SUPPORT,1,[permit enciphering and deciphering image pixels])
654 # Build a zero-configuration version of ImageMagick.
655 AC_ARG_ENABLE([zero-configuration],
656 [AC_HELP_STRING([--enable-zero-configuration],
657 [enable self-contained, embeddable, zero-configuration ImageMagick])],
658 [enable_zero_configuration=$enableval],
659 [enable_zero_configuration='no'])
661 if test "$enable_zero_configuration" = 'yes'; then
662 AC_DEFINE(ZERO_CONFIGURATION_SUPPORT,1,[Build self-contained, embeddable, zero-configuration ImageMagick])
663 MAGICK_FEATURES="Zero-Configuration $MAGICK_FEATURES"
666 # Build a high dynamic range version of ImageMagick.
667 AC_ARG_ENABLE([hdri],
668 [AC_HELP_STRING([--enable-hdri],
669 [accurately represent the wide range of intensity levels found in real scenes])],
670 [enable_hdri=$enableval],
674 if test "$enable_hdri" = 'yes'; then
676 magick_hdri_enable='1';
677 MAGICK_FEATURES="HDRI $MAGICK_FEATURES"
679 magick_hdri_enable='0'
681 AC_DEFINE_UNQUOTED(HDRI_ENABLE_OBSOLETE_IN_H,$magick_hdri_enable,[Whether hdri is enabled or not])
682 AC_SUBST(MAGICK_HDRI)dnl
683 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -DMAGICKCORE_HDRI_ENABLE=$magick_hdri_enable"
684 CFLAGS="$CFLAGS -DMAGICKCORE_HDRI_ENABLE=$magick_hdri_enable"
685 CPPFLAGS="$CPPFLAGS -DMAGICKCORE_HDRI_ENABLE=$magick_hdri_enable"
687 # Build a version of ImageMagick with assert statements.
688 AC_ARG_ENABLE([assert],
689 [AC_HELP_STRING([--disable-assert],
690 [disable assert() statements in build])],
691 [enable_assert=$enableval],
692 [enable_assert='yes'])
694 if test "$enable_assert" = 'no'; then
695 AC_DEFINE(NDEBUG,1,[Turn off assert statements])
698 # Don't emit "rebuild rules" for configure, Makefile.ins, etc.
701 # Enable hugepages support
702 AC_ARG_ENABLE([hugepages],
703 [AC_HELP_STRING([--enable-hugepages],
704 [enable 'huge pages' support])],
705 [enable_hugepages=$enableval],
706 [enable_hugepages='no'])
708 # Enable ccmalloc memory debugging support
709 AC_ARG_ENABLE([ccmalloc],
710 [AC_HELP_STRING([--enable-ccmalloc],
711 [enable 'ccmalloc' memory debug support])],
712 [enable_ccmalloc=$enableval],
713 [enable_ccmalloc='no'])
715 # Enable Electric Fence memory debugging support
716 AC_ARG_ENABLE([efence],
717 [AC_HELP_STRING([--enable-efence],
718 [enable 'efence' memory debug support])],
719 [enable_efence=$enableval],
720 [enable_efence='no'])
722 # Enable prof-based profiling support
723 AC_ARG_ENABLE([prof],
724 [AC_HELP_STRING([--enable-prof],
725 [enable 'prof' profiling support])],
726 [enable_prof=$enableval],
729 # Enable gprof-based profiling support
730 AC_ARG_ENABLE([gprof],
731 [AC_HELP_STRING([--enable-gprof],
732 [enable 'gprof' profiling support])],
733 [enable_gprof=$enableval],
736 # Enable gcov-based profiling support
737 AC_ARG_ENABLE([gcov],
738 [AC_HELP_STRING([--enable-gcov],
739 [enable 'gcov' profiling support])],
740 [enable_gcov=$enableval],
743 enable_profiling='no'
744 if test "$enable_prof" = 'yes' || test "$enable_gprof" = 'yes' || test "$enable_gcov" = 'yes'; then
745 enable_profiling='yes'
746 if test "$libtool_build_shared_libs" = 'yes'; then
747 echo "Warning: Can not profile code using shared libraries"
751 # Magick API method prefix
752 AC_ARG_WITH([method-prefix],
753 [AC_HELP_STRING([--with-method-prefix=PREFIX],
754 [prefix MagickCore API methods])],
755 [with_method_prefix=$withval],
756 [with_method_prefix='no'])
758 if test "$with_method_prefix" != 'no'; then
759 AC_DEFINE_UNQUOTED(NAMESPACE_PREFIX,$with_method_prefix,[Magick API method prefix])
760 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-method-prefix "
763 # Enable legacy support (default no)
764 AC_ARG_ENABLE(legacy-support,
765 [ --enable-legacy-support install legacy command-line utilities (default disabled)],
766 [with_legacy_support=$enableval],
767 [with_legacy_support='no'])
768 AM_CONDITIONAL(LEGACY_SUPPORT, test "$with_legacy_support" != 'no')
770 # Number of bits in a Quantum
771 AC_ARG_WITH([quantum-depth],
772 [AC_HELP_STRING([--with-quantum-depth=DEPTH],
773 [number of bits in a pixel quantum (default 16)])],
774 [with_quantum_depth=$withval],
775 [with_quantum_depth=16])
777 if test "$with_quantum_depth" != '8'; then
778 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-quantum-depth=$with_quantum_depth "
781 case "${with_quantum_depth}" in
786 * ) AC_MSG_ERROR("Pixel quantum depth must have value of 8, 16, 32, or 64") ;;
788 QUANTUM_DEPTH="$with_quantum_depth"
789 AC_DEFINE_UNQUOTED(QUANTUM_DEPTH_OBSOLETE_IN_H,$QUANTUM_DEPTH,[Number of bits in a pixel Quantum (8/16/32/64)])
790 AC_SUBST(QUANTUM_DEPTH)dnl
791 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -DMAGICKCORE_QUANTUM_DEPTH=$QUANTUM_DEPTH"
792 CFLAGS="$CFLAGS -DMAGICKCORE_QUANTUM_DEPTH=$QUANTUM_DEPTH"
793 CPPFLAGS="$CPPFLAGS -DMAGICKCORE_QUANTUM_DEPTH=$QUANTUM_DEPTH"
795 # define a lib suffix for abi purpose
796 MAGICK_ABI_SUFFIX="Q${QUANTUM_DEPTH}"
797 if test "$enable_hdri" = 'yes'; then
798 MAGICK_ABI_SUFFIX="Q${QUANTUM_DEPTH}${MAGICK_HDRI}"
800 AC_SUBST(MAGICK_ABI_SUFFIX)
802 # Set pixel cache threshold
804 [AC_HELP_STRING([--with-cache=THRESHOLD],
805 [set pixel cache threshhold in MB (default available memory)])],
806 [with_cache=$withval],
809 if test "$with_cache" != ''; then
810 AC_DEFINE_UNQUOTED(PixelCacheThreshold,$with_cache,[Pixel cache threshold in MB (defaults to available memory)])
811 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-cache=$with_cache "
814 # Disable/Enable support for full delegate paths
815 AC_ARG_WITH([frozenpaths],
816 [AC_HELP_STRING([--with-frozenpaths],
817 [freeze delegate paths])],
818 [with_frozenpaths=$withval],
819 [with_frozenpaths='no'])
821 # Enable build/install of Magick++
822 AC_ARG_WITH([magick-plus-plus],
823 [AC_HELP_STRING([--without-magick-plus-plus],
824 [disable build/install of Magick++])],
825 [with_magick_plus_plus=$withval],
826 [with_magick_plus_plus='yes'])
828 # Encode the this name into the shared library.
829 AC_ARG_WITH([package-release-name],
830 [AC_HELP_STRING([--with-package-release-name=NAME],
831 [encode this name into the shared library])],
832 [MAGICK_LT_RELEASE_OPTS="-release $withval"])
833 AC_SUBST(MAGICK_LT_RELEASE_OPTS)
835 # Disable build/install of PerlMagick.
837 [AC_HELP_STRING([--with-perl],
838 [enable build/install of PerlMagick])],
839 [with_perl=$withval],
842 # Options to pass when configuring PerlMagick
843 AC_ARG_WITH([perl-options],
844 [AC_HELP_STRING([--with-perl-options=OPTIONS],
845 [options to pass on command-line when generating PerlMagick build file])],
846 PERL_MAKE_OPTIONS=$withval)
847 AC_SUBST(PERL_MAKE_OPTIONS)
849 # Enable umem, object-caching memory allocation library.
851 [ --with-umem enable umem memory allocation library support],
852 [with_umem=$withval],
854 if test "$with_umem" != 'yes' ; then
855 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-umem=$with_umem "
859 # Specify path to shared libstdc++ if not in normal location
861 AC_ARG_WITH([libstdc],
862 [AC_HELP_STRING([--with-libstdc=DIR],
863 [ use libstdc++ in DIR (for GNU C++)])],
864 [with_libstdc=$withval],
867 if test "$with_libstdc" != ''; then
868 if test -d "$with_libstdc"; then
869 LIBSTDCLDFLAGS="-L$with_libstdc"
872 AC_SUBST(LIBSTDCLDFLAGS)
874 # Does gcc required -traditional?
875 AC_PROG_GCC_TRADITIONAL
879 # Set defines required to build DLLs and modules using MinGW
882 # These options are set for multi-thread DLL module build
883 # libMagickCore: _DLL _MAGICKMOD_ _MAGICKLIB_
885 # executable/Magick++: _DLL _MAGICKMOD_
886 MODULE_EXTRA_CPPFLAGS=''
887 LIBRARY_EXTRA_CPPFLAGS=''
888 if test "${native_win32_build}" = 'yes'; then
889 if test "${libtool_build_shared_libs}" = 'yes'; then
890 CPPFLAGS="$CPPFLAGS -D_DLL"
891 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_DLL"
892 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_DLL"
893 LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKLIB_"
894 if test "$build_modules" = 'yes'; then
895 LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKMOD_"
897 MODULE_EXTRA_CPPFLAGS="$MODULE_EXTRA_CPPFLAGS -D_MAGICKLIB_"
900 CPPFLAGS="$CPPFLAGS -D_LIB"
901 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_LIB"
902 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_LIB"
904 if test "$with_threads" = 'yes'; then
905 CPPFLAGS="$CPPFLAGS -D_MT"
906 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_MT"
907 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_MT"
910 AC_SUBST(MODULE_EXTRA_CPPFLAGS)
911 AC_SUBST(LIBRARY_EXTRA_CPPFLAGS)
913 # Check standard headers
915 if ! test x"$ac_cv_header_stdc" = x"yes"; then
916 AC_MSG_WARN([configure has detected that you do not have the ANSI standard C
917 header files. Compilation cannot proceed. Please install the ANSI C
918 headers and rerun this script.]);
923 # Check additional headers
924 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)
928 # Checks for typedefs, structures, and compiler characteristics.
942 # Checks for language qualifiers and semantics.
950 # If words are stored with the most significant byte first (like
951 # Motorola and SPARC CPUs), define `WORDS_BIGENDIAN'.
954 # Define to a suitable type, if standard headers do not define it.
962 AC_TYPE_LONG_DOUBLE_WIDER
963 AC_TYPE_LONG_LONG_INT
977 AC_TYPE_UNSIGNED_LONG_LONG_INT
979 # Float_t and double_t are intended to be the the most efficient type.
980 AC_CHECK_TYPES([float_t], [], [], [[#include <math.h>]])
981 AC_CHECK_TYPES([double_t], [], [], [[#include <math.h>]])
982 AC_CHECK_SIZEOF([float_t], [], [[#include <math.h>]])
983 AC_CHECK_SIZEOF([double_t], [], [[#include <math.h>]])
985 # Get size of float, double and long double for comparaison.
986 AC_CHECK_SIZEOF([float])
987 AC_CHECK_SIZEOF([double])
988 AC_CHECK_SIZEOF([long double])
990 # Obtain size of an 'signed short' and define as SIZEOF_SIGNED_SHORT
991 AC_CHECK_SIZEOF(signed short)
993 # Obtain size of an 'unsigned short' and define as SIZEOF_UNSIGNED_SHORT
994 AC_CHECK_SIZEOF(unsigned short)
996 # Obtain size of an 'signed int' and define as SIZEOF_SIGNED_INT
997 AC_CHECK_SIZEOF(signed int)
999 # Obtain size of an 'unsigned int' and define as SIZEOF_UNSIGNED_INT
1000 AC_CHECK_SIZEOF(unsigned int)
1002 # Obtain size of a 'signed long' and define as SIZEOF_SIGNED_LONG
1003 AC_CHECK_SIZEOF(signed long)
1005 # Obtain size of a 'unsigned long' and define as SIZEOF_UNSIGNED_LONG
1006 AC_CHECK_SIZEOF(unsigned long)
1008 # Obtain size of a 'long long' and define as SIZEOF_SIGNED_LONG_LONG. If
1009 # 'signed long long' is not supported then the value defined is zero.
1010 AC_CHECK_SIZEOF(signed long long)
1012 # Obtain size of a 'unsigned long long' and define as
1013 # SIZEOF_UNSIGNED_LONG_LONG. If 'unsigned long long' is not
1014 # supported then the value defined is zero.
1015 AC_CHECK_SIZEOF(unsigned long long)
1017 # Obtain size of off_t and define as SIZEOF_OFF_T
1018 AC_CHECK_SIZEOF(off_t)
1020 # Obtain size of size_t and define as SIZEOF_SIZE_T
1021 AC_CHECK_SIZEOF(size_t)
1023 # Obtain size of ssize_t and define as SIZEOF_SSIZE_T
1024 AC_CHECK_SIZEOF(ssize_t)
1026 # Obtain size of an unsigned int pointer and define as SIZEOF_UNSIGNED_INTP
1027 AC_CHECK_SIZEOF(unsigned int*)
1030 # Compute sized types for current CPU and compiler options.
1033 AC_MSG_CHECKING(for signed 8-bit type)
1034 INT8_T='signed char'
1035 AC_MSG_RESULT($INT8_T)
1038 AC_MSG_CHECKING(for unsigned 8-bit type)
1039 UINT8_T='unsigned char'
1040 AC_MSG_RESULT($UINT8_T)
1043 AC_MSG_CHECKING(for signed 16-bit type)
1044 INT16_T='signed short'
1045 AC_MSG_RESULT($INT16_T)
1048 AC_MSG_CHECKING(for unsigned 16-bit type)
1049 UINT16_T='unsigned short'
1050 AC_MSG_RESULT($UINT16_T)
1053 AC_MSG_CHECKING(for signed 32-bit type)
1056 if test $ac_cv_sizeof_signed_int -eq 4; then
1057 INT32_T='signed int'
1059 elif test $ac_cv_sizeof_signed_long -eq 4; then
1060 INT32_T='signed long'
1063 AC_MSG_RESULT($INT32_T)
1067 AC_MSG_CHECKING(for unsigned 32-bit type)
1070 if test $ac_cv_sizeof_unsigned_int -eq 4; then
1071 UINT32_T='unsigned int'
1073 elif test $ac_cv_sizeof_unsigned_long -eq 4; then
1074 UINT32_T='unsigned long'
1077 AC_MSG_RESULT($UINT32_T)
1081 AC_MSG_CHECKING(for signed 64-bit type)
1084 if test $ac_cv_sizeof_signed_long -eq 8; then
1085 INT64_T='signed long'
1087 elif test $ac_cv_sizeof_signed_long_long -eq 8; then
1088 INT64_T='signed long long'
1091 case "${host_os}" in
1096 AC_MSG_RESULT($INT64_T)
1100 AC_MSG_CHECKING(for unsigned 64-bit type)
1103 if test $ac_cv_sizeof_unsigned_long -eq 8; then
1104 UINT64_T='unsigned long'
1106 elif test $ac_cv_sizeof_unsigned_long_long -eq 8; then
1107 UINT64_T='unsigned long long'
1110 case "${host_os}" in
1115 AC_MSG_RESULT($UINT64_T)
1119 AC_MSG_CHECKING(for unsigned maximum type)
1122 if test "$UINT64_T" != 'none'; then
1125 elif test "$UINT32_T" != 'none'; then
1129 AC_MSG_RESULT($UINTMAX_T)
1133 AC_MSG_CHECKING(for pointer difference type)
1136 if test $ac_cv_sizeof_unsigned_long -eq $ac_cv_sizeof_unsigned_intp; then
1137 UINTPTR_T='unsigned long'
1139 elif test $ac_cv_sizeof_unsigned_long_long -eq $ac_cv_sizeof_unsigned_intp; then
1140 UINTPTR_T='unsigned long long'
1143 AC_MSG_RESULT($UINTPTR_T)
1147 AC_MSG_CHECKING([whether our compiler supports __func__])
1149 [{ const char *func = __func__; return(func != 0 ? 0 : 1); }],
1150 AC_MSG_RESULT([yes]),
1152 AC_MSG_CHECKING([whether our compiler supports __FUNCTION__])
1154 [{ const char *func = __FUNCTION__; return(func != 0 ? 0 : 1); }],
1155 AC_MSG_RESULT([yes])
1156 AC_DEFINE(__func__, __FUNCTION__,
1157 [Define to appropriate substitue if compiler does not have __func__]),
1159 AC_DEFINE(__func__, __FILE__,
1160 [Define to appropriate substitue if compiler does not have __func__])))
1164 # Check for functions
1167 AC_FUNC_CLOSEDIR_VOID
1171 AC_FUNC_SELECT_ARGTYPES
1172 AC_FUNC_SETVBUF_REVERSED
1182 AC_CHECK_LIB(m,sqrt,MATH_LIBS="-lm",,)
1183 LIBS="$MATH_LIBS $LIBS"
1187 # Find socket library
1189 AC_SEARCH_LIBS(gethostbyname, resolv nsl)
1190 AC_SEARCH_LIBS(socket, socket,
1192 AC_DEFINE([HAVE_SOCKET],[1],[Define to 1 if you have socket support.])
1193 MAGICK_FEATURES="DPC $MAGICK_FEATURES"
1196 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])
1199 # Check for clock_gettime().
1201 AC_SEARCH_LIBS(clock_gettime, rt,
1203 AC_DEFINE([HAVE_CLOCK_GETTIME],[1],[Define to 1 if you have clock_gettime.])
1204 AC_MSG_CHECKING([whether clock_gettime supports CLOCK_REALTIME])
1207 [[#include <time.h>]],
1208 [[clockid_t clockType = CLOCK_REALTIME;]])],
1211 AC_DEFINE([HAVE_CLOCK_REALTIME],[1],
1212 [Define to 1 if clock_gettime supports CLOCK_REALTIME.])
1218 AC_CHECK_FUNCS([gettimeofday ftime], [break])
1224 # Check for function prototypes
1228 AC_CHECK_DECLS([pread, pwrite],[],[],[
1229 #include <unistd.h>])
1231 AC_CHECK_DECLS([strlcpy],[],[],[
1232 #include <strings.h>])
1234 AC_CHECK_DECLS([vsnprintf],[],[],[
1236 #include <stdarg.h>])
1240 # C++ Support Tests (For Magick++)
1243 have_magick_plus_plus='no'
1244 if test "$with_magick_plus_plus" = 'yes'; then
1249 # Full set of headers used...
1250 # algorithm cctype cerrno cmath cstdio cstdlib cstring ctime exception
1251 # functional iomanip iosfwd iostream iterator list string strstream utility
1256 AX_CXX_NAMESPACE_STD
1257 AC_CXX_HAVE_STD_LIBS
1261 AC_MSG_CHECKING([whether C++ compiler is sufficient for Magick++])
1263 test $ax_cv_cxx_bool = 'yes' && \
1264 test $ax_cv_cxx_namespaces = 'yes' && \
1265 test $ac_cv_cxx_have_std_libs = 'yes' && \
1266 test $ax_cv_cxx_have_std_namespace = 'yes'; then
1267 have_magick_plus_plus='yes'
1269 have_magick_plus_plus='no (failed tests)'
1271 AC_MSG_RESULT([$have_magick_plus_plus])
1274 AM_CONDITIONAL(WITH_MAGICK_PLUS_PLUS, test "$have_magick_plus_plus" = 'yes')
1276 # Only check for delegate libraries in subdirectories if requested.
1277 if test "$enable_delegate_build" != 'no'; then
1278 # Check for delegate sub-directories and add -I & -L options as required.
1279 # This presumes that delegates are installed as detailed in the ImageMagick
1280 # README. If delegates are installed in a standard location where the
1281 # compiler will automatically find them then these options should not be
1285 # Most delegates have includes in the same directory as the library, but not all...
1288 for dir in bzlib fftw fpx gslib/src jp2 jp2/src/libjasper/include jbig/libjbig jpeg lcms/include lzma magick mupdf png tiff/libtiff ttf/include wand webp wmf/include xml/include zlib; do
1289 if test -d "$builddir/$dir"; then
1290 CPPFLAGS="$CPPFLAGS -I$builddir/$dir"
1292 if test -d "$srcdirfull/$dir"; then
1293 CPPFLAGS="$CPPFLAGS -I$srcdirfull/$dir"
1299 for dir in bzlib fftw fpx gslib/src jp2 jp2/src/libjasper jbig/libjbig jpeg lcms/src lzma magick mupdf png tiff/libtiff ttf/objs wand webp wmf/src xml zlib; do
1300 if test -d "$builddir/$dir/.libs"; then
1301 LDFLAGS="$LDFLAGS -L$builddir/$dir/.libs"
1303 if test -d "$srcdirfull/$dir/.libs"; then
1304 LDFLAGS="$LDFLAGS -L$srcdirfull/$dir/.libs"
1307 if test -d "$builddir/$dir"; then
1308 LDFLAGS="$LDFLAGS -L$builddir/$dir"
1310 if test -d "$srcdirfull/$dir"; then
1311 LDFLAGS="$LDFLAGS -L$srcdirfull/$dir"
1317 # Assume that delegate headers reside under same directory as ImageMagick
1318 # installation prefix.
1319 MAGICK_CPPFLAGS="-I$INCLUDE_DIR/${PACKAGE_NAME}-$MAGICK_MAJOR_VERSION $MAGICK_CPPFLAGS"
1322 # Find the X11 RGB database
1324 AC_CACHE_CHECK(for X11 configure files,im_cv_x_configure,
1325 [# Look for the header file in a standard set of common directories.
1326 # Check X11 before X11Rn because it is often a symlink to the current release.
1335 /usr/XFree86/lib/X11 \
1343 /usr/local/X11/lib \
1344 /usr/local/X11R4/lib \
1345 /usr/local/X11R5/lib \
1346 /usr/local/X11R6/lib \
1348 /usr/local/lib/X11 \
1349 /usr/local/lib/X11R4 \
1350 /usr/local/lib/X11R5 \
1351 /usr/local/lib/X11R6 \
1352 /usr/local/lib/X11R7 \
1353 /usr/local/x11r5/lib \
1354 /usr/lpp/Xamples/lib \
1356 /usr/openwin/share/lib \
1357 /usr/unsupported/lib \
1360 if test -f "$ac_dir/X11/rgb.txt"; then
1361 im_cv_x_configure="$ac_dir/X11/"
1363 elif test -f "$ac_dir/rgb.txt"; then
1364 im_cv_x_configure="$ac_dir/"
1369 X11_CONFIGURE_PATH="$im_cv_x_configure"
1370 case "${build_os}" in
1372 X11ConfigurePath=`$WinPathScript "$X11ConfigurePath=" 1`
1375 AC_DEFINE_UNQUOTED(X11_CONFIGURE_PATH,"$X11ConfigurePath",[Location of X11 configure files])
1378 # Find OpenMP library
1381 if test "$enable_openmp" != 'no'; then
1382 if test "${GCC}" = "yes"; then
1383 # Open64 (passes for GCC but uses different OpenMP implementation)
1384 if test "x$GOMP_LIBS" = x ; then
1385 if $CC --version 2>&1 | grep Open64 > /dev/null ; then
1386 AC_CHECK_LIB(openmp,omp_get_num_procs,GOMP_LIBS="-lopenmp",,)
1390 if test "x$GOMP_LIBS" = x ; then
1391 AC_CHECK_LIB(gomp,GOMP_parallel_start,GOMP_LIBS="-lgomp",,)
1395 if test "x$GOMP_LIBS" = x ; then
1396 AC_CHECK_LIB(mtsk,sunw_mp_register_warn,GOMP_LIBS="-lmtsk",,)
1399 if test "x$GOMP_LIBS" = x ; then
1400 AC_CHECK_LIB(xlsmp,_xlsmpFlush,GOMP_LIBS="-lxlsmp",,)
1402 # SGI IRIX 6.5 MIPSpro C/C++
1403 if test "x$GOMP_LIBS" = x ; then
1404 AC_CHECK_LIB(mp,mp_destroy,GOMP_LIBS="-lmp",,)
1407 LIBS="$GOMP_LIBS $LIBS"
1418 if test "$with_umem" != 'no'; then
1419 AC_MSG_CHECKING(for UMEM support )
1423 AC_CHECK_HEADER(umem.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1424 AC_CHECK_LIB(umem,umem_alloc,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1425 AC_CHECK_LIB(umem,umem_free,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1426 AC_MSG_CHECKING(if umem memory allocation library is complete)
1427 if test $passed -gt 0; then
1428 if test $failed -gt 0; then
1429 AC_MSG_RESULT(no -- some components failed test)
1430 have_umem='no (failed tests)'
1433 LIBS="$UMEM_LIBS $LIBS"
1434 AC_DEFINE(HasUMEM,1,Define if you have umem memory allocation library)
1442 AM_CONDITIONAL(HasUMEM, test "$have_umem" = 'yes')
1446 # Add support for ccmalloc memory debugging library if requested
1450 if test "$enable_ccmalloc" = 'yes'; then
1451 AC_PATH_PROG(CCMALLOCDelegate,ccmalloc,)
1452 if test -n "$CCMALLOCDelegate"; then
1453 eval `grep PREFIX= $CCMALLOCDelegate | sed -e 's/PREFIX/CCMALLOC_PREFIX/'`
1455 # Assume that gcc is used with ccmalloc.
1456 LIBS="$LIBS $CCMALLOC_PREFIX/lib/ccmalloc-gcc.o"
1457 AC_CHECK_LIB(ccmalloc,ccmalloc_malloc,CCMALLOC_LIBS="$CCMALLOC_PREFIX/lib/ccmalloc-gcc.o -lccmalloc -ldl",,-ldl)
1458 if test -n "$CCMALLOC_LIBS"; then
1460 LIBS="$LIBS $CCMALLOC_LIBS"
1469 # Add support for 'huge pages' if requested
1471 AS_IF([test "x$enable_hugepages" != "xno"],[
1472 AC_DEFINE(HAVE_HUGEPAGES, 1, [Compile with hugepage support])
1476 # Add support for efence memory debugging library if requested
1478 if test "$enable_efence" = 'yes'; then
1479 EFENCE_LIBS='-lefence'
1480 LIBS="$EFENCE_LIBS $LIBS"
1483 dnl ===========================================================================
1489 AC_ARG_WITH([bzlib],
1490 [AC_HELP_STRING([--without-bzlib],
1491 [disable BZLIB support])],
1492 [with_bzlib=$withval],
1495 if test "$with_bzlib" != 'yes'; then
1496 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-bzlib=$with_bzlib "
1500 if test "$with_bzlib" != 'no'; then
1502 AC_MSG_RESULT([-------------------------------------------------------------])
1503 AC_MSG_CHECKING([for BZLIB])
1508 AC_CHECK_HEADER(bzlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1509 AC_CHECK_LIB(bz2,BZ2_bzDecompress,found_libbz=`expr $found_libbz + 1`,,)
1510 if test "$native_win32_build" = 'yes'; then
1511 AC_CHECK_LIB(bz2,_imp__BZ2_decompress,found_libbz=`expr $found_libbz + 1`,,)
1513 if test $found_libbz -gt 0; then
1514 passed=`expr $passed + 1`
1516 failed=`expr $failed + 1`
1518 AC_MSG_CHECKING(if BZLIB package is complete)
1519 if test $passed -gt 0; then
1520 if test $failed -gt 0; then
1521 AC_MSG_RESULT(no -- some components failed test)
1522 have_bzlib='no (failed tests)'
1525 LIBS="$BZLIB_LIBS $LIBS"
1526 AC_DEFINE(BZLIB_DELEGATE,1,Define if you have the bzip2 library)
1534 AM_CONDITIONAL(BZLIB_DELEGATE, test "$have_bzlib" = 'yes')
1535 AC_SUBST(BZLIB_LIBS)
1538 # Find the X11 include and library directories.
1545 if test "$no_x" != 'yes'; then
1546 AC_MSG_RESULT([-------------------------------------------------------------])
1547 AC_MSG_CHECKING([for X11])
1549 LDFLAGS="$LDFLAGS $X_LIBS"
1550 X11_LIBS="$X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
1551 LIBS="$X11_LIBS $LIBS"
1552 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1554 AC_DEFINE(X11_DELEGATE,1,Define if you have X11 library)dnl
1557 # Check for X11 shared memory extension
1559 # shmctl is required to support the shared memory extension
1560 AC_CHECK_FUNC([shmctl],[have_shmctl='yes'],[])
1561 if test "$have_shmctl" != 'yes'; then
1563 LIBS="$LIBS -lcygipc"
1564 AC_TRY_LINK_FUNC([shmctl],[have_shmctl='yes'; IPC_LIBS='-lcygipc'],[])
1568 if test "$have_shmctl" = 'yes'; then
1569 AC_CHECK_LIB([Xext],[XShmAttach],[XEXT_LIBS='-lXext' ; AC_DEFINE(HAVE_SHARED_MEMORY,1,X11 server supports shared memory extension)],[],[])
1573 # Check for X11 shape extension
1575 AC_CHECK_LIB([Xext],[XShapeCombineMask],[XEXT_LIBS='-lXext' ; AC_DEFINE(HAVE_SHAPE,1,X11 server supports shape extension)],[],[])
1576 AC_CHECK_LIB(Xt,XtSetEventDispatcher,XT_LIBS='-lXt',,)
1577 LIBS="$XEXT_LIBS $XT_LIBS $LIBS"
1579 if test "$no_x" != 'yes'; then
1584 AM_CONDITIONAL(X11_DELEGATE, test "$have_x" = 'yes')
1588 dnl ===========================================================================
1594 [AC_HELP_STRING([--without-zlib],
1595 [disable ZLIB support])],
1596 [with_zlib=$withval],
1599 if test "$with_zlib" != 'yes'; then
1600 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-zlib=$with_zlib "
1605 dnl PNG requires zlib so enable zlib check if PNG is requested
1606 if test "$with_zlib" != 'no' || test "$with_png" != 'no'; then
1607 AC_MSG_RESULT([-------------------------------------------------------------])
1608 AC_MSG_CHECKING([for ZLIB])
1613 AC_CHECK_HEADER(zconf.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1614 AC_CHECK_HEADER(zlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1615 AC_CHECK_LIB(z,compress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1616 AC_CHECK_LIB(z,uncompress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1617 AC_CHECK_LIB(z,deflate,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1618 AC_CHECK_LIB(z,inflate,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1619 AC_CHECK_LIB(z,gzseek,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1620 AC_CHECK_LIB(z,gztell,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1621 AC_MSG_CHECKING([if ZLIB package is complete])
1622 if test $passed -gt 0; then
1623 if test $failed -gt 0; then
1624 AC_MSG_RESULT([no -- some components failed test])
1625 have_zlib='no (failed tests)'
1628 LIBS="$ZLIB_LIBS $LIBS"
1629 AC_DEFINE(ZLIB_DELEGATE,1,Define if you have zlib compression library)
1630 AC_MSG_RESULT([yes])
1637 AM_CONDITIONAL(ZLIB_DELEGATE, test "$have_zlib" = 'yes')
1640 # whether modules are built or not.
1644 if test "$build_modules" != 'no' ; then
1645 AC_MSG_RESULT([-------------------------------------------------------------])
1646 AC_MSG_CHECKING([for libltdl])
1650 AC_CHECK_HEADER([ltdl.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
1651 AC_CHECK_LIB([ltdl],[lt_dlinit],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
1652 AC_MSG_CHECKING([if libltdl package is complete])
1653 if test $passed -gt 0 ; then
1654 if test $failed -gt 0 ; then
1655 AC_MSG_RESULT([no -- some components failed test])
1656 have_ltdl='no (failed tests)'
1659 LIBS="$LTDL_LIBS $LIBS"
1660 AC_DEFINE(LTDL_DELEGATE,1,[Define if using libltdl to support dynamically loadable modules])
1661 AC_MSG_RESULT([yes])
1667 if test "$have_ltdl" != 'yes' ; then
1668 AC_MSG_FAILURE([libltdl is required for modules build],[1])
1671 AM_CONDITIONAL(WITH_LTDL, test "$have_ltdl" != 'no')
1674 # If profiling, then check for -ldl and dlopen (required for Solaris & gcc)
1677 if test "$enable_profiling" = 'yes'; then
1678 AC_CHECK_LIB(dl,dlopen,LIB_DL='-ldl',,)
1679 LIBS="$LIB_DL $LIBS"
1683 dnl ===========================================================================
1686 # Check for Autotrace delegate library.
1688 AC_ARG_WITH([autotrace],
1689 [AC_HELP_STRING([--with-autotrace],
1690 [enable autotrace support])],
1691 [with_autotrace=$withval],
1692 [with_autotrace='no'])
1694 if test "$with_autotrace" != 'yes'; then
1695 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-autotrace=$with_autotrace "
1702 if test "x$with_autotrace" = "xyes"; then
1703 AC_MSG_RESULT([-------------------------------------------------------------])
1704 PKG_CHECK_MODULES(AUTOTRACE,[autotrace >= 0.31.1], have_autotrace=yes, have_autotrace=no)
1708 if test "$have_autotrace" = 'yes'; then
1710 AC_DEFINE(AUTOTRACE_DELEGATE,1,Define if you have AUTOTRACE library)
1711 if test "$build_modules" = 'no'; then
1712 CPPFLAGS="$AUTOTRACE_CFLAGS $CPPFLAGS"
1716 AM_CONDITIONAL(AUTOTRACE_DELEGATE,test "$have_autotrace" = 'yes')
1717 AC_SUBST(AUTOTRACE_CFLAGS)
1718 AC_SUBST(AUTOTRACE_LIBS)
1720 dnl ===========================================================================
1723 # Check for Display Postscript delegate library.
1726 [AC_HELP_STRING([--without-dps],
1727 [disable Display Postscript support])],
1728 [with_dps=$withval],
1731 if test "$with_dps" != 'yes'; then
1732 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-dps=$with_dps "
1737 if test "$with_dps" != 'no' && test "$with_x" != 'no'; then
1738 AC_MSG_RESULT([-------------------------------------------------------------])
1739 AC_MSG_CHECKING([for DPS])
1743 PERSIST_CPPFLAGS="$CPPFLAGS"
1744 CPPFLAGS="$CPPFLAGS -I${ac_x_includes}/X11"
1745 AC_CHECK_HEADER(DPS/dpsXclient.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1747 # XFree86-4.x needs -lXt to provide XtMalloc for -ldps.
1748 # Cygwin doesn't deliver -lXt as a DLL, which prevents a DLL build.
1749 # Adobe DPS (as delivered on Solaris) doesn't require -lXt.
1750 # ImageMagick itself doesn't use -lXt.
1753 AC_CHECK_LIB(dps,DPSInitialize,have_libdps='yes',have_libdps='no',)
1754 if test "$have_libdps" != 'yes'; then
1755 # Unset cache variable so we can try again.
1756 unset ac_cv_lib_dps_DPSInitialize
1757 AC_CHECK_LIB(dps,DPSInitialize,have_libdps='yes',have_libdps='no',-lXt)
1758 if test "$have_libdps" = 'yes'; then
1762 if test "$have_libdps" = 'yes'; then
1763 passed=`expr $passed + 1`
1765 failed=`expr $failed + 1`
1767 AC_CHECK_LIB(dpstk,XDPSPixelsPerPoint,passed=`expr $passed + 1`,failed=`expr $failed + 1`,-ldps $LIBDPS_XT)
1768 AC_MSG_CHECKING([if DPS package is complete])
1769 if test $passed -gt 0; then
1770 if test $failed -gt 0; then
1771 AC_MSG_RESULT([no -- some components failed test])
1772 have_dps='no (failed tests)'
1773 CPPFLAGS="$PERSIST_CPPFLAGS"
1775 DPS_LIBS="-ldpstk -ldps ${LIBDPS_XT}"
1776 LIBS="$DPS_LIBS $LIBS"
1777 AC_DEFINE(DPS_DELEGATE,1,Define if you have Display Postscript)
1778 AC_MSG_RESULT([yes])
1783 CPPFLAGS=$PERSIST_CPPFLAGS
1786 AM_CONDITIONAL(DPS_DELEGATE, test "$have_dps" = 'yes')
1789 dnl ===========================================================================
1792 # Check for DJVU delegate library.
1795 [AC_HELP_STRING([--without-djvu],
1796 [disable DjVu support])],
1797 [with_djvu=$withval],
1800 if test "$with_djvu" != 'yes'; then
1801 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-djvu=$with_djvu "
1806 if test "$with_djvu" != 'no'; then
1807 AC_MSG_RESULT([-------------------------------------------------------------])
1808 AC_MSG_CHECKING([for DJVU])
1812 AC_CHECK_HEADER(libdjvu/ddjvuapi.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1813 AC_CHECK_LIB(djvulibre,ddjvu_context_create,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1814 AC_MSG_CHECKING([if DJVU package is complete])
1815 if test $passed -gt 0; then
1816 if test $failed -gt 0; then
1817 AC_MSG_RESULT([no -- some components failed test])
1818 have_djvu='no (failed tests)'
1820 DJVU_LIBS='-ldjvulibre'
1821 LIBS="$DJVU_LIBS $LIBS"
1822 AC_DEFINE(DJVU_DELEGATE,1,Define if you have DJVU library)
1823 AC_MSG_RESULT([yes])
1830 AM_CONDITIONAL(DJVU_DELEGATE, test "$have_djvu" = 'yes')
1833 dnl ===========================================================================
1836 # Set DejaVu font directory.
1838 AC_ARG_WITH([dejavu-font-dir],
1839 [AC_HELP_STRING([--with-dejavu-font-dir=DIR],
1840 [DejaVu font directory])],
1841 [with_dejavu_font_dir=$withval],
1842 [with_dejavu_font_dir='default'])
1844 if test "$with_dejavu_font_dir" != 'default'; then
1845 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-dejavu-font-dir=$with_dejavu_font_dir "
1848 dnl ===========================================================================
1851 # Check for FFTW delegate library.
1854 [AC_HELP_STRING([--without-fftw],
1855 [disable FFTW support])],
1856 [with_fftw=$withval],
1859 if test "$with_fftw" != 'yes'; then
1860 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fftw=$with_fftw "
1865 if test "$with_fftw" != 'no'; then
1866 AC_MSG_RESULT([-------------------------------------------------------------])
1867 AC_MSG_CHECKING([for FFTW])
1871 AC_CHECK_HEADER(fftw3.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1872 AC_CHECK_LIB(fftw3,fftw_execute,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1873 AC_MSG_CHECKING([if FFTW package is complete])
1874 if test $passed -gt 0; then
1875 if test $failed -gt 0; then
1876 AC_MSG_RESULT([no -- some components failed test])
1877 have_fftw='no (failed tests)'
1880 LIBS="$FFTW_LIBS $LIBS"
1881 AC_DEFINE(FFTW_DELEGATE,1,Define if you have FFTW library)
1882 AC_MSG_RESULT([yes])
1889 AM_CONDITIONAL(FFTW_DELEGATE, test "$have_fftw" = 'yes')
1892 dnl ===========================================================================
1895 # Check for FlashPIX delegate library.
1898 [AC_HELP_STRING([--without-fpx],
1899 [disable FlashPIX support])],
1900 [with_fpx=$withval],
1903 if test "$with_fpx" != 'yes'; then
1904 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fpx=$with_fpx "
1909 if test "$with_fpx" != 'no'; then
1910 AC_MSG_RESULT([-------------------------------------------------------------])
1911 AC_MSG_CHECKING([for FlashPIX])
1916 AC_CHECK_HEADER(fpxlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1917 AC_CHECK_LIB(fpx,FPX_OpenImageByFilename,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1919 AC_MSG_CHECKING([if FlashPIX package is complete])
1920 if test $passed -gt 0; then
1921 if test $failed -gt 0; then
1922 AC_MSG_RESULT([no -- some components failed test])
1923 have_fpx='no (failed tests)'
1926 AC_DEFINE(FPX_DELEGATE,1,Define if you have FlashPIX library)
1927 AC_MSG_RESULT([yes])
1935 AM_CONDITIONAL(FPX_DELEGATE, test "$have_fpx" = 'yes')
1938 dnl ===========================================================================
1941 # Check for fontconfig delegate library.
1943 AC_ARG_WITH([fontconfig],
1944 [AC_HELP_STRING([--without-fontconfig],
1945 [disable fontconfig support])],
1946 [with_fontconfig=$withval],
1947 [with_fontconfig='yes'])
1949 if test "$with_fontconfig" != 'yes'; then
1950 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontconfig=$with_fontconfig "
1953 have_fontconfig='no'
1954 FONTCONFIG_CFLAGS=""
1957 if test "x$with_fontconfig" = "xyes"; then
1958 AC_MSG_RESULT([-------------------------------------------------------------])
1959 PKG_CHECK_MODULES(FONTCONFIG,[fontconfig >= 2.1.0], have_fontconfig=yes, have_fontconfig=no)
1963 if test "$have_fontconfig" = 'yes'; then
1964 AC_DEFINE(FONTCONFIG_DELEGATE,1,Define if you have FONTCONFIG library)
1965 if test "$build_modules" = 'no'; then
1966 CPPFLAGS="$FONTCONFIG_CFLAGS $CPPFLAGS"
1970 AM_CONDITIONAL(FONTCONFIG_DELEGATE,test "$have_fontconfig" = 'yes')
1971 AC_SUBST(FONTCONFIG_CFLAGS)
1972 AC_SUBST(FONTCONFIG_LIBS)
1974 dnl ===========================================================================
1977 # Check for the Freetype delegate library.
1979 AC_ARG_WITH([freetype],
1980 [AC_HELP_STRING([--without-freetype],
1981 [disable Freetype support])],
1982 [with_freetype=$withval],
1983 [with_freetype='yes'])
1985 if test "$with_freetype" != 'yes'; then
1986 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-freetype=$with_freetype "
1993 if test "x$with_freetype" = "xyes"; then
1994 AC_MSG_RESULT([-------------------------------------------------------------])
1995 PKG_CHECK_MODULES(FREETYPE,[freetype2], have_freetype=yes, have_freetype=no)
1999 if test "$have_freetype" = 'yes'; then
2000 AC_DEFINE(FREETYPE_DELEGATE,1,Define if you have FREETYPE library)
2001 CFLAGS="$FREETYPE_CFLAGS $CFLAGS"
2004 AM_CONDITIONAL(FREETYPE_DELEGATE, test "$have_freetype" = 'yes')
2005 AC_SUBST(FREETYPE_CFLAGS)
2006 AC_SUBST(FREETYPE_LIBS)
2008 dnl ===========================================================================
2011 # Check for Ghostscript library or framework.
2013 # Test for iapi.h & test for gsapi_new_instance in -lgs
2014 # or -framework Ghostscript
2016 AC_ARG_WITH([gslib],
2017 [AC_HELP_STRING([--with-gslib],
2018 [enable Ghostscript library support])],
2019 [with_gslib=$withval],
2022 gslib_framework='no'
2023 if test "$with_gslib" != 'yes'; then
2024 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gslib=$with_gslib "
2029 if test "$with_gslib" != 'no'; then
2030 AC_MSG_RESULT([-------------------------------------------------------------])
2031 AC_MSG_CHECKING([for Ghostscript])
2036 AC_CHECK_HEADER(ghostscript/iapi.h,passed=`expr $passed + 1`,
2037 failed=`expr $failed + 1`,)
2038 AC_CHECK_HEADER(ghostscript/ierrors.h,passed=`expr $passed + 1`,
2039 failed=`expr $failed + 1`,)
2040 AC_CHECK_FRAMEWORK(Ghostscript,gsapi_new_instance,framework=`expr $framework + 1`,
2041 AC_CHECK_LIB(gs,gsapi_new_instance,passed=`expr $passed + 1`,failed=`expr $failed + 1`,),)
2042 AC_MSG_CHECKING([if Ghostscript package is complete])
2043 if test $passed -gt 0; then
2044 if test $failed -gt 0; then
2045 AC_MSG_RESULT([no -- some components failed test])
2046 have_gslib='no (failed tests)'
2048 if test $framework -gt 0; then
2049 GS_LIBS='-framework Ghostscript'
2050 gslib_framework='yes'
2051 AC_MSG_RESULT([yes, using framework.])
2053 AC_MSG_RESULT([yes, using library.])
2056 LIBS="$GS_LIBS $LIBS"
2057 AC_DEFINE(GS_DELEGATE,1,Define if you have Ghostscript library or framework)
2064 AM_CONDITIONAL(GS_DELEGATE, test "$have_gslib" = 'yes')
2067 # Set default font search path
2068 AC_ARG_WITH([fontpath],
2069 [AC_HELP_STRING([--with-fontpath=DIR],
2070 [prepend to default font search path])],
2071 [with_fontpath=$withval],
2074 if test "$with_fontpath" != "yes" && test -z "$with_fontpath"; then
2077 AC_DEFINE_UNQUOTED(MAGICK_FONT_PATH,"$with_fontpath",[Define to prepend to default font search path.])
2079 if test "$with_fontpath=" != ''; then
2080 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontpath=$with_fontpath "
2083 # Set Ghostscript font directory
2084 AC_ARG_WITH([gs-font-dir],
2085 [AC_HELP_STRING([--with-gs-font-dir=DIR],
2086 [Ghostscript font directory])],
2087 [with_gs_font_dir=$withval],
2088 [with_gs_font_dir='default'])
2090 if test "$with_gs_font_dir" != 'default'; then
2091 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gs-font-dir=$with_gs_font_dir "
2094 dnl ===========================================================================
2097 # Check for GVC delegate library.
2100 [AC_HELP_STRING([--with-gvc],
2101 [enable GVC support])],
2102 [with_gvc=$withval],
2105 if test "$with_gvc" != 'yes'; then
2106 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gvc=$with_gvc "
2110 if test "x$with_gvc" = "xyes"; then
2111 AC_MSG_RESULT([-------------------------------------------------------------])
2112 PKG_CHECK_MODULES(GVC,[libgvc >= 2.9.0], have_gvc=yes, have_gvc=no)
2116 if test "$have_gvc" = 'yes'; then
2117 AC_DEFINE(GVC_DELEGATE,1,Define if you have GVC library)
2118 if test "$build_modules" = 'no'; then
2119 CPPFLAGS="$GVC_CFLAGS $CPPFLAGS"
2123 AM_CONDITIONAL(GVC_DELEGATE, test "$have_gvc" = 'yes')
2124 AC_SUBST(GVC_CFLAGS)
2127 dnl ===========================================================================
2130 # Check for JBIG delegate library.
2134 [AC_HELP_STRING([--without-jbig],
2135 [disable JBIG support])],
2136 [with_jbig=$withval],
2141 if test "$with_jbig" != 'no'; then
2142 AC_MSG_RESULT([-------------------------------------------------------------])
2143 AC_MSG_CHECKING([for JBIG])
2147 AC_CHECK_HEADER(jbig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2148 AC_CHECK_LIB(jbig,jbg_dec_init,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2149 AC_MSG_CHECKING([if JBIG package is complete])
2150 if test $passed -gt 0; then
2151 if test $failed -gt 0; then
2152 AC_MSG_RESULT([no -- some components failed test])
2153 have_jbig='no (failed tests)'
2156 LIBS="$JBIG_LIBS $LIBS"
2157 AC_DEFINE(JBIG_DELEGATE,1,Define if you have JBIG library)
2158 AC_MSG_RESULT([yes])
2165 AM_CONDITIONAL(JBIG_DELEGATE, test "$have_jbig" = 'yes')
2168 dnl ===========================================================================
2171 # Check for JPEG delegate library.
2174 [AC_HELP_STRING([--without-jpeg],
2175 [disable JPEG support])],
2176 [with_jpeg=$withval],
2179 if test "$with_jpeg" != 'yes'; then
2180 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jpeg=$with_jpeg "
2185 if test "$with_jpeg" != 'no'; then
2186 AC_MSG_RESULT([-------------------------------------------------------------])
2187 AC_MSG_CHECKING([for JPEG])
2191 AC_CHECK_HEADER(jconfig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2192 AC_CHECK_HEADER(jerror.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2193 AC_CHECK_HEADER(jmorecfg.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2194 AC_CHECK_HEADER(jpeglib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2195 AC_CHECK_LIB(jpeg,jpeg_read_header,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2197 # Test for compatible JPEG library
2198 if test "$ac_cv_jpeg_version_ok" != 'yes'; then
2199 AC_CACHE_CHECK(for JPEG library is version 6b or later, ac_cv_jpeg_version_ok,
2203 #include <jpeglib.h>
2205 changequote(<<, >>)dnl
2207 #if JPEG_LIB_VERSION < 62
2208 #error IJG JPEG library must be version 6b or newer!
2212 changequote([, ])dnl
2213 ac_cv_jpeg_version_ok='yes'; passed=`expr $passed + 1`,
2214 ac_cv_jpeg_version_ok='no'; failed=`expr $failed + 1`)])
2216 AC_MSG_CHECKING([if JPEG package is complete])
2217 if test $passed -gt 0; then
2218 if test $failed -gt 0; then
2219 AC_MSG_RESULT([no -- some components failed test])
2220 have_jpeg='no (failed tests)'
2223 LIBS="$JPEG_LIBS $LIBS"
2224 AC_DEFINE(JPEG_DELEGATE,1,Define if you have JPEG library)
2225 AC_MSG_RESULT([yes])
2232 AM_CONDITIONAL(JPEG_DELEGATE, test "$have_jpeg" = 'yes')
2235 dnl ===========================================================================
2238 # Check for JPEG Version 2 delegate library.
2241 [AC_HELP_STRING([--without-jp2],
2242 [disable JPEG-2000 support])],
2243 [with_jp2=$withval],
2246 if test "$with_jp2" != 'yes'; then
2247 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jp2=$with_jp2 "
2252 if test "$with_jp2" != 'no'; then
2253 AC_MSG_RESULT([-------------------------------------------------------------])
2254 AC_MSG_CHECKING([for JPEG Version 2])
2258 AC_CHECK_HEADER(jasper/jasper.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2259 AC_CHECK_LIB(jasper,jas_stream_fopen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2260 AC_MSG_CHECKING([if JPEG version 2 support package is complete])
2261 if test $passed -gt 0; then
2262 if test $failed -gt 0; then
2263 AC_MSG_RESULT([no -- some components failed test])
2264 have_jp2='no (failed tests)'
2267 LIBS="$JP2_LIBS $LIBS"
2268 AC_DEFINE(JP2_DELEGATE,1,Define if you have JPEG version 2 "Jasper" library)
2269 AC_MSG_RESULT([yes])
2276 AM_CONDITIONAL(JP2_DELEGATE, test "$have_jp2" = 'yes')
2279 dnl ===========================================================================
2282 # Check for LCMS delegate library.
2286 [ --without-lcms disable lcms (v1.1X) support],
2287 [with_lcms=$withval],
2289 if test "$with_lcms" != 'yes' ; then
2290 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lcms=$with_lcms "
2295 [ --without-lcms2 disable lcms (v2.X) support],
2296 [with_lcms2=$withval],
2298 if test "$with_lcms2" != 'yes' ; then
2299 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lcms2=$with_lcms2 "
2304 if test "$with_lcms2" != 'no'; then
2305 AC_MSG_RESULT([-------------------------------------------------------------])
2306 AC_MSG_CHECKING([for LCMS v2])
2310 have_lcms_header='no'
2312 # Check for <lcms2.h>
2313 AC_CHECK_HEADER(lcms2.h,have_lcms_header='yes',,)
2314 if test "$have_lcms_header" = 'yes'; then
2315 AC_DEFINE(HAVE_LCMS2_H,1,Define if you have the <lcms2.h> header file.)
2316 passed=`expr $passed + 1`
2319 # Check for <lcms2/lcms2.h)
2320 if test "$have_lcms_header" != 'yes'; then
2321 AC_CHECK_HEADER(lcms2/lcms2.h,have_lcms_header='yes',,)
2322 if test "$have_lcms_header" = 'yes'; then
2323 passed=`expr $passed + 1`
2324 AC_DEFINE(HAVE_LCMS2_LCMS2_H,1,Define if you have the <lcms2/lcms2.h> header file.)
2328 # Failed to find lcms header?
2329 if test "$have_lcms_header" != 'yes'; then
2330 failed=`expr $failed + 1`
2333 AC_CHECK_LIB(lcms2,cmsSetLogErrorHandler,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2334 AC_MSG_CHECKING(if LCMS v2 package is complete)
2335 if test $passed -gt 0; then
2336 if test $failed -gt 0; then
2337 AC_MSG_RESULT(no -- some components failed test)
2338 have_lcms2='no (failed tests)'
2341 LIBS="$LCMS_LIBS $LIBS"
2351 # Check for LCMS v1 (1.11 or later)
2353 if test $have_lcms2 = 'yes'; then
2358 if test "$with_lcms" != 'no'; then
2359 AC_MSG_RESULT([-------------------------------------------------------------])
2360 AC_MSG_CHECKING([for LCMS v1.1X])
2364 have_lcms_header='no'
2366 # Check for <lcms.h>
2367 if test "$have_lcms_header" != 'yes'; then
2368 AC_CHECK_HEADER(lcms.h,have_lcms_header='yes',,)
2369 if test "$have_lcms_header" = 'yes'; then
2370 passed=`expr $passed + 1`
2371 AC_DEFINE(HAVE_LCMS_H,1,Define if you have the <lcms.h> header file.)
2375 # Check for <lcms/lcms.h>
2376 if test "$have_lcms_header" != 'yes'; then
2377 AC_CHECK_HEADER(lcms/lcms.h,have_lcms_header='yes',,)
2378 if test "$have_lcms_header" = 'yes'; then
2379 passed=`expr $passed + 1`
2380 AC_DEFINE(HAVE_LCMS_LCMS_H,1,Define if you have the <lcms/lcms.h> header file.)
2384 # Failed to find lcms header?
2385 if test "$have_lcms_header" != 'yes'; then
2386 failed=`expr $failed + 1`
2389 AC_CHECK_LIB(lcms,cmsSetErrorHandler,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2390 AC_MSG_CHECKING(if LCMS package is complete)
2391 if test $passed -gt 0; then
2392 if test $failed -gt 0; then
2393 AC_MSG_RESULT(no -- some components failed test)
2394 have_lcms='no (failed tests)'
2397 LIBS="$LCMS_LIBS $LIBS"
2406 AM_CONDITIONAL(LCMS_DELEGATE, test "$have_lcms2" = 'yes' -o "$have_lcms" = 'yes')
2407 if test "$have_lcms2" = 'yes' -o "$have_lcms" = 'yes'; then
2408 AC_DEFINE(LCMS_DELEGATE,1,[Define if you have LCMS (v1.11 or later) library])
2413 dnl ===========================================================================
2416 # Check for the LQR (Liquid Rescale) delegate library.
2419 [AC_HELP_STRING([--without-lqr],
2420 [disable Liquid Rescale support])],
2421 [with_lqr=$withval],
2424 if test "$with_lqr" != 'yes'; then
2425 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lqr=$with_lqr "
2432 if test "x$with_lqr" = "xyes"; then
2433 AC_MSG_RESULT([-------------------------------------------------------------])
2434 PKG_CHECK_MODULES(LQR,[lqr-1 >= 0.1.0], have_lqr=yes, have_lqr=no)
2438 if test "$have_lqr" = 'yes'; then
2439 AC_DEFINE(LQR_DELEGATE,1,Define if you have LQR library)
2440 CFLAGS="$LQR_CFLAGS $CFLAGS"
2443 AM_CONDITIONAL(LQR_DELEGATE, test "$have_lqr" = 'yes')
2444 AC_SUBST(LQR_CFLAGS)
2447 dnl ===========================================================================
2449 # Disable LZMA (lzma library)
2451 [ --without-lzma disable LZMA support],
2452 [with_lzma=$withval],
2454 if test "$with_lzma" != 'yes' ; then
2455 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lzma=$with_lzma "
2459 if test "x$with_lzma" = "xyes"; then
2460 AC_MSG_RESULT([-------------------------------------------------------------])
2461 PKG_CHECK_MODULES(LZMA,[liblzma >= 2.9.0], have_lzma=yes, have_lzma=no)
2465 if test "$have_lzma" = 'yes'; then
2466 AC_DEFINE(LZMA_DELEGATE,1,Define if you have LZMA library)
2467 if test "$build_modules" = 'no'; then
2468 CPPFLAGS="$LZMA_CFLAGS $CPPFLAGS"
2472 AM_CONDITIONAL(LZMA_DELEGATE, test "$have_lzma" = 'yes')
2473 AC_SUBST(LZMA_CFLAGS)
2476 dnl ===========================================================================
2479 # Check for MUPDF delegate library.
2482 [AC_HELP_STRING([--with-mupdf],
2483 [enable MUPDF support])],
2484 [with_mupdf=$withval],
2487 if test "$with_mupdf" != 'yes'; then
2488 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-mupdf=$with_mupdf "
2493 if test "$with_mupdf" != 'no'; then
2494 AC_MSG_RESULT([-------------------------------------------------------------])
2495 AC_MSG_CHECKING([for MUPDF])
2499 AC_CHECK_HEADER(mupdf/fitz.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2500 AC_CHECK_LIB(mupdf,fz_new_context,passed=`expr $passed + 1`,failed=`expr $failed + 1`,-lmupdf $FREETYPE_LIBS)
2501 AC_MSG_CHECKING([if MUPDF package is complete])
2502 if test $passed -gt 0; then
2503 if test $failed -gt 0; then
2504 AC_MSG_RESULT([no -- some components failed test])
2505 have_mupdf='no (failed tests)'
2507 MUPDF_LIBS='-lmupdf'
2508 LIBS="$MUPDF_LIBS $LIBS"
2509 AC_DEFINE(MUPDF_DELEGATE,1,Define if you have MUPDF library)
2510 AC_MSG_RESULT([yes])
2517 AM_CONDITIONAL(MUPDF_DELEGATE,test "$have_mupdf" = 'yes')
2518 AC_SUBST(MUPDF_LIBS)
2520 dnl ===========================================================================
2523 # Check for the OpenEXR delegate library.
2525 AC_ARG_WITH([openexr],
2526 [AC_HELP_STRING([--without-openexr],
2527 [disable OpenEXR support])],
2528 [with_openexr=$withval],
2529 [with_openexr='yes'])
2531 if test "$with_openexr" != 'yes'; then
2532 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-openexr=$with_openexr "
2539 if test "x$with_openexr" = "xyes"; then
2540 AC_MSG_RESULT([-------------------------------------------------------------])
2541 PKG_CHECK_MODULES(OPENEXR,[OpenEXR >= 1.0.6], have_openexr=yes, have_openexr=no)
2545 if test "$have_openexr" = 'yes'; then
2546 AC_DEFINE(OPENEXR_DELEGATE,1,Define if you have OPENEXR library)
2547 if test "$build_modules" = 'no'; then
2548 CFLAGS="$OPENEXR_CFLAGS $CFLAGS"
2552 AM_CONDITIONAL(OPENEXR_DELEGATE, test "$have_openexr" = 'yes')
2553 AC_SUBST(OPENEXR_CFLAGS)
2554 AC_SUBST(OPENEXR_LIBS)
2556 dnl ===========================================================================
2559 # Check for PANGO delegate library.
2561 AC_ARG_WITH([pango],
2562 [AC_HELP_STRING([--without-pango],
2563 [disable PANGO support])],
2564 [with_pango=$withval],
2567 if test "$with_pango" != 'yes'; then
2568 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-pango=$with_pango "
2572 have_pangocairo='no'
2576 if test "x$with_pango" = "xyes"; then
2577 AC_MSG_RESULT([-------------------------------------------------------------])
2578 PKG_CHECK_MODULES(PANGO, [pangocairo >= 1.28.1], have_pangocairo=yes, have_pangocairo=no)
2580 PKG_CHECK_MODULES(PANGO, [pango >= 1.28.1], have_pango=yes, have_pango=no)
2584 if test "$have_pango" = 'yes'; then
2585 AC_DEFINE(PANGO_DELEGATE,1,Define if you have PANGO library)
2586 if test "$build_modules" = 'no'; then
2587 CPPFLAGS="$PANGO_CFLAGS $CPPFLAGS"
2591 if test "$have_pangocairo" = 'yes'; then
2592 AC_DEFINE(PANGOCAIRO_DELEGATE,1,Define if you have PANGOCAIRO library)
2593 if test "$build_modules" = 'no'; then
2594 CPPFLAGS="$PANGOCAIRO_CFLAGS $CPPFLAGS"
2598 AM_CONDITIONAL(PANGO_DELEGATE, test "$have_pango" = 'yes')
2599 AM_CONDITIONAL(PANGOCAIRO_DELEGATE, test "$have_pangocairo" = 'yes')
2600 AC_SUBST(PANGO_CFLAGS)
2601 AC_SUBST(PANGO_LIBS)
2603 dnl ===========================================================================
2606 # Check for PNG delegate library.
2609 [AC_HELP_STRING([--without-png],
2610 [disable PNG support])],
2611 [with_png=$withval],
2614 if test "$with_png" != 'yes'; then
2615 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-png=$with_png "
2621 if test "$with_png" != 'no' -a "$have_zlib" != 'no' ; then
2622 AC_MSG_RESULT([-------------------------------------------------------------])
2623 AC_MSG_CHECKING(for PNG support )
2627 AC_CHECK_HEADER(png.h,passed=`expr $passed + 1`,
2628 failed=`expr $failed + 1`,)
2630 if test $passed -gt 0; then
2631 for var in 7 6 5 4 2 '' ; do
2632 if test "$have_png" = 'no' ; then
2633 if test "x${var}" = 'x' ; then
2639 # Test for compatible LIBPNG library
2642 if test "$with_png" = 'yes' -o "$with_png" = "libpng1${var}" ; then
2643 if test "${pnglib}" != 'png' ; then
2644 AC_MSG_CHECKING(for LIBPNG1${var} support )
2650 changequote(<<, >>)dnl
2652 #if PNG_LIBPNG_VER_MINOR != ${var}
2653 #error LIBPNG library must be version 1${var}!
2658 changequote([, ])dnl
2659 ac_cv_libpng_ok='yes',
2660 ac_cv_libpng_ok='no')
2661 if test "$ac_cv_libpng_ok" = 'yes' ; then
2662 passed=`expr $passed + 1`
2665 failed=`expr $failed + 1`
2669 passed=`expr $passed + 1`
2674 if test $passed -gt 0 -a $failed -le 0; then
2675 if test "1${var}" = '17' ; then
2676 AC_CHECK_LIB(png17,png_get_io_ptr,passed=`expr $passed + 1`,
2677 failed=`expr $failed + 1`,)
2678 AC_CHECK_LIB(png17,png_longjmp,passed=`expr $passed + 1`,
2679 failed=`expr $failed + 1`,)
2681 if test "1${var}" = '16' ; then
2682 AC_CHECK_LIB(png16,png_get_io_ptr,passed=`expr $passed + 1`,
2683 failed=`expr $failed + 1`,)
2684 AC_CHECK_LIB(png16,png_longjmp,passed=`expr $passed + 1`,
2685 failed=`expr $failed + 1`,)
2687 if test "1${var}" = '15' ; then
2688 AC_CHECK_LIB(png15,png_get_io_ptr,passed=`expr $passed + 1`,
2689 failed=`expr $failed + 1`,)
2690 AC_CHECK_LIB(png15,png_longjmp,passed=`expr $passed + 1`,
2691 failed=`expr $failed + 1`,)
2693 if test "1${var}" = '14' ; then
2694 AC_CHECK_LIB(png14,png_get_io_ptr,passed=`expr $passed + 1`,
2695 failed=`expr $failed + 1`,)
2696 AC_CHECK_LIB(png14,png_get_io_state,passed=`expr $passed + 1`,
2697 failed=`expr $failed + 1`,)
2699 if test "1${var}" = '12' ; then
2700 AC_CHECK_LIB(png12,png_get_io_ptr,passed=`expr $passed + 1`,
2701 failed=`expr $failed + 1`,)
2703 if test "1${var}" = '1' ; then
2704 AC_CHECK_LIB(png,png_get_io_ptr,passed=`expr $passed + 1`,
2705 failed=`expr $failed + 1`,)
2707 if test $passed -gt 0 -a $failed -le 0 ; then
2708 AC_MSG_CHECKING(if ${pnglib} package is complete)
2709 if test $passed -gt 0 ; then
2710 if test $failed -gt 0 ; then
2711 AC_MSG_RESULT(no -- some components failed test)
2712 have_png='no (failed tests)'
2714 PNG_LIBS="-l${pnglib}"
2715 LIBS="$PNG_LIBS $LIBS"
2716 AC_DEFINE(PNG_DELEGATE,1,Define if you have PNG library)
2728 AM_CONDITIONAL(PNG_DELEGATE,test "$have_png" = 'yes')
2732 dnl ===========================================================================
2735 # Check for RSVG delegate library.
2738 [AC_HELP_STRING([--with-rsvg],
2739 [enable RSVG support])],
2740 [with_rsvg=$withval],
2743 if test "$with_rsvg" != 'yes'; then
2744 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-rsvg=$with_rsvg "
2752 if test "x$with_rsvg" = "xyes"; then
2753 AC_MSG_RESULT([-------------------------------------------------------------])
2754 PKG_CHECK_MODULES(RSVG,[librsvg-2.0 >= 2.9.0], have_rsvg=yes, have_rsvg=no)
2756 PKG_CHECK_MODULES(CAIRO_SVG, cairo-svg, have_cairo=yes, have_cairo=no)
2760 if test "$have_rsvg" = 'yes'; then
2761 AC_DEFINE(RSVG_DELEGATE,1,Define if you have RSVG library)
2762 if test "$build_modules" = 'no'; then
2763 CPPFLAGS="$RSVG_CFLAGS $CPPFLAGS"
2767 if test "$have_cairo" = 'yes'; then
2768 AC_DEFINE(CAIRO_DELEGATE,1,Define if you have CAIRO library)
2769 if test "$build_modules" = 'no'; then
2770 CPPFLAGS="$CAIRO_SVG_CFLAGS $CPPFLAGS"
2774 AM_CONDITIONAL(RSVG_DELEGATE, test "$have_rsvg" = 'yes')
2775 AM_CONDITIONAL(CAIRO_DELEGATE, test "$have_cairo" = 'yes')
2776 AC_SUBST(RSVG_CFLAGS)
2779 dnl ===========================================================================
2782 # Check for TIFF delegate library.
2785 [AC_HELP_STRING([--without-tiff],
2786 [disable TIFF support])],
2787 [with_tiff=$withval],
2790 if test "$with_tiff" != 'yes'; then
2791 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-tiff=$with_tiff "
2796 if test "$with_tiff" != 'no'; then
2797 AC_MSG_RESULT([-------------------------------------------------------------])
2798 AC_MSG_CHECKING([for TIFF])
2802 AC_CHECK_HEADER(tiff.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2803 AC_CHECK_HEADER(tiffio.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2804 AC_CHECK_LIB(tiff,TIFFOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2805 AC_CHECK_LIB(tiff,TIFFClientOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2806 AC_CHECK_LIB(tiff,TIFFIsByteSwapped,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2807 AC_CHECK_LIB(tiff,TIFFReadRGBATile,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2808 AC_CHECK_LIB(tiff,TIFFReadRGBAStrip,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2809 AC_MSG_CHECKING([if TIFF package is complete])
2810 if test $passed -gt 0; then
2811 if test $failed -gt 0; then
2812 AC_MSG_RESULT([no -- some components failed test])
2813 have_tiff='no (failed tests)'
2816 LIBS="$TIFF_LIBS $LIBS"
2817 AC_DEFINE(TIFF_DELEGATE,1,Define if you have TIFF library)
2818 AC_MSG_RESULT([yes])
2820 AC_CHECK_HEADERS(tiffconf.h)
2821 AC_CHECK_FUNCS([TIFFIsCODECConfigured TIFFMergeFieldInfo \
2822 TIFFIsBigEndian TIFFReadEXIFDirectory TIFFSetErrorHandlerExt \
2823 TIFFSetTagExtender TIFFSetWarningHandlerExt \
2824 TIFFSwabArrayOfTriples])
2830 AM_CONDITIONAL(TIFF_DELEGATE, test "$have_tiff" = 'yes')
2833 dnl ===========================================================================
2836 # Check for WEBP delegate library.
2839 [AC_HELP_STRING([--without-webp],
2840 [disable WEBP support])],
2841 [with_webp=$withval],
2844 if test "$with_webp" != 'yes'; then
2845 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-webp=$with_webp "
2850 if test "$with_webp" != 'no'; then
2851 AC_MSG_RESULT([-------------------------------------------------------------])
2852 AC_MSG_CHECKING([for WEBP])
2856 AC_CHECK_HEADER(webp/decode.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2857 AC_CHECK_LIB(webp,WebPPictureInitInternal,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2858 AC_MSG_CHECKING([if WEBP package is complete])
2859 if test $passed -gt 0; then
2860 if test $failed -gt 0; then
2861 AC_MSG_RESULT([no -- some components failed test])
2862 have_webp='no (failed tests)'
2865 LIBS="$WEBP_LIBS $LIBS"
2866 AC_DEFINE(WEBP_DELEGATE,1,Define if you have WEBP library)
2867 AC_MSG_RESULT([yes])
2874 AM_CONDITIONAL(WEBP_DELEGATE,test "$have_webp" = 'yes')
2877 dnl ===========================================================================
2880 # Set Windows font directory.
2882 AC_ARG_WITH([windows-font-dir],
2883 [AC_HELP_STRING([--with-windows-font-dir=DIR],
2884 [directory containing MS-Windows fonts])],
2885 [with_windows_font_dir=$withval],
2886 [with_windows_font_dir=''])
2887 if test "$with_windows_font_dir" != '' ; then
2888 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-windows-font-dir=$with_windows_font_dir "
2891 dnl ===========================================================================
2894 # Check for WMF delegate library.
2897 [AC_HELP_STRING([--with-wmf],
2898 [enable WMF support])],
2899 [with_wmf=$withval],
2902 if test "$with_wmf" != 'yes'; then
2903 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-wmf=$with_wmf "
2910 if test "$with_wmf" != 'no'; then
2911 AC_MSG_RESULT([-------------------------------------------------------------])
2912 AC_MSG_CHECKING([for WMF])
2915 have_libwmflite='no'
2916 have_libwmf_ipa_h='no'
2918 AC_CHECK_HEADER([libwmf/ipa.h],[have_libwmf_ipa_h='yes'],,[$FT2BUILD_H])
2919 if test "$have_libwmf_ipa_h" = 'yes'; then
2920 AC_CHECK_LIB(wmflite,wmf_lite_create,have_libwmflite='yes',,)
2921 if test "$have_libwmflite" = 'yes'; then
2922 AC_DEFINE(WMFLITE_DELEGATE,1,Define if you have wmflite library)
2923 WMF_LIBS='-lwmflite'
2924 LIBS="$WMF_LIBS $LIBS"
2928 WMF_CONFIG_LIBS=`libwmf-config --libs`
2929 for lib in xml2 expat freetype jpeg png z; do
2931 echo "$WMF_CONFIG_LIBS" | grep -- "$testlib" > /dev/null && WMF_LIBS_DEPS="$WMF_LIBS_DEPS $testlib"
2933 AC_CHECK_LIB(wmf,wmf_api_create,have_libwmf='yes',,$WMF_LIBS_DEPS)
2934 if test "$have_libwmf" = 'yes'; then
2935 AC_DEFINE(WMF_DELEGATE,1,Define if you have wmf library)
2937 LIBS="$WMF_LIBS $LIBS"
2940 AC_MSG_RESULT([no -- some components failed test])
2941 have_wmf='no (failed tests)'
2942 have_wmflite='no (failed tests)'
2948 AC_MSG_CHECKING([if WMF package is complete])
2949 if test "$have_wmf" = 'yes'; then
2950 AC_MSG_RESULT([yes])
2955 AM_CONDITIONAL(WMF_DELEGATE, test "$have_wmf" = 'yes')
2957 AC_SUBST(WMF_LIBS_DEPS)
2960 dnl ===========================================================================
2963 # Check for XML delegate library.
2966 [AC_HELP_STRING([--without-xml],
2967 [disable XML support])],
2968 [with_xml=$withval],
2971 if test "$with_xml" != 'yes' ; then
2972 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-xml=$with_xml "
2977 if test "$with_xml" != 'no'; then
2978 AC_MSG_RESULT([-------------------------------------------------------------])
2979 AC_MSG_CHECKING([for XML])
2981 PERSIST_LDFLAGS=$LDFLAGS
2982 PERSIST_CPPFLAGS=$CPPFLAGS
2984 AC_PATH_PROG(xml2_config,xml2-config,)dnl
2985 if test -n "$xml2_config"; then
2986 # Debian installs libxml headers under /usr/include/libxml2/libxml with
2987 # the shared library installed under /usr/lib, whereas the package
2988 # installs itself under $prefix/libxml and $prefix/lib.
2989 xml2_prefix=`xml2-config --prefix`
2990 if test -d "${xml2_prefix}/include/libxml2"; then
2991 CPPFLAGS="$CPPFLAGS -I${xml2_prefix}/include/libxml2"
2993 if test "${xml2_prefix}" != '/usr'; then
2994 LDFLAGS="$LDFLAGS -L${xml2_prefix}/lib"
2999 AC_CHECK_HEADER(libxml/parser.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
3000 AC_CHECK_LIB(xml2,xmlSAXVersion,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
3001 AC_CHECK_LIB(xml2,xmlParseChunk,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
3002 AC_CHECK_LIB(xml2,xmlCreatePushParserCtxt,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
3003 AC_MSG_CHECKING([if XML package is complete])
3004 if test $passed -gt 0; then
3005 if test $failed -gt 0; then
3006 AC_MSG_RESULT([no -- some components failed test])
3007 have_xml='no (failed tests)'
3008 LDFLAGS="$PERSIST_LDFLAGS"
3009 CPPFLAGS="$PERSIST_CPPFLAGS"
3012 LIBS="$XML_LIBS $LIBS"
3013 AC_DEFINE(XML_DELEGATE,1,Define if you have XML library)
3014 AC_MSG_RESULT([yes])
3021 AM_CONDITIONAL(XML_DELEGATE,test "$have_xml" = 'yes')
3024 dnl ===========================================================================
3026 # Substitute compiler name to build/link PerlMagick
3028 AC_SUBST(PERLMAINCC)
3031 # Configure install Paths
3034 # Path to ImageMagick header files
3035 INCLUDE_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
3036 INCLUDE_PATH="${INCLUDE_DIR}/${INCLUDE_RELATIVE_PATH}"
3037 DEFINE_INCLUDE_PATH="${INCLUDE_DIR}/${INCLUDE_RELATIVE_PATH}/"
3038 case "${build_os}" in
3040 DEFINE_INCLUDE_PATH=`$WinPathScript "$DEFINE_INCLUDE_PATH" 1`
3043 AC_DEFINE_UNQUOTED(INCLUDE_PATH,"$DEFINE_INCLUDE_PATH",[Directory where ImageMagick headers live.])
3044 AC_SUBST(INCLUDE_PATH)
3046 # Path to ImageMagick header files (arch part)
3047 INCLUDEARCH_PATH="${INCLUDEARCH_DIR}/${INCLUDE_RELATIVE_PATH}"
3048 DEFINE_INCLUDEARCH_PATH="${INCLUDEARCH_DIR}/${INCLUDE_RELATIVE_PATH}/"
3049 case "${build_os}" in
3051 DEFINE_INCLUDEARCH_PATH=`$WinPathScript "$DEFINE_INCLUDEARCH_PATH" 1`
3054 AC_DEFINE_UNQUOTED(INCLUDEARCH_PATH,"$DEFINE_INCLUDE_PATH",[Directory where ImageMagick architecture headers live.])
3055 AC_SUBST(INCLUDEARCH_PATH)
3057 # Subdirectory under lib to place ImageMagick lib files
3058 LIBRARY_RELATIVE_PATH="${PACKAGE_NAME}-${PACKAGE_VERSION}"
3059 AC_DEFINE_UNQUOTED(LIBRARY_RELATIVE_PATH,"$LIBRARY_RELATIVE_PATH",[Subdirectory of lib where ImageMagick architecture dependent files are installed.])
3061 # Path to ImageMagick bin directory
3062 EXECUTABLE_PATH="${BIN_DIR}"
3063 DEFINE_EXECUTABLE_PATH="${BIN_DIR}/"
3064 case "${build_os}" in
3066 DEFINE_EXECUTABLE_PATH=`$WinPathScript "$DEFINE_EXECUTABLE_PATH" 1`
3069 AC_DEFINE_UNQUOTED(EXECUTABLE_PATH,"$DEFINE_EXECUTABLE_PATH",[Directory where executables are installed.])
3070 AC_SUBST(EXECUTABLE_PATH)
3072 # Path to ImageMagick lib
3073 LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}"
3074 DEFINE_LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}/"
3075 case "${build_os}" in
3077 DEFINE_LIBRARY_PATH=`$WinPathScript "$DEFINE_LIBRARY_PATH" 1`
3080 AC_DEFINE_UNQUOTED(LIBRARY_PATH,"$DEFINE_LIBRARY_PATH",[Directory where architecture-dependent files live.])
3081 AC_SUBST(LIBRARY_PATH)
3084 # path to local binaries
3085 if test "x$LIB_BIN_BASEDIRNAME" = "x"; then
3086 LIB_BIN_BASEDIRNAME="bin"
3088 AC_DEFINE_UNQUOTED(LIB_BIN_BASEDIRNAME,"$LIB_BIN_BASEDIRNAME",[Binaries in libraries path base name (will be during install linked to bin)])
3089 AC_SUBST(LIB_BIN_BASEDIRNAME)
3091 if test "x$LIB_BIN_DIR" = "x"; then
3092 LIB_BIN_DIR=${LIB_BIN_BASEDIRNAME}-${MAGICK_ABI_SUFFIX}
3094 AC_SUBST(LIB_BIN_DIR)
3096 LIB_BIN_DIR_RELATIVE_PATH=$LIB_BIN_DIR
3097 AC_SUBST(LIB_BIN_DIR_RELATIVE_PATH)
3098 LIB_BIN_DIR_PATH="${LIBRARY_PATH}/${LIB_BIN_DIR_RELATIVE_PATH}"
3099 AC_SUBST(LIB_BIN_DIR_PATH)
3102 # path to modules lib
3103 if test "x$MODULES_BASEDIRNAME" = "x"; then
3104 MODULES_BASEDIRNAME="modules"
3106 AC_DEFINE_UNQUOTED(MODULES_BASEDIRNAME,"$MODULES_BASEDIRNAME",[Module directory name without ABI part.])
3107 AC_SUBST(MODULES_BASEDIRNAME)
3109 if test "x$MODULES_DIRNAME" = "x"; then
3110 MODULES_DIRNAME=${MODULES_BASEDIRNAME}-${MAGICK_ABI_SUFFIX}
3112 AC_DEFINE_UNQUOTED(MODULES_DIRNAME,"$MODULES_DIRNAME",[Module directory dirname])
3114 AC_SUBST(MODULES_DIRNAME)
3116 MODULES_RELATIVE_PATH="${MODULES_DIRNAME}"
3117 AC_SUBST(MODULES_RELATIVE_PATH)
3118 MODULES_PATH="${LIBRARY_PATH}/${MODULES_RELATIVE_PATH}"
3119 AC_SUBST(MODULES_PATH)
3122 # path to coders lib
3123 if test "x$CODER_DIRNAME" = "x"; then
3124 CODER_DIRNAME="coders"
3126 AC_DEFINE_UNQUOTED(CODER_DIRNAME,"$CODER_DIRNAME",[coders subdirectory.])
3127 AC_SUBST(CODER_DIRNAME)
3129 CODER_RELATIVE_PATH="${CODER_DIRNAME}"
3130 CODER_PATH="${MODULES_PATH}/${CODER_DIRNAME}"
3131 AC_SUBST(CODER_PATH)
3134 # Subdirectory under lib to place ImageMagick filter module files
3136 # path to coders lib
3137 if test "x$FILTER_DIRNAME" = "x"; then
3138 FILTER_DIRNAME="filters"
3140 AC_DEFINE_UNQUOTED(FILTER_DIRNAME,"$FILTER_DIRNAME",[filter subdirectory.])
3141 AC_SUBST(FILTER_DIRNAME)
3143 FILTER_RELATIVE_PATH="${FILTER_DIRNAME}"
3144 FILTER_PATH="${MODULES_PATH}/${FILTER_DIRNAME}"
3145 AC_SUBST(FILTER_PATH)
3148 # Path to ImageMagick documentation files
3149 DOCUMENTATION_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
3150 DOCUMENTATION_PATH="${DOC_DIR}/${DOCUMENTATION_RELATIVE_PATH}"
3151 DEFINE_DOCUMENTATION_PATH="${DOC_DIR}/${DOCUMENTATION_RELATIVE_PATH}/"
3152 case "${build_os}" in
3154 DEFINE_DOCUMENTATION_PATH=`$WinPathScript "$DEFINE_DOCUMENTATION_PATH" 1`
3157 AC_DEFINE_UNQUOTED(DOCUMENTATION_PATH,"$DEFINE_DOCUMENTATION_PATH",[Directory where ImageMagick documents live.])
3158 AC_SUBST(DOCUMENTATION_PATH)
3160 # Subdirectory to place architecture-dependent configuration files
3161 CONFIGURE_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
3162 AC_DEFINE_UNQUOTED(CONFIGURE_RELATIVE_PATH,"$CONFIGURE_RELATIVE_PATH",[Subdirectory of lib where architecture-dependent configuration files live.])
3163 CONFIGURE_PATH="${SYSCONF_DIR}/${CONFIGURE_RELATIVE_PATH}/"
3164 DEFINE_CONFIGURE_PATH="${SYSCONF_DIR}/${CONFIGURE_RELATIVE_PATH}/"
3165 case "${build_os}" in
3167 DEFINE_CONFIGURE_PATH=`$WinPathScript "$DEFINE_CONFIGURE_PATH" 1`
3170 AC_DEFINE_UNQUOTED(CONFIGURE_PATH,"$DEFINE_CONFIGURE_PATH",[Directory where architecture-dependent configuration files live.])
3171 AC_SUBST(CONFIGURE_PATH)
3173 # Subdirectory to place architecture-independent configuration files
3174 SHARE_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
3175 AC_DEFINE_UNQUOTED(SHARE_RELATIVE_PATH,"$SHARE_RELATIVE_PATH",[Subdirectory of lib where architecture-independent configuration files live.])
3176 SHARE_PATH="${DATA_DIR}/${SHARE_RELATIVE_PATH}"
3177 DEFINE_SHARE_PATH="${DATA_DIR}/${SHARE_RELATIVE_PATH}/"
3178 case "${build_os}" in
3180 DEFINE_SHARE_PATH=`$WinPathScript "$DEFINE_SHARE_PATH" 1`
3183 AC_DEFINE_UNQUOTED(SHARE_PATH,"$DEFINE_SHARE_PATH",[Directory where architecture-independent configuration files live.])
3184 AC_SUBST(SHARE_PATH)
3187 # Subdirectory to place architecture-dependent configuration files.
3188 if test "x$SHAREARCH_BASEDIRNAME" = "x"; then
3189 SHAREARCH_BASEDIRNAME="config"
3191 AC_DEFINE_UNQUOTED(SHAREARCH_BASEDIRNAME,"$SHAREARCH_BASEDIRNAME",[Sharearch directory name without ABI part.])
3192 AC_SUBST(SHAREARCH_BASEDIRNAME)
3194 if test "x$SHAREARCH_DIRNAME" = "x"; then
3195 SHAREARCH_DIRNAME=${SHAREARCH_BASEDIRNAME}-${MAGICK_ABI_SUFFIX}
3197 AC_DEFINE_UNQUOTED(SHAREARCH_DIRNAME,"$SHAREARCH_DIRNAME",[Sharearch directory dirname])
3199 AC_SUBST(SHAREARCH_DIRNAME)
3201 SHAREARCH_RELATIVE_PATH="${SHAREARCH_DIRNAME}"
3202 AC_SUBST(SHAREARCH_RELATIVE_PATH)
3203 SHAREARCH_PATH="${LIBRARY_PATH}/${SHAREARCH_RELATIVE_PATH}"
3204 AC_SUBST(SHAREARCH_PATH)
3207 # program_transform_name is formed for use in a Makefile, so create a
3208 # modified version for use in a shell script.
3209 configure_transform_name=`echo ${program_transform_name} | sed 's,\\$\\$,$,'`
3211 # Default delegate definitions
3212 AC_MSG_RESULT([-------------------------------------------------------------])
3213 AC_MSG_CHECKING([for ImageMagick delegate programs])
3215 AutotraceDecodeDelegateDefault='autotrace'
3216 BlenderDecodeDelegateDefault='blender'
3217 BZIPDelegateDefault='bzip2'
3218 BrowseDelegateDefault='xdg-open'
3219 CGMDecodeDelegateDefault='ralcgm'
3220 CatDelegateDefault='cat'
3221 DNGDecodeDelegateDefault='ufraw-batch'
3222 GVCDecodeDelegateDefault='dot'
3223 DVIDecodeDelegateDefault='dvips'
3224 EchoDelegateDefault='echo'
3225 EditorDelegateDefault='xterm'
3226 FIGDecodeDelegateDefault='fig2dev'
3227 ConvertDelegateDefault=`echo convert | sed ${configure_transform_name}`
3228 DisplayDelegateDefault=`echo display | sed ${configure_transform_name}`
3229 MogrifyDelegateDefault=`echo mogrify | sed ${configure_transform_name}`
3230 GnuplotDecodeDelegateDefault='gnuplot'
3231 HPGLDecodeDelegateDefault='hp2xx'
3232 HTMLDecodeDelegateDefault='html2ps'
3233 ILBMDecodeDelegateDefault='ilbmtoppm'
3234 ILBMEncodeDelegateDefault='ppmtoilbm'
3235 JXRDecodeDelegateDefault='JxrDecApp'
3236 JXREncodeDelegateDefault='JxrEncApp'
3237 LPDelegateDefault='lp'
3238 LPRDelegateDefault='lpr'
3239 LaunchDelegateDefault='gimp'
3240 MANDelegateDefault='groff'
3241 MPEGDecodeDelegateDefault='ffmpeg'
3242 MPEGEncodeDelegateDefault='ffmpeg'
3243 MrSIDDecodeDelegateDefault='mrsidgeodecode'
3244 MVDelegateDefault='mv'
3245 PCLDelegateDefault='pcl6'
3246 PGPDecodeDelegateDefault='pgpv'
3247 POVDelegateDefault='povray'
3248 if test "$native_win32_build" = 'yes'; then
3249 PSDelegateDefault='gswin32c'
3250 elif test "$gslib_framework" = 'yes'; then
3251 PSDelegateDefault='gsc'
3253 PSDelegateDefault='gs'
3255 RLEEncodeDelegateDefault='rawtorle'
3256 RMDelegateDefault='rm'
3257 RSVGDecodeDelegateDefault='rsvg-convert'
3258 SCANDecodeDelegateDefault='scanimage'
3259 SVGDecodeDelegateDefault='inkscape'
3260 TXTDelegateDefault='enscript'
3261 UniconvertorDelegateDefault='uniconvertor'
3262 WebPDecodeDelegateDefault='dwebp'
3263 WebPEncodeDelegateDefault='cwebp'
3264 WMFDecodeDelegateDefault='wmf2eps'
3265 WWWDecodeDelegateDefault='curl'
3266 XPSDelegateDefault='gxps'
3267 ZipDelegateDefault='gzip'
3269 # Search for delegates
3270 AC_PATH_PROG(AutotraceDecodeDelegate, "$AutotraceDecodeDelegateDefault", "$AutotraceDecodeDelegateDefault")
3271 AC_PATH_PROG(BlenderDecodeDelegate, "$BlenderDecodeDelegateDefault", "$BlenderDecodeDelegateDefault")
3272 AC_PATH_PROG(BZIPDelegate, "$BZIPDelegateDefault", "$BZIPDelegateDefault")
3273 AC_PATH_PROGS(BrowseDelegate, "$BrowseDelegateDefault" google-chrome firefox konqueror mozilla lynx, "$BrowseDelegateDefault")
3274 AC_PATH_PROG(CGMDecodeDelegate, "$CGMDecodeDelegateDefault", "$CGMDecodeDelegateDefault")
3275 AC_PATH_PROG(CatDelegate, "$CatDelegateDefault", "$CatDelegateDefault")
3276 AC_PATH_PROG(DNGDecodeDelegate, "$DNGDecodeDelegateDefault", "$DNGDecodeDelegateDefault")
3277 AC_PATH_PROG(GVCDecodeDelegate, "$GVCDecodeDelegateDefault", "$GVCDecodeDelegateDefault")
3278 AC_PATH_PROG(DVIDecodeDelegate, "$DVIDecodeDelegateDefault", "$DVIDecodeDelegateDefault")
3279 AC_PATH_PROG(EchoDelegate, "$EchoDelegateDefault", "$EchoDelegateDefault")
3280 AC_PATH_PROG(EditorDelegate, "$EditorDelegateDefault", "$EditorDelegateDefault")
3281 AC_PATH_PROG(FIGDecodeDelegate, "$FIGDecodeDelegateDefault", "$FIGDecodeDelegateDefault")
3282 AC_PATH_PROG(ConvertDelegate, "$ConvertDelegateDefault", "$ConvertDelegateDefault")
3283 AC_PATH_PROG(DisplayDelegate, "$DisplayDelegateDefault", "$DisplayDelegateDefault")
3284 AC_PATH_PROG(MogrifyDelegate, "$MogrifyDelegateDefault", "$MogrifyDelegateDefault")
3285 AC_PATH_PROG(GnuplotDecodeDelegate, "$GnuplotDecodeDelegateDefault", "$GnuplotDecodeDelegateDefault")
3286 AC_PATH_PROG(HPGLDecodeDelegate, "$HPGLDecodeDelegateDefault", "$HPGLDecodeDelegateDefault")
3287 AC_PATH_PROG(HTMLDecodeDelegate, "$HTMLDecodeDelegateDefault", "$HTMLDecodeDelegateDefault")
3288 AC_PATH_PROG(ILBMDecodeDelegate, "$ILBMDecodeDelegateDefault", "$ILBMDecodeDelegateDefault")
3289 AC_PATH_PROG(ILBMEncodeDelegate, "$ILBMEncodeDelegateDefault", "$ILBMEncodeDelegateDefault")
3290 AC_PATH_PROG(JXRDecodeDelegate, "$JXRDecodeDelegateDefault", "$JXRDecodeDelegateDefault")
3291 AC_PATH_PROG(JXREncodeDelegate, "$JXREncodeDelegateDefault", "$JXREncodeDelegateDefault")
3292 AC_PATH_PROG(LPDelegate, "$LPDelegateDefault", no)
3293 AC_PATH_PROG(LPRDelegate, "$LPRDelegateDefault", "$LPRDelegateDefault")
3294 AC_PATH_PROG(LaunchDelegate, "$LaunchDelegateDefault", "$LaunchDelegateDefault")
3295 AC_PATH_PROG(MANDelegate, "$MANDelegateDefault", "$MANDelegateDefault")
3296 AC_PATH_PROG(MPEGDecodeDelegate, "$MPEGDecodeDelegateDefault", "$MPEGDecodeDelegateDefault")
3297 AC_PATH_PROG(MPEGEncodeDelegate, "$MPEGEncodeDelegateDefault", "$MPEGEncodeDelegateDefault")
3298 AC_PATH_PROG(MrSIDDecodeDelegate, "$MrSIDDecodeDelegateDefault", "$MrSIDDecodeDelegateDefault")
3299 AC_PATH_PROG(MVDelegate, "$MVDelegateDefault", "$MVDelegateDefault")
3300 AC_PATH_PROG(PCLDelegate, "$PCLDelegateDefault", "$PCLDelegateDefault")
3301 AC_PATH_PROG(PGPDecodeDelegate, "$PGPDecodeDelegateDefault", "$PGPDecodeDelegateDefault")
3302 AC_PATH_PROG(POVDelegate, "$POVDelegateDefault", "$POVDelegateDefault")
3303 AC_PATH_PROGS(PSDelegate, gsx gsc "$PSDelegateDefault", "$PSDelegateDefault")
3304 AC_PATH_PROG(RLEEncodeDelegate, "$RLEEncodeDelegateDefault", "$RLEEncodeDelegateDefault")
3305 AC_PATH_PROG(RMDelegate, "$RMDelegateDefault", "$RMDelegateDefault")
3306 AC_PATH_PROG(RSVGDecodeDelegate, "$RSVGDecodeDelegateDefault", "$RSVGDecodeDelegateDefault")
3307 AC_PATH_PROG(SCANDecodeDelegate, "$SCANDecodeDelegateDefault", "$SCANDecodeDelegateDefault")
3308 AC_PATH_PROG(SVGDecodeDelegate, "$SVGDecodeDelegateDefault", "$SVGDecodeDelegateDefault")
3309 AC_PATH_PROG(TXTDelegate, "$TXTDelegateDefault", "$TXTDelegateDefault")
3310 AC_PATH_PROG(UniconvertorDelegate, "$UniconvertorDelegateDefault", "$UniconvertorDelegateDefault")
3311 AC_PATH_PROG(WebPDecodeDelegate, "$WebPDecodeDelegateDefault", "$WebPDecodeDelegateDefault")
3312 AC_PATH_PROG(WebPEncodeDelegate, "$WebPEncodeDelegateDefault", "$WebPEncodeDelegateDefault")
3313 AC_PATH_PROG(WMFDecodeDelegate, "$WMFDecodeDelegateDefault", "$WMFDecodeDelegateDefault")
3314 AC_PATH_PROG(WWWDecodeDelegate, "$WWWDecodeDelegateDefault", "$WWWDecodeDelegateDefault")
3315 AC_PATH_PROG(XPSDelegate, "$XPSDelegateDefault", "$XPSDelegateDefault")
3316 AC_PATH_PROG(ZipDelegate, "$ZipDelegateDefault", "$ZipDelegateDefault")
3318 # Prefer lpr to lp; lp needs options tacked on.
3319 if test "$LPRDelegate" != no; then
3320 PrintDelegate="$LPRDelegate"
3322 PrintDelegate="$LPDelegate -c -s"
3324 AC_SUBST(PrintDelegate)
3326 # Installed ImageMagick utiltity paths
3327 ConvertDelegate="${BIN_DIR}/${ConvertDelegateDefault}"
3328 DisplayDelegate="${BIN_DIR}/${DisplayDelegateDefault}"
3329 MogrifyDelegate="${BIN_DIR}/${MogrifyDelegateDefault}"
3331 # Set delegate booleans
3332 have_ffmpeg='no'; if test "$MPEGDecodeDelegate" != "$MPEGDecodeDelegateDefault" ; then have_ffmpeg='yes'; fi
3333 have_fig2dev='no' ; if test "$FIGDecodeDelegate" != "$FIGDecodeDelegateDefault" ; then have_fig2dev='yes'; fi
3334 have_gs='no' ; if test "$PSDelegate" != "$PSDelegateDefault"; then have_gs='yes'; fi
3335 have_hp2xx='no' ; if test "$HPGLDecodeDelegate" != "$HPGLDecodeDelegateDefault" ; then have_hp2xx='yes'; fi
3336 have_ilbmtoppm='no' ; if test "$ILBMDecodeDelegate" != "$ILBMDecodeDelegateDefault" ; then have_ilbmtoppm='yes'; fi
3337 have_mrsid='no'; if test "$MrSIDDecodeDelegate" != "$MrSIDDecodeDelegateDefault" ; then have_mrsid='yes'; fi
3338 have_pcl='no' ; if test "$PCLDelegate" != "$PCLDelegateDefault"; then have_pcl='yes'; fi
3339 have_ppmtoilbm='no' ; if test "$ILBMEncodeDelegate" != "$ILBMEncodeDelegateDefault" ; then have_ppmtoilbm='yes'; fi
3340 have_ralcgm='no' ; if test "$CGMDecodeDelegate" != "$CGMDecodeDelegateDefault" ; then have_ralcgm='yes'; fi
3341 have_xps='no' ; if test "$XPSDelegate" != "$XPSDelegateDefault"; then have_xps='yes'; fi
3344 # Test for font directories
3346 type_include_files=''
3349 AC_MSG_CHECKING(for Dejavu fonts directory)
3351 if test "${with_dejavu_font_dir}" != 'default'; then
3352 dejavu_font_dir="${with_dejavu_font_dir}/"
3354 for font_dir in "${prefix}/share/dejavu/fonts/" '/usr/share/fonts/dejavu/'; do
3355 if test -f "${font_dir}DejaVuSerif.ttf"; then
3356 dejavu_font_dir="${font_dir}"
3361 if test "${dejavu_font_dir}x" != 'x'; then
3362 type_include_files="${type_include_files} "'<include file="type-dejavu.xml" />'
3363 AC_MSG_RESULT([$dejavu_font_dir])
3365 AC_MSG_RESULT([not found!]);
3367 AC_SUBST(dejavu_font_dir)
3371 if test "$with_windows_font_dir" != "no" && test -n "$with_windows_font_dir"; then
3372 windows_font_dir="${with_windows_font_dir}/"
3374 if test "${windows_font_dir}x" != 'x'; then
3375 if test -f '/usr/X11R6/lib/X11/fonts/truetype/arial.ttf'; then
3376 windows_font_dir='/usr/X11R6/lib/X11/fonts/truetype/'
3378 if test -f '/usr/X11R7/lib/X11/fonts/truetype/arial.ttf'; then
3379 windows_font_dir='/usr/X11R7/lib/X11/fonts/truetype/'
3381 if test -f '/usr/share/fonts/msttcore/arial.ttf'; then
3382 windows_font_dir='/usr/share/fonts/msttcore/truetype/'
3385 if test "${windows_font_dir}x" != 'x'; then
3386 type_include_files="$type_include_files "'<include file="type-windows.xml" />'
3388 AC_SUBST(windows_font_dir)
3391 AC_MSG_CHECKING(for Ghostscript fonts directory)
3392 ghostscript_font_dir=''
3393 if test "${with_gs_font_dir}" != 'default'; then
3394 ghostscript_font_dir="${with_gs_font_dir}/"
3396 if test "${native_win32_build}" = 'yes'; then
3397 # Native Windows Build
3398 for font_dir in "c:\\Program Files\\gs\\fonts\\" "c:\\Program Files \(x86\)\\gs\\fonts\\" "c:\\gs\\fonts\\"; do
3399 if test -f "${font_dir}a010013l.pfb"; then
3400 ghostscript_font_dir="$font_dir"
3404 if test "${PSDelegate}" != 'gswin32c'; then
3405 ghostscript_font_dir=`echo "${PSDelegate}" | sed -e 's:/gs/.*:/gs:;s:^/::;s/./&:/;s:/:\\\\:g'`"\\fonts\\"
3408 # Linux / Mac OS X / Unix Build
3409 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
3410 if test -f "${font_dir}a010013l.pfb"; then
3411 ghostscript_font_dir="${font_dir}"
3415 if test "${ghostscript_font_dir}x" = 'x'; then
3416 if test "$PSDelegate" != 'gs'; then
3417 ghostscript_font_dir=`echo "$PSDelegate" | sed -e 's:/bin/gs:/share/ghostscript/fonts:'`"/"
3422 if test "${ghostscript_font_dir}x" != 'x'; then
3423 type_include_files="${type_include_files} "'<include file="type-ghostscript.xml" />'
3424 AC_MSG_RESULT([$ghostscript_font_dir])
3426 AC_MSG_RESULT([not found!]);
3428 AC_SUBST(ghostscript_font_dir)
3429 case "${build_os}" in
3431 PSDelegate=`$WinPathScript "$PSDelegate" 1`
3435 AC_SUBST(type_include_files)
3438 # Handle case where user doesn't want frozen paths
3440 if test "$with_frozenpaths" != 'yes'; then
3441 # Re-set delegate definitions to default (no paths)
3442 AutotraceDecodeDelegate="$AutotraceDecodeDelegateDefault"
3443 BlenderDecodeDelegate="$BlenderDecodeDelegateDefault"
3444 BZIPDelegate="$BZIPDelegateDefault"
3445 BrowseDelegate="$BrowseDelegateDefault"
3446 CGMDecodeDelegate="$CGMDecodeDelegateDefault"
3447 CatDelegate="$CatDelegateDefault"
3448 ConvertDelegate="$ConvertDelegateDefault"
3449 DisplayDelegate="$DisplayDelegateDefault"
3450 DNGDecodeDelegate="$DNGDecodeDelegateDefault"
3451 DVIDecodeDelegate="$DVIDecodeDelegateDefault"
3452 EchoDelegate="$EchoDelegateDefault"
3453 EditorDelegate="$EditorDelegateDefault"
3454 FIGDecodeDelegate="$FIGDecodeDelegateDefault"
3455 GnuplotDecodeDelegate="$GnuplotDecodeDelegateDefault"
3456 GVCDecodeDelegate="$GVCDecodeDelegateDefault"
3457 HPGLDecodeDelegate="$HPGLDecodeDelegateDefault"
3458 HTMLDecodeDelegate="$HTMLDecodeDelegateDefault"
3459 ILBMDecodeDelegate="$ILBMDecodeDelegateDefault"
3460 ILBMEncodeDelegate="$ILBMEncodeDelegateDefault"
3461 JXRDecodeDelegate="$JXRDecodeDelegateDefault"
3462 JXREncodeDelegate="$JXREncodeDelegateDefault"
3463 LPDelegate="$LPDelegateDefault"
3464 LaunchDelegate="$LaunchDelegateDefault"
3465 MANDelegate="$MANDelegateDefault"
3466 MPEGDecodeDelegate="$MPEGDecodeDelegateDefault"
3467 MPEGEncodeDelegate="$MPEGEncodeDelegateDefault"
3468 MogrifyDelegate="$MogrifyDelegateDefault"
3469 MrSIDDecodeDelegate="$MrSIDDecodeDelegateDefault"
3470 MVDelegate="$MVDelegateDefault"
3471 PCLDelegate="$PCLDelegateDefault"
3472 PGPDecodeDelegate="$PGPDecodeDelegateDefault"
3473 POVDelegate="$POVDelegateDefault"
3474 PSDelegate="$PSDelegateDefault"
3475 RLEEncodeDelegate="$RLEEncodeDelegateDefault"
3476 RMDelegate="$RMDelegateDefault"
3477 RSVGDecodeDelegate="$RSVGDecodeDelegateDefault"
3478 SCANDecodeDelegate="$SCANDecodeDelegateDefault"
3479 SVGDecodeDelegate="$SVGDecodeDelegateDefault"
3480 ShowImageDelegate="$ShowImageDelegateDefault"
3481 TXTDelegate="$TXTDelegateDefault"
3482 UniconvertorDelegate="$UniconvertorDelegateDefault"
3483 WebPDecodeDelegate="$WebPDecodeDelegateDefault"
3484 WebPEncodeDelegate="$WebPEncodeDelegateDefault"
3485 WMFDecodeDelegate="$WMFDecodeDelegateDefault"
3486 WWWDecodeDelegate="$WWWDecodeDelegateDefault"
3487 XPSDelegate="$XPSDelegateDefault"
3488 ZipDelegate="$ZipDelegateDefault"
3491 # Delegate substitutions
3492 AC_SUBST(AutotraceDecodeDelegate)
3493 AC_SUBST(BlenderDecodeDelegate)
3494 AC_SUBST(BZIPDelegate)
3495 AC_SUBST(BrowseDelegate)
3496 AC_SUBST(CGMDecodeDelegate)
3497 AC_SUBST(CatDelegate)
3498 AC_SUBST(ConvertDelegate)
3499 AC_SUBST(GVCDecodeDelegate)
3500 AC_SUBST(DVIDecodeDelegate)
3501 AC_SUBST(EchoDelegate)
3502 AC_SUBST(EditorDelegate)
3503 AC_SUBST(FIGDecodeDelegate)
3504 AC_SUBST(GnuplotDecodeDelegate)
3505 AC_SUBST(HPGLDecodeDelegate)
3506 AC_SUBST(HTMLDecodeDelegate)
3507 AC_SUBST(ILBMDecodeDelegate)
3508 AC_SUBST(ILBMEncodeDelegate)
3509 AC_SUBST(JXRDecodeDelegate)
3510 AC_SUBST(JXREncodeDelegate)
3511 AC_SUBST(LPDelegate)
3512 AC_SUBST(LaunchDelegate)
3513 AC_SUBST(MANDelegate)
3514 AC_SUBST(MPEGDecodeDelegate)
3515 AC_SUBST(MPEGEncodeDelegate)
3516 AC_SUBST(MogrifyDelegate)
3517 AC_SUBST(MrSIDDecodeDelegate)
3518 AC_SUBST(MVDelegate)
3519 AC_SUBST(PCLDelegate)
3520 AC_SUBST(PGPDecodeDelegate)
3521 AC_SUBST(POVDelegate)
3522 AC_SUBST(PSDelegate)
3523 AC_SUBST(RLEEncodeDelegate)
3524 AC_SUBST(RMDelegate)
3525 AC_SUBST(SCANDecodeDelegate)
3526 AC_SUBST(ShowImageDelegate)
3527 AC_SUBST(TXTDelegate)
3528 AC_SUBST(UniconvertorDelegate)
3529 AC_SUBST(WMFDecodeDelegate)
3530 AC_SUBST(WebPDecodeDelegate)
3531 AC_SUBST(WebPEncodeDelegate)
3532 AC_SUBST(WWWDecodeDelegate)
3533 AC_SUBST(XPSDelegate)
3534 AC_SUBST(ZipDelegate)
3540 AC_CHECK_PROGS(TAR,gnutar gtar tar)
3541 AC_CHECK_PROGS(PERL,perl)
3542 AC_CHECK_PROGS(RPM,rpmbuild rpm)
3543 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
3544 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
3545 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
3546 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
3548 AM_CONDITIONAL(RPM_DELEGATE, test "x$RPM" != "x" )
3551 # 7ZIP support (http://p7zip.sourceforge.net/)
3554 AC_CHECK_PROGS(P7ZIP,[7za])
3556 AM_CONDITIONAL(P7ZIP_DELEGATE, test "x$P7ZIP" != "x" )
3559 # ZIP support (http://www.info-zip.org/Zip.html)
3562 AC_CHECK_PROGS(ZIP,[zip])
3564 AM_CONDITIONAL(ZIP_DELEGATE, test "x$ZIP" != "x" )
3567 # GhostPCL related configuration.
3569 PCLColorDevice=ppmraw
3570 PCLCMYKDevice=pamcmyk32
3571 PCLMonoDevice=pbmraw
3572 if test -z "$PCLVersion"; then
3573 PCLVersion='unknown'
3575 if test $have_pcl = 'yes'; then
3576 AC_MSG_RESULT([-------------------------------------------------------------])
3577 AC_MSG_CHECKING([for PCL])
3580 AC_MSG_CHECKING([for pcl color device])
3581 if $PCLDelegate -dBATCH -sDEVICE=$PCLColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3584 PCLColorDevice=ppmraw
3586 AC_MSG_RESULT([$PCLColorDevice])
3589 AC_MSG_CHECKING([for pcl CMYK device])
3590 if $PCLDelegate -dBATCH -sDEVICE=$PCLColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3593 PCLCMYKDevice=$PCLColorDevice
3595 AC_MSG_RESULT([$PCLCMYKDevice])
3598 AC_MSG_CHECKING([for pcl mono device])
3599 if $PCLDelegate -dBATCH -sDEVICE=$PCLMonoDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3602 PCLMonoDevice=$PCLColorDevice
3604 AC_MSG_RESULT([$PCLMonoDevice])
3607 AC_SUBST(PCLMonoDevice)
3608 AC_SUBST(PCLColorDevice)
3609 AC_SUBST(PCLCMYKDevice)
3610 AC_SUBST(PCLVersion)
3613 # GhostXPS related configuration.
3615 XPSColorDevice=ppmraw
3616 XPSCMYKDevice=bmpsep8
3617 XPSMonoDevice=pbmraw
3618 if test -z "$XPSVersion"; then
3619 XPSVersion='unknown'
3621 if test $have_xps = 'yes'; then
3622 AC_MSG_RESULT([-------------------------------------------------------------])
3623 AC_MSG_CHECKING([for XPS])
3626 AC_MSG_CHECKING([for xps color device])
3627 if $XPSDelegate -dBATCH -sDEVICE=$XPSColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3630 XPSColorDevice=ppmraw
3632 AC_MSG_RESULT([$XPSColorDevice])
3635 AC_MSG_CHECKING([for xps CMYK device])
3636 if $XPSDelegate -dBATCH -sDEVICE=$XPSColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3639 XPSCMYKDevice=$XPSColorDevice
3641 AC_MSG_RESULT([$XPSCMYKDevice])
3644 AC_MSG_CHECKING([for xps mono device])
3645 if $XPSDelegate -dBATCH -sDEVICE=$XPSMonoDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3648 XPSMonoDevice=$XPSColorDevice
3650 AC_MSG_RESULT([$XPSMonoDevice])
3653 AC_SUBST(XPSMonoDevice)
3654 AC_SUBST(XPSColorDevice)
3655 AC_SUBST(XPSCMYKDevice)
3656 AC_SUBST(XPSVersion)
3659 # Ghostscript related configuration.
3661 GSAlphaDevice=pngalpha
3662 GSColorDevice=pnmraw
3665 GSPDFDevice=pdfwrite
3667 GSEPSDevice=epswrite
3669 if test $have_gs = 'yes'; then
3670 AC_MSG_RESULT([-------------------------------------------------------------])
3671 AC_MSG_CHECKING([for Ghostscript])
3673 AC_MSG_CHECKING([for Ghostscript version])
3674 if GSVersion=`$PSDelegate --version`; then
3677 GSVersion=`$PSDelegate --help | sed -e '1q' | awk '{ print $3 }'`
3679 AC_MSG_RESULT([$GSVersion])
3682 AC_MSG_CHECKING([for gs alpha device])
3683 if $PSDelegate -q -dBATCH -sDEVICE=$GSAlphaDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3686 GSAlphaDevice=pnmraw
3688 AC_MSG_RESULT([$GSAlphaDevice])
3691 AC_MSG_CHECKING([for gs color device])
3692 if $PSDelegate -q -dBATCH -sDEVICE=$GSColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3695 GSColorDevice=pnmraw
3697 AC_MSG_RESULT([$GSColorDevice])
3700 AC_MSG_CHECKING([for gs CMYK device])
3701 if $PSDelegate -q -dBATCH -sDEVICE=$GSCMYKDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3704 GSCMYKDevice=bmpsep8
3706 AC_MSG_RESULT([$GSCMYKDevice])
3709 AC_MSG_CHECKING([for gs mono device])
3710 if $PSDelegate -q -dBATCH -sDEVICE=$GSMonoDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3713 GSMonoDevice=$GSColorDevice
3715 AC_MSG_RESULT([$GSMonoDevice])
3718 AC_MSG_CHECKING([for gs PDF writing device])
3719 if $PSDelegate -q -dBATCH -sDEVICE=$GSPDFDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3722 GSPDFDevice=nodevice
3724 AC_MSG_RESULT([$GSPDFDevice])
3727 AC_MSG_CHECKING([for gs PS writing device])
3728 if $PSDelegate -q -dBATCH -sDEVICE=$GSPSDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3733 AC_MSG_RESULT([$GSPSDevice])
3736 AC_MSG_CHECKING([for gs EPS writing device])
3737 if $PSDelegate -q -dBATCH -sDEVICE=$GSEPSDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3740 GSEPSDevice=nodevice
3742 AC_MSG_RESULT([$GSEPSDevice])
3745 AC_SUBST(GSAlphaDevice)
3746 AC_SUBST(GSCMYKDevice)
3747 AC_SUBST(GSColorDevice)
3748 AC_SUBST(GSEPSDevice)
3749 AC_SUBST(GSMonoDevice)
3750 AC_SUBST(GSPDFDevice)
3751 AC_SUBST(GSPSDevice)
3755 # PerlMagick-related configuration
3758 # Look for PERL if PerlMagick requested
3759 # If name/path of desired PERL interpreter is specified, look for that one first
3761 if test "$with_perl" != 'no'; then
3762 AC_MSG_RESULT([-------------------------------------------------------------])
3763 AC_MSG_CHECKING([for Perl])
3765 if test "$with_perl" != 'yes'; then
3766 AC_CACHE_CHECK(for perl,ac_cv_path_PERL,ac_cv_path_PERL="$with_perl");
3767 PERL=$ac_cv_path_PERL
3769 have_perl="$ac_cv_path_PERL"
3771 AC_PATH_PROGS(PERL,perl perl5,)dnl
3772 if test "$ac_cv_path_PERL"; then
3773 have_perl="$ac_cv_path_PERL"
3778 if test "$with_perl" != 'yes' ; then
3779 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-perl=$with_perl "
3782 PERL_SUPPORTS_DESTDIR='no'
3784 with_perl_static='no'
3785 with_perl_dynamic='no'
3786 if test "$have_perl" != 'no'; then
3787 if test "$with_perl" != 'no' && test "$libtool_build_shared_libs" = 'no'; then
3788 with_perl_static='yes'
3790 if test "$with_perl" != 'no' && test "$libtool_build_shared_libs" = 'yes'; then
3791 with_perl_dynamic='yes'
3793 # Is PERL's MakeMaker new enough to support DESTDIR?
3794 AX_PROG_PERL_VERSION(5.8.1,[PERL_SUPPORTS_DESTDIR='yes'],[PERL_SUPPORTS_DESTDIR='no'])
3796 AM_CONDITIONAL(WITH_PERL, test "$have_perl" != 'no')
3797 AM_CONDITIONAL(WITH_PERL_STATIC, test $with_perl_static = 'yes')
3798 AM_CONDITIONAL(WITH_PERL_DYNAMIC, test $with_perl_dynamic = 'yes')
3799 AC_SUBST(PERL_SUPPORTS_DESTDIR)
3801 # Determine path to pick up MagickCore library from for use with building PerlMagick
3802 MAGICKCORE_PATH="${LIB_DIR}"
3803 if test $with_perl_static = 'yes'; then
3804 # Find out where libtool hides its uninstalled libraries (as libtool_objdir)
3805 libtool_objdir=$objdir
3807 # Linker search path to library, followed by -lMagickCore
3808 MAGICKCORE_PATH="${builddir}/MagickCore/${libtool_objdir}"
3810 AC_SUBST(MAGICKCORE_PATH)
3812 # Create a simple string containing format names for all delegate libraries.
3814 if test "$have_autotrace" = 'yes' ; then
3815 MAGICK_DELEGATES="$MAGICK_DELEGATES autotrace"
3817 if test "$have_bzlib" = 'yes' ; then
3818 MAGICK_DELEGATES="$MAGICK_DELEGATES bzlib"
3820 if test "$have_dps" = 'yes' ; then
3821 MAGICK_DELEGATES="$MAGICK_DELEGATES dps"
3823 if test "$have_djvu" = 'yes' ; then
3824 MAGICK_DELEGATES="$MAGICK_DELEGATES djvu"
3826 if test "$have_ffmpeg" = 'yes' ; then
3827 MAGICK_DELEGATES="$MAGICK_DELEGATES mpeg"
3829 if test "$have_mupdf" = 'yes' ; then
3830 MAGICK_DELEGATES="$MAGICK_DELEGATES mupdf"
3832 if test "$have_fftw" = 'yes' ; then
3833 MAGICK_DELEGATES="$MAGICK_DELEGATES fftw"
3835 if test "$have_fig2dev" = 'yes' && test "$have_ps" = 'yes' ; then
3836 MAGICK_DELEGATES="$MAGICK_DELEGATES xfig"
3838 if test "$have_fpx" = 'yes' ; then
3839 MAGICK_DELEGATES="$MAGICK_DELEGATES fpx"
3841 if test "$have_fontconfig" = 'yes' ; then
3842 MAGICK_DELEGATES="$MAGICK_DELEGATES fontconfig"
3844 if test "$have_freetype" = 'yes' ; then
3845 MAGICK_DELEGATES="$MAGICK_DELEGATES freetype"
3847 if test "$have_gslib" = 'yes' ; then
3848 MAGICK_DELEGATES="$MAGICK_DELEGATES gslib"
3850 if test "$have_jbig" = 'yes' ; then
3851 MAGICK_DELEGATES="$MAGICK_DELEGATES jbig"
3853 if test "$have_png$have_jpeg" = 'yesyes' ; then
3854 MAGICK_DELEGATES="$MAGICK_DELEGATES jng"
3856 if test "$have_jp2" = 'yes' ; then
3857 MAGICK_DELEGATES="$MAGICK_DELEGATES jp2"
3859 if test "$have_jpeg" = 'yes' ; then
3860 MAGICK_DELEGATES="$MAGICK_DELEGATES jpeg"
3862 if test "$have_lcms" = 'yes' || test "$have_lcms2" = 'yes' ; then
3863 MAGICK_DELEGATES="$MAGICK_DELEGATES lcms"
3865 if test "$have_lqr" = 'yes' ; then
3866 MAGICK_DELEGATES="$MAGICK_DELEGATES lqr"
3868 if test "$have_lzma" = 'yes' ; then
3869 MAGICK_DELEGATES="$MAGICK_DELEGATES lzma"
3871 if test "$have_openexr" = 'yes' ; then
3872 MAGICK_DELEGATES="$MAGICK_DELEGATES openexr"
3874 if test "$have_pango" = 'yes' ; then
3875 MAGICK_DELEGATES="$MAGICK_DELEGATES pango"
3877 if test "$have_png" = 'yes' ; then
3878 MAGICK_DELEGATES="$MAGICK_DELEGATES png"
3881 if test "$have_dps" = 'yes' || \
3882 test "$have_gs" = 'yes' || \
3883 test "${native_win32_build}" = 'yes' ; then
3886 if test "$have_ps" = 'yes' ; then
3887 MAGICK_DELEGATES="$MAGICK_DELEGATES ps"
3889 if test "$have_ralcgm" = 'yes' ; then
3890 MAGICK_DELEGATES="$MAGICK_DELEGATES cgm"
3892 if test "$have_ra_ppm" = 'yes' ; then
3893 MAGICK_DELEGATES="$MAGICK_DELEGATES rad"
3895 if test "$have_rsvg" = 'yes' ; then
3896 MAGICK_DELEGATES="$MAGICK_DELEGATES rsvg"
3898 if test "$have_tiff" = 'yes' ; then
3899 MAGICK_DELEGATES="$MAGICK_DELEGATES tiff"
3901 if test "$have_ttf" = 'yes' ; then
3902 MAGICK_DELEGATES="$MAGICK_DELEGATES ttf"
3904 if test "$have_webp" = 'yes' ; then
3905 MAGICK_DELEGATES="$MAGICK_DELEGATES webp"
3907 if test "$have_wmf" = 'yes' ; then
3908 MAGICK_DELEGATES="$MAGICK_DELEGATES wmf"
3910 if test "$have_x" = 'yes' ; then
3911 MAGICK_DELEGATES="$MAGICK_DELEGATES x"
3913 if test "$have_xml" = 'yes' ; then
3914 MAGICK_DELEGATES="$MAGICK_DELEGATES xml"
3916 if test "$have_zlib" = 'yes' ; then
3917 MAGICK_DELEGATES="$MAGICK_DELEGATES zlib"
3919 # Remove extraneous spaces from output variables (asthetic)
3920 MAGICK_DELEGATES=`echo $MAGICK_DELEGATES | sed -e 's/ */ /g'`
3921 MAGICK_FEATURES=`echo $MAGICK_FEATURES | sed -e 's/ */ /g'`
3922 AC_SUBST(MAGICK_DELEGATES)
3923 AC_SUBST(MAGICK_FEATURES)
3926 # Handle special compiler flags
3929 # Add '-p' if prof source profiling support enabled
3930 if test "$enable_prof" = 'yes'; then
3932 CXXFLAGS="-p $CXXFLAGS"
3933 LDFLAGS="-p $LDFLAGS"
3936 # Add '-pg' if gprof source profiling support enabled
3937 if test "$enable_gprof" = 'yes'; then
3938 CFLAGS="-pg $CFLAGS"
3939 CXXFLAGS="-pg $CXXFLAGS"
3940 LDFLAGS="-pg $LDFLAGS"
3943 # Add '-ftest-coverage -fprofile-arcs' if gcov source profiling support enabled
3944 # This is a gcc-specific feature
3945 if test "$enable_gcov" = 'yes'; then
3946 AC_CHECK_LIB(gcov,_gcov_init)
3947 AC_CHECK_LIB(gcov,__gcov_init)
3948 case "$target_os" in
3950 OSX_GCOV_LDFLAG="-Wl,-single_module"
3956 AC_SUBST(OSX_GCOV_LDFLAG)
3957 CFLAGS="-ftest-coverage -fprofile-arcs $CFLAGS"
3958 CXXFLAGS="-ftest-coverage -fprofile-arcs $CXXFLAGS"
3959 LDFLAGS="-ftest-coverage -fprofile-arcs $LDFLAGS"
3963 # Build library dependency list for libMagickCore
3966 if test "$build_modules" != 'no'; then
3967 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"
3969 MAGICK_DEP_LIBS="$JBIG_LIBS $LCMS_LIBS $TIFF_LIBS $FREETYPE_LIBS $JP2_LIBS $JPEG_LIBS $GS_LIBS $LQR_LIBS $PNG_LIBS $AUTOTRACE_LIBS $DJVU_LIBS $FFTW_LIBS $FPX_LIBS $FONTCONFIG_LIBS $WEBP_LIBS $WMF_LIBS $DPS_LIBS $XEXT_LIBS $XT_LIBS $IPC_LIBS $X11_LIBS $LZMA_LIBS $BZLIB_LIBS $OPENEXR_LIBS $PANGO_LIBS $RSVG_LIBS $XML_LIBS $GVC_LIBS $ZLIB_LIBS $GDI32_LIBS $MATH_LIBS $GOMP_LIBS $CL_LIBS $UMEM_LIBS $THREAD_LIBS"
3971 AC_SUBST(MAGICK_DEP_LIBS)
3974 # Remove extraneous spaces from output variables (asthetic)
3976 X_CFLAGS=`echo $X_CFLAGS | sed -e 's/ */ /g'`
3977 X_PRE_LIBS=`echo $X_PRE_LIBS | sed -e 's/ */ /g'`
3978 X_LIBS=`echo $X_LIBS | sed -e 's/ */ /g'`
3979 X_EXTRA_LIBS=`echo $X_EXTRA_LIBS | sed -e 's/ */ /g'`
3981 CC=`echo $CC | sed -e 's/ */ /g'`
3982 CFLAGS=`echo $CFLAGS | sed -e 's/ */ /g'`
3983 CPPFLAGS=`echo $CPPFLAGS | sed -e 's/ */ /g'`
3984 CXXFLAGS=`echo $CXXFLAGS | sed -e 's/ */ /g'`
3985 DISTCHECK_CONFIG_FLAGS=`echo $DISTCHECK_CONFIG_FLAGS | sed -e 's/ */ /g'`
3986 LDFLAGS=`echo $LDFLAGS | sed -e 's/ */ /g'`
3987 TESTED_LIBS=`echo $LIBS | sed -e 's/ */ /g'`
3988 MAGICK_DEP_LIBS=`echo $MAGICK_DEP_LIBS | sed -e 's/ */ /g'`
3989 #LIBS=`echo $LIBS | sed -e 's/ */ /g'`
3991 # Pass only user-provided LIBS as "global" libraries
3997 #AC_SUBST(X_PRE_LIBS)
3999 #AC_SUBST(X_EXTRA_LIBS)
4001 MAGICK_CFLAGS=$CFLAGS
4002 MAGICK_CXXFLAGS="$CXXFLAGS"
4003 MAGICK_CPPFLAGS=`echo $MAGICK_CPPFLAGS | sed -e 's/ */ /g'`
4004 MAGICK_PCFLAGS=`echo $MAGICK_PCFLAGS | sed -e 's/ */ /g'`
4005 MAGICK_LDFLAGS="-L$LIB_DIR $LDFLAGS"
4006 MAGICK_LIBS="-lMagickCore $MAGICK_DEP_LIBS"
4008 AC_SUBST(MAGICK_CFLAGS)
4009 AC_SUBST(MAGICK_CXXFLAGS)
4010 AC_SUBST(MAGICK_CPPFLAGS)
4011 AC_SUBST(MAGICK_PCFLAGS)
4012 AC_SUBST(MAGICK_LDFLAGS)
4013 AC_SUBST(MAGICK_LIBS)
4015 # Set configured scripts to executable.
4016 AC_CONFIG_COMMANDS([default],[],[])
4017 AC_CONFIG_COMMANDS([magick.sh.in],[chmod +x magick.sh])
4018 AC_CONFIG_COMMANDS([MagickCore-config.in],[chmod +x MagickCore/MagickCore-config])
4019 AC_CONFIG_COMMANDS([MagickWand-config.in],[chmod +x MagickWand/MagickWand-config])
4020 AC_CONFIG_COMMANDS([Magick++-config.in],[chmod +x Magick++/bin/Magick++-config])
4021 AC_CONFIG_COMMANDS([PerlMagick/check.sh.in],[chmod +x PerlMagick/check.sh])
4023 AC_MSG_RESULT([-------------------------------------------------------------])
4024 AC_MSG_RESULT([Update ImageMagick configuration])
4027 rm -f magick-version
4029 result_dejavu_font_dir='none'
4030 if test "${dejavu_font_dir}x" != 'x'; then
4031 result_dejavu_font_dir=$dejavu_font_dir
4034 result_ghostscript_font_dir='none'
4035 if test "${ghostscript_font_dir}x" != 'x'; then
4036 result_ghostscript_font_dir=$ghostscript_font_dir
4039 result_windows_font_dir='none'
4040 if test "${windows_font_dir}x" != 'x'; then
4041 result_windows_font_dir=${windows_font_dir}
4045 ImageMagick is configured as follows. Please verify that this configuration
4046 matches your expectations.
4048 Host system type: $host
4049 Build system type: $build
4052 -------------------------------------------------------------------------------
4053 Shared libraries --enable-shared=$enable_shared $libtool_build_shared_libs
4054 Static libraries --enable-static=$enable_static $libtool_build_static_libs
4055 Module support --with-modules=$build_modules $build_modules
4056 GNU ld --with-gnu-ld=$with_gnu_ld $lt_cv_prog_gnu_ld
4057 Quantum depth --with-quantum-depth=$with_quantum_depth $with_quantum_depth
4058 High Dynamic Range Imagery
4059 --enable-hdri=$enable_hdri $enable_hdri
4061 Delegate Configuration:
4062 BZLIB --with-bzlib=$with_bzlib $have_bzlib
4063 Autotrace --with-autotrace=$with_autotrace $have_autotrace
4064 Dejavu fonts --with-dejavu-font-dir=$with_dejavu_font_dir $result_dejavu_font_dir
4065 DJVU --with-djvu=$with_djvu $have_djvu
4066 DPS --with-dps=$with_dps $have_dps
4067 FFTW --with-fftw=$with_fftw $have_fftw
4068 FlashPIX --with-fpx=$with_fpx $have_fpx
4069 FontConfig --with-fontconfig=$with_fontconfig $have_fontconfig
4070 FreeType --with-freetype=$with_freetype $have_freetype
4071 GhostPCL None $PCLDelegate ($PCLVersion)
4072 GhostXPS None $XPSDelegate ($XPSVersion)
4073 Ghostscript None $PSDelegate ($GSVersion)
4074 Ghostscript fonts --with-gs-font-dir=$with_gs_font_dir $result_ghostscript_font_dir
4075 Ghostscript lib --with-gslib=$with_gslib $have_gslib
4076 Graphviz --with-gvc=$with_gvc $have_gvc
4077 JBIG --with-jbig=$with_jbig $have_jbig
4078 JPEG v1 --with-jpeg=$with_jpeg $have_jpeg
4079 JPEG-2000 --with-jp2=$with_jp2 $have_jp2
4080 LCMS v1 --with-lcms=$with_lcms $have_lcms
4081 LCMS v2 --with-lcms2=$with_lcms2 $have_lcms2
4082 LQR --with-lqr=$with_lqr $have_lqr
4083 LTDL --with-ltdl=$with_ltdl $have_ltdl
4084 LZMA --with-lzma=$with_lzma $have_lzma
4085 Magick++ --with-magick-plus-plus=$with_magick_plus_plus $have_magick_plus_plus
4086 MUPDF --with-mupdf=$with_mupdf $have_mupdf
4087 OpenEXR --with-openexr=$with_openexr $have_openexr
4088 PANGO --with-pango=$with_pango $have_pango
4089 PERL --with-perl=$with_perl $have_perl
4090 PNG --with-png=$with_png $have_png
4091 RSVG --with-rsvg=$with_rsvg $have_rsvg
4092 TIFF --with-tiff=$with_tiff $have_tiff
4093 WEBP --with-webp=$with_webp $have_webp
4094 Windows fonts --with-windows-font-dir=$with_windows_font_dir $result_windows_font_dir
4095 WMF --with-wmf=$with_wmf $have_wmf
4096 X11 --with-x=$with_x $have_x
4097 XML --with-xml=$with_xml $have_xml
4098 ZLIB --with-zlib=$with_zlib $have_zlib
4101 X_CFLAGS = $X_CFLAGS
4102 X_PRE_LIBS = $X_PRE_LIBS
4104 X_EXTRA_LIBS = $X_EXTRA_LIBS
4106 Options used to compile and link:
4107 PREFIX = $PREFIX_DIR
4108 EXEC-PREFIX = $EXEC_PREFIX_DIR
4109 VERSION = $PACKAGE_VERSION
4112 CPPFLAGS = $MAGICK_CPPFLAGS
4113 PCFLAGS = $MAGICK_PCFLAGS
4116 MAGICK_LDFLAGS = $MAGICK_LDFLAGS
4119 CXXFLAGS = $CXXFLAGS
4120 FEATURES = $MAGICK_FEATURES
4121 DELEGATES = $MAGICK_DELEGATES