1 # Copyright 1999-2015 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-apple.xml \
47 config/type-dejavu.xml \
48 config/type-ghostscript.xml \
49 config/type-windows.xml \
52 Magick++/bin/Magick++-config \
53 MagickCore/ImageMagick.pc \
54 Magick++/lib/Magick++.pc \
55 MagickCore/MagickCore-config \
56 MagickCore/MagickCore.pc \
57 MagickCore/version.h \
61 PerlMagick/default/Magick.pm \
62 PerlMagick/Makefile.PL \
63 PerlMagick/default/Makefile.PL \
64 PerlMagick/quantum/Makefile.PL \
65 PerlMagick/quantum/quantum.pm \
66 PerlMagick/quantum/quantum.xs \
67 PerlMagick/quantum/typemap \
70 utilities/composite.1 \
74 utilities/identify.1 \
75 utilities/ImageMagick.1 \
80 MagickWand/MagickWand-config \
81 MagickWand/MagickWand.pc ])
84 # Save initial user-tunable values
87 for var in CC CFLAGS CPPFLAGS CXX CXXCPP LDFLAGS LIBS ; do
88 eval isset=\${$var+set}
89 if test "$isset" = 'set'; then
91 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS}'${var}=${val}' "
94 AC_SUBST(DISTCHECK_CONFIG_FLAGS)
96 CONFIGURE_ARGS="$0 ${ac_configure_args}"
97 AC_SUBST(CONFIGURE_ARGS)
99 # Source file containing package/library versioning information.
100 . ${srcdir}/version.sh
102 echo "configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}${PACKAGE_VERSION_ADDENDUM}"
108 MAGICK_TARGET_CPU=$host_cpu
109 AC_SUBST(MAGICK_TARGET_CPU)
110 AC_DEFINE_UNQUOTED(MAGICK_TARGET_CPU,$MAGICK_TARGET_CPU,[Target Host CPU])
112 MAGICK_TARGET_VENDOR=$host_vendor
113 AC_SUBST(MAGICK_TARGET_VENDOR)
114 AC_DEFINE_UNQUOTED(MAGICK_TARGET_VENDOR,$MAGICK_TARGET_VENDOR,[Target Host Vendor])
116 MAGICK_TARGET_OS=$host_os
117 AC_SUBST(MAGICK_TARGET_OS)
118 AC_DEFINE_UNQUOTED(MAGICK_TARGET_OS,$MAGICK_TARGET_OS,[Target Host OS])
121 # Substitute versioning
122 AC_SUBST([MAGICK_MAJOR_VERSION],[magick_major_version])
123 AC_SUBST([MAGICK_MINOR_VERSION],[magick_minor_version])
124 AC_SUBST([MAGICK_MICRO_VERSION],[magick_micro_version])
125 AC_SUBST([MAGICK_PATCHLEVEL_VERSION],[magick_patchlevel_version])
126 AC_SUBST([MAGICK_VERSION],[magick_version])
127 AC_SUBST([MAGICK_SVN_REVISION],[magick_svn_revision])
129 # Substitute library versioning
130 AC_SUBST(MAGICK_LIBRARY_CURRENT)dnl
131 AC_SUBST(MAGICK_LIBRARY_REVISION)dnl
132 AC_SUBST(MAGICK_LIBRARY_AGE)dnl
133 AC_SUBST([MAGICK_LIBRARY_CURRENT_MIN],
134 [`expr $MAGICK_LIBRARY_CURRENT - $MAGICK_LIBRARY_AGE`])
135 AC_SUBST([MAGICK_LIBRARY_VERSION_INFO],
136 [$MAGICK_LIBRARY_CURRENT:$MAGICK_LIBRARY_REVISION:$MAGICK_LIBRARY_AGE])
138 AC_SUBST(MAGICKPP_LIBRARY_CURRENT)dnl
139 AC_SUBST(MAGICKPP_LIBRARY_REVISION)dnl
140 AC_SUBST(MAGICKPP_LIBRARY_AGE)dnl
141 AC_SUBST([MAGICKPP_LIBRARY_CURRENT_MIN],
142 [`expr $MAGICKPP_LIBRARY_CURRENT - $MAGICKPP_LIBRARY_AGE`])
143 AC_SUBST([MAGICKPP_LIBRARY_VERSION_INFO],
144 [$MAGICKPP_LIBRARY_CURRENT:$MAGICKPP_LIBRARY_REVISION:$MAGICKPP_LIBRARY_AGE])
146 AC_SUBST(PACKAGE_NAME)dnl
147 AC_SUBST(PACKAGE_VERSION)dnl
148 AC_SUBST(PACKAGE_PERL_VERSION)dnl
149 AC_SUBST(PACKAGE_RELEASE)dnl
150 AC_SUBST(PACKAGE_CHANGE_DATE)dnl
151 AC_SUBST(PACKAGE_LIB_VERSION)dnl
152 AC_SUBST(PACKAGE_LIB_VERSION_NUMBER)dnl
153 AC_SUBST(PACKAGE_RELEASE_DATE)dnl
154 AC_SUBST(PACKAGE_VERSION_ADDENDUM)dnl
156 # Ensure that make can run correctly
159 AM_INIT_AUTOMAKE([1.12 nostdinc color-tests foreign parallel-tests silent-rules subdir-objects dist-bzip2 dist-lzip dist-xz dist-zip])
161 # Enable support for silent build rules
162 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
164 # versioning of library
165 MAGICK_LIB_VERSION="0x"
166 if test ${MAGICK_LIBRARY_CURRENT} -lt 10 ; then
167 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
169 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_CURRENT}
170 if test ${MAGICK_LIBRARY_AGE} -lt 10 ; then
171 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
173 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_AGE}
174 if test ${MAGICK_LIBRARY_REVISION} -lt 10 ; then
175 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
177 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_REVISION}
178 AC_SUBST(MAGICK_LIB_VERSION)
180 # Definition used to define MagickLibVersionText in version.h
181 MAGICK_LIB_VERSION_TEXT="${PACKAGE_VERSION}"
182 AC_SUBST(MAGICK_LIB_VERSION_TEXT)
184 # Definition used to define MagickLibVersionNumber in version.h
185 MAGICK_LIB_VERSION_NUMBER="${MAGICK_LIBRARY_CURRENT},${MAGICK_LIBRARY_AGE},${MAGICK_LIBRARY_REVISION}"
186 AC_SUBST(MAGICK_LIB_VERSION_NUMBER)
188 MAGICKPP_LIB_VERSION="0x"
189 if test ${MAGICKPP_LIBRARY_CURRENT} -lt 10 ; then
190 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}0
192 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}${MAGICKPP_LIBRARY_CURRENT}
193 if test ${MAGICKPP_LIBRARY_AGE} -lt 10 ; then
194 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}0
196 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}${MAGICKPP_LIBRARY_AGE}
197 if test ${MAGICKPP_LIBRARY_REVISION} -lt 10 ; then
198 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}0
200 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}${MAGICKPP_LIBRARY_REVISION}
201 AC_SUBST(MAGICKPP_LIB_VERSION)
203 # Definition used to define MagickLibVersionText in version.h
204 MAGICKPP_LIB_VERSION_TEXT="${PACKAGE_VERSION}"
205 AC_SUBST(MAGICKPP_LIB_VERSION_TEXT)
207 # Definition used to define MagickLibVersionNumber in version.h
208 MAGICK_LIB_VERSION_NUMBER="${MAGICK_LIBRARY_CURRENT},${MAGICK_LIBRARY_AGE},${MAGICK_LIBRARY_REVISION}"
209 AC_SUBST(MAGICK_LIB_VERSION_NUMBER)
213 # Regenerate config.status if ChangeLog or version.sh is updated.
214 AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/version.sh'])
219 MAGICK_CPPFLAGS=$CPPFLAGS_USER
220 MAGICK_PCFLAGS=$CPPFLAGS_USER
226 # Evaluate shell variable equivalents to Makefile directory variables
228 if test "x$prefix" = xNONE; then
229 prefix=$ac_default_prefix
231 # Let make expand exec_prefix.
232 if test "x$exec_prefix" = xNONE; then
233 exec_prefix='${prefix}'
237 eval "eval PREFIX_DIR=${prefix}"
239 eval "eval EXEC_PREFIX_DIR=${exec_prefix}"
240 AC_SUBST(EXEC_PREFIX_DIR)
241 eval "eval BIN_DIR=$bindir"
243 eval "eval SBIN_DIR=$sbindir"
245 eval "eval LIBEXEC_DIR=$libexecdir"
246 AC_SUBST(LIBEXEC_DIR)
247 eval "eval DATA_DIR=$datadir"
249 eval "eval DOC_DIR=$datadir/doc"
251 eval "eval SYSCONF_DIR=$sysconfdir"
252 AC_SUBST(SYSCONF_DIR)
253 eval "eval SHAREDSTATE_DIR=$sharedstatedir"
254 AC_SUBST(SHAREDSTATE_DIR)
255 eval "eval LOCALSTATE_DIR=$localstatedir"
256 AC_SUBST(LOCALSTATE_DIR)
257 eval "eval LIB_DIR=$libdir"
259 eval "eval INCLUDE_DIR=$includedir"
260 AC_SUBST(INCLUDE_DIR)
261 eval "eval PERSISTINCLUDE_DIR=$oldincludedir"
262 AC_SUBST(PERSISTINCLUDE_DIR)
263 eval "eval INFO_DIR=$infodir"
265 eval "eval MAN_DIR=$mandir"
268 # Get full paths to source and build directories
269 srcdirfull="`cd $srcdir && pwd`"
273 # Compute variables useful for running uninstalled software.
275 MAGICK_CODER_MODULE_PATH="${builddir}/coders"
276 MAGICK_CONFIGURE_SRC_PATH="${srcdirfull}/config"
277 MAGICK_CONFIGURE_BUILD_PATH="${builddir}/config"
278 MAGICK_FILTER_MODULE_PATH="${builddir}/filters"
280 case "${build_os}" in
282 MAGICK_CODER_MODULE_PATH=`$WinPathScript "${MAGICK_CODER_MODULE_PATH}" 0`
283 MAGICK_CONFIGURE_SRC_PATH=`$WinPathScript "${MAGICK_CONFIGURE_SRC_PATH}" 0`
284 MAGICK_CONFIGURE_BUILD_PATH=`$WinPathScript "${MAGICK_CONFIGURE_BUILD_PATH}" 0`
285 MAGICK_FILTER_MODULE_PATH=`$WinPathScript "${MAGICK_FILTER_MODULE_PATH}" 0`
294 AC_SUBST(MAGICK_CODER_MODULE_PATH)
295 AC_SUBST(MAGICK_CONFIGURE_SRC_PATH)
296 AC_SUBST(MAGICK_CONFIGURE_BUILD_PATH)
297 AC_SUBST(MAGICK_FILTER_MODULE_PATH)
302 # Enable OS features.
304 AC_USE_SYSTEM_EXTENSIONS
323 AX_GCC_ARCHFLAG([no])
326 # Test for 64-bit build.
327 AC_CHECK_SIZEOF([size_t])
330 # The AX_CFLAGS_WARN_ALL macro doesn't currently work for sunpro
332 if test "$ax_cv_c_compiler_vendor" != "sun"; then
336 if test "x$GCC" = "xyes"; then
337 CFLAGS="$CFLAGS -fexceptions"
340 cat > local.exp <<EOF
341 set CC_FOR_TARGET "$CC"
345 # Check for linker script support
349 # Enable run-time checking.
351 AC_ARG_ENABLE([bounds-checking],
352 [AC_HELP_STRING([--enable-bounds-checking],
353 [enable run-time bounds-checking])],
354 [enable_bounds_checking=$enableval],
355 [enable_bounds_checking='no'])
357 if test "$enable_bounds_checking" = yes; then
358 AC_DEFINE([_FORTIFY_SOURCE], [2],
359 [enable run-time bounds-checking])
369 native_win32_build='no'
377 native_win32_build='yes'
381 if test "${GDI32_LIBS}x" != 'x'; then
382 AC_DEFINE(WINGDI32_DELEGATE,1,Define to use the Windows GDI32 library)
385 AM_CONDITIONAL(WINGDI32_DELEGATE, test "${GDI32_LIBS}x" != 'x' )
386 AM_CONDITIONAL(WIN32_NATIVE_BUILD, test "${native_win32_build}" = 'yes' )
387 AM_CONDITIONAL(CYGWIN_BUILD, test "${cygwin_build}" = 'yes' )
388 AM_CONDITIONAL(USING_CL, test "x${CC}" = 'xcl.exe' )
390 WinPathScript="${srcdirfull}/winpath.sh"
391 AC_SUBST(WinPathScript)
394 # Compiler flags tweaks
396 if test "${GCC}" != "yes"; then
399 # aCC: HP ANSI C++ B3910B A.03.34
400 CFLAGS="${CFLAGS} -Wp,-H30000"
401 if test -n "${CXXFLAGS}"; then
404 CXXFLAGS="${CXXFLAGS} -AA"
408 # Compaq alphaev68-dec-osf5.1 compiler
409 if test -n "${CXXFLAGS}"; then
410 CXXFLAGS='-std strict_ansi -noimplicit_include'
412 CXXFLAGS="${CXXFLAGS} -std strict_ansi -noimplicit_include"
417 # Check for lazy-loading.
418 AC_CACHE_CHECK([for linker lazyload option],[im_cv_ld_lazyload],
420 im_cv_ld_lazyload='none'
422 *-*-solaris2.8 | *-*-solaris2.9 | *-*-solaris2.1? )
423 if test "$lt_cv_prog_gnu_ld" != 'yes' ; then
424 im_cv_ld_lazyload='-Wl,-zlazyload'
429 if test "${im_cv_ld_lazyload}" != 'none' ; then
430 if test -z "${LDFLAGS}" ; then
431 LDFLAGS="${im_cv_ld_lazyload}"
433 LDFLAGS="${im_cv_ld_lazyload} ${LDFLAGS}"
437 dnl Platform-specific stuff
439 *darwin* | *-macos10*)
440 dnl Disable FORTIFY_SOURCE to fix a bug in LVVM / OpenMP support
441 CFLAGS="${CFLAGS} -D_FORTIFY_SOURCE=0"
442 dnl OS X universal binary support, requires --disable-dependency-tracking
443 AC_ARG_ENABLE([osx-universal-binary],
444 AC_HELP_STRING([--enable-osx-universal-binary],
445 [build universal binary on OS X [[default=no]]]),
446 [build_osxuniversal="${enableval}"], [build_osxuniversal=no])
448 if test "${build_osxuniversal}" != no ; then
449 if test "$enable_dependency_tracking" != no ; then
450 AC_MSG_ERROR([--enable-osx-universal-binary requires --disable-dependency-tracking.
451 Please re-run configure with these options:
452 --disable-dependency-tracking --enable-osx-universal-binary
455 CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
456 CXXFLAGS="$CXXFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
457 LDFLAGS="$LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
463 # ARCH specific include directory
465 AC_ARG_WITH([includearch-dir],
466 [AC_HELP_STRING([--includearch-dir=DIR],
467 [ARCH specific include directory])],
468 [includearch_dir=$withval],
469 [includearch_dir=$INCLUDE_DIR])
471 eval "eval INCLUDEARCH_DIR=$includearch_dir"
472 AC_SUBST(INCLUDEARCH_DIR)
475 # ARCH specific configuration directory
477 AC_ARG_WITH([sharearch-dir],
478 [AC_HELP_STRING([--sharearch-dir=DIR],
479 [ARCH specific config directory])],
480 [sharearch_dir=$withval],
481 [sharearch_dir="${LIB_DIR}"])
483 eval "eval SHAREARCH_DIR=$sharearch_dir"
484 AC_SUBST(SHAREARCH_DIR)
486 # Path to the pkgconfig folder
487 AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=DIR],
488 [Path to the pkgconfig directory @<:@LIBDIR/pkgconfig@:>@]),
489 [pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
490 AC_SUBST([pkgconfigdir])
493 # Enable support for threads
495 # Find Posix threads library
497 AC_ARG_WITH([threads],
498 [AC_HELP_STRING([--without-threads], [disable threads support])],
499 [with_threads=$withval],
500 [with_threads='yes'])
504 if test "$with_threads" != 'no'; then
506 if test "$ax_pthread_ok" = yes; then
508 DEF_THREAD="$PTHREAD_CFLAGS"
509 CFLAGS="$CFLAGS $DEF_THREAD"
510 CXXFLAGS="$CXXFLAGS $DEF_THREAD"
511 THREAD_LIBS="$PTHREAD_LIBS"
512 if test "$CC" != "$PTHREAD_CC"; then
513 AC_MSG_WARN([Replacing compiler $CC with compiler $PTHREAD_CC to support pthreads.])
516 AC_DEFINE(THREAD_SUPPORT,1,[Define if you have POSIX threads libraries and header files.])
519 LIBS="$LIBS $THREAD_LIBS"
520 AC_SUBST(THREAD_LIBS)
522 # Enable support for OpenMP
523 if test "$have_threads" != 'yes'; then
524 ac_cv_prog_c_openmp=unsupported
527 CFLAGS="$OPENMP_CFLAGS $CFLAGS"
528 MAGICK_PCFLAGS="$MAGICK_PCFLAGS $OPENMP_CFLAGS"
529 AC_SUBST(OPENMP_CFLAGS)
530 if test "$enable_openmp" != no; then
531 if test "$ac_cv_prog_c_openmp" != 'unsupported'; then
532 MAGICK_FEATURES="OpenMP $MAGICK_FEATURES"
536 # Enable support for OpenCL
538 CFLAGS="$CL_CFLAGS $CFLAGS"
539 CPPFLAGS="$CL_CFLAGS $CPPFLAGS"
540 LIBS="$CL_LIBS $LIBS"
542 if test "$enable_opencl" != no; then
543 if test "X$ax_cv_check_cl_libcl" != Xno; then :
544 MAGICK_FEATURES="OpenCL $MAGICK_FEATURES"
550 # Check for large file support
556 if test "$enable_largefile" != no; then
557 case $ac_cv_sys_file_offset_bits in
559 # nothing to do here as the host supports LFS fine
562 AC_MSG_CHECKING([for native large file support])
563 AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>
565 exit(!(sizeof(off_t) == 8));
567 [ac_cv_sys_file_offset_bits=64; AC_DEFINE(_FILE_OFFSET_BITS,64)
568 AC_MSG_RESULT([yes])],
569 [AC_MSG_RESULT([no])])
572 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
575 if test "$ac_cv_sys_large_files" != 'no'; then
576 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGE_FILES=1"
578 if test "$ac_cv_sys_largefile_source" != 'no'; then
579 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGEFILE_SOURCE=1"
582 AC_SUBST(LFS_CPPFLAGS)
588 AC_SUBST(LIBTOOL_DEPS)
590 # Check to see if building shared libraries
591 libtool_build_shared_libs='no'
592 if test "$enable_shared" = 'yes'; then
593 libtool_build_shared_libs='yes'
596 # Check to see if building static libraries
597 libtool_build_static_libs='no'
598 if test "$enable_static" = 'yes'; then
599 libtool_build_static_libs='yes'
602 AM_CONDITIONAL(WITH_SHARED_LIBS, test "${libtool_build_shared_libs}" = 'yes')
604 # Enable support for building loadable modules
607 AC_ARG_WITH([modules],
608 [AC_HELP_STRING([--with-modules],
609 [enable building dynamically loadable modules])],
610 [with_modules=$withval],
613 # Only allow building loadable modules if we are building shared libraries
614 if test "$with_modules" != 'no' ; then
615 if test "$libtool_build_shared_libs" = 'no'; then
616 AC_MSG_WARN([Modules may only be built if building shared libraries is enabled.])
622 if test "$build_modules" != 'no' ; then
623 AC_DEFINE(BUILD_MODULES,1,Define if coders and filters are to be built as modules.)
624 MAGICK_FEATURES="$MAGICK_FEATURES Modules"
626 AM_CONDITIONAL(WITH_MODULES, test "$build_modules" != 'no')
628 # Enable build using delegate libraries built in subdirectories rather than installed
629 # delegate libraries (bzlib fftw fpx gslib jp2 jbig jpeg lcms lzma png tiff ttf wmf xml zlib)
630 AC_ARG_ENABLE([delegate-build],
631 [AC_HELP_STRING([--enable-delegate-build],
632 [look for delegate libraries in build directory])],
633 [enable_delegate_build=$enableval],
634 [enable_delegate_build='no'])
636 AC_ARG_ENABLE([deprecated],
637 [AC_HELP_STRING([--disable-deprecated],
638 [exclude deprecated methods in MagickCore and MagickWand APIs])],
639 [enable_deprecated=$enableval],
640 [enable_deprecated='no'])
642 if test "$enable_deprecated" = 'yes'; then
643 AC_DEFINE(EXCLUDE_DEPRECATED,1,[exclude deprecated methods in MagickCore API])
645 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-deprecated "
648 # Build a version of ImageMagick which operates uninstalled.
649 # Used to build distributions located via MAGICK_HOME / executable path
650 AC_ARG_ENABLE([installed],
651 [AC_HELP_STRING([--disable-installed],
652 [Formally install ImageMagick under PREFIX])],
653 [enable_installed=$enableval],
654 [enable_installed='yes'])
656 if test "$enable_installed" = 'yes'; then
657 AC_DEFINE(INSTALLED_SUPPORT,1,[ImageMagick is formally installed under prefix])
659 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-installed "
662 # Permit enciphering and deciphering image pixels.
663 AC_ARG_ENABLE([cipher],
664 [AC_HELP_STRING([--disable-cipher],
665 [disable enciphering and deciphering image pixels])],
666 [enable_cipher=$enableval],
667 [enable_cipher='yes'])
669 if test "$enable_cipher" = 'yes'; then
670 AC_DEFINE(CIPHER_SUPPORT,1,[permit enciphering and deciphering image pixels])
673 # Build a zero-configuration version of ImageMagick.
674 AC_ARG_ENABLE([zero-configuration],
675 [AC_HELP_STRING([--enable-zero-configuration],
676 [enable self-contained, embeddable, zero-configuration ImageMagick])],
677 [enable_zero_configuration=$enableval],
678 [enable_zero_configuration='no'])
680 if test "$enable_zero_configuration" = 'yes'; then
681 AC_DEFINE(ZERO_CONFIGURATION_SUPPORT,1,[Build self-contained, embeddable, zero-configuration ImageMagick])
682 MAGICK_FEATURES="Zero-Configuration $MAGICK_FEATURES"
685 # Build a high dynamic range version of ImageMagick.
686 AC_ARG_ENABLE([hdri],
687 [AC_HELP_STRING([--enable-hdri],
688 [accurately represent the wide range of intensity levels found in real scenes])],
689 [enable_hdri=$enableval],
693 if test "$enable_hdri" = 'yes'; then
695 magick_hdri_enable='1';
696 MAGICK_FEATURES="HDRI $MAGICK_FEATURES"
698 magick_hdri_enable='0'
700 AC_DEFINE_UNQUOTED(HDRI_ENABLE_OBSOLETE_IN_H,$magick_hdri_enable,[Whether hdri is enabled or not])
701 AC_SUBST(MAGICK_HDRI)dnl
702 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -DMAGICKCORE_HDRI_ENABLE=$magick_hdri_enable"
703 CFLAGS="$CFLAGS -DMAGICKCORE_HDRI_ENABLE=$magick_hdri_enable"
704 CPPFLAGS="$CPPFLAGS -DMAGICKCORE_HDRI_ENABLE=$magick_hdri_enable"
706 # Build a version of ImageMagick with assert statements.
707 AC_ARG_ENABLE([assert],
708 [AC_HELP_STRING([--disable-assert],
709 [disable assert() statements in build])],
710 [enable_assert=$enableval],
711 [enable_assert='yes'])
713 if test "$enable_assert" = 'no'; then
714 AC_DEFINE(NDEBUG,1,[Turn off assert statements])
717 # Don't emit "rebuild rules" for configure, Makefile.ins, etc.
720 # Enable hugepages support
721 AC_ARG_ENABLE([hugepages],
722 [AC_HELP_STRING([--enable-hugepages],
723 [enable 'huge pages' support])],
724 [enable_hugepages=$enableval],
725 [enable_hugepages='no'])
727 # Enable ccmalloc memory debugging support
728 AC_ARG_ENABLE([ccmalloc],
729 [AC_HELP_STRING([--enable-ccmalloc],
730 [enable 'ccmalloc' memory debug support])],
731 [enable_ccmalloc=$enableval],
732 [enable_ccmalloc='no'])
734 # Enable Electric Fence memory debugging support
735 AC_ARG_ENABLE([efence],
736 [AC_HELP_STRING([--enable-efence],
737 [enable 'efence' memory debug support])],
738 [enable_efence=$enableval],
739 [enable_efence='no'])
741 # Enable prof-based profiling support
742 AC_ARG_ENABLE([prof],
743 [AC_HELP_STRING([--enable-prof],
744 [enable 'prof' profiling support])],
745 [enable_prof=$enableval],
748 # Enable gprof-based profiling support
749 AC_ARG_ENABLE([gprof],
750 [AC_HELP_STRING([--enable-gprof],
751 [enable 'gprof' profiling support])],
752 [enable_gprof=$enableval],
755 # Enable gcov-based profiling support
756 AC_ARG_ENABLE([gcov],
757 [AC_HELP_STRING([--enable-gcov],
758 [enable 'gcov' profiling support])],
759 [enable_gcov=$enableval],
762 enable_profiling='no'
763 if test "$enable_prof" = 'yes' || test "$enable_gprof" = 'yes' || test "$enable_gcov" = 'yes'; then
764 enable_profiling='yes'
765 if test "$libtool_build_shared_libs" = 'yes'; then
766 echo "Warning: Can not profile code using shared libraries"
770 # Magick API method prefix
771 AC_ARG_WITH([method-prefix],
772 [AC_HELP_STRING([--with-method-prefix=PREFIX],
773 [prefix MagickCore API methods])],
774 [with_method_prefix=$withval],
775 [with_method_prefix='no'])
777 if test "$with_method_prefix" != 'no'; then
778 AC_DEFINE_UNQUOTED(NAMESPACE_PREFIX,$with_method_prefix,[Magick API method prefix])
779 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-method-prefix "
782 # Enable legacy support (default no)
783 AC_ARG_ENABLE(legacy-support,
784 [ --enable-legacy-support install legacy command-line utilities (default disabled)],
785 [with_legacy_support=$enableval],
786 [with_legacy_support='no'])
787 AM_CONDITIONAL(LEGACY_SUPPORT, test "$with_legacy_support" != 'no')
789 # Number of bits in a Quantum
790 AC_ARG_WITH([quantum-depth],
791 [AC_HELP_STRING([--with-quantum-depth=DEPTH],
792 [number of bits in a pixel quantum (default 16)])],
793 [with_quantum_depth=$withval],
794 [with_quantum_depth=16])
796 if test "$with_quantum_depth" != '8'; then
797 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-quantum-depth=$with_quantum_depth "
800 case "${with_quantum_depth}" in
805 * ) AC_MSG_ERROR("Pixel quantum depth must have value of 8, 16, 32, or 64") ;;
807 QUANTUM_DEPTH="$with_quantum_depth"
808 AC_DEFINE_UNQUOTED(QUANTUM_DEPTH_OBSOLETE_IN_H,$QUANTUM_DEPTH,[Number of bits in a pixel Quantum (8/16/32/64)])
809 AC_SUBST(QUANTUM_DEPTH)dnl
810 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -DMAGICKCORE_QUANTUM_DEPTH=$QUANTUM_DEPTH"
811 CFLAGS="$CFLAGS -DMAGICKCORE_QUANTUM_DEPTH=$QUANTUM_DEPTH"
812 CPPFLAGS="$CPPFLAGS -DMAGICKCORE_QUANTUM_DEPTH=$QUANTUM_DEPTH"
814 # define a lib suffix for abi purpose
815 MAGICK_ABI_SUFFIX="Q${QUANTUM_DEPTH}"
816 if test "$enable_hdri" = 'yes'; then
817 MAGICK_ABI_SUFFIX="Q${QUANTUM_DEPTH}${MAGICK_HDRI}"
819 AC_SUBST(MAGICK_ABI_SUFFIX)
821 # Set pixel cache threshold
823 [AC_HELP_STRING([--with-cache=THRESHOLD],
824 [set pixel cache threshhold in MB (default available memory)])],
825 [with_cache=$withval],
828 if test "$with_cache" != ''; then
829 AC_DEFINE_UNQUOTED(PixelCacheThreshold,$with_cache,[Pixel cache threshold in MB (defaults to available memory)])
830 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-cache=$with_cache "
833 # Disable/Enable support for full delegate paths
834 AC_ARG_WITH([frozenpaths],
835 [AC_HELP_STRING([--with-frozenpaths],
836 [freeze delegate paths])],
837 [with_frozenpaths=$withval],
838 [with_frozenpaths='no'])
840 # Enable build/install of Magick++
841 AC_ARG_WITH([magick-plus-plus],
842 [AC_HELP_STRING([--without-magick-plus-plus],
843 [disable build/install of Magick++])],
844 [with_magick_plus_plus=$withval],
845 [with_magick_plus_plus='yes'])
847 # Encode the this name into the shared library.
848 AC_ARG_WITH([package-release-name],
849 [AC_HELP_STRING([--with-package-release-name=NAME],
850 [encode this name into the shared library])],
851 [MAGICK_LT_RELEASE_OPTS="-release $withval"])
852 AC_SUBST(MAGICK_LT_RELEASE_OPTS)
854 # Disable build/install of PerlMagick.
856 [AC_HELP_STRING([--with-perl],
857 [enable build/install of PerlMagick])],
858 [with_perl=$withval],
861 # Options to pass when configuring PerlMagick
862 AC_ARG_WITH([perl-options],
863 [AC_HELP_STRING([--with-perl-options=OPTIONS],
864 [options to pass on command-line when generating PerlMagick build file])],
865 PERL_MAKE_OPTIONS=$withval)
866 AC_SUBST(PERL_MAKE_OPTIONS)
868 # Enable jemalloc, object-caching memory allocation library.
869 AC_ARG_WITH(jemalloc,
870 [ --with-jemalloc enable jemalloc memory allocation library support],
871 [with_jemalloc=$withval],
872 [with_jemalloc='no'])
873 if test "$with_jemalloc" != 'yes' ; then
874 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jemalloc=$with_jemalloc "
877 # Enable umem, object-caching memory allocation library.
879 [ --with-umem enable umem memory allocation library support],
880 [with_umem=$withval],
882 if test "$with_umem" != 'yes' ; then
883 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-umem=$with_umem "
887 # Specify path to shared libstdc++ if not in normal location
889 AC_ARG_WITH([libstdc],
890 [AC_HELP_STRING([--with-libstdc=DIR],
891 [ use libstdc++ in DIR (for GNU C++)])],
892 [with_libstdc=$withval],
895 if test "$with_libstdc" != ''; then
896 if test -d "$with_libstdc"; then
897 LIBSTDCLDFLAGS="-L$with_libstdc"
900 AC_SUBST(LIBSTDCLDFLAGS)
902 # Does gcc required -traditional?
903 AC_PROG_GCC_TRADITIONAL
907 # Set defines required to build DLLs and modules using MinGW
910 # These options are set for multi-thread DLL module build
911 # libMagickCore: _DLL _MAGICKMOD_ _MAGICKLIB_
913 # executable/Magick++: _DLL _MAGICKMOD_
914 MODULE_EXTRA_CPPFLAGS=''
915 LIBRARY_EXTRA_CPPFLAGS=''
916 if test "${native_win32_build}" = 'yes'; then
917 if test "${libtool_build_shared_libs}" = 'yes'; then
918 CPPFLAGS="$CPPFLAGS -D_DLL"
919 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_DLL"
920 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_DLL"
921 LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKLIB_"
922 if test "$build_modules" = 'yes'; then
923 LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKMOD_"
925 MODULE_EXTRA_CPPFLAGS="$MODULE_EXTRA_CPPFLAGS -D_MAGICKLIB_"
928 CPPFLAGS="$CPPFLAGS -D_LIB"
929 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_LIB"
930 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_LIB"
932 if test "$with_threads" = 'yes'; then
933 CPPFLAGS="$CPPFLAGS -D_MT"
934 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_MT"
935 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_MT"
938 AC_SUBST(MODULE_EXTRA_CPPFLAGS)
939 AC_SUBST(LIBRARY_EXTRA_CPPFLAGS)
941 # Check standard headers
943 if ! test x"$ac_cv_header_stdc" = x"yes"; then
944 AC_MSG_WARN([configure has detected that you do not have the ANSI standard C
945 header files. Compilation cannot proceed. Please install the ANSI C
946 headers and rerun this script.]);
951 # Check additional headers
952 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)
956 # Checks for typedefs, structures, and compiler characteristics.
970 # Checks for language qualifiers and semantics.
978 # If words are stored with the most significant byte first (like
979 # Motorola and SPARC CPUs), define `WORDS_BIGENDIAN'.
982 # Define to a suitable type, if standard headers do not define it.
990 AC_TYPE_LONG_DOUBLE_WIDER
991 AC_TYPE_LONG_LONG_INT
1005 AC_TYPE_UNSIGNED_LONG_LONG_INT
1007 # Float_t and double_t are intended to be the the most efficient type.
1008 AC_CHECK_TYPES([float_t], [], [], [[#include <math.h>]])
1009 AC_CHECK_TYPES([double_t], [], [], [[#include <math.h>]])
1010 AC_CHECK_SIZEOF([float_t], [], [[#include <math.h>]])
1011 AC_CHECK_SIZEOF([double_t], [], [[#include <math.h>]])
1013 # Get size of float, double and long double for comparaison.
1014 AC_CHECK_SIZEOF([float])
1015 AC_CHECK_SIZEOF([double])
1016 AC_CHECK_SIZEOF([long double])
1018 # Obtain size of an 'signed short' and define as SIZEOF_SIGNED_SHORT
1019 AC_CHECK_SIZEOF(signed short)
1021 # Obtain size of an 'unsigned short' and define as SIZEOF_UNSIGNED_SHORT
1022 AC_CHECK_SIZEOF(unsigned short)
1024 # Obtain size of an 'signed int' and define as SIZEOF_SIGNED_INT
1025 AC_CHECK_SIZEOF(signed int)
1027 # Obtain size of an 'unsigned int' and define as SIZEOF_UNSIGNED_INT
1028 AC_CHECK_SIZEOF(unsigned int)
1030 # Obtain size of a 'signed long' and define as SIZEOF_SIGNED_LONG
1031 AC_CHECK_SIZEOF(signed long)
1033 # Obtain size of a 'unsigned long' and define as SIZEOF_UNSIGNED_LONG
1034 AC_CHECK_SIZEOF(unsigned long)
1036 # Obtain size of a 'long long' and define as SIZEOF_SIGNED_LONG_LONG. If
1037 # 'signed long long' is not supported then the value defined is zero.
1038 AC_CHECK_SIZEOF(signed long long)
1040 # Obtain size of a 'unsigned long long' and define as
1041 # SIZEOF_UNSIGNED_LONG_LONG. If 'unsigned long long' is not
1042 # supported then the value defined is zero.
1043 AC_CHECK_SIZEOF(unsigned long long)
1045 # Obtain size of off_t and define as SIZEOF_OFF_T
1046 AC_CHECK_SIZEOF(off_t)
1048 # Obtain size of size_t and define as SIZEOF_SIZE_T
1049 AC_CHECK_SIZEOF(size_t)
1051 # Obtain size of ssize_t and define as SIZEOF_SSIZE_T
1052 AC_CHECK_SIZEOF(ssize_t)
1054 # Obtain size of an unsigned int pointer and define as SIZEOF_UNSIGNED_INTP
1055 AC_CHECK_SIZEOF(unsigned int*)
1058 # Compute sized types for current CPU and compiler options.
1061 AC_MSG_CHECKING(for signed 8-bit type)
1062 INT8_T='signed char'
1063 AC_MSG_RESULT($INT8_T)
1066 AC_MSG_CHECKING(for unsigned 8-bit type)
1067 UINT8_T='unsigned char'
1068 AC_MSG_RESULT($UINT8_T)
1071 AC_MSG_CHECKING(for signed 16-bit type)
1072 INT16_T='signed short'
1073 AC_MSG_RESULT($INT16_T)
1076 AC_MSG_CHECKING(for unsigned 16-bit type)
1077 UINT16_T='unsigned short'
1078 AC_MSG_RESULT($UINT16_T)
1081 AC_MSG_CHECKING(for signed 32-bit type)
1084 if test $ac_cv_sizeof_signed_int -eq 4; then
1085 INT32_T='signed int'
1087 elif test $ac_cv_sizeof_signed_long -eq 4; then
1088 INT32_T='signed long'
1091 AC_MSG_RESULT($INT32_T)
1095 AC_MSG_CHECKING(for unsigned 32-bit type)
1098 if test $ac_cv_sizeof_unsigned_int -eq 4; then
1099 UINT32_T='unsigned int'
1101 elif test $ac_cv_sizeof_unsigned_long -eq 4; then
1102 UINT32_T='unsigned long'
1105 AC_MSG_RESULT($UINT32_T)
1109 AC_MSG_CHECKING(for signed 64-bit type)
1112 if test $ac_cv_sizeof_signed_long -eq 8; then
1113 INT64_T='signed long'
1115 elif test $ac_cv_sizeof_signed_long_long -eq 8; then
1116 INT64_T='signed long long'
1119 case "${host_os}" in
1124 AC_MSG_RESULT($INT64_T)
1128 AC_MSG_CHECKING(for unsigned 64-bit type)
1131 if test $ac_cv_sizeof_unsigned_long -eq 8; then
1132 UINT64_T='unsigned long'
1134 elif test $ac_cv_sizeof_unsigned_long_long -eq 8; then
1135 UINT64_T='unsigned long long'
1138 case "${host_os}" in
1143 AC_MSG_RESULT($UINT64_T)
1147 AC_MSG_CHECKING(for unsigned maximum type)
1150 if test "$UINT64_T" != 'none'; then
1153 elif test "$UINT32_T" != 'none'; then
1157 AC_MSG_RESULT($UINTMAX_T)
1161 AC_MSG_CHECKING(for pointer difference type)
1164 if test $ac_cv_sizeof_unsigned_long -eq $ac_cv_sizeof_unsigned_intp; then
1165 UINTPTR_T='unsigned long'
1167 elif test $ac_cv_sizeof_unsigned_long_long -eq $ac_cv_sizeof_unsigned_intp; then
1168 UINTPTR_T='unsigned long long'
1171 AC_MSG_RESULT($UINTPTR_T)
1175 AC_MSG_CHECKING([whether our compiler supports __func__])
1177 [{ const char *func = __func__; return(func != 0 ? 0 : 1); }],
1178 AC_MSG_RESULT([yes]),
1180 AC_MSG_CHECKING([whether our compiler supports __FUNCTION__])
1182 [{ const char *func = __FUNCTION__; return(func != 0 ? 0 : 1); }],
1183 AC_MSG_RESULT([yes])
1184 AC_DEFINE(__func__, __FUNCTION__,
1185 [Define to appropriate substitue if compiler does not have __func__]),
1187 AC_DEFINE(__func__, __FILE__,
1188 [Define to appropriate substitue if compiler does not have __func__])))
1192 # Check for functions
1195 AC_FUNC_CLOSEDIR_VOID
1199 AC_FUNC_SELECT_ARGTYPES
1200 AC_FUNC_SETVBUF_REVERSED
1210 AC_CHECK_LIB(m,sqrt,MATH_LIBS="-lm",,)
1211 LIBS="$MATH_LIBS $LIBS"
1215 # Find socket library
1217 AC_SEARCH_LIBS(gethostbyname, resolv nsl)
1218 AC_SEARCH_LIBS(socket, socket,
1220 AC_DEFINE([HAVE_SOCKET],[1],[Define to 1 if you have socket support.])
1221 MAGICK_FEATURES="DPC $MAGICK_FEATURES"
1224 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])
1227 # Check for clock_gettime().
1229 AC_SEARCH_LIBS(clock_gettime, rt,
1231 AC_DEFINE([HAVE_CLOCK_GETTIME],[1],[Define to 1 if you have clock_gettime.])
1232 AC_MSG_CHECKING([whether clock_gettime supports CLOCK_REALTIME])
1235 [[#include <time.h>]],
1236 [[clockid_t clockType = CLOCK_REALTIME;]])],
1239 AC_DEFINE([HAVE_CLOCK_REALTIME],[1],
1240 [Define to 1 if clock_gettime supports CLOCK_REALTIME.])
1246 AC_CHECK_FUNCS([gettimeofday ftime], [break])
1252 # Check for function prototypes
1256 AC_CHECK_DECLS([pread, pwrite],[],[],[
1257 #include <unistd.h>])
1259 AC_CHECK_DECLS([strlcpy],[],[],[
1260 #include <strings.h>])
1262 AC_CHECK_DECLS([vsnprintf],[],[],[
1264 #include <stdarg.h>])
1268 # C++ Support Tests (For Magick++)
1271 have_magick_plus_plus='no'
1272 if test "$with_magick_plus_plus" = 'yes'; then
1277 # Full set of headers used...
1278 # algorithm cctype cerrno cmath cstdio cstdlib cstring ctime exception
1279 # functional iomanip iosfwd iostream iterator list string strstream utility
1284 AX_CXX_NAMESPACE_STD
1285 AC_CXX_HAVE_STD_LIBS
1289 AC_MSG_CHECKING([whether C++ compiler is sufficient for Magick++])
1291 test $ax_cv_cxx_bool = 'yes' && \
1292 test $ax_cv_cxx_namespaces = 'yes' && \
1293 test $ac_cv_cxx_have_std_libs = 'yes' && \
1294 test $ax_cv_cxx_have_std_namespace = 'yes'; then
1295 have_magick_plus_plus='yes'
1297 have_magick_plus_plus='no (failed tests)'
1299 AC_MSG_RESULT([$have_magick_plus_plus])
1302 AM_CONDITIONAL(WITH_MAGICK_PLUS_PLUS, test "$have_magick_plus_plus" = 'yes')
1304 # Only check for delegate libraries in subdirectories if requested.
1305 if test "$enable_delegate_build" != 'no'; then
1306 # Check for delegate sub-directories and add -I & -L options as required.
1307 # This presumes that delegates are installed as detailed in the ImageMagick
1308 # README. If delegates are installed in a standard location where the
1309 # compiler will automatically find them then these options should not be
1313 # Most delegates have includes in the same directory as the library, but not all...
1316 for dir in bzlib fftw fpx gslib/src jp2 jp2/src/libjasper/include jbig/libjbig jpeg lcms/include lzma magick openjp2/include png tiff/libtiff ttf/include wand webp/src wmf/include xml/include zlib; do
1317 if test -d "$builddir/$dir"; then
1318 CPPFLAGS="$CPPFLAGS -I$builddir/$dir"
1320 if test -d "$srcdirfull/$dir"; then
1321 CPPFLAGS="$CPPFLAGS -I$srcdirfull/$dir"
1327 for dir in bzlib fftw fpx gslib/src jp2 jp2/src/libjasper jbig/libjbig jpeg lcms/src lzma magick openjp2 png tiff/libtiff ttf/objs wand webp wmf/src xml zlib; do
1328 if test -d "$builddir/$dir/.libs"; then
1329 LDFLAGS="$LDFLAGS -L$builddir/$dir/.libs"
1331 if test -d "$srcdirfull/$dir/.libs"; then
1332 LDFLAGS="$LDFLAGS -L$srcdirfull/$dir/.libs"
1335 if test -d "$builddir/$dir"; then
1336 LDFLAGS="$LDFLAGS -L$builddir/$dir"
1338 if test -d "$srcdirfull/$dir"; then
1339 LDFLAGS="$LDFLAGS -L$srcdirfull/$dir"
1345 # Assume that delegate headers reside under same directory as ImageMagick
1346 # installation prefix.
1347 MAGICK_CPPFLAGS="-I$INCLUDE_DIR/${PACKAGE_NAME}-$MAGICK_MAJOR_VERSION $MAGICK_CPPFLAGS"
1350 # Find the X11 RGB database
1352 AC_CACHE_CHECK(for X11 configure files,im_cv_x_configure,
1353 [# Look for the header file in a standard set of common directories.
1354 # Check X11 before X11Rn because it is often a symlink to the current release.
1363 /usr/XFree86/lib/X11 \
1371 /usr/local/X11/lib \
1372 /usr/local/X11R4/lib \
1373 /usr/local/X11R5/lib \
1374 /usr/local/X11R6/lib \
1376 /usr/local/lib/X11 \
1377 /usr/local/lib/X11R4 \
1378 /usr/local/lib/X11R5 \
1379 /usr/local/lib/X11R6 \
1380 /usr/local/lib/X11R7 \
1381 /usr/local/x11r5/lib \
1382 /usr/lpp/Xamples/lib \
1384 /usr/openwin/share/lib \
1385 /usr/unsupported/lib \
1388 if test -f "$ac_dir/X11/rgb.txt"; then
1389 im_cv_x_configure="$ac_dir/X11/"
1391 elif test -f "$ac_dir/rgb.txt"; then
1392 im_cv_x_configure="$ac_dir/"
1397 X11_CONFIGURE_PATH="$im_cv_x_configure"
1398 case "${build_os}" in
1400 X11ConfigurePath=`$WinPathScript "$X11ConfigurePath=" 1`
1403 AC_DEFINE_UNQUOTED(X11_CONFIGURE_PATH,"$X11ConfigurePath",[Location of X11 configure files])
1406 # Find OpenMP library
1409 if test "$enable_openmp" != 'no'; then
1410 if test "${GCC}" = "yes"; then
1411 # Open64 (passes for GCC but uses different OpenMP implementation)
1412 if test "x$GOMP_LIBS" = x ; then
1413 if $CC --version 2>&1 | grep Open64 > /dev/null ; then
1414 AC_CHECK_LIB(openmp,omp_get_num_procs,GOMP_LIBS="-lopenmp",,)
1418 if test "x$GOMP_LIBS" = x ; then
1419 AC_CHECK_LIB(gomp,GOMP_parallel_start,GOMP_LIBS="-lgomp",,)
1423 if test "x$GOMP_LIBS" = x ; then
1424 AC_CHECK_LIB(mtsk,sunw_mp_register_warn,GOMP_LIBS="-lmtsk",,)
1427 if test "x$GOMP_LIBS" = x ; then
1428 AC_CHECK_LIB(xlsmp,_xlsmpFlush,GOMP_LIBS="-lxlsmp",,)
1430 # SGI IRIX 6.5 MIPSpro C/C++
1431 if test "x$GOMP_LIBS" = x ; then
1432 AC_CHECK_LIB(mp,mp_destroy,GOMP_LIBS="-lmp",,)
1435 LIBS="$GOMP_LIBS $LIBS"
1440 # Check for jemalloc.
1444 if test "$with_jemalloc" != 'no'; then
1445 AC_MSG_CHECKING(for JEMALLOC support )
1449 AC_CHECK_HEADER([jemalloc/jemalloc.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
1450 AC_CHECK_LIB(jemalloc,[malloc_stats_print],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
1451 AC_MSG_CHECKING(if jemalloc memory allocation library is complete)
1452 if test $passed -gt 0; then
1453 if test $failed -gt 0; then
1454 AC_MSG_RESULT(no -- some components failed test)
1455 have_jemalloc='no (failed tests)'
1457 JEMALLOC_LIBS='-ljemalloc'
1458 LIBS="$JEMALLOC_LIBS $LIBS"
1459 AC_DEFINE(HasJEMALLOC,1,Define if you have jemalloc memory allocation library)
1467 AM_CONDITIONAL(HasJEMALLOC, test "$have_jemalloc" = 'yes')
1468 AC_SUBST(JEMALLOC_LIBS)
1475 if test "$with_umem" != 'no'; then
1476 AC_MSG_CHECKING(for UMEM support )
1480 AC_CHECK_HEADER(umem.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1481 AC_CHECK_LIB(umem,umem_alloc,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1482 AC_CHECK_LIB(umem,umem_free,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1483 AC_MSG_CHECKING(if umem memory allocation library is complete)
1484 if test $passed -gt 0; then
1485 if test $failed -gt 0; then
1486 AC_MSG_RESULT(no -- some components failed test)
1487 have_umem='no (failed tests)'
1490 LIBS="$UMEM_LIBS $LIBS"
1491 AC_DEFINE(HasUMEM,1,Define if you have umem memory allocation library)
1499 AM_CONDITIONAL(HasUMEM, test "$have_umem" = 'yes')
1503 # Add support for ccmalloc memory debugging library if requested
1507 if test "$enable_ccmalloc" = 'yes'; then
1508 AC_PATH_PROG(CCMALLOCDelegate,ccmalloc,)
1509 if test -n "$CCMALLOCDelegate"; then
1510 eval `grep PREFIX= $CCMALLOCDelegate | sed -e 's/PREFIX/CCMALLOC_PREFIX/'`
1512 # Assume that gcc is used with ccmalloc.
1513 LIBS="$LIBS $CCMALLOC_PREFIX/lib/ccmalloc-gcc.o"
1514 AC_CHECK_LIB(ccmalloc,ccmalloc_malloc,CCMALLOC_LIBS="$CCMALLOC_PREFIX/lib/ccmalloc-gcc.o -lccmalloc -ldl",,-ldl)
1515 if test -n "$CCMALLOC_LIBS"; then
1517 LIBS="$LIBS $CCMALLOC_LIBS"
1526 # Add support for 'huge pages' if requested
1528 AS_IF([test "x$enable_hugepages" != "xno"],[
1529 AC_DEFINE(HAVE_HUGEPAGES, 1, [Compile with hugepage support])
1533 # Add support for efence memory debugging library if requested
1535 if test "$enable_efence" = 'yes'; then
1536 EFENCE_LIBS='-lefence'
1537 LIBS="$EFENCE_LIBS $LIBS"
1540 dnl ===========================================================================
1546 AC_ARG_WITH([bzlib],
1547 [AC_HELP_STRING([--without-bzlib],
1548 [disable BZLIB support])],
1549 [with_bzlib=$withval],
1552 if test "$with_bzlib" != 'yes'; then
1553 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-bzlib=$with_bzlib "
1557 if test "$with_bzlib" != 'no'; then
1559 AC_MSG_RESULT([-------------------------------------------------------------])
1560 AC_MSG_CHECKING([for BZLIB])
1565 AC_CHECK_HEADER(bzlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1566 AC_CHECK_LIB(bz2,BZ2_bzDecompress,found_libbz=`expr $found_libbz + 1`,,)
1567 if test "$native_win32_build" = 'yes'; then
1568 AC_CHECK_LIB(bz2,_imp__BZ2_decompress,found_libbz=`expr $found_libbz + 1`,,)
1570 if test $found_libbz -gt 0; then
1571 passed=`expr $passed + 1`
1573 failed=`expr $failed + 1`
1575 AC_MSG_CHECKING(if BZLIB package is complete)
1576 if test $passed -gt 0; then
1577 if test $failed -gt 0; then
1578 AC_MSG_RESULT(no -- some components failed test)
1579 have_bzlib='no (failed tests)'
1582 LIBS="$BZLIB_LIBS $LIBS"
1583 AC_DEFINE(BZLIB_DELEGATE,1,Define if you have the bzip2 library)
1591 AM_CONDITIONAL(BZLIB_DELEGATE, test "$have_bzlib" = 'yes')
1592 AC_SUBST(BZLIB_LIBS)
1595 # Find the X11 include and library directories.
1602 if test "$no_x" != 'yes'; then
1603 AC_MSG_RESULT([-------------------------------------------------------------])
1604 AC_MSG_CHECKING([for X11])
1606 LDFLAGS="$LDFLAGS $X_LIBS"
1607 X11_LIBS="$X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
1608 LIBS="$X11_LIBS $LIBS"
1609 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1611 AC_DEFINE(X11_DELEGATE,1,Define if you have X11 library)dnl
1614 # Check for X11 shared memory extension
1616 # shmctl is required to support the shared memory extension
1617 AC_CHECK_FUNC([shmctl],[have_shmctl='yes'],[])
1618 if test "$have_shmctl" != 'yes'; then
1620 LIBS="$LIBS -lcygipc"
1621 AC_TRY_LINK_FUNC([shmctl],[have_shmctl='yes'; IPC_LIBS='-lcygipc'],[])
1625 if test "$have_shmctl" = 'yes'; then
1626 AC_CHECK_LIB([Xext],[XShmAttach],[XEXT_LIBS='-lXext' ; AC_DEFINE(HAVE_SHARED_MEMORY,1,X11 server supports shared memory extension)],[],[])
1630 # Check for X11 shape extension
1632 AC_CHECK_LIB([Xext],[XShapeCombineMask],[XEXT_LIBS='-lXext' ; AC_DEFINE(HAVE_SHAPE,1,X11 server supports shape extension)],[],[])
1633 AC_CHECK_LIB(Xt,XtSetEventDispatcher,XT_LIBS='-lXt',,)
1634 LIBS="$XEXT_LIBS $XT_LIBS $LIBS"
1636 if test "$no_x" != 'yes'; then
1641 AM_CONDITIONAL(X11_DELEGATE, test "$have_x" = 'yes')
1645 dnl ===========================================================================
1651 [AC_HELP_STRING([--without-zlib],
1652 [disable ZLIB support])],
1653 [with_zlib=$withval],
1656 if test "$with_zlib" != 'yes'; then
1657 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-zlib=$with_zlib "
1662 dnl PNG requires zlib so enable zlib check if PNG is requested
1663 if test "$with_zlib" != 'no' || test "$with_png" != 'no'; then
1664 AC_MSG_RESULT([-------------------------------------------------------------])
1665 AC_MSG_CHECKING([for ZLIB])
1670 AC_CHECK_HEADER(zconf.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1671 AC_CHECK_HEADER(zlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1672 AC_CHECK_LIB(z,compress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1673 AC_CHECK_LIB(z,uncompress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1674 AC_CHECK_LIB(z,deflate,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1675 AC_CHECK_LIB(z,inflate,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1676 AC_CHECK_LIB(z,gzseek,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1677 AC_CHECK_LIB(z,gztell,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1678 AC_MSG_CHECKING([if ZLIB package is complete])
1679 if test $passed -gt 0; then
1680 if test $failed -gt 0; then
1681 AC_MSG_RESULT([no -- some components failed test])
1682 have_zlib='no (failed tests)'
1685 LIBS="$ZLIB_LIBS $LIBS"
1686 AC_DEFINE(ZLIB_DELEGATE,1,Define if you have zlib compression library)
1687 AC_MSG_RESULT([yes])
1694 AM_CONDITIONAL(ZLIB_DELEGATE, test "$have_zlib" = 'yes')
1697 # whether modules are built or not.
1701 if test "$build_modules" != 'no' ; then
1702 AC_MSG_RESULT([-------------------------------------------------------------])
1703 AC_MSG_CHECKING([for libltdl])
1707 AC_CHECK_HEADER([ltdl.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
1708 AC_CHECK_LIB([ltdl],[lt_dlinit],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
1709 AC_MSG_CHECKING([if libltdl package is complete])
1710 if test $passed -gt 0 ; then
1711 if test $failed -gt 0 ; then
1712 AC_MSG_RESULT([no -- some components failed test])
1713 have_ltdl='no (failed tests)'
1716 LIBS="$LTDL_LIBS $LIBS"
1717 AC_DEFINE(LTDL_DELEGATE,1,[Define if using libltdl to support dynamically loadable modules])
1718 AC_MSG_RESULT([yes])
1724 if test "$have_ltdl" != 'yes' ; then
1725 AC_MSG_FAILURE([libltdl is required for modules build],[1])
1728 AM_CONDITIONAL(WITH_LTDL, test "$have_ltdl" != 'no')
1731 # If profiling, then check for -ldl and dlopen (required for Solaris & gcc)
1734 if test "$enable_profiling" = 'yes'; then
1735 AC_CHECK_LIB(dl,dlopen,LIB_DL='-ldl',,)
1736 LIBS="$LIB_DL $LIBS"
1740 dnl ===========================================================================
1743 # Set Apple font directory.
1745 AC_ARG_WITH([apple-font-dir],
1746 [AC_HELP_STRING([--with-apple-font-dir=DIR],
1747 [Apple font directory])],
1748 [with_apple_font_dir=$withval],
1749 [with_apple_font_dir='default'])
1751 if test "$with_apple_font_dir" != 'default'; then
1752 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-apple-font-dir=$with_apple_font_dir "
1755 dnl ===========================================================================
1758 # Check for Autotrace delegate library.
1760 AC_ARG_WITH([autotrace],
1761 [AC_HELP_STRING([--with-autotrace],
1762 [enable autotrace support])],
1763 [with_autotrace=$withval],
1764 [with_autotrace='no'])
1766 if test "$with_autotrace" != 'yes'; then
1767 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-autotrace=$with_autotrace "
1774 if test "x$with_autotrace" = "xyes"; then
1775 AC_MSG_RESULT([-------------------------------------------------------------])
1776 PKG_CHECK_MODULES(AUTOTRACE,[autotrace >= 0.31.1], have_autotrace=yes, have_autotrace=no)
1780 if test "$have_autotrace" = 'yes'; then
1782 AC_DEFINE(AUTOTRACE_DELEGATE,1,Define if you have AUTOTRACE library)
1783 if test "$build_modules" = 'no'; then
1784 CPPFLAGS="$AUTOTRACE_CFLAGS $CPPFLAGS"
1788 AM_CONDITIONAL(AUTOTRACE_DELEGATE,test "$have_autotrace" = 'yes')
1789 AC_SUBST(AUTOTRACE_CFLAGS)
1790 AC_SUBST(AUTOTRACE_LIBS)
1792 dnl ===========================================================================
1795 # Check for Display Postscript delegate library.
1798 [AC_HELP_STRING([--without-dps],
1799 [disable Display Postscript support])],
1800 [with_dps=$withval],
1803 if test "$with_dps" != 'yes'; then
1804 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-dps=$with_dps "
1809 if test "$with_dps" != 'no' && test "$with_x" != 'no'; then
1810 AC_MSG_RESULT([-------------------------------------------------------------])
1811 AC_MSG_CHECKING([for DPS])
1815 PERSIST_CPPFLAGS="$CPPFLAGS"
1816 CPPFLAGS="$CPPFLAGS -I${ac_x_includes}/X11"
1817 AC_CHECK_HEADER(DPS/dpsXclient.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1819 # XFree86-4.x needs -lXt to provide XtMalloc for -ldps.
1820 # Cygwin doesn't deliver -lXt as a DLL, which prevents a DLL build.
1821 # Adobe DPS (as delivered on Solaris) doesn't require -lXt.
1822 # ImageMagick itself doesn't use -lXt.
1825 AC_CHECK_LIB(dps,DPSInitialize,have_libdps='yes',have_libdps='no',)
1826 if test "$have_libdps" != 'yes'; then
1827 # Unset cache variable so we can try again.
1828 unset ac_cv_lib_dps_DPSInitialize
1829 AC_CHECK_LIB(dps,DPSInitialize,have_libdps='yes',have_libdps='no',-lXt)
1830 if test "$have_libdps" = 'yes'; then
1834 if test "$have_libdps" = 'yes'; then
1835 passed=`expr $passed + 1`
1837 failed=`expr $failed + 1`
1839 AC_CHECK_LIB(dpstk,XDPSPixelsPerPoint,passed=`expr $passed + 1`,failed=`expr $failed + 1`,-ldps $LIBDPS_XT)
1840 AC_MSG_CHECKING([if DPS package is complete])
1841 if test $passed -gt 0; then
1842 if test $failed -gt 0; then
1843 AC_MSG_RESULT([no -- some components failed test])
1844 have_dps='no (failed tests)'
1845 CPPFLAGS="$PERSIST_CPPFLAGS"
1847 DPS_LIBS="-ldpstk -ldps ${LIBDPS_XT}"
1848 LIBS="$DPS_LIBS $LIBS"
1849 AC_DEFINE(DPS_DELEGATE,1,Define if you have Display Postscript)
1850 AC_MSG_RESULT([yes])
1855 CPPFLAGS=$PERSIST_CPPFLAGS
1858 AM_CONDITIONAL(DPS_DELEGATE, test "$have_dps" = 'yes')
1861 dnl ===========================================================================
1864 # Set DejaVu font directory.
1866 AC_ARG_WITH([dejavu-font-dir],
1867 [AC_HELP_STRING([--with-dejavu-font-dir=DIR],
1868 [DejaVu font directory])],
1869 [with_dejavu_font_dir=$withval],
1870 [with_dejavu_font_dir='default'])
1872 if test "$with_dejavu_font_dir" != 'default'; then
1873 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-dejavu-font-dir=$with_dejavu_font_dir "
1876 dnl ===========================================================================
1879 # Check for FFTW delegate library.
1882 [AC_HELP_STRING([--without-fftw],
1883 [disable FFTW support])],
1884 [with_fftw=$withval],
1887 if test "$with_fftw" != 'yes'; then
1888 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fftw=$with_fftw "
1893 if test "$with_fftw" != 'no'; then
1894 AC_MSG_RESULT([-------------------------------------------------------------])
1895 AC_MSG_CHECKING([for FFTW])
1899 AC_CHECK_HEADER(fftw3.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1900 AC_CHECK_LIB(fftw3,fftw_execute,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1901 AC_MSG_CHECKING([if FFTW package is complete])
1902 if test $passed -gt 0; then
1903 if test $failed -gt 0; then
1904 AC_MSG_RESULT([no -- some components failed test])
1905 have_fftw='no (failed tests)'
1908 LIBS="$FFTW_LIBS $LIBS"
1909 AC_DEFINE(FFTW_DELEGATE,1,Define if you have FFTW library)
1910 AC_MSG_RESULT([yes])
1917 AM_CONDITIONAL(FFTW_DELEGATE, test "$have_fftw" = 'yes')
1920 dnl ===========================================================================
1923 # Check for FlashPIX delegate library.
1926 [AC_HELP_STRING([--without-fpx],
1927 [disable FlashPIX support])],
1928 [with_fpx=$withval],
1931 if test "$with_fpx" != 'yes'; then
1932 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fpx=$with_fpx "
1937 if test "$with_fpx" != 'no'; then
1938 AC_MSG_RESULT([-------------------------------------------------------------])
1939 AC_MSG_CHECKING([for FlashPIX])
1944 AC_CHECK_HEADER(fpxlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1945 AC_CHECK_LIB(fpx,FPX_OpenImageByFilename,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1947 AC_MSG_CHECKING([if FlashPIX package is complete])
1948 if test $passed -gt 0; then
1949 if test $failed -gt 0; then
1950 AC_MSG_RESULT([no -- some components failed test])
1951 have_fpx='no (failed tests)'
1954 AC_DEFINE(FPX_DELEGATE,1,Define if you have FlashPIX library)
1955 AC_MSG_RESULT([yes])
1963 AM_CONDITIONAL(FPX_DELEGATE, test "$have_fpx" = 'yes')
1966 dnl ===========================================================================
1969 # Check for DJVU delegate library.
1972 [AC_HELP_STRING([--without-djvu],
1973 [disable DjVu support])],
1974 [with_djvu=$withval],
1977 if test "$with_djvu" != 'yes'; then
1978 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-djvu=$with_djvu "
1983 if test "$with_djvu" != 'no'; then
1984 AC_MSG_RESULT([-------------------------------------------------------------])
1985 AC_MSG_CHECKING([for DJVU])
1989 AC_CHECK_HEADER(libdjvu/ddjvuapi.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1990 AC_CHECK_LIB(djvulibre,ddjvu_context_create,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1991 AC_MSG_CHECKING([if DJVU package is complete])
1992 if test $passed -gt 0; then
1993 if test $failed -gt 0; then
1994 AC_MSG_RESULT([no -- some components failed test])
1995 have_djvu='no (failed tests)'
1997 DJVU_LIBS='-ldjvulibre'
1998 LIBS="$DJVU_LIBS $LIBS"
1999 AC_DEFINE(DJVU_DELEGATE,1,Define if you have DJVU library)
2000 AC_MSG_RESULT([yes])
2007 AM_CONDITIONAL(DJVU_DELEGATE, test "$have_djvu" = 'yes')
2010 dnl ===========================================================================
2013 # Check for fontconfig delegate library.
2015 AC_ARG_WITH([fontconfig],
2016 [AC_HELP_STRING([--without-fontconfig],
2017 [disable fontconfig support])],
2018 [with_fontconfig=$withval],
2019 [with_fontconfig='yes'])
2021 if test "$with_fontconfig" != 'yes'; then
2022 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontconfig=$with_fontconfig "
2025 have_fontconfig='no'
2026 FONTCONFIG_CFLAGS=""
2029 if test "x$with_fontconfig" = "xyes"; then
2030 AC_MSG_RESULT([-------------------------------------------------------------])
2031 PKG_CHECK_MODULES(FONTCONFIG,[fontconfig >= 2.1.0], have_fontconfig=yes, have_fontconfig=no)
2035 if test "$have_fontconfig" = 'yes'; then
2036 AC_DEFINE(FONTCONFIG_DELEGATE,1,Define if you have FONTCONFIG library)
2037 if test "$build_modules" = 'no'; then
2038 CPPFLAGS="$FONTCONFIG_CFLAGS $CPPFLAGS"
2042 AM_CONDITIONAL(FONTCONFIG_DELEGATE,test "$have_fontconfig" = 'yes')
2043 AC_SUBST(FONTCONFIG_CFLAGS)
2044 AC_SUBST(FONTCONFIG_LIBS)
2046 dnl ===========================================================================
2049 # Check for the Freetype delegate library.
2051 AC_ARG_WITH([freetype],
2052 [AC_HELP_STRING([--without-freetype],
2053 [disable Freetype support])],
2054 [with_freetype=$withval],
2055 [with_freetype='yes'])
2057 if test "$with_freetype" != 'yes'; then
2058 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-freetype=$with_freetype "
2065 if test "x$with_freetype" = "xyes"; then
2066 AC_MSG_RESULT([-------------------------------------------------------------])
2067 PKG_CHECK_MODULES(FREETYPE,[freetype2], have_freetype=yes, have_freetype=no)
2071 if test "$have_freetype" = 'yes'; then
2072 AC_DEFINE(FREETYPE_DELEGATE,1,Define if you have FREETYPE library)
2073 CFLAGS="$FREETYPE_CFLAGS $CFLAGS"
2076 AM_CONDITIONAL(FREETYPE_DELEGATE, test "$have_freetype" = 'yes')
2077 AC_SUBST(FREETYPE_CFLAGS)
2078 AC_SUBST(FREETYPE_LIBS)
2080 dnl ===========================================================================
2083 # Check for Ghostscript library or framework.
2085 # Test for iapi.h & test for gsapi_new_instance in -lgs
2086 # or -framework Ghostscript
2088 AC_ARG_WITH([gslib],
2089 [AC_HELP_STRING([--with-gslib],
2090 [enable Ghostscript library support])],
2091 [with_gslib=$withval],
2094 gslib_framework='no'
2095 if test "$with_gslib" != 'yes'; then
2096 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gslib=$with_gslib "
2101 if test "$with_gslib" != 'no'; then
2102 AC_MSG_RESULT([-------------------------------------------------------------])
2103 AC_MSG_CHECKING([for Ghostscript])
2108 AC_CHECK_HEADER(ghostscript/iapi.h,passed=`expr $passed + 1`,
2109 failed=`expr $failed + 1`,)
2110 AC_CHECK_HEADER(ghostscript/ierrors.h,passed=`expr $passed + 1`,
2111 failed=`expr $failed + 1`,)
2112 AC_CHECK_FRAMEWORK(Ghostscript,gsapi_new_instance,framework=`expr $framework + 1`,
2113 AC_CHECK_LIB(gs,gsapi_new_instance,passed=`expr $passed + 1`,failed=`expr $failed + 1`,),)
2114 AC_MSG_CHECKING([if Ghostscript package is complete])
2115 if test $passed -gt 0; then
2116 if test $failed -gt 0; then
2117 AC_MSG_RESULT([no -- some components failed test])
2118 have_gslib='no (failed tests)'
2120 if test $framework -gt 0; then
2121 GS_LIBS='-framework Ghostscript'
2122 gslib_framework='yes'
2123 AC_MSG_RESULT([yes, using framework.])
2125 AC_MSG_RESULT([yes, using library.])
2128 LIBS="$GS_LIBS $LIBS"
2129 AC_DEFINE(GS_DELEGATE,1,Define if you have Ghostscript library or framework)
2136 AM_CONDITIONAL(GS_DELEGATE, test "$have_gslib" = 'yes')
2139 # Set default font search path
2140 AC_ARG_WITH([fontpath],
2141 [AC_HELP_STRING([--with-fontpath=DIR],
2142 [prepend to default font search path])],
2143 [with_fontpath=$withval],
2146 if test "$with_fontpath" != "yes" && test -z "$with_fontpath"; then
2149 AC_DEFINE_UNQUOTED(MAGICK_FONT_PATH,"$with_fontpath",[Define to prepend to default font search path.])
2151 if test "$with_fontpath=" != ''; then
2152 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontpath=$with_fontpath "
2155 # Set Ghostscript font directory
2156 AC_ARG_WITH([gs-font-dir],
2157 [AC_HELP_STRING([--with-gs-font-dir=DIR],
2158 [Ghostscript font directory])],
2159 [with_gs_font_dir=$withval],
2160 [with_gs_font_dir='default'])
2162 if test "$with_gs_font_dir" != 'default'; then
2163 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gs-font-dir=$with_gs_font_dir "
2166 dnl ===========================================================================
2169 # Check for GVC delegate library.
2172 [AC_HELP_STRING([--with-gvc],
2173 [enable GVC support])],
2174 [with_gvc=$withval],
2177 if test "$with_gvc" != 'yes'; then
2178 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gvc=$with_gvc "
2182 if test "x$with_gvc" = "xyes"; then
2183 AC_MSG_RESULT([-------------------------------------------------------------])
2184 PKG_CHECK_MODULES(GVC,[libgvc >= 2.9.0], have_gvc=yes, have_gvc=no)
2188 if test "$have_gvc" = 'yes'; then
2189 AC_DEFINE(GVC_DELEGATE,1,Define if you have GVC library)
2190 if test "$build_modules" = 'no'; then
2191 CPPFLAGS="$GVC_CFLAGS $CPPFLAGS"
2195 AM_CONDITIONAL(GVC_DELEGATE, test "$have_gvc" = 'yes')
2196 AC_SUBST(GVC_CFLAGS)
2199 dnl ===========================================================================
2202 # Check for JBIG delegate library.
2206 [AC_HELP_STRING([--without-jbig],
2207 [disable JBIG support])],
2208 [with_jbig=$withval],
2213 if test "$with_jbig" != 'no'; then
2214 AC_MSG_RESULT([-------------------------------------------------------------])
2215 AC_MSG_CHECKING([for JBIG])
2219 AC_CHECK_HEADER(jbig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2220 AC_CHECK_LIB(jbig,jbg_dec_init,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2221 AC_MSG_CHECKING([if JBIG package is complete])
2222 if test $passed -gt 0; then
2223 if test $failed -gt 0; then
2224 AC_MSG_RESULT([no -- some components failed test])
2225 have_jbig='no (failed tests)'
2228 LIBS="$JBIG_LIBS $LIBS"
2229 AC_DEFINE(JBIG_DELEGATE,1,Define if you have JBIG library)
2230 AC_MSG_RESULT([yes])
2237 AM_CONDITIONAL(JBIG_DELEGATE, test "$have_jbig" = 'yes')
2240 dnl ===========================================================================
2243 # Check for JPEG delegate library.
2246 [AC_HELP_STRING([--without-jpeg],
2247 [disable JPEG support])],
2248 [with_jpeg=$withval],
2251 if test "$with_jpeg" != 'yes'; then
2252 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jpeg=$with_jpeg "
2257 if test "$with_jpeg" != 'no'; then
2258 AC_MSG_RESULT([-------------------------------------------------------------])
2259 AC_MSG_CHECKING([for JPEG])
2263 AC_CHECK_HEADER(jconfig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2264 AC_CHECK_HEADER(jerror.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2265 AC_CHECK_HEADER(jmorecfg.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2266 AC_CHECK_HEADER(jpeglib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2267 AC_CHECK_LIB(jpeg,jpeg_read_header,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2269 # Test for compatible JPEG library
2270 if test "$ac_cv_jpeg_version_ok" != 'yes'; then
2271 AC_CACHE_CHECK(for JPEG library is version 6b or later, ac_cv_jpeg_version_ok,
2275 #include <jpeglib.h>
2277 changequote(<<, >>)dnl
2279 #if JPEG_LIB_VERSION < 62
2280 #error IJG JPEG library must be version 6b or newer!
2284 changequote([, ])dnl
2285 ac_cv_jpeg_version_ok='yes'; passed=`expr $passed + 1`,
2286 ac_cv_jpeg_version_ok='no'; failed=`expr $failed + 1`)])
2288 AC_MSG_CHECKING([if JPEG package is complete])
2289 if test $passed -gt 0; then
2290 if test $failed -gt 0; then
2291 AC_MSG_RESULT([no -- some components failed test])
2292 have_jpeg='no (failed tests)'
2295 LIBS="$JPEG_LIBS $LIBS"
2296 AC_DEFINE(JPEG_DELEGATE,1,Define if you have JPEG library)
2297 AC_MSG_RESULT([yes])
2304 AM_CONDITIONAL(JPEG_DELEGATE, test "$have_jpeg" = 'yes')
2307 dnl ===========================================================================
2310 # Check for LCMS delegate library.
2314 [ --without-lcms disable lcms (v1.1X) support],
2315 [with_lcms=$withval],
2317 if test "$with_lcms" != 'yes' ; then
2318 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lcms=$with_lcms "
2323 [ --without-lcms2 disable lcms (v2.X) support],
2324 [with_lcms2=$withval],
2326 if test "$with_lcms2" != 'yes' ; then
2327 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lcms2=$with_lcms2 "
2332 if test "$with_lcms2" != 'no'; then
2333 AC_MSG_RESULT([-------------------------------------------------------------])
2334 AC_MSG_CHECKING([for LCMS v2])
2338 have_lcms_header='no'
2340 # Check for <lcms2.h>
2341 AC_CHECK_HEADER(lcms2.h,have_lcms_header='yes',,)
2342 if test "$have_lcms_header" = 'yes'; then
2343 AC_DEFINE(HAVE_LCMS2_H,1,Define if you have the <lcms2.h> header file.)
2344 passed=`expr $passed + 1`
2347 # Check for <lcms2/lcms2.h)
2348 if test "$have_lcms_header" != 'yes'; then
2349 AC_CHECK_HEADER(lcms2/lcms2.h,have_lcms_header='yes',,)
2350 if test "$have_lcms_header" = 'yes'; then
2351 passed=`expr $passed + 1`
2352 AC_DEFINE(HAVE_LCMS2_LCMS2_H,1,Define if you have the <lcms2/lcms2.h> header file.)
2356 # Failed to find lcms header?
2357 if test "$have_lcms_header" != 'yes'; then
2358 failed=`expr $failed + 1`
2361 AC_CHECK_LIB(lcms2,cmsSetLogErrorHandler,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2362 AC_MSG_CHECKING(if LCMS v2 package is complete)
2363 if test $passed -gt 0; then
2364 if test $failed -gt 0; then
2365 AC_MSG_RESULT(no -- some components failed test)
2366 have_lcms2='no (failed tests)'
2369 LIBS="$LCMS_LIBS $LIBS"
2379 # Check for LCMS v1 (1.11 or later)
2381 if test $have_lcms2 = 'yes'; then
2386 if test "$with_lcms" != 'no'; then
2387 AC_MSG_RESULT([-------------------------------------------------------------])
2388 AC_MSG_CHECKING([for LCMS v1.1X])
2392 have_lcms_header='no'
2394 # Check for <lcms.h>
2395 if test "$have_lcms_header" != 'yes'; then
2396 AC_CHECK_HEADER(lcms.h,have_lcms_header='yes',,)
2397 if test "$have_lcms_header" = 'yes'; then
2398 passed=`expr $passed + 1`
2399 AC_DEFINE(HAVE_LCMS_H,1,Define if you have the <lcms.h> header file.)
2403 # Check for <lcms/lcms.h>
2404 if test "$have_lcms_header" != 'yes'; then
2405 AC_CHECK_HEADER(lcms/lcms.h,have_lcms_header='yes',,)
2406 if test "$have_lcms_header" = 'yes'; then
2407 passed=`expr $passed + 1`
2408 AC_DEFINE(HAVE_LCMS_LCMS_H,1,Define if you have the <lcms/lcms.h> header file.)
2412 # Failed to find lcms header?
2413 if test "$have_lcms_header" != 'yes'; then
2414 failed=`expr $failed + 1`
2417 AC_CHECK_LIB(lcms,cmsSetErrorHandler,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2418 AC_MSG_CHECKING(if LCMS package is complete)
2419 if test $passed -gt 0; then
2420 if test $failed -gt 0; then
2421 AC_MSG_RESULT(no -- some components failed test)
2422 have_lcms='no (failed tests)'
2425 LIBS="$LCMS_LIBS $LIBS"
2434 AM_CONDITIONAL(LCMS_DELEGATE, test "$have_lcms2" = 'yes' -o "$have_lcms" = 'yes')
2435 if test "$have_lcms2" = 'yes' -o "$have_lcms" = 'yes'; then
2436 AC_DEFINE(LCMS_DELEGATE,1,[Define if you have LCMS (v1.11 or later) library])
2441 dnl ===========================================================================
2444 # Check for the OpenJP2 delegate library.
2446 AC_ARG_WITH([openjp2],
2447 [AC_HELP_STRING([--without-openjp2],
2448 [disable OpenJP2 support])],
2449 [with_openjp2=$withval],
2450 [with_openjp2='yes'])
2452 if test "$with_openjp2" != 'yes'; then
2453 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-openjp2=$with_openjp2 "
2457 LIBOPENJP2_CFLAGS=""
2460 if test "x$with_openjp2" = "xyes"; then
2461 AC_MSG_RESULT([-------------------------------------------------------------])
2462 PKG_CHECK_MODULES(LIBOPENJP2,[libopenjp2 >= 2.1.0], have_openjp2=yes, have_openjp2=no)
2466 if test "$have_openjp2" = 'yes'; then
2467 AC_DEFINE(LIBOPENJP2_DELEGATE,1,Define if you have OPENJP2 library)
2468 if test "$build_modules" = 'no'; then
2469 CFLAGS="$LIBOPENJP2_CFLAGS $CFLAGS"
2473 AM_CONDITIONAL(LIBOPENJP2_DELEGATE, test "$have_openjp2" = 'yes')
2474 AC_SUBST(LIBOPENJP2_CFLAGS)
2475 AC_SUBST(LIBOPENJP2_LIBS)
2478 dnl ===========================================================================
2481 # Check for the LQR (Liquid Rescale) delegate library.
2484 [AC_HELP_STRING([--without-lqr],
2485 [disable Liquid Rescale support])],
2486 [with_lqr=$withval],
2489 if test "$with_lqr" != 'yes'; then
2490 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lqr=$with_lqr "
2497 if test "x$with_lqr" = "xyes"; then
2498 AC_MSG_RESULT([-------------------------------------------------------------])
2499 PKG_CHECK_MODULES(LQR,[lqr-1 >= 0.1.0], have_lqr=yes, have_lqr=no)
2503 if test "$have_lqr" = 'yes'; then
2504 AC_DEFINE(LQR_DELEGATE,1,Define if you have LQR library)
2505 CFLAGS="$LQR_CFLAGS $CFLAGS"
2508 AM_CONDITIONAL(LQR_DELEGATE, test "$have_lqr" = 'yes')
2509 AC_SUBST(LQR_CFLAGS)
2512 dnl ===========================================================================
2514 # Disable LZMA (lzma library)
2516 [ --without-lzma disable LZMA support],
2517 [with_lzma=$withval],
2519 if test "$with_lzma" != 'yes' ; then
2520 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lzma=$with_lzma "
2524 if test "x$with_lzma" = "xyes"; then
2525 AC_MSG_RESULT([-------------------------------------------------------------])
2526 PKG_CHECK_MODULES(LZMA,[liblzma >= 2.9.0], have_lzma=yes, have_lzma=no)
2530 if test "$have_lzma" = 'yes'; then
2531 AC_DEFINE(LZMA_DELEGATE,1,Define if you have LZMA library)
2532 if test "$build_modules" = 'no'; then
2533 CPPFLAGS="$LZMA_CFLAGS $CPPFLAGS"
2537 AM_CONDITIONAL(LZMA_DELEGATE, test "$have_lzma" = 'yes')
2538 AC_SUBST(LZMA_CFLAGS)
2541 dnl ===========================================================================
2544 # Check for the OpenEXR delegate library.
2546 AC_ARG_WITH([openexr],
2547 [AC_HELP_STRING([--without-openexr],
2548 [disable OpenEXR support])],
2549 [with_openexr=$withval],
2550 [with_openexr='yes'])
2552 if test "$with_openexr" != 'yes'; then
2553 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-openexr=$with_openexr "
2560 if test "x$with_openexr" = "xyes"; then
2561 AC_MSG_RESULT([-------------------------------------------------------------])
2562 PKG_CHECK_MODULES(OPENEXR,[OpenEXR >= 1.0.6], have_openexr=yes, have_openexr=no)
2566 if test "$have_openexr" = 'yes'; then
2567 AC_DEFINE(OPENEXR_DELEGATE,1,Define if you have OPENEXR library)
2568 if test "$build_modules" = 'no'; then
2569 CFLAGS="$OPENEXR_CFLAGS $CFLAGS"
2573 AM_CONDITIONAL(OPENEXR_DELEGATE, test "$have_openexr" = 'yes')
2574 AC_SUBST(OPENEXR_CFLAGS)
2575 AC_SUBST(OPENEXR_LIBS)
2577 dnl ===========================================================================
2580 # Check for PANGO delegate library.
2582 AC_ARG_WITH([pango],
2583 [AC_HELP_STRING([--without-pango],
2584 [disable PANGO support])],
2585 [with_pango=$withval],
2588 if test "$with_pango" != 'yes'; then
2589 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-pango=$with_pango "
2593 have_pangocairo='no'
2597 if test "x$with_pango" = "xyes"; then
2598 AC_MSG_RESULT([-------------------------------------------------------------])
2599 PKG_CHECK_MODULES(PANGO, [pangocairo >= 1.28.1], have_pangocairo=yes, have_pangocairo=no)
2601 PKG_CHECK_MODULES(PANGO, [pango >= 1.28.1], have_pango=yes, have_pango=no)
2605 if test "$have_pango" = 'yes'; then
2606 AC_DEFINE(PANGO_DELEGATE,1,Define if you have PANGO library)
2607 if test "$build_modules" = 'no'; then
2608 CPPFLAGS="$PANGO_CFLAGS $CPPFLAGS"
2612 if test "$have_pangocairo" = 'yes'; then
2613 AC_DEFINE(PANGOCAIRO_DELEGATE,1,Define if you have PANGOCAIRO library)
2614 if test "$build_modules" = 'no'; then
2615 CPPFLAGS="$PANGOCAIRO_CFLAGS $CPPFLAGS"
2619 AM_CONDITIONAL(PANGO_DELEGATE, test "$have_pango" = 'yes')
2620 AM_CONDITIONAL(PANGOCAIRO_DELEGATE, test "$have_pangocairo" = 'yes')
2621 AC_SUBST(PANGO_CFLAGS)
2622 AC_SUBST(PANGO_LIBS)
2624 dnl ===========================================================================
2627 # Check for PNG delegate library.
2630 [AC_HELP_STRING([--without-png],
2631 [disable PNG support])],
2632 [with_png=$withval],
2635 if test "$with_png" != 'yes'; then
2636 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-png=$with_png "
2642 if test "$with_png" != 'no' -a "$have_zlib" != 'no' ; then
2643 AC_MSG_RESULT([-------------------------------------------------------------])
2644 AC_MSG_CHECKING(for PNG support )
2648 AC_CHECK_HEADER(png.h,passed=`expr $passed + 1`,
2649 failed=`expr $failed + 1`,)
2651 if test $passed -gt 0; then
2652 for var in 7 6 5 4 2 '' ; do
2653 if test "$have_png" = 'no' ; then
2654 if test "x${var}" = 'x' ; then
2660 # Test for compatible LIBPNG library
2663 if test "$with_png" = 'yes' -o "$with_png" = "libpng1${var}" ; then
2664 if test "${pnglib}" != 'png' ; then
2665 AC_MSG_CHECKING(for LIBPNG1${var} support )
2671 changequote(<<, >>)dnl
2673 #if PNG_LIBPNG_VER_MINOR != ${var}
2674 #error LIBPNG library must be version 1${var}!
2679 changequote([, ])dnl
2680 ac_cv_libpng_ok='yes',
2681 ac_cv_libpng_ok='no')
2682 if test "$ac_cv_libpng_ok" = 'yes' ; then
2683 passed=`expr $passed + 1`
2686 failed=`expr $failed + 1`
2690 passed=`expr $passed + 1`
2695 if test $passed -gt 0 -a $failed -le 0; then
2696 if test "1${var}" = '17' ; then
2697 AC_CHECK_LIB(png17,png_get_io_ptr,passed=`expr $passed + 1`,
2698 failed=`expr $failed + 1`,)
2699 AC_CHECK_LIB(png17,png_longjmp,passed=`expr $passed + 1`,
2700 failed=`expr $failed + 1`,)
2702 if test "1${var}" = '16' ; then
2703 AC_CHECK_LIB(png16,png_get_io_ptr,passed=`expr $passed + 1`,
2704 failed=`expr $failed + 1`,)
2705 AC_CHECK_LIB(png16,png_longjmp,passed=`expr $passed + 1`,
2706 failed=`expr $failed + 1`,)
2708 if test "1${var}" = '15' ; then
2709 AC_CHECK_LIB(png15,png_get_io_ptr,passed=`expr $passed + 1`,
2710 failed=`expr $failed + 1`,)
2711 AC_CHECK_LIB(png15,png_longjmp,passed=`expr $passed + 1`,
2712 failed=`expr $failed + 1`,)
2714 if test "1${var}" = '14' ; then
2715 AC_CHECK_LIB(png14,png_get_io_ptr,passed=`expr $passed + 1`,
2716 failed=`expr $failed + 1`,)
2717 AC_CHECK_LIB(png14,png_get_io_state,passed=`expr $passed + 1`,
2718 failed=`expr $failed + 1`,)
2720 if test "1${var}" = '12' ; then
2721 AC_CHECK_LIB(png12,png_get_io_ptr,passed=`expr $passed + 1`,
2722 failed=`expr $failed + 1`,)
2724 if test "1${var}" = '1' ; then
2725 AC_CHECK_LIB(png,png_get_io_ptr,passed=`expr $passed + 1`,
2726 failed=`expr $failed + 1`,)
2728 if test $passed -gt 0 -a $failed -le 0 ; then
2729 AC_MSG_CHECKING(if ${pnglib} package is complete)
2730 if test $passed -gt 0 ; then
2731 if test $failed -gt 0 ; then
2732 AC_MSG_RESULT(no -- some components failed test)
2733 have_png='no (failed tests)'
2735 PNG_LIBS="-l${pnglib}"
2736 LIBS="$PNG_LIBS $LIBS"
2737 AC_DEFINE(PNG_DELEGATE,1,Define if you have PNG library)
2749 AM_CONDITIONAL(PNG_DELEGATE,test "$have_png" = 'yes')
2753 dnl ===========================================================================
2756 # Check for RSVG delegate library.
2759 [AC_HELP_STRING([--with-rsvg],
2760 [enable RSVG support])],
2761 [with_rsvg=$withval],
2764 if test "$with_rsvg" != 'yes'; then
2765 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-rsvg=$with_rsvg "
2773 if test "x$with_rsvg" = "xyes"; then
2774 AC_MSG_RESULT([-------------------------------------------------------------])
2775 PKG_CHECK_MODULES(RSVG,[librsvg-2.0 >= 2.9.0], have_rsvg=yes, have_rsvg=no)
2777 PKG_CHECK_MODULES(CAIRO_SVG, cairo-svg, have_cairo=yes, have_cairo=no)
2781 if test "$have_rsvg" = 'yes'; then
2782 AC_DEFINE(RSVG_DELEGATE,1,Define if you have RSVG library)
2783 if test "$build_modules" = 'no'; then
2784 CPPFLAGS="$RSVG_CFLAGS $CPPFLAGS"
2788 if test "$have_cairo" = 'yes'; then
2789 AC_DEFINE(CAIRO_DELEGATE,1,Define if you have CAIRO library)
2790 if test "$build_modules" = 'no'; then
2791 CPPFLAGS="$CAIRO_SVG_CFLAGS $CPPFLAGS"
2795 AM_CONDITIONAL(RSVG_DELEGATE, test "$have_rsvg" = 'yes')
2796 AM_CONDITIONAL(CAIRO_DELEGATE, test "$have_cairo" = 'yes')
2797 AC_SUBST(RSVG_CFLAGS)
2800 dnl ===========================================================================
2803 # Check for TIFF delegate library.
2806 [AC_HELP_STRING([--without-tiff],
2807 [disable TIFF support])],
2808 [with_tiff=$withval],
2811 if test "$with_tiff" != 'yes'; then
2812 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-tiff=$with_tiff "
2817 if test "$with_tiff" != 'no'; then
2818 AC_MSG_RESULT([-------------------------------------------------------------])
2819 AC_MSG_CHECKING([for TIFF])
2823 AC_CHECK_HEADER(tiff.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2824 AC_CHECK_HEADER(tiffio.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2825 AC_CHECK_LIB(tiff,TIFFOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2826 AC_CHECK_LIB(tiff,TIFFClientOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2827 AC_CHECK_LIB(tiff,TIFFIsByteSwapped,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2828 AC_CHECK_LIB(tiff,TIFFReadRGBATile,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2829 AC_CHECK_LIB(tiff,TIFFReadRGBAStrip,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2830 AC_MSG_CHECKING([if TIFF package is complete])
2831 if test $passed -gt 0; then
2832 if test $failed -gt 0; then
2833 AC_MSG_RESULT([no -- some components failed test])
2834 have_tiff='no (failed tests)'
2837 LIBS="$TIFF_LIBS $LIBS"
2838 AC_DEFINE(TIFF_DELEGATE,1,Define if you have TIFF library)
2839 AC_MSG_RESULT([yes])
2841 AC_CHECK_HEADERS(tiffconf.h)
2842 AC_CHECK_FUNCS([TIFFIsCODECConfigured TIFFMergeFieldInfo \
2843 TIFFIsBigEndian TIFFReadEXIFDirectory TIFFSetErrorHandlerExt \
2844 TIFFSetTagExtender TIFFSetWarningHandlerExt \
2845 TIFFSwabArrayOfTriples])
2851 AM_CONDITIONAL(TIFF_DELEGATE, test "$have_tiff" = 'yes')
2854 dnl ===========================================================================
2857 # Check for WEBP delegate library.
2860 [AC_HELP_STRING([--without-webp],
2861 [disable WEBP support])],
2862 [with_webp=$withval],
2865 if test "$with_webp" != 'yes'; then
2866 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-webp=$with_webp "
2871 if test "$with_webp" != 'no'; then
2872 AC_MSG_RESULT([-------------------------------------------------------------])
2873 AC_MSG_CHECKING([for WEBP])
2877 AC_CHECK_HEADER(webp/decode.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2878 AC_CHECK_LIB(webp,WebPPictureInitInternal,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2879 AC_MSG_CHECKING([if WEBP package is complete])
2880 if test $passed -gt 0; then
2881 if test $failed -gt 0; then
2882 AC_MSG_RESULT([no -- some components failed test])
2883 have_webp='no (failed tests)'
2886 LIBS="$WEBP_LIBS $LIBS"
2887 AC_DEFINE(WEBP_DELEGATE,1,Define if you have WEBP library)
2888 AC_MSG_RESULT([yes])
2895 AM_CONDITIONAL(WEBP_DELEGATE,test "$have_webp" = 'yes')
2898 dnl ===========================================================================
2901 # Set Windows font directory.
2903 AC_ARG_WITH([windows-font-dir],
2904 [AC_HELP_STRING([--with-windows-font-dir=DIR],
2905 [Windows font directory])],
2906 [with_windows_font_dir=$withval],
2907 [with_windows_font_dir='default'])
2909 if test "$with_windows_font_dir" != 'default'; then
2910 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-windows-font-dir=$with_windows_font_dir "
2913 dnl ===========================================================================
2916 # Check for WMF delegate library.
2919 [AC_HELP_STRING([--with-wmf],
2920 [enable WMF support])],
2921 [with_wmf=$withval],
2924 if test "$with_wmf" != 'yes'; then
2925 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-wmf=$with_wmf "
2932 if test "$with_wmf" != 'no'; then
2933 AC_MSG_RESULT([-------------------------------------------------------------])
2934 AC_MSG_CHECKING([for WMF])
2937 have_libwmflite='no'
2938 have_libwmf_ipa_h='no'
2940 AC_CHECK_HEADER([libwmf/ipa.h],[have_libwmf_ipa_h='yes'],,[$FT2BUILD_H])
2941 if test "$have_libwmf_ipa_h" = 'yes'; then
2942 AC_CHECK_LIB(wmflite,wmf_lite_create,have_libwmflite='yes',,)
2943 if test "$have_libwmflite" = 'yes'; then
2944 AC_DEFINE(WMFLITE_DELEGATE,1,Define if you have wmflite library)
2945 WMF_LIBS='-lwmflite'
2946 LIBS="$WMF_LIBS $LIBS"
2950 WMF_CONFIG_LIBS=`libwmf-config --libs`
2951 for lib in xml2 expat freetype jpeg png z; do
2953 echo "$WMF_CONFIG_LIBS" | grep -- "$testlib" > /dev/null && WMF_LIBS_DEPS="$WMF_LIBS_DEPS $testlib"
2955 AC_CHECK_LIB(wmf,wmf_api_create,have_libwmf='yes',,$WMF_LIBS_DEPS)
2956 if test "$have_libwmf" = 'yes'; then
2957 AC_DEFINE(WMF_DELEGATE,1,Define if you have wmf library)
2959 LIBS="$WMF_LIBS $LIBS"
2962 AC_MSG_RESULT([no -- some components failed test])
2963 have_wmf='no (failed tests)'
2964 have_wmflite='no (failed tests)'
2970 AC_MSG_CHECKING([if WMF package is complete])
2971 if test "$have_wmf" = 'yes'; then
2972 AC_MSG_RESULT([yes])
2977 AM_CONDITIONAL(WMF_DELEGATE, test "$have_wmf" = 'yes')
2979 AC_SUBST(WMF_LIBS_DEPS)
2982 dnl ===========================================================================
2985 # Check for XML delegate library.
2988 [AC_HELP_STRING([--without-xml],
2989 [disable XML support])],
2990 [with_xml=$withval],
2993 if test "$with_xml" != 'yes' ; then
2994 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-xml=$with_xml "
2999 if test "$with_xml" != 'no'; then
3000 AC_MSG_RESULT([-------------------------------------------------------------])
3001 AC_MSG_CHECKING([for XML])
3003 PERSIST_LDFLAGS=$LDFLAGS
3004 PERSIST_CPPFLAGS=$CPPFLAGS
3006 AC_PATH_PROG(xml2_config,xml2-config,)dnl
3007 if test -n "$xml2_config"; then
3008 # Debian installs libxml headers under /usr/include/libxml2/libxml with
3009 # the shared library installed under /usr/lib, whereas the package
3010 # installs itself under $prefix/libxml and $prefix/lib.
3011 xml2_prefix=`${xml2_config} --prefix`
3012 if test -d "${xml2_prefix}/include/libxml2"; then
3013 CPPFLAGS="$CPPFLAGS -I${xml2_prefix}/include/libxml2"
3015 if test "${xml2_prefix}" != '/usr'; then
3016 LDFLAGS="$LDFLAGS -L${xml2_prefix}/lib"
3021 AC_CHECK_HEADER(libxml/parser.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
3022 AC_CHECK_LIB(xml2,xmlSAXVersion,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
3023 AC_CHECK_LIB(xml2,xmlParseChunk,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
3024 AC_CHECK_LIB(xml2,xmlCreatePushParserCtxt,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
3025 AC_MSG_CHECKING([if XML package is complete])
3026 if test $passed -gt 0; then
3027 if test $failed -gt 0; then
3028 AC_MSG_RESULT([no -- some components failed test])
3029 have_xml='no (failed tests)'
3030 LDFLAGS="$PERSIST_LDFLAGS"
3031 CPPFLAGS="$PERSIST_CPPFLAGS"
3034 LIBS="$XML_LIBS $LIBS"
3035 AC_DEFINE(XML_DELEGATE,1,Define if you have XML library)
3036 AC_MSG_RESULT([yes])
3043 AM_CONDITIONAL(XML_DELEGATE,test "$have_xml" = 'yes')
3046 dnl ===========================================================================
3048 # Substitute compiler name to build/link PerlMagick
3050 AC_SUBST(PERLMAINCC)
3053 # Configure install Paths
3056 # Path to ImageMagick header files
3057 INCLUDE_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
3058 INCLUDE_PATH="${INCLUDE_DIR}/${INCLUDE_RELATIVE_PATH}"
3059 DEFINE_INCLUDE_PATH="${INCLUDE_DIR}/${INCLUDE_RELATIVE_PATH}/"
3060 case "${build_os}" in
3062 DEFINE_INCLUDE_PATH=`$WinPathScript "$DEFINE_INCLUDE_PATH" 1`
3065 AC_DEFINE_UNQUOTED(INCLUDE_PATH,"$DEFINE_INCLUDE_PATH",[Directory where ImageMagick headers live.])
3066 AC_SUBST(INCLUDE_PATH)
3068 # Path to ImageMagick header files (arch part)
3069 INCLUDEARCH_PATH="${INCLUDEARCH_DIR}/${INCLUDE_RELATIVE_PATH}"
3070 DEFINE_INCLUDEARCH_PATH="${INCLUDEARCH_DIR}/${INCLUDE_RELATIVE_PATH}/"
3071 case "${build_os}" in
3073 DEFINE_INCLUDEARCH_PATH=`$WinPathScript "$DEFINE_INCLUDEARCH_PATH" 1`
3076 AC_DEFINE_UNQUOTED(INCLUDEARCH_PATH,"$DEFINE_INCLUDE_PATH",[Directory where ImageMagick architecture headers live.])
3077 AC_SUBST(INCLUDEARCH_PATH)
3079 # Subdirectory under lib to place ImageMagick lib files
3080 LIBRARY_RELATIVE_PATH="${PACKAGE_NAME}-${PACKAGE_VERSION}"
3081 AC_DEFINE_UNQUOTED(LIBRARY_RELATIVE_PATH,"$LIBRARY_RELATIVE_PATH",[Subdirectory of lib where ImageMagick architecture dependent files are installed.])
3083 # Path to ImageMagick bin directory
3084 EXECUTABLE_PATH="${BIN_DIR}"
3085 DEFINE_EXECUTABLE_PATH="${BIN_DIR}/"
3086 case "${build_os}" in
3088 DEFINE_EXECUTABLE_PATH=`$WinPathScript "$DEFINE_EXECUTABLE_PATH" 1`
3091 AC_DEFINE_UNQUOTED(EXECUTABLE_PATH,"$DEFINE_EXECUTABLE_PATH",[Directory where executables are installed.])
3092 AC_SUBST(EXECUTABLE_PATH)
3094 # Path to ImageMagick lib
3095 LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}"
3096 DEFINE_LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}/"
3097 case "${build_os}" in
3099 DEFINE_LIBRARY_PATH=`$WinPathScript "$DEFINE_LIBRARY_PATH" 1`
3102 AC_DEFINE_UNQUOTED(LIBRARY_PATH,"$DEFINE_LIBRARY_PATH",[Directory where architecture-dependent files live.])
3103 AC_SUBST(LIBRARY_PATH)
3106 # path to local binaries
3107 if test "x$LIB_BIN_BASEDIRNAME" = "x"; then
3108 LIB_BIN_BASEDIRNAME="bin"
3110 AC_DEFINE_UNQUOTED(LIB_BIN_BASEDIRNAME,"$LIB_BIN_BASEDIRNAME",[Binaries in libraries path base name (will be during install linked to bin)])
3111 AC_SUBST(LIB_BIN_BASEDIRNAME)
3113 if test "x$LIB_BIN_DIR" = "x"; then
3114 LIB_BIN_DIR=${LIB_BIN_BASEDIRNAME}-${MAGICK_ABI_SUFFIX}
3116 AC_SUBST(LIB_BIN_DIR)
3118 LIB_BIN_DIR_RELATIVE_PATH=$LIB_BIN_DIR
3119 AC_SUBST(LIB_BIN_DIR_RELATIVE_PATH)
3120 LIB_BIN_DIR_PATH="${LIBRARY_PATH}/${LIB_BIN_DIR_RELATIVE_PATH}"
3121 AC_SUBST(LIB_BIN_DIR_PATH)
3124 # path to modules lib
3125 if test "x$MODULES_BASEDIRNAME" = "x"; then
3126 MODULES_BASEDIRNAME="modules"
3128 AC_DEFINE_UNQUOTED(MODULES_BASEDIRNAME,"$MODULES_BASEDIRNAME",[Module directory name without ABI part.])
3129 AC_SUBST(MODULES_BASEDIRNAME)
3131 if test "x$MODULES_DIRNAME" = "x"; then
3132 MODULES_DIRNAME=${MODULES_BASEDIRNAME}-${MAGICK_ABI_SUFFIX}
3134 AC_DEFINE_UNQUOTED(MODULES_DIRNAME,"$MODULES_DIRNAME",[Module directory dirname])
3136 AC_SUBST(MODULES_DIRNAME)
3138 MODULES_RELATIVE_PATH="${MODULES_DIRNAME}"
3139 AC_SUBST(MODULES_RELATIVE_PATH)
3140 MODULES_PATH="${LIBRARY_PATH}/${MODULES_RELATIVE_PATH}"
3141 AC_SUBST(MODULES_PATH)
3144 # path to coders lib
3145 if test "x$CODER_DIRNAME" = "x"; then
3146 CODER_DIRNAME="coders"
3148 AC_DEFINE_UNQUOTED(CODER_DIRNAME,"$CODER_DIRNAME",[coders subdirectory.])
3149 AC_SUBST(CODER_DIRNAME)
3151 CODER_RELATIVE_PATH="${CODER_DIRNAME}"
3152 CODER_PATH="${MODULES_PATH}/${CODER_DIRNAME}"
3153 AC_SUBST(CODER_PATH)
3156 # Subdirectory under lib to place ImageMagick filter module files
3158 # path to coders lib
3159 if test "x$FILTER_DIRNAME" = "x"; then
3160 FILTER_DIRNAME="filters"
3162 AC_DEFINE_UNQUOTED(FILTER_DIRNAME,"$FILTER_DIRNAME",[filter subdirectory.])
3163 AC_SUBST(FILTER_DIRNAME)
3165 FILTER_RELATIVE_PATH="${FILTER_DIRNAME}"
3166 FILTER_PATH="${MODULES_PATH}/${FILTER_DIRNAME}"
3167 AC_SUBST(FILTER_PATH)
3170 # Path to ImageMagick documentation files
3171 DOCUMENTATION_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
3172 DOCUMENTATION_PATH="${DOC_DIR}/${DOCUMENTATION_RELATIVE_PATH}"
3173 DEFINE_DOCUMENTATION_PATH="${DOC_DIR}/${DOCUMENTATION_RELATIVE_PATH}/"
3174 case "${build_os}" in
3176 DEFINE_DOCUMENTATION_PATH=`$WinPathScript "$DEFINE_DOCUMENTATION_PATH" 1`
3179 AC_DEFINE_UNQUOTED(DOCUMENTATION_PATH,"$DEFINE_DOCUMENTATION_PATH",[Directory where ImageMagick documents live.])
3180 AC_SUBST(DOCUMENTATION_PATH)
3183 # Enable/Disable documentation
3184 AC_ARG_ENABLE([docs],
3185 [AS_HELP_STRING([--disable-docs],
3186 [disable building of documentation])],
3187 wantdocs=$enableval, wantdocs=yes)
3188 AM_CONDITIONAL([INSTALL_DOC], [test "$wantdocs" = "yes"])
3190 # Subdirectory to place architecture-dependent configuration files
3191 CONFIGURE_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
3192 AC_DEFINE_UNQUOTED(CONFIGURE_RELATIVE_PATH,"$CONFIGURE_RELATIVE_PATH",[Subdirectory of lib where architecture-dependent configuration files live.])
3193 CONFIGURE_PATH="${SYSCONF_DIR}/${CONFIGURE_RELATIVE_PATH}/"
3194 DEFINE_CONFIGURE_PATH="${SYSCONF_DIR}/${CONFIGURE_RELATIVE_PATH}/"
3195 case "${build_os}" in
3197 DEFINE_CONFIGURE_PATH=`$WinPathScript "$DEFINE_CONFIGURE_PATH" 1`
3200 AC_DEFINE_UNQUOTED(CONFIGURE_PATH,"$DEFINE_CONFIGURE_PATH",[Directory where architecture-dependent configuration files live.])
3201 AC_SUBST(CONFIGURE_PATH)
3203 # Subdirectory to place architecture-independent configuration files
3204 SHARE_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
3205 AC_DEFINE_UNQUOTED(SHARE_RELATIVE_PATH,"$SHARE_RELATIVE_PATH",[Subdirectory of lib where architecture-independent configuration files live.])
3206 SHARE_PATH="${DATA_DIR}/${SHARE_RELATIVE_PATH}"
3207 DEFINE_SHARE_PATH="${DATA_DIR}/${SHARE_RELATIVE_PATH}/"
3208 case "${build_os}" in
3210 DEFINE_SHARE_PATH=`$WinPathScript "$DEFINE_SHARE_PATH" 1`
3213 AC_DEFINE_UNQUOTED(SHARE_PATH,"$DEFINE_SHARE_PATH",[Directory where architecture-independent configuration files live.])
3214 AC_SUBST(SHARE_PATH)
3217 # Subdirectory to place architecture-dependent configuration files.
3218 if test "x$SHAREARCH_BASEDIRNAME" = "x"; then
3219 SHAREARCH_BASEDIRNAME="config"
3221 AC_DEFINE_UNQUOTED(SHAREARCH_BASEDIRNAME,"$SHAREARCH_BASEDIRNAME",[Sharearch directory name without ABI part.])
3222 AC_SUBST(SHAREARCH_BASEDIRNAME)
3224 if test "x$SHAREARCH_DIRNAME" = "x"; then
3225 SHAREARCH_DIRNAME=${SHAREARCH_BASEDIRNAME}-${MAGICK_ABI_SUFFIX}
3227 AC_DEFINE_UNQUOTED(SHAREARCH_DIRNAME,"$SHAREARCH_DIRNAME",[Sharearch directory dirname])
3229 AC_SUBST(SHAREARCH_DIRNAME)
3231 SHAREARCH_RELATIVE_PATH="${SHAREARCH_DIRNAME}"
3232 AC_SUBST(SHAREARCH_RELATIVE_PATH)
3233 SHAREARCH_PATH="${LIBRARY_PATH}/${SHAREARCH_RELATIVE_PATH}"
3234 AC_SUBST(SHAREARCH_PATH)
3237 # program_transform_name is formed for use in a Makefile, so create a
3238 # modified version for use in a shell script.
3239 configure_transform_name=`echo ${program_transform_name} | sed 's,\\$\\$,$,'`
3241 # Default delegate definitions
3242 AC_MSG_RESULT([-------------------------------------------------------------])
3243 AC_MSG_CHECKING([for ImageMagick delegate programs])
3245 AutotraceDecodeDelegateDefault='autotrace'
3246 BlenderDecodeDelegateDefault='blender'
3247 BZIPDelegateDefault='bzip2'
3248 BrowseDelegateDefault='xdg-open'
3249 CatDelegateDefault='cat'
3250 DNGDecodeDelegateDefault='ufraw-batch'
3251 DOCDecodeDelegateDefault='soffice'
3252 GVCDecodeDelegateDefault='dot'
3253 DVIDecodeDelegateDefault='dvips'
3254 EchoDelegateDefault='echo'
3255 EditorDelegateDefault='xterm'
3256 ConvertDelegateDefault=`echo convert | sed ${configure_transform_name}`
3257 DisplayDelegateDefault=`echo display | sed ${configure_transform_name}`
3258 MogrifyDelegateDefault=`echo mogrify | sed ${configure_transform_name}`
3259 GnuplotDecodeDelegateDefault='gnuplot'
3260 HPGLDecodeDelegateDefault='hp2xx'
3261 HTMLDecodeDelegateDefault='html2ps'
3262 ILBMDecodeDelegateDefault='ilbmtoppm'
3263 ILBMEncodeDelegateDefault='ppmtoilbm'
3264 JXRDecodeDelegateDefault='JxrDecApp'
3265 JXREncodeDelegateDefault='JxrEncApp'
3266 LPDelegateDefault='lp'
3267 LPRDelegateDefault='lpr'
3268 LaunchDelegateDefault='gimp'
3269 MANDelegateDefault='groff'
3270 MPEGDecodeDelegateDefault='avconv'
3271 MPEGEncodeDelegateDefault='avconv'
3272 MrSIDDecodeDelegateDefault='mrsidgeodecode'
3273 MVDelegateDefault='mv'
3274 PCLDelegateDefault='pcl6'
3275 PGPDecodeDelegateDefault='pgpv'
3276 POVDelegateDefault='povray'
3277 if test "$native_win32_build" = 'yes'; then
3278 PSDelegateDefault='gswin32c'
3279 elif test "$gslib_framework" = 'yes'; then
3280 PSDelegateDefault='gsc'
3282 PSDelegateDefault='gs'
3284 RLEEncodeDelegateDefault='rawtorle'
3285 RMDelegateDefault='rm'
3286 RSVGDecodeDelegateDefault='rsvg-convert'
3287 SCANDecodeDelegateDefault='scanimage'
3288 SVGDecodeDelegateDefault='inkscape'
3289 TXTDelegateDefault='enscript'
3290 UniconvertorDelegateDefault='uniconvertor'
3291 WebPDecodeDelegateDefault='dwebp'
3292 WebPEncodeDelegateDefault='cwebp'
3293 WMFDecodeDelegateDefault='wmf2eps'
3294 WWWDecodeDelegateDefault='curl'
3295 XPSDelegateDefault='gxps'
3296 ZipDelegateDefault='gzip'
3298 # Search for delegates
3299 AC_PATH_PROG(AutotraceDecodeDelegate, "$AutotraceDecodeDelegateDefault", "$AutotraceDecodeDelegateDefault")
3300 AC_PATH_PROG(BlenderDecodeDelegate, "$BlenderDecodeDelegateDefault", "$BlenderDecodeDelegateDefault")
3301 AC_PATH_PROG(BZIPDelegate, "$BZIPDelegateDefault", "$BZIPDelegateDefault")
3302 AC_PATH_PROGS(BrowseDelegate, "$BrowseDelegateDefault" google-chrome firefox konqueror mozilla lynx, "$BrowseDelegateDefault")
3303 AC_PATH_PROG(CatDelegate, "$CatDelegateDefault", "$CatDelegateDefault")
3304 AC_PATH_PROG(DNGDecodeDelegate, "$DNGDecodeDelegateDefault", "$DNGDecodeDelegateDefault")
3305 AC_PATH_PROG(DOCDecodeDelegate, "$DOCDecodeDelegateDefault", "$DOCDecodeDelegateDefault")
3306 AC_PATH_PROG(DVIDecodeDelegate, "$DVIDecodeDelegateDefault", "$DVIDecodeDelegateDefault")
3307 AC_PATH_PROG(ConvertDelegate, "$ConvertDelegateDefault", "$ConvertDelegateDefault")
3308 AC_PATH_PROG(DisplayDelegate, "$DisplayDelegateDefault", "$DisplayDelegateDefault")
3309 AC_PATH_PROG(EchoDelegate, "$EchoDelegateDefault", "$EchoDelegateDefault")
3310 AC_PATH_PROG(EditorDelegate, "$EditorDelegateDefault", "$EditorDelegateDefault")
3311 AC_PATH_PROG(GnuplotDecodeDelegate, "$GnuplotDecodeDelegateDefault", "$GnuplotDecodeDelegateDefault")
3312 AC_PATH_PROG(GVCDecodeDelegate, "$GVCDecodeDelegateDefault", "$GVCDecodeDelegateDefault")
3313 AC_PATH_PROG(HPGLDecodeDelegate, "$HPGLDecodeDelegateDefault", "$HPGLDecodeDelegateDefault")
3314 AC_PATH_PROG(HTMLDecodeDelegate, "$HTMLDecodeDelegateDefault", "$HTMLDecodeDelegateDefault")
3315 AC_PATH_PROG(ILBMDecodeDelegate, "$ILBMDecodeDelegateDefault", "$ILBMDecodeDelegateDefault")
3316 AC_PATH_PROG(ILBMEncodeDelegate, "$ILBMEncodeDelegateDefault", "$ILBMEncodeDelegateDefault")
3317 AC_PATH_PROG(JXRDecodeDelegate, "$JXRDecodeDelegateDefault", "$JXRDecodeDelegateDefault")
3318 AC_PATH_PROG(JXREncodeDelegate, "$JXREncodeDelegateDefault", "$JXREncodeDelegateDefault")
3319 AC_PATH_PROG(LPDelegate, "$LPDelegateDefault", no)
3320 AC_PATH_PROG(LPRDelegate, "$LPRDelegateDefault", "$LPRDelegateDefault")
3321 AC_PATH_PROG(LaunchDelegate, "$LaunchDelegateDefault", "$LaunchDelegateDefault")
3322 AC_PATH_PROG(MANDelegate, "$MANDelegateDefault", "$MANDelegateDefault")
3323 AC_PATH_PROG(MogrifyDelegate, "$MogrifyDelegateDefault", "$MogrifyDelegateDefault")
3324 AC_PATH_PROG(MPEGDecodeDelegate, "$MPEGDecodeDelegateDefault", "$MPEGDecodeDelegateDefault")
3325 if test "$MPEGDecodeDelegate" = "$MPEGDecodeDelegateDefault" ; then
3326 MPEGDecodeDelegateDefault='ffmpeg'
3327 AC_PATH_PROG(MPEGDecodeDelegate, "$MPEGDecodeDelegateDefault", "$MPEGDecodeDelegateDefault")
3329 AC_PATH_PROG(MPEGEncodeDelegate, "$MPEGEncodeDelegateDefault", "$MPEGEncodeDelegateDefault")
3330 if test "$MPEGEncodeDelegate" = "$MPEGEncodeDelegateDefault" ; then
3331 MPEGEncodeDelegateDefault='ffmpeg'
3332 AC_PATH_PROG(MPEGEncodeDelegate, "$MPEGEncodeDelegateDefault", "$MPEGEncodeDelegateDefault")
3334 AC_PATH_PROG(MrSIDDecodeDelegate, "$MrSIDDecodeDelegateDefault", "$MrSIDDecodeDelegateDefault")
3335 AC_PATH_PROG(MVDelegate, "$MVDelegateDefault", "$MVDelegateDefault")
3336 AC_PATH_PROG(PCLDelegate, "$PCLDelegateDefault", "$PCLDelegateDefault")
3337 AC_PATH_PROG(PGPDecodeDelegate, "$PGPDecodeDelegateDefault", "$PGPDecodeDelegateDefault")
3338 AC_PATH_PROG(POVDelegate, "$POVDelegateDefault", "$POVDelegateDefault")
3339 AC_PATH_PROGS(PSDelegate, gsx gsc "$PSDelegateDefault", "$PSDelegateDefault")
3340 AC_PATH_PROG(RLEEncodeDelegate, "$RLEEncodeDelegateDefault", "$RLEEncodeDelegateDefault")
3341 AC_PATH_PROG(RMDelegate, "$RMDelegateDefault", "$RMDelegateDefault")
3342 AC_PATH_PROG(RSVGDecodeDelegate, "$RSVGDecodeDelegateDefault", "$RSVGDecodeDelegateDefault")
3343 AC_PATH_PROG(SCANDecodeDelegate, "$SCANDecodeDelegateDefault", "$SCANDecodeDelegateDefault")
3344 AC_PATH_PROG(SVGDecodeDelegate, "$SVGDecodeDelegateDefault", "$SVGDecodeDelegateDefault")
3345 AC_PATH_PROG(TXTDelegate, "$TXTDelegateDefault", "$TXTDelegateDefault")
3346 AC_PATH_PROG(UniconvertorDelegate, "$UniconvertorDelegateDefault", "$UniconvertorDelegateDefault")
3347 AC_PATH_PROG(WebPDecodeDelegate, "$WebPDecodeDelegateDefault", "$WebPDecodeDelegateDefault")
3348 AC_PATH_PROG(WebPEncodeDelegate, "$WebPEncodeDelegateDefault", "$WebPEncodeDelegateDefault")
3349 AC_PATH_PROG(WMFDecodeDelegate, "$WMFDecodeDelegateDefault", "$WMFDecodeDelegateDefault")
3350 AC_PATH_PROG(WWWDecodeDelegate, "$WWWDecodeDelegateDefault", "$WWWDecodeDelegateDefault")
3351 AC_PATH_PROG(XPSDelegate, "$XPSDelegateDefault", "$XPSDelegateDefault")
3352 AC_PATH_PROG(ZipDelegate, "$ZipDelegateDefault", "$ZipDelegateDefault")
3354 # Prefer lpr to lp; lp needs options tacked on.
3355 if test "$LPRDelegate" != no; then
3356 PrintDelegate="$LPRDelegate"
3358 PrintDelegate="$LPDelegate -c -s"
3360 AC_SUBST(PrintDelegate)
3362 # Installed ImageMagick utiltity paths
3363 ConvertDelegate="${BIN_DIR}/${ConvertDelegateDefault}"
3364 DisplayDelegate="${BIN_DIR}/${DisplayDelegateDefault}"
3365 MogrifyDelegate="${BIN_DIR}/${MogrifyDelegateDefault}"
3367 # Set delegate booleans
3368 have_avconv='no'; if test "$MPEGDecodeDelegate" != "$MPEGDecodeDelegateDefault" ; then have_avconv='yes'; fi
3369 have_gs='no' ; if test "$PSDelegate" != "$PSDelegateDefault"; then have_gs='yes'; fi
3370 have_hp2xx='no' ; if test "$HPGLDecodeDelegate" != "$HPGLDecodeDelegateDefault" ; then have_hp2xx='yes'; fi
3371 have_ilbmtoppm='no' ; if test "$ILBMDecodeDelegate" != "$ILBMDecodeDelegateDefault" ; then have_ilbmtoppm='yes'; fi
3372 have_mrsid='no'; if test "$MrSIDDecodeDelegate" != "$MrSIDDecodeDelegateDefault" ; then have_mrsid='yes'; fi
3373 have_pcl='no' ; if test "$PCLDelegate" != "$PCLDelegateDefault"; then have_pcl='yes'; fi
3374 have_ppmtoilbm='no' ; if test "$ILBMEncodeDelegate" != "$ILBMEncodeDelegateDefault" ; then have_ppmtoilbm='yes'; fi
3375 have_xps='no' ; if test "$XPSDelegate" != "$XPSDelegateDefault"; then have_xps='yes'; fi
3378 # Test for font directories
3380 type_include_files=''
3383 AC_MSG_CHECKING(for Apple fonts directory)
3385 if test "${with_apple_font_dir}" != 'default'; then
3386 apple_font_dir="${with_apple_font_dir}/"
3388 for font_dir in '/Library/Fonts/'; do
3389 if test -f "${font_dir}Arial.ttf"; then
3390 apple_font_dir="${font_dir}"
3395 if test "${apple_font_dir}x" != 'x'; then
3396 type_include_files="${type_include_files} "'<include file="type-apple.xml" />'
3397 AC_MSG_RESULT([$apple_font_dir])
3399 AC_MSG_RESULT([not found!]);
3401 AC_SUBST(apple_font_dir)
3404 AC_MSG_CHECKING(for Dejavu fonts directory)
3406 if test "${with_dejavu_font_dir}" != 'default'; then
3407 dejavu_font_dir="${with_dejavu_font_dir}/"
3409 for font_dir in "${prefix}/share/dejavu/fonts/" '/usr/share/fonts/dejavu/'; do
3410 if test -f "${font_dir}DejaVuSerif.ttf"; then
3411 dejavu_font_dir="${font_dir}"
3416 if test "${dejavu_font_dir}x" != 'x'; then
3417 type_include_files="${type_include_files} "'<include file="type-dejavu.xml" />'
3418 AC_MSG_RESULT([$dejavu_font_dir])
3420 AC_MSG_RESULT([not found!]);
3422 AC_SUBST(dejavu_font_dir)
3425 AC_MSG_CHECKING(for Ghostscript fonts directory)
3426 ghostscript_font_dir=''
3427 if test "${with_gs_font_dir}" != 'default'; then
3428 ghostscript_font_dir="${with_gs_font_dir}/"
3430 if test "${native_win32_build}" = 'yes'; then
3431 # Native Windows Build
3432 for font_dir in "c:\\Program Files\\gs\\fonts\\" "c:\\Program Files \(x86\)\\gs\\fonts\\" "c:\\gs\\fonts\\"; do
3433 if test -f "${font_dir}a010013l.pfb"; then
3434 ghostscript_font_dir="$font_dir"
3438 if test "${PSDelegate}" != 'gswin32c'; then
3439 ghostscript_font_dir=`echo "${PSDelegate}" | sed -e 's:/gs/.*:/gs:;s:^/::;s/./&:/;s:/:\\\\:g'`"\\fonts\\"
3442 # Linux / Mac OS X / Unix Build
3443 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
3444 if test -f "${font_dir}a010013l.pfb"; then
3445 ghostscript_font_dir="${font_dir}"
3449 if test "${ghostscript_font_dir}x" = 'x'; then
3450 if test "$PSDelegate" != 'gs'; then
3451 ghostscript_font_dir=`echo "$PSDelegate" | sed -e 's:/bin/gs:/share/ghostscript/fonts:'`"/"
3456 if test "${ghostscript_font_dir}x" != 'x'; then
3457 type_include_files="${type_include_files} "'<include file="type-ghostscript.xml" />'
3458 AC_MSG_RESULT([$ghostscript_font_dir])
3460 AC_MSG_RESULT([not found!]);
3462 AC_SUBST(ghostscript_font_dir)
3463 case "${build_os}" in
3465 PSDelegate=`$WinPathScript "$PSDelegate" 1`
3470 AC_MSG_CHECKING(for Windows fonts directory)
3472 if test "${with_windows_font_dir}" != 'default'; then
3473 windows_font_dir="${with_windows_font_dir}/"
3475 for font_dir in '/usr/X11R6/lib/X11/fonts/truetype/' '/usr/X11R7/lib/X11/fonts/truetype/' '/usr/share/fonts/msttcore/'; do
3476 if test -f "${font_dir}arial.ttf"; then
3477 windows_font_dir="${font_dir}"
3482 if test "${windows_font_dir}x" != 'x'; then
3483 type_include_files="${type_include_files} "'<include file="type-windows.xml" />'
3484 AC_MSG_RESULT([$windows_font_dir])
3486 AC_MSG_RESULT([not found!]);
3488 AC_SUBST(windows_font_dir)
3490 AC_SUBST(type_include_files)
3493 # Handle case where user doesn't want frozen paths
3495 if test "$with_frozenpaths" != 'yes'; then
3496 # Re-set delegate definitions to default (no paths)
3497 AutotraceDecodeDelegate="$AutotraceDecodeDelegateDefault"
3498 BlenderDecodeDelegate="$BlenderDecodeDelegateDefault"
3499 BZIPDelegate="$BZIPDelegateDefault"
3500 BrowseDelegate="$BrowseDelegateDefault"
3501 CatDelegate="$CatDelegateDefault"
3502 ConvertDelegate="$ConvertDelegateDefault"
3503 DisplayDelegate="$DisplayDelegateDefault"
3504 DNGDecodeDelegate="$DNGDecodeDelegateDefault"
3505 DOCDecodeDelegate="$DOCDecodeDelegateDefault"
3506 DVIDecodeDelegate="$DVIDecodeDelegateDefault"
3507 EchoDelegate="$EchoDelegateDefault"
3508 EditorDelegate="$EditorDelegateDefault"
3509 GnuplotDecodeDelegate="$GnuplotDecodeDelegateDefault"
3510 GVCDecodeDelegate="$GVCDecodeDelegateDefault"
3511 HPGLDecodeDelegate="$HPGLDecodeDelegateDefault"
3512 HTMLDecodeDelegate="$HTMLDecodeDelegateDefault"
3513 ILBMDecodeDelegate="$ILBMDecodeDelegateDefault"
3514 ILBMEncodeDelegate="$ILBMEncodeDelegateDefault"
3515 JXRDecodeDelegate="$JXRDecodeDelegateDefault"
3516 JXREncodeDelegate="$JXREncodeDelegateDefault"
3517 LPDelegate="$LPDelegateDefault"
3518 LaunchDelegate="$LaunchDelegateDefault"
3519 MANDelegate="$MANDelegateDefault"
3520 MPEGDecodeDelegate="$MPEGDecodeDelegateDefault"
3521 MPEGEncodeDelegate="$MPEGEncodeDelegateDefault"
3522 MogrifyDelegate="$MogrifyDelegateDefault"
3523 MrSIDDecodeDelegate="$MrSIDDecodeDelegateDefault"
3524 MVDelegate="$MVDelegateDefault"
3525 PCLDelegate="$PCLDelegateDefault"
3526 PGPDecodeDelegate="$PGPDecodeDelegateDefault"
3527 POVDelegate="$POVDelegateDefault"
3528 PSDelegate="$PSDelegateDefault"
3529 RLEEncodeDelegate="$RLEEncodeDelegateDefault"
3530 RMDelegate="$RMDelegateDefault"
3531 RSVGDecodeDelegate="$RSVGDecodeDelegateDefault"
3532 SCANDecodeDelegate="$SCANDecodeDelegateDefault"
3533 SVGDecodeDelegate="$SVGDecodeDelegateDefault"
3534 ShowImageDelegate="$ShowImageDelegateDefault"
3535 TXTDelegate="$TXTDelegateDefault"
3536 UniconvertorDelegate="$UniconvertorDelegateDefault"
3537 WebPDecodeDelegate="$WebPDecodeDelegateDefault"
3538 WebPEncodeDelegate="$WebPEncodeDelegateDefault"
3539 WMFDecodeDelegate="$WMFDecodeDelegateDefault"
3540 WWWDecodeDelegate="$WWWDecodeDelegateDefault"
3541 XPSDelegate="$XPSDelegateDefault"
3542 ZipDelegate="$ZipDelegateDefault"
3545 # Delegate substitutions
3546 AC_SUBST(AutotraceDecodeDelegate)
3547 AC_SUBST(BlenderDecodeDelegate)
3548 AC_SUBST(BZIPDelegate)
3549 AC_SUBST(BrowseDelegate)
3550 AC_SUBST(CatDelegate)
3551 AC_SUBST(ConvertDelegate)
3552 AC_SUBST(GVCDecodeDelegate)
3553 AC_SUBST(DVIDecodeDelegate)
3554 AC_SUBST(EchoDelegate)
3555 AC_SUBST(EditorDelegate)
3556 AC_SUBST(GnuplotDecodeDelegate)
3557 AC_SUBST(HPGLDecodeDelegate)
3558 AC_SUBST(HTMLDecodeDelegate)
3559 AC_SUBST(ILBMDecodeDelegate)
3560 AC_SUBST(ILBMEncodeDelegate)
3561 AC_SUBST(JXRDecodeDelegate)
3562 AC_SUBST(JXREncodeDelegate)
3563 AC_SUBST(LPDelegate)
3564 AC_SUBST(LaunchDelegate)
3565 AC_SUBST(MANDelegate)
3566 AC_SUBST(MPEGDecodeDelegate)
3567 AC_SUBST(MPEGEncodeDelegate)
3568 AC_SUBST(MogrifyDelegate)
3569 AC_SUBST(MrSIDDecodeDelegate)
3570 AC_SUBST(MVDelegate)
3571 AC_SUBST(PCLDelegate)
3572 AC_SUBST(PGPDecodeDelegate)
3573 AC_SUBST(POVDelegate)
3574 AC_SUBST(PSDelegate)
3575 AC_SUBST(RLEEncodeDelegate)
3576 AC_SUBST(RMDelegate)
3577 AC_SUBST(SCANDecodeDelegate)
3578 AC_SUBST(ShowImageDelegate)
3579 AC_SUBST(TXTDelegate)
3580 AC_SUBST(UniconvertorDelegate)
3581 AC_SUBST(WMFDecodeDelegate)
3582 AC_SUBST(WebPDecodeDelegate)
3583 AC_SUBST(WebPEncodeDelegate)
3584 AC_SUBST(WWWDecodeDelegate)
3585 AC_SUBST(XPSDelegate)
3586 AC_SUBST(ZipDelegate)
3592 AC_CHECK_PROGS(TAR,gnutar gtar tar)
3593 AC_CHECK_PROGS(PERL,perl)
3594 AC_CHECK_PROGS(RPM,rpmbuild rpm)
3595 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
3596 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
3597 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
3598 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
3600 AM_CONDITIONAL(RPM_DELEGATE, test "x$RPM" != "x" )
3603 # 7ZIP support (http://p7zip.sourceforge.net/)
3606 AC_CHECK_PROGS(P7ZIP,[7za])
3608 AM_CONDITIONAL(P7ZIP_DELEGATE, test "x$P7ZIP" != "x" )
3611 # ZIP support (http://www.info-zip.org/Zip.html)
3614 AC_CHECK_PROGS(ZIP,[zip])
3616 AM_CONDITIONAL(ZIP_DELEGATE, test "x$ZIP" != "x" )
3619 # GhostPCL related configuration.
3621 PCLColorDevice=ppmraw
3622 PCLCMYKDevice=pamcmyk32
3623 PCLMonoDevice=pbmraw
3624 if test -z "$PCLVersion"; then
3625 PCLVersion='unknown'
3627 if test $have_pcl = 'yes'; then
3628 AC_MSG_RESULT([-------------------------------------------------------------])
3629 AC_MSG_CHECKING([for PCL])
3632 AC_MSG_CHECKING([for pcl color device])
3633 if $PCLDelegate -dBATCH -sDEVICE=$PCLColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3636 PCLColorDevice=ppmraw
3638 AC_MSG_RESULT([$PCLColorDevice])
3641 AC_MSG_CHECKING([for pcl CMYK device])
3642 if $PCLDelegate -dBATCH -sDEVICE=$PCLColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3645 PCLCMYKDevice=$PCLColorDevice
3647 AC_MSG_RESULT([$PCLCMYKDevice])
3650 AC_MSG_CHECKING([for pcl mono device])
3651 if $PCLDelegate -dBATCH -sDEVICE=$PCLMonoDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3654 PCLMonoDevice=$PCLColorDevice
3656 AC_MSG_RESULT([$PCLMonoDevice])
3659 AC_SUBST(PCLMonoDevice)
3660 AC_SUBST(PCLColorDevice)
3661 AC_SUBST(PCLCMYKDevice)
3662 AC_SUBST(PCLVersion)
3665 # GhostXPS related configuration.
3667 XPSColorDevice=ppmraw
3668 XPSCMYKDevice=bmpsep8
3669 XPSMonoDevice=pbmraw
3670 if test -z "$XPSVersion"; then
3671 XPSVersion='unknown'
3673 if test $have_xps = 'yes'; then
3674 AC_MSG_RESULT([-------------------------------------------------------------])
3675 AC_MSG_CHECKING([for XPS])
3678 AC_MSG_CHECKING([for xps color device])
3679 if $XPSDelegate -dBATCH -sDEVICE=$XPSColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3682 XPSColorDevice=ppmraw
3684 AC_MSG_RESULT([$XPSColorDevice])
3687 AC_MSG_CHECKING([for xps CMYK device])
3688 if $XPSDelegate -dBATCH -sDEVICE=$XPSColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3691 XPSCMYKDevice=$XPSColorDevice
3693 AC_MSG_RESULT([$XPSCMYKDevice])
3696 AC_MSG_CHECKING([for xps mono device])
3697 if $XPSDelegate -dBATCH -sDEVICE=$XPSMonoDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3700 XPSMonoDevice=$XPSColorDevice
3702 AC_MSG_RESULT([$XPSMonoDevice])
3705 AC_SUBST(XPSMonoDevice)
3706 AC_SUBST(XPSColorDevice)
3707 AC_SUBST(XPSCMYKDevice)
3708 AC_SUBST(XPSVersion)
3711 # Ghostscript related configuration.
3713 GSAlphaDevice=pngalpha
3714 GSColorDevice=pnmraw
3717 GSPDFDevice=pdfwrite
3719 GSEPSDevice=epswrite
3721 if test $have_gs = 'yes'; then
3722 AC_MSG_RESULT([-------------------------------------------------------------])
3723 AC_MSG_CHECKING([for Ghostscript])
3725 AC_MSG_CHECKING([for Ghostscript version])
3726 if GSVersion=`$PSDelegate --version`; then
3729 GSVersion=`$PSDelegate --help | sed -e '1q' | awk '{ print $3 }'`
3731 AC_MSG_RESULT([$GSVersion])
3734 AC_MSG_CHECKING([for gs alpha device])
3735 if $PSDelegate -q -dBATCH -sDEVICE=$GSAlphaDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3738 GSAlphaDevice=pnmraw
3740 AC_MSG_RESULT([$GSAlphaDevice])
3743 AC_MSG_CHECKING([for gs color device])
3744 if $PSDelegate -q -dBATCH -sDEVICE=$GSColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3747 GSColorDevice=pnmraw
3749 AC_MSG_RESULT([$GSColorDevice])
3752 AC_MSG_CHECKING([for gs CMYK device])
3753 if $PSDelegate -q -dBATCH -sDEVICE=$GSCMYKDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3756 GSCMYKDevice=bmpsep8
3758 AC_MSG_RESULT([$GSCMYKDevice])
3761 AC_MSG_CHECKING([for gs mono device])
3762 if $PSDelegate -q -dBATCH -sDEVICE=$GSMonoDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3765 GSMonoDevice=$GSColorDevice
3767 AC_MSG_RESULT([$GSMonoDevice])
3770 AC_MSG_CHECKING([for gs PDF writing device])
3771 if $PSDelegate -q -dBATCH -sDEVICE=$GSPDFDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3774 GSPDFDevice=nodevice
3776 AC_MSG_RESULT([$GSPDFDevice])
3779 AC_MSG_CHECKING([for gs PS writing device])
3780 if $PSDelegate -q -dBATCH -sDEVICE=$GSPSDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3785 AC_MSG_RESULT([$GSPSDevice])
3788 AC_MSG_CHECKING([for gs EPS writing device])
3789 if $PSDelegate -q -dBATCH -sDEVICE=$GSEPSDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3792 GSEPSDevice=nodevice
3794 AC_MSG_RESULT([$GSEPSDevice])
3797 AC_SUBST(GSAlphaDevice)
3798 AC_SUBST(GSCMYKDevice)
3799 AC_SUBST(GSColorDevice)
3800 AC_SUBST(GSEPSDevice)
3801 AC_SUBST(GSMonoDevice)
3802 AC_SUBST(GSPDFDevice)
3803 AC_SUBST(GSPSDevice)
3807 # PerlMagick-related configuration
3810 # Look for PERL if PerlMagick requested
3811 # If name/path of desired PERL interpreter is specified, look for that one first
3813 if test "$with_perl" != 'no'; then
3814 AC_MSG_RESULT([-------------------------------------------------------------])
3815 AC_MSG_CHECKING([for Perl])
3817 if test "$with_perl" != 'yes'; then
3818 AC_CACHE_CHECK(for perl,ac_cv_path_PERL,ac_cv_path_PERL="$with_perl");
3819 PERL=$ac_cv_path_PERL
3821 have_perl="$ac_cv_path_PERL"
3823 AC_PATH_PROGS(PERL,perl perl5,)dnl
3824 if test "$ac_cv_path_PERL"; then
3825 have_perl="$ac_cv_path_PERL"
3830 if test "$with_perl" != 'yes' ; then
3831 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-perl=$with_perl "
3834 PERL_SUPPORTS_DESTDIR='no'
3836 with_perl_static='no'
3837 with_perl_dynamic='no'
3838 if test "$have_perl" != 'no'; then
3839 if test "$with_perl" != 'no' && test "$libtool_build_shared_libs" = 'no'; then
3840 with_perl_static='yes'
3842 if test "$with_perl" != 'no' && test "$libtool_build_shared_libs" = 'yes'; then
3843 with_perl_dynamic='yes'
3845 # Is PERL's MakeMaker new enough to support DESTDIR?
3846 AX_PROG_PERL_VERSION(5.8.1,[PERL_SUPPORTS_DESTDIR='yes'],[PERL_SUPPORTS_DESTDIR='no'])
3848 AM_CONDITIONAL(WITH_PERL, test "$have_perl" != 'no')
3849 AM_CONDITIONAL(WITH_PERL_STATIC, test $with_perl_static = 'yes')
3850 AM_CONDITIONAL(WITH_PERL_DYNAMIC, test $with_perl_dynamic = 'yes')
3851 AC_SUBST(PERL_SUPPORTS_DESTDIR)
3853 # Determine path to pick up MagickCore library from for use with building PerlMagick
3854 MAGICKCORE_PATH="${LIB_DIR}"
3855 if test $with_perl_static = 'yes'; then
3856 # Find out where libtool hides its uninstalled libraries (as libtool_objdir)
3857 libtool_objdir=$objdir
3859 # Linker search path to library, followed by -lMagickCore
3860 MAGICKCORE_PATH="${builddir}/MagickCore/${libtool_objdir}"
3862 AC_SUBST(MAGICKCORE_PATH)
3864 # Create a simple string containing format names for all delegate libraries.
3866 if test "$have_autotrace" = 'yes' ; then
3867 MAGICK_DELEGATES="$MAGICK_DELEGATES autotrace"
3869 if test "$have_bzlib" = 'yes' ; then
3870 MAGICK_DELEGATES="$MAGICK_DELEGATES bzlib"
3872 if test "$have_dps" = 'yes' ; then
3873 MAGICK_DELEGATES="$MAGICK_DELEGATES dps"
3875 if test "$have_djvu" = 'yes' ; then
3876 MAGICK_DELEGATES="$MAGICK_DELEGATES djvu"
3878 if test "$have_avconv" = 'yes' ; then
3879 MAGICK_DELEGATES="$MAGICK_DELEGATES mpeg"
3881 if test "$have_fftw" = 'yes' ; then
3882 MAGICK_DELEGATES="$MAGICK_DELEGATES fftw"
3884 if test "$have_fpx" = 'yes' ; then
3885 MAGICK_DELEGATES="$MAGICK_DELEGATES fpx"
3887 if test "$have_fontconfig" = 'yes' ; then
3888 MAGICK_DELEGATES="$MAGICK_DELEGATES fontconfig"
3890 if test "$have_freetype" = 'yes' ; then
3891 MAGICK_DELEGATES="$MAGICK_DELEGATES freetype"
3893 if test "$have_gslib" = 'yes' ; then
3894 MAGICK_DELEGATES="$MAGICK_DELEGATES gslib"
3896 if test "$have_jbig" = 'yes' ; then
3897 MAGICK_DELEGATES="$MAGICK_DELEGATES jbig"
3899 if test "$have_png$have_jpeg" = 'yesyes' ; then
3900 MAGICK_DELEGATES="$MAGICK_DELEGATES jng"
3902 if test "$have_jp2" = 'yes' ; then
3903 MAGICK_DELEGATES="$MAGICK_DELEGATES jp2"
3905 if test "$have_jpeg" = 'yes' ; then
3906 MAGICK_DELEGATES="$MAGICK_DELEGATES jpeg"
3908 if test "$have_lcms" = 'yes' || test "$have_lcms2" = 'yes' ; then
3909 MAGICK_DELEGATES="$MAGICK_DELEGATES lcms"
3911 if test "$have_lqr" = 'yes' ; then
3912 MAGICK_DELEGATES="$MAGICK_DELEGATES lqr"
3914 if test "$have_lzma" = 'yes' ; then
3915 MAGICK_DELEGATES="$MAGICK_DELEGATES lzma"
3917 if test "$have_openexr" = 'yes' ; then
3918 MAGICK_DELEGATES="$MAGICK_DELEGATES openexr"
3920 if test "$have_openjp2" = 'yes' ; then
3921 MAGICK_DELEGATES="$MAGICK_DELEGATES openjp2"
3923 if test "$have_pango" = 'yes' ; then
3924 MAGICK_DELEGATES="$MAGICK_DELEGATES pango"
3926 if test "$have_png" = 'yes' ; then
3927 MAGICK_DELEGATES="$MAGICK_DELEGATES png"
3930 if test "$have_dps" = 'yes' || \
3931 test "$have_gs" = 'yes' || \
3932 test "${native_win32_build}" = 'yes' ; then
3935 if test "$have_ps" = 'yes' ; then
3936 MAGICK_DELEGATES="$MAGICK_DELEGATES ps"
3938 if test "$have_ra_ppm" = 'yes' ; then
3939 MAGICK_DELEGATES="$MAGICK_DELEGATES rad"
3941 if test "$have_rsvg" = 'yes' ; then
3942 MAGICK_DELEGATES="$MAGICK_DELEGATES rsvg"
3944 if test "$have_tiff" = 'yes' ; then
3945 MAGICK_DELEGATES="$MAGICK_DELEGATES tiff"
3947 if test "$have_ttf" = 'yes' ; then
3948 MAGICK_DELEGATES="$MAGICK_DELEGATES ttf"
3950 if test "$have_webp" = 'yes' ; then
3951 MAGICK_DELEGATES="$MAGICK_DELEGATES webp"
3953 if test "$have_wmf" = 'yes' ; then
3954 MAGICK_DELEGATES="$MAGICK_DELEGATES wmf"
3956 if test "$have_x" = 'yes' ; then
3957 MAGICK_DELEGATES="$MAGICK_DELEGATES x"
3959 if test "$have_xml" = 'yes' ; then
3960 MAGICK_DELEGATES="$MAGICK_DELEGATES xml"
3962 if test "$have_zlib" = 'yes' ; then
3963 MAGICK_DELEGATES="$MAGICK_DELEGATES zlib"
3965 # Remove extraneous spaces from output variables (asthetic)
3966 MAGICK_DELEGATES=`echo $MAGICK_DELEGATES | sed -e 's/ */ /g'`
3967 MAGICK_FEATURES=`echo $MAGICK_FEATURES | sed -e 's/ */ /g'`
3968 AC_SUBST(MAGICK_DELEGATES)
3969 AC_SUBST(MAGICK_FEATURES)
3972 # Handle special compiler flags
3975 # Add '-p' if prof source profiling support enabled
3976 if test "$enable_prof" = 'yes'; then
3978 CXXFLAGS="-p $CXXFLAGS"
3979 LDFLAGS="-p $LDFLAGS"
3982 # Add '-pg' if gprof source profiling support enabled
3983 if test "$enable_gprof" = 'yes'; then
3984 CFLAGS="-pg $CFLAGS"
3985 CXXFLAGS="-pg $CXXFLAGS"
3986 LDFLAGS="-pg $LDFLAGS"
3989 # Add '-ftest-coverage -fprofile-arcs' if gcov source profiling support enabled
3990 # This is a gcc-specific feature
3991 if test "$enable_gcov" = 'yes'; then
3992 AC_CHECK_LIB(gcov,_gcov_init)
3993 AC_CHECK_LIB(gcov,__gcov_init)
3994 case "$target_os" in
3996 OSX_GCOV_LDFLAG="-Wl,-single_module"
4002 AC_SUBST(OSX_GCOV_LDFLAG)
4003 CFLAGS="-ftest-coverage -fprofile-arcs $CFLAGS"
4004 CXXFLAGS="-ftest-coverage -fprofile-arcs $CXXFLAGS"
4005 LDFLAGS="-ftest-coverage -fprofile-arcs $LDFLAGS"
4009 # Build library dependency list for libMagickCore
4012 if test "$build_modules" != 'no'; then
4013 MAGICK_DEP_LIBS="$USER_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 $JEMALLOC_LIBS $THREAD_LIBS"
4015 MAGICK_DEP_LIBS="$USER_LIBS $JBIG_LIBS $LCMS_LIBS $TIFF_LIBS $FREETYPE_LIBS $JPEG_LIBS $GS_LIBS $LQR_LIBS $PNG_LIBS $AUTOTRACE_LIBS $DJVU_LIBS $FFTW_LIBS $FPX_LIBS $FONTCONFIG_LIBS $WEBP_LIBS $WMF_LIBS $DPS_LIBS $XEXT_LIBS $XT_LIBS $IPC_LIBS $X11_LIBS $LZMA_LIBS $BZLIB_LIBS $OPENEXR_LIBS $OPENJPEG_LIBS $PANGO_LIBS $RSVG_LIBS $XML_LIBS $GVC_LIBS $ZLIB_LIBS $GDI32_LIBS $MATH_LIBS $GOMP_LIBS $CL_LIBS $UMEM_LIBS $JEMALLOC_LIBS $THREAD_LIBS"
4017 AC_SUBST(MAGICK_DEP_LIBS)
4020 # Remove extraneous spaces from output variables (asthetic)
4022 X_CFLAGS=`echo $X_CFLAGS | sed -e 's/ */ /g'`
4023 X_PRE_LIBS=`echo $X_PRE_LIBS | sed -e 's/ */ /g'`
4024 X_LIBS=`echo $X_LIBS | sed -e 's/ */ /g'`
4025 X_EXTRA_LIBS=`echo $X_EXTRA_LIBS | sed -e 's/ */ /g'`
4027 CC=`echo $CC | sed -e 's/ */ /g'`
4028 CFLAGS=`echo $CFLAGS | sed -e 's/ */ /g'`
4029 CPPFLAGS=`echo $CPPFLAGS | sed -e 's/ */ /g'`
4030 CXXFLAGS=`echo $CXXFLAGS | sed -e 's/ */ /g'`
4031 DISTCHECK_CONFIG_FLAGS=`echo $DISTCHECK_CONFIG_FLAGS | sed -e 's/ */ /g'`
4032 LDFLAGS=`echo $LDFLAGS | sed -e 's/ */ /g'`
4033 TESTED_LIBS=`echo $LIBS | sed -e 's/ */ /g'`
4034 MAGICK_DEP_LIBS=`echo $MAGICK_DEP_LIBS | sed -e 's/ */ /g'`
4035 #LIBS=`echo $LIBS | sed -e 's/ */ /g'`
4037 # Pass only user-provided LIBS as "global" libraries
4043 #AC_SUBST(X_PRE_LIBS)
4045 #AC_SUBST(X_EXTRA_LIBS)
4047 MAGICK_CFLAGS=$CFLAGS
4048 MAGICK_CXXFLAGS="$CXXFLAGS"
4049 MAGICK_CPPFLAGS=`echo $MAGICK_CPPFLAGS | sed -e 's/ */ /g'`
4050 MAGICK_PCFLAGS=`echo $MAGICK_PCFLAGS | sed -e 's/ */ /g'`
4051 MAGICK_LDFLAGS="-L$LIB_DIR $LDFLAGS"
4052 MAGICK_LIBS="$MAGICK_DEP_LIBS"
4054 AC_SUBST(MAGICK_CFLAGS)
4055 AC_SUBST(MAGICK_CXXFLAGS)
4056 AC_SUBST(MAGICK_CPPFLAGS)
4057 AC_SUBST(MAGICK_PCFLAGS)
4058 AC_SUBST(MAGICK_LDFLAGS)
4059 AC_SUBST(MAGICK_LIBS)
4061 # Set configured scripts to executable.
4062 AC_CONFIG_COMMANDS([default],[],[])
4063 AC_CONFIG_COMMANDS([magick.sh.in],[chmod +x magick.sh])
4064 AC_CONFIG_COMMANDS([MagickCore-config.in],[chmod +x MagickCore/MagickCore-config])
4065 AC_CONFIG_COMMANDS([MagickWand-config.in],[chmod +x MagickWand/MagickWand-config])
4066 AC_CONFIG_COMMANDS([Magick++-config.in],[chmod +x Magick++/bin/Magick++-config])
4067 AC_CONFIG_COMMANDS([PerlMagick/check.sh.in],[chmod +x PerlMagick/check.sh])
4069 AC_MSG_RESULT([-------------------------------------------------------------])
4070 AC_MSG_RESULT([Update ImageMagick configuration])
4073 rm -f magick-version
4075 result_dejavu_font_dir='none'
4076 if test "${dejavu_font_dir}x" != 'x'; then
4077 result_dejavu_font_dir=$dejavu_font_dir
4080 result_ghostscript_font_dir='none'
4081 if test "${ghostscript_font_dir}x" != 'x'; then
4082 result_ghostscript_font_dir=$ghostscript_font_dir
4085 result_windows_font_dir='none'
4086 if test "${windows_font_dir}x" != 'x'; then
4087 result_windows_font_dir=${windows_font_dir}
4091 ImageMagick is configured as follows. Please verify that this configuration
4092 matches your expectations.
4094 Host system type: $host
4095 Build system type: $build
4098 -------------------------------------------------------------------------------
4099 Shared libraries --enable-shared=$enable_shared $libtool_build_shared_libs
4100 Static libraries --enable-static=$enable_static $libtool_build_static_libs
4101 Module support --with-modules=$build_modules $build_modules
4102 GNU ld --with-gnu-ld=$with_gnu_ld $lt_cv_prog_gnu_ld
4103 Quantum depth --with-quantum-depth=$with_quantum_depth $with_quantum_depth
4104 High Dynamic Range Imagery
4105 --enable-hdri=$enable_hdri $enable_hdri
4107 Delegate Library Configuration:
4108 BZLIB --with-bzlib=$with_bzlib $have_bzlib
4109 Autotrace --with-autotrace=$with_autotrace $have_autotrace
4110 DJVU --with-djvu=$with_djvu $have_djvu
4111 DPS --with-dps=$with_dps $have_dps
4112 FFTW --with-fftw=$with_fftw $have_fftw
4113 FlashPIX --with-fpx=$with_fpx $have_fpx
4114 FontConfig --with-fontconfig=$with_fontconfig $have_fontconfig
4115 FreeType --with-freetype=$with_freetype $have_freetype
4116 Ghostscript lib --with-gslib=$with_gslib $have_gslib
4117 Graphviz --with-gvc=$with_gvc $have_gvc
4118 JBIG --with-jbig=$with_jbig $have_jbig
4119 JPEG v1 --with-jpeg=$with_jpeg $have_jpeg
4120 JPEG-2000 --with-jp2=$with_jp2 $have_jp2
4121 LCMS v1 --with-lcms=$with_lcms $have_lcms
4122 LCMS v2 --with-lcms2=$with_lcms2 $have_lcms2
4123 LIBJPEG2 --with-openjp2=$with_openjp2 $have_openjp2
4124 LQR --with-lqr=$with_lqr $have_lqr
4125 LTDL --with-ltdl=$with_ltdl $have_ltdl
4126 LZMA --with-lzma=$with_lzma $have_lzma
4127 Magick++ --with-magick-plus-plus=$with_magick_plus_plus $have_magick_plus_plus
4128 OpenEXR --with-openexr=$with_openexr $have_openexr
4129 PANGO --with-pango=$with_pango $have_pango
4130 PERL --with-perl=$with_perl $have_perl
4131 PNG --with-png=$with_png $have_png
4132 RSVG --with-rsvg=$with_rsvg $have_rsvg
4133 TIFF --with-tiff=$with_tiff $have_tiff
4134 WEBP --with-webp=$with_webp $have_webp
4135 WMF --with-wmf=$with_wmf $have_wmf
4136 X11 --with-x=$with_x $have_x
4137 XML --with-xml=$with_xml $have_xml
4138 ZLIB --with-zlib=$with_zlib $have_zlib
4140 Delegate Program Configuration:
4141 GhostPCL None $PCLDelegate ($PCLVersion)
4142 GhostXPS None $XPSDelegate ($XPSVersion)
4143 Ghostscript None $PSDelegate ($GSVersion)
4146 Apple fonts --with-apple-font-dir=$with_apple_font_dir $result_apple_font_dir
4147 Dejavu fonts --with-dejavu-font-dir=$with_dejavu_font_dir $result_dejavu_font_dir
4148 Ghostscript fonts --with-gs-font-dir=$with_gs_font_dir $result_ghostscript_font_dir
4149 Windows fonts --with-windows-font-dir=$with_windows_font_dir $result_windows_font_dir
4152 X_CFLAGS = $X_CFLAGS
4153 X_PRE_LIBS = $X_PRE_LIBS
4155 X_EXTRA_LIBS = $X_EXTRA_LIBS
4157 Options used to compile and link:
4158 PREFIX = $PREFIX_DIR
4159 EXEC-PREFIX = $EXEC_PREFIX_DIR
4160 VERSION = $PACKAGE_VERSION
4163 CPPFLAGS = $CPPFLAGS
4169 CXXFLAGS = $CXXFLAGS
4170 FEATURES = $MAGICK_FEATURES
4171 DELEGATES = $MAGICK_DELEGATES