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.
21 # Process this file with autoconf to create configure script.
24 # ==============================================================================
25 # ImageMagick release.
26 # ==============================================================================
27 m4_define([magick_major_version], [7])
28 m4_define([magick_minor_version], [0])
29 m4_define([magick_micro_version], [0])
30 m4_define([magick_patchlevel_version], [0])
31 m4_define([magick_version],
32 [magick_major_version.magick_minor_version.magick_micro_version-magick_patchlevel_version])
33 m4_define([magick_svn_revision], esyscmd([sh -c "(svnversion .) | awk '{ print \$1 }' | tr -d '\n'"]))
35 # ==============================================================================
37 # ==============================================================================
38 AC_INIT([ImageMagick],[magick_version],[http://www.imagemagick.org],[ImageMagick])
39 AC_CONFIG_SRCDIR([MagickCore/MagickCore.h])
40 AC_CONFIG_AUX_DIR([config])
41 AC_REQUIRE_AUX_FILE([tap-driver.sh])
42 AC_CONFIG_MACRO_DIR([m4])
43 AC_CONFIG_HEADERS([config/config.h])
44 AX_PREFIX_CONFIG_H([MagickCore/magick-baseconfig.h],[MagickCore])
47 AM_INIT_AUTOMAKE([1.12 nostdinc color-tests foreign parallel-tests silent-rules subdir-objects dist-bzip2 dist-lzip dist-xz dist-zip])
48 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
51 # Save initial user-tunable values
54 for var in CC CFLAGS CPPFLAGS CXX CXXCPP LDFLAGS LIBS ; do
55 eval isset=\${$var+set}
56 if test "$isset" = 'set'; then
58 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS}'${var}=${val}' "
61 AC_SUBST(DISTCHECK_CONFIG_FLAGS)
63 CONFIGURE_ARGS="$0 ${ac_configure_args}"
64 AC_SUBST(CONFIGURE_ARGS)
66 AC_ARG_ENABLE([reproducible-build],
67 [AC_HELP_STRING([--enable-reproducible-build],
68 [enable reproducible build])],
69 [enable_reproducible_build=$enableval],
70 [enable_reproducible_build='no'])
72 # Source file containing package/library versioning information.
73 . ${srcdir}/version.sh
75 echo "configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}${PACKAGE_VERSION_ADDENDUM}"
77 MAGICK_TARGET_CPU=$host_cpu
78 AC_SUBST(MAGICK_TARGET_CPU)
79 AC_DEFINE_UNQUOTED(MAGICK_TARGET_CPU,$MAGICK_TARGET_CPU,[Target Host CPU])
81 MAGICK_TARGET_VENDOR=$host_vendor
82 AC_SUBST(MAGICK_TARGET_VENDOR)
83 AC_DEFINE_UNQUOTED(MAGICK_TARGET_VENDOR,$MAGICK_TARGET_VENDOR,[Target Host Vendor])
85 MAGICK_TARGET_OS=$host_os
86 AC_SUBST(MAGICK_TARGET_OS)
87 AC_DEFINE_UNQUOTED(MAGICK_TARGET_OS,$MAGICK_TARGET_OS,[Target Host OS])
90 # Substitute versioning
91 AC_SUBST([MAGICK_MAJOR_VERSION],[magick_major_version])
92 AC_SUBST([MAGICK_MINOR_VERSION],[magick_minor_version])
93 AC_SUBST([MAGICK_MICRO_VERSION],[magick_micro_version])
94 AC_SUBST([MAGICK_PATCHLEVEL_VERSION],[magick_patchlevel_version])
95 AC_SUBST([MAGICK_VERSION],[magick_version])
96 AC_SUBST([MAGICK_SVN_REVISION],[magick_svn_revision])
98 # Substitute library versioning
99 AC_SUBST(MAGICK_LIBRARY_CURRENT)dnl
100 AC_SUBST(MAGICK_LIBRARY_REVISION)dnl
101 AC_SUBST(MAGICK_LIBRARY_AGE)dnl
102 AC_SUBST([MAGICK_LIBRARY_CURRENT_MIN],
103 [`expr $MAGICK_LIBRARY_CURRENT - $MAGICK_LIBRARY_AGE`])
104 AC_SUBST([MAGICK_LIBRARY_VERSION_INFO],
105 [$MAGICK_LIBRARY_CURRENT:$MAGICK_LIBRARY_REVISION:$MAGICK_LIBRARY_AGE])
107 AC_SUBST(MAGICKPP_LIBRARY_CURRENT)dnl
108 AC_SUBST(MAGICKPP_LIBRARY_REVISION)dnl
109 AC_SUBST(MAGICKPP_LIBRARY_AGE)dnl
110 AC_SUBST([MAGICKPP_LIBRARY_CURRENT_MIN],
111 [`expr $MAGICKPP_LIBRARY_CURRENT - $MAGICKPP_LIBRARY_AGE`])
112 AC_SUBST([MAGICKPP_LIBRARY_VERSION_INFO],
113 [$MAGICKPP_LIBRARY_CURRENT:$MAGICKPP_LIBRARY_REVISION:$MAGICKPP_LIBRARY_AGE])
115 AC_SUBST(PACKAGE_NAME)dnl
116 AC_SUBST(PACKAGE_VERSION)dnl
117 AC_SUBST(PACKAGE_PERL_VERSION)dnl
118 AC_SUBST(PACKAGE_RELEASE)dnl
119 AC_SUBST(PACKAGE_CHANGE_DATE)dnl
120 AC_SUBST(PACKAGE_LIB_VERSION)dnl
121 AC_SUBST(PACKAGE_LIB_VERSION_NUMBER)dnl
122 AS_IF([test X$enable_reproducible_build = Xyes],
123 [PACKAGE_RELEASE_DATE=$PACKAGE_RELEASE_DATE_REPRODUCIBLE],
124 [PACKAGE_RELEASE_DATE=$PACKAGE_RELEASE_DATE_RAW],
126 AC_SUBST(PACKAGE_RELEASE_DATE)dnl
128 AC_SUBST(PACKAGE_VERSION_ADDENDUM)dnl
130 # Ensure that make can run correctly
133 # versioning of library
134 MAGICK_LIB_VERSION="0x"
135 if test ${MAGICK_LIBRARY_CURRENT} -lt 10 ; then
136 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
138 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_CURRENT}
139 if test ${MAGICK_LIBRARY_AGE} -lt 10 ; then
140 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
142 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_AGE}
143 if test ${MAGICK_LIBRARY_REVISION} -lt 10 ; then
144 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
146 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_REVISION}
147 AC_SUBST(MAGICK_LIB_VERSION)
149 # Definition used to define MagickLibVersionText in version.h
150 MAGICK_LIB_VERSION_TEXT="${PACKAGE_VERSION}"
151 AC_SUBST(MAGICK_LIB_VERSION_TEXT)
153 # Definition used to define MagickLibVersionNumber in version.h
154 MAGICK_LIB_VERSION_NUMBER="${MAGICK_LIBRARY_CURRENT},${MAGICK_LIBRARY_AGE},${MAGICK_LIBRARY_REVISION}"
155 AC_SUBST(MAGICK_LIB_VERSION_NUMBER)
157 MAGICKPP_LIB_VERSION="0x"
158 if test ${MAGICKPP_LIBRARY_CURRENT} -lt 10 ; then
159 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}0
161 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}${MAGICKPP_LIBRARY_CURRENT}
162 if test ${MAGICKPP_LIBRARY_AGE} -lt 10 ; then
163 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}0
165 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}${MAGICKPP_LIBRARY_AGE}
166 if test ${MAGICKPP_LIBRARY_REVISION} -lt 10 ; then
167 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}0
169 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}${MAGICKPP_LIBRARY_REVISION}
170 AC_SUBST(MAGICKPP_LIB_VERSION)
172 # Definition used to define MagickLibVersionText in version.h
173 MAGICKPP_LIB_VERSION_TEXT="${PACKAGE_VERSION}"
174 AC_SUBST(MAGICKPP_LIB_VERSION_TEXT)
176 # Definition used to define MagickLibVersionNumber in version.h
177 MAGICK_LIB_VERSION_NUMBER="${MAGICK_LIBRARY_CURRENT},${MAGICK_LIBRARY_AGE},${MAGICK_LIBRARY_REVISION}"
178 AC_SUBST(MAGICK_LIB_VERSION_NUMBER)
182 # Regenerate config.status if ChangeLog or version.sh is updated.
183 AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/version.sh'])
188 MAGICK_CPPFLAGS=$CPPFLAGS_USER
189 MAGICK_PCFLAGS=$CPPFLAGS_USER
195 # Evaluate shell variable equivalents to Makefile directory variables
197 if test "x$prefix" = xNONE; then
198 prefix=$ac_default_prefix
200 # Let make expand exec_prefix.
201 if test "x$exec_prefix" = xNONE; then
202 exec_prefix='${prefix}'
206 eval "eval PREFIX_DIR=${prefix}"
208 eval "eval EXEC_PREFIX_DIR=${exec_prefix}"
209 AC_SUBST(EXEC_PREFIX_DIR)
210 eval "eval BIN_DIR=$bindir"
212 eval "eval SBIN_DIR=$sbindir"
214 eval "eval LIBEXEC_DIR=$libexecdir"
215 AC_SUBST(LIBEXEC_DIR)
216 eval "eval DATA_DIR=$datadir"
218 eval "eval DOC_DIR=$datadir/doc"
220 eval "eval SYSCONF_DIR=$sysconfdir"
221 AC_SUBST(SYSCONF_DIR)
222 eval "eval SHAREDSTATE_DIR=$sharedstatedir"
223 AC_SUBST(SHAREDSTATE_DIR)
224 eval "eval LOCALSTATE_DIR=$localstatedir"
225 AC_SUBST(LOCALSTATE_DIR)
226 eval "eval LIB_DIR=$libdir"
228 eval "eval INCLUDE_DIR=$includedir"
229 AC_SUBST(INCLUDE_DIR)
230 eval "eval PERSISTINCLUDE_DIR=$oldincludedir"
231 AC_SUBST(PERSISTINCLUDE_DIR)
232 eval "eval INFO_DIR=$infodir"
234 eval "eval MAN_DIR=$mandir"
237 # Get full paths to source and build directories
238 srcdirfull="`cd $srcdir && pwd`"
242 # Compute variables useful for running uninstalled software.
244 MAGICK_CODER_MODULE_PATH="${builddir}/coders"
245 MAGICK_CONFIGURE_SRC_PATH="${srcdirfull}/config"
246 MAGICK_CONFIGURE_BUILD_PATH="${builddir}/config"
247 MAGICK_FILTER_MODULE_PATH="${builddir}/filters"
249 case "${build_os}" in
251 MAGICK_CODER_MODULE_PATH=`$WinPathScript "${MAGICK_CODER_MODULE_PATH}" 0`
252 MAGICK_CONFIGURE_SRC_PATH=`$WinPathScript "${MAGICK_CONFIGURE_SRC_PATH}" 0`
253 MAGICK_CONFIGURE_BUILD_PATH=`$WinPathScript "${MAGICK_CONFIGURE_BUILD_PATH}" 0`
254 MAGICK_FILTER_MODULE_PATH=`$WinPathScript "${MAGICK_FILTER_MODULE_PATH}" 0`
263 AC_SUBST(MAGICK_CODER_MODULE_PATH)
264 AC_SUBST(MAGICK_CONFIGURE_SRC_PATH)
265 AC_SUBST(MAGICK_CONFIGURE_BUILD_PATH)
266 AC_SUBST(MAGICK_FILTER_MODULE_PATH)
271 # Enable OS features.
273 AC_USE_SYSTEM_EXTENSIONS
275 # ==============================================================================
276 # Find required base packages
277 # ==============================================================================
278 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
295 AX_GCC_ARCHFLAG([yes])
300 # Test for 64-bit build.
301 AC_CHECK_SIZEOF([size_t])
304 # The AX_CFLAGS_WARN_ALL macro doesn't currently work for sunpro
306 if test "$ax_cv_c_compiler_vendor" != "sun"; then
310 if test "x$GCC" = "xyes"; then
311 CFLAGS="$CFLAGS -fexceptions"
314 cat > local.exp <<EOF
315 set CC_FOR_TARGET "$CC"
319 # Check for linker script support
323 # Enable run-time checking.
325 AC_ARG_ENABLE([bounds-checking],
326 [AC_HELP_STRING([--enable-bounds-checking],
327 [enable run-time bounds-checking])],
328 [enable_bounds_checking=$enableval],
329 [enable_bounds_checking='no'])
331 if test "$enable_bounds_checking" = yes; then
332 AC_DEFINE([_FORTIFY_SOURCE], [2],
333 [enable run-time bounds-checking])
343 native_win32_build='no'
351 native_win32_build='yes'
355 if test "${GDI32_LIBS}x" != 'x'; then
356 AC_DEFINE(WINGDI32_DELEGATE,1,Define to use the Windows GDI32 library)
359 AM_CONDITIONAL(WINGDI32_DELEGATE, test "${GDI32_LIBS}x" != 'x' )
360 AM_CONDITIONAL(WIN32_NATIVE_BUILD, test "${native_win32_build}" = 'yes' )
361 AM_CONDITIONAL(CYGWIN_BUILD, test "${cygwin_build}" = 'yes' )
362 AM_CONDITIONAL(USING_CL, test "x${CC}" = 'xcl.exe' )
364 WinPathScript="${srcdirfull}/winpath.sh"
365 AC_SUBST(WinPathScript)
368 # Compiler flags tweaks
370 if test "${GCC}" != "yes"; then
373 # aCC: HP ANSI C++ B3910B A.03.34
374 CFLAGS="${CFLAGS} -Wp,-H30000"
375 if test -n "${CXXFLAGS}"; then
378 CXXFLAGS="${CXXFLAGS} -AA"
382 # Compaq alphaev68-dec-osf5.1 compiler
383 if test -n "${CXXFLAGS}"; then
384 CXXFLAGS='-std strict_ansi -noimplicit_include'
386 CXXFLAGS="${CXXFLAGS} -std strict_ansi -noimplicit_include"
391 # Check for lazy-loading.
392 AC_CACHE_CHECK([for linker lazyload option],[im_cv_ld_lazyload],
394 im_cv_ld_lazyload='none'
396 *-*-solaris2.8 | *-*-solaris2.9 | *-*-solaris2.1? )
397 if test "$lt_cv_prog_gnu_ld" != 'yes' ; then
398 im_cv_ld_lazyload='-Wl,-zlazyload'
403 if test "${im_cv_ld_lazyload}" != 'none' ; then
404 if test -z "${LDFLAGS}" ; then
405 LDFLAGS="${im_cv_ld_lazyload}"
407 LDFLAGS="${im_cv_ld_lazyload} ${LDFLAGS}"
411 dnl Platform-specific stuff
413 *darwin* | *-macos10*)
414 dnl Disable FORTIFY_SOURCE to fix a bug in LVVM / OpenMP support
415 CFLAGS="${CFLAGS} -D_FORTIFY_SOURCE=0"
416 dnl OS X universal binary support, requires --disable-dependency-tracking
417 AC_ARG_ENABLE([osx-universal-binary],
418 AC_HELP_STRING([--enable-osx-universal-binary],
419 [build universal binary on OS X [[default=no]]]),
420 [build_osxuniversal="${enableval}"], [build_osxuniversal=no])
422 if test "${build_osxuniversal}" != no ; then
423 if test "$enable_dependency_tracking" != no ; then
424 AC_MSG_ERROR([--enable-osx-universal-binary requires --disable-dependency-tracking.
425 Please re-run configure with these options:
426 --disable-dependency-tracking --enable-osx-universal-binary
429 CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
430 CXXFLAGS="$CXXFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
431 LDFLAGS="$LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
437 # ARCH specific include directory
439 AC_ARG_WITH([includearch-dir],
440 [AC_HELP_STRING([--includearch-dir=DIR],
441 [ARCH specific include directory])],
442 [includearch_dir=$withval],
443 [includearch_dir=$INCLUDE_DIR])
445 eval "eval INCLUDEARCH_DIR=$includearch_dir"
446 AC_SUBST(INCLUDEARCH_DIR)
449 # ARCH specific configuration directory
451 AC_ARG_WITH([sharearch-dir],
452 [AC_HELP_STRING([--sharearch-dir=DIR],
453 [ARCH specific config directory])],
454 [sharearch_dir=$withval],
455 [sharearch_dir="${LIB_DIR}"])
457 eval "eval SHAREARCH_DIR=$sharearch_dir"
458 AC_SUBST(SHAREARCH_DIR)
460 # Path to the pkgconfig folder
461 AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=DIR],
462 [Path to the pkgconfig directory @<:@LIBDIR/pkgconfig@:>@]),
463 [pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
464 AC_SUBST([pkgconfigdir])
467 # Enable support for threads
469 # Find Posix threads library
471 AC_ARG_WITH([threads],
472 [AC_HELP_STRING([--without-threads], [disable threads support])],
473 [with_threads=$withval],
474 [with_threads='yes'])
478 if test "$with_threads" != 'no'; then
480 if test "$ax_pthread_ok" = yes; then
482 DEF_THREAD="$PTHREAD_CFLAGS"
483 CFLAGS="$CFLAGS $DEF_THREAD"
484 CXXFLAGS="$CXXFLAGS $DEF_THREAD"
485 THREAD_LIBS="$PTHREAD_LIBS"
486 if test "$CC" != "$PTHREAD_CC"; then
487 AC_MSG_WARN([Replacing compiler $CC with compiler $PTHREAD_CC to support pthreads.])
490 AC_DEFINE(THREAD_SUPPORT,1,[Define if you have POSIX threads libraries and header files.])
493 LIBS="$LIBS $THREAD_LIBS"
494 AC_SUBST(THREAD_LIBS)
496 # Enable support for OpenMP
497 if test "$have_threads" != 'yes'; then
498 ac_cv_prog_c_openmp=unsupported
501 CFLAGS="$OPENMP_CFLAGS $CFLAGS"
502 MAGICK_PCFLAGS="$MAGICK_PCFLAGS $OPENMP_CFLAGS"
503 AC_SUBST(OPENMP_CFLAGS)
504 if test "$enable_openmp" != no; then
505 if test "$ac_cv_prog_c_openmp" != 'unsupported'; then
506 MAGICK_FEATURES="OpenMP $MAGICK_FEATURES"
510 # Enable support for OpenCL
512 CFLAGS="$CL_CFLAGS $CFLAGS"
513 CPPFLAGS="$CL_CFLAGS $CPPFLAGS"
514 LIBS="$CL_LIBS $LIBS"
516 if test "$enable_opencl" != no; then
517 if test "X$ax_cv_check_cl_libcl" != Xno; then :
518 MAGICK_FEATURES="OpenCL $MAGICK_FEATURES"
524 # Check for large file support
530 if test "$enable_largefile" != no; then
531 case $ac_cv_sys_file_offset_bits in
533 # nothing to do here as the host supports LFS fine
536 AC_MSG_CHECKING([for native large file support])
537 AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>
539 exit(!(sizeof(off_t) == 8));
541 [ac_cv_sys_file_offset_bits=64; AC_DEFINE(_FILE_OFFSET_BITS,64)
542 AC_MSG_RESULT([yes])],
543 [AC_MSG_RESULT([no])])
546 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
549 if test "$ac_cv_sys_large_files" != 'no'; then
550 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGE_FILES=1"
552 if test "$ac_cv_sys_largefile_source" != 'no'; then
553 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGEFILE_SOURCE=1"
556 AC_SUBST(LFS_CPPFLAGS)
562 AC_SUBST(LIBTOOL_DEPS)
564 # Check to see if building shared libraries
565 libtool_build_shared_libs='no'
566 if test "$enable_shared" = 'yes'; then
567 libtool_build_shared_libs='yes'
570 # Check to see if building static libraries
571 libtool_build_static_libs='no'
572 if test "$enable_static" = 'yes'; then
573 libtool_build_static_libs='yes'
576 AM_CONDITIONAL(WITH_SHARED_LIBS, test "${libtool_build_shared_libs}" = 'yes')
578 # Enable support for building loadable modules
581 AC_ARG_WITH([modules],
582 [AC_HELP_STRING([--with-modules],
583 [enable building dynamically loadable modules])],
584 [with_modules=$withval],
587 # Only allow building loadable modules if we are building shared libraries
588 if test "$with_modules" != 'no' ; then
589 if test "$libtool_build_shared_libs" = 'no'; then
590 AC_MSG_WARN([Modules may only be built if building shared libraries is enabled.])
596 if test "$build_modules" != 'no' ; then
597 AC_DEFINE(BUILD_MODULES,1,Define if coders and filters are to be built as modules.)
598 MAGICK_FEATURES="$MAGICK_FEATURES Modules"
600 AM_CONDITIONAL(WITH_MODULES, test "$build_modules" != 'no')
602 # Enable build using delegate libraries built in subdirectories rather than installed
603 # delegate libraries (bzlib fftw fpx gslib jp2 jbig jpeg lcms lzma png tiff ttf wmf xml zlib)
604 AC_ARG_ENABLE([delegate-build],
605 [AC_HELP_STRING([--enable-delegate-build],
606 [look for delegate libraries in build directory])],
607 [enable_delegate_build=$enableval],
608 [enable_delegate_build='no'])
610 AC_ARG_ENABLE([deprecated],
611 [AC_HELP_STRING([--disable-deprecated],
612 [exclude deprecated methods in MagickCore and MagickWand APIs])],
613 [enable_deprecated=$enableval],
614 [enable_deprecated='no'])
616 if test "$enable_deprecated" = 'yes'; then
617 AC_DEFINE(EXCLUDE_DEPRECATED,1,[exclude deprecated methods in MagickCore API])
619 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-deprecated "
622 # Build a version of ImageMagick which operates uninstalled.
623 # Used to build distributions located via MAGICK_HOME / executable path
624 AC_ARG_ENABLE([installed],
625 [AC_HELP_STRING([--disable-installed],
626 [Formally install ImageMagick under PREFIX])],
627 [enable_installed=$enableval],
628 [enable_installed='yes'])
630 if test "$enable_installed" = 'yes'; then
631 AC_DEFINE(INSTALLED_SUPPORT,1,[ImageMagick is formally installed under prefix])
633 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-installed "
636 # Permit enciphering and deciphering image pixels.
637 AC_ARG_ENABLE([cipher],
638 [AC_HELP_STRING([--disable-cipher],
639 [disable enciphering and deciphering image pixels])],
640 [enable_cipher=$enableval],
641 [enable_cipher='yes'])
643 if test "$enable_cipher" = 'yes'; then
644 AC_DEFINE(CIPHER_SUPPORT,1,[permit enciphering and deciphering image pixels])
645 MAGICK_FEATURES="Cipher $MAGICK_FEATURES"
648 # Build a zero-configuration version of ImageMagick.
649 AC_ARG_ENABLE([zero-configuration],
650 [AC_HELP_STRING([--enable-zero-configuration],
651 [enable self-contained, embeddable, zero-configuration ImageMagick])],
652 [enable_zero_configuration=$enableval],
653 [enable_zero_configuration='no'])
655 if test "$enable_zero_configuration" = 'yes'; then
656 AC_DEFINE(ZERO_CONFIGURATION_SUPPORT,1,[Build self-contained, embeddable, zero-configuration ImageMagick])
657 MAGICK_FEATURES="Zero-configuration $MAGICK_FEATURES"
660 # Build a high dynamic range version of ImageMagick.
661 AC_ARG_ENABLE([hdri],
662 [AC_HELP_STRING([--enable-hdri],
663 [accurately represent the wide range of intensity levels found in real scenes])],
664 [enable_hdri=$enableval],
668 if test "$enable_hdri" = 'yes'; then
670 magick_hdri_enable='1';
671 MAGICK_FEATURES="HDRI $MAGICK_FEATURES"
673 magick_hdri_enable='0'
675 AC_DEFINE_UNQUOTED(HDRI_ENABLE_OBSOLETE_IN_H,$magick_hdri_enable,[Whether hdri is enabled or not])
676 AC_SUBST(MAGICK_HDRI)dnl
677 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -DMAGICKCORE_HDRI_ENABLE=$magick_hdri_enable"
678 CFLAGS="$CFLAGS -DMAGICKCORE_HDRI_ENABLE=$magick_hdri_enable"
679 CPPFLAGS="$CPPFLAGS -DMAGICKCORE_HDRI_ENABLE=$magick_hdri_enable"
681 # Build a version of ImageMagick with assert statements.
682 AC_ARG_ENABLE([assert],
683 [AC_HELP_STRING([--disable-assert],
684 [disable assert() statements in build])],
685 [enable_assert=$enableval],
686 [enable_assert='yes'])
688 if test "$enable_assert" = 'no'; then
689 AC_DEFINE(NDEBUG,1,[Turn off assert statements])
692 # Don't emit "rebuild rules" for configure, Makefile.ins, etc.
695 # Enable hugepages support
696 AC_ARG_ENABLE([hugepages],
697 [AC_HELP_STRING([--enable-hugepages],
698 [enable 'huge pages' support])],
699 [enable_hugepages=$enableval],
700 [enable_hugepages='no'])
702 # Enable ccmalloc memory debugging support
703 AC_ARG_ENABLE([ccmalloc],
704 [AC_HELP_STRING([--enable-ccmalloc],
705 [enable 'ccmalloc' memory debug support])],
706 [enable_ccmalloc=$enableval],
707 [enable_ccmalloc='no'])
709 # Enable Electric Fence memory debugging support
710 AC_ARG_ENABLE([efence],
711 [AC_HELP_STRING([--enable-efence],
712 [enable 'efence' memory debug support])],
713 [enable_efence=$enableval],
714 [enable_efence='no'])
716 # Enable prof-based profiling support
717 AC_ARG_ENABLE([prof],
718 [AC_HELP_STRING([--enable-prof],
719 [enable 'prof' profiling support])],
720 [enable_prof=$enableval],
723 # Enable gprof-based profiling support
724 AC_ARG_ENABLE([gprof],
725 [AC_HELP_STRING([--enable-gprof],
726 [enable 'gprof' profiling support])],
727 [enable_gprof=$enableval],
730 # Enable gcov-based profiling support
731 AC_ARG_ENABLE([gcov],
732 [AC_HELP_STRING([--enable-gcov],
733 [enable 'gcov' profiling support])],
734 [enable_gcov=$enableval],
737 enable_profiling='no'
738 if test "$enable_prof" = 'yes' || test "$enable_gprof" = 'yes' || test "$enable_gcov" = 'yes'; then
739 enable_profiling='yes'
740 if test "$libtool_build_shared_libs" = 'yes'; then
741 echo "Warning: Can not profile code using shared libraries"
745 # Magick API method prefix
746 AC_ARG_WITH([method-prefix],
747 [AC_HELP_STRING([--with-method-prefix=PREFIX],
748 [prefix MagickCore API methods])],
749 [with_method_prefix=$withval],
750 [with_method_prefix='no'])
752 if test "$with_method_prefix" != 'no'; then
753 AC_DEFINE_UNQUOTED(NAMESPACE_PREFIX,$with_method_prefix,[Magick API method prefix])
754 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-method-prefix "
757 # Enable legacy support (default no)
758 AC_ARG_ENABLE(legacy-support,
759 [ --enable-legacy-support install legacy command-line utilities (default disabled)],
760 [with_legacy_support=$enableval],
761 [with_legacy_support='no'])
762 AM_CONDITIONAL(LEGACY_SUPPORT, test "$with_legacy_support" != 'no')
764 # Number of bits in a Quantum
765 AC_ARG_WITH([quantum-depth],
766 [AC_HELP_STRING([--with-quantum-depth=DEPTH],
767 [number of bits in a pixel quantum (default 16)])],
768 [with_quantum_depth=$withval],
769 [with_quantum_depth=16])
771 if test "$with_quantum_depth" != '8'; then
772 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-quantum-depth=$with_quantum_depth "
775 case "${with_quantum_depth}" in
780 * ) AC_MSG_ERROR("Pixel quantum depth must have value of 8, 16, 32, or 64") ;;
782 QUANTUM_DEPTH="$with_quantum_depth"
783 AC_DEFINE_UNQUOTED(QUANTUM_DEPTH_OBSOLETE_IN_H,$QUANTUM_DEPTH,[Number of bits in a pixel Quantum (8/16/32/64)])
784 AC_SUBST(QUANTUM_DEPTH)dnl
785 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -DMAGICKCORE_QUANTUM_DEPTH=$QUANTUM_DEPTH"
786 CFLAGS="$CFLAGS -DMAGICKCORE_QUANTUM_DEPTH=$QUANTUM_DEPTH"
787 CPPFLAGS="$CPPFLAGS -DMAGICKCORE_QUANTUM_DEPTH=$QUANTUM_DEPTH"
789 # define a lib suffix for abi purpose
790 MAGICK_ABI_SUFFIX="Q${QUANTUM_DEPTH}"
791 if test "$enable_hdri" = 'yes'; then
792 MAGICK_ABI_SUFFIX="Q${QUANTUM_DEPTH}${MAGICK_HDRI}"
794 AC_SUBST(MAGICK_ABI_SUFFIX)
796 # Set pixel cache threshold
798 [AC_HELP_STRING([--with-cache=THRESHOLD],
799 [set pixel cache threshhold in MB (default available memory)])],
800 [with_cache=$withval],
803 if test "$with_cache" != ''; then
804 AC_DEFINE_UNQUOTED(PixelCacheThreshold,$with_cache,[Pixel cache threshold in MB (defaults to available memory)])
805 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-cache=$with_cache "
808 # Disable/Enable support for full delegate paths
809 AC_ARG_WITH([frozenpaths],
810 [AC_HELP_STRING([--with-frozenpaths],
811 [freeze delegate paths])],
812 [with_frozenpaths=$withval],
813 [with_frozenpaths='no'])
815 # Enable build/install of Magick++
816 AC_ARG_WITH([magick-plus-plus],
817 [AC_HELP_STRING([--without-magick-plus-plus],
818 [disable build/install of Magick++])],
819 [with_magick_plus_plus=$withval],
820 [with_magick_plus_plus='yes'])
822 # Encode the this name into the shared library.
823 AC_ARG_WITH([package-release-name],
824 [AC_HELP_STRING([--with-package-release-name=NAME],
825 [encode this name into the shared library])],
826 [MAGICK_LT_RELEASE_OPTS="-release $withval"])
827 AC_SUBST(MAGICK_LT_RELEASE_OPTS)
829 # Disable build/install of PerlMagick.
831 [AC_HELP_STRING([--with-perl],
832 [enable build/install of PerlMagick])],
833 [with_perl=$withval],
836 # Options to pass when configuring PerlMagick
837 AC_ARG_WITH([perl-options],
838 [AC_HELP_STRING([--with-perl-options=OPTIONS],
839 [options to pass on command-line when generating PerlMagick build file])],
840 PERL_MAKE_OPTIONS=$withval)
841 AC_SUBST(PERL_MAKE_OPTIONS)
843 # Enable jemalloc, object-caching memory allocation library.
844 AC_ARG_WITH(jemalloc,
845 [ --with-jemalloc enable jemalloc memory allocation library support],
846 [with_jemalloc=$withval],
847 [with_jemalloc='no'])
848 if test "$with_jemalloc" != 'yes' ; then
849 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jemalloc=$with_jemalloc "
852 # Enable umem, object-caching memory allocation library.
854 [ --with-umem enable umem memory allocation library support],
855 [with_umem=$withval],
857 if test "$with_umem" != 'yes' ; then
858 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-umem=$with_umem "
862 # Specify path to shared libstdc++ if not in normal location
864 AC_ARG_WITH([libstdc],
865 [AC_HELP_STRING([--with-libstdc=DIR],
866 [ use libstdc++ in DIR (for GNU C++)])],
867 [with_libstdc=$withval],
870 if test "$with_libstdc" != ''; then
871 if test -d "$with_libstdc"; then
872 LIBSTDCLDFLAGS="-L$with_libstdc"
875 AC_SUBST(LIBSTDCLDFLAGS)
877 # Does gcc required -traditional?
878 AC_PROG_GCC_TRADITIONAL
882 # Set defines required to build DLLs and modules using MinGW
885 # These options are set for multi-thread DLL module build
886 # libMagickCore: _DLL _MAGICKMOD_ _MAGICKLIB_
888 # executable/Magick++: _DLL _MAGICKMOD_
889 MODULE_EXTRA_CPPFLAGS=''
890 LIBRARY_EXTRA_CPPFLAGS=''
891 if test "${native_win32_build}" = 'yes'; then
892 if test "${libtool_build_shared_libs}" = 'yes'; then
893 CPPFLAGS="$CPPFLAGS -D_DLL"
894 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_DLL"
895 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_DLL"
896 LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKLIB_"
897 if test "$build_modules" = 'yes'; then
898 LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKMOD_"
900 MODULE_EXTRA_CPPFLAGS="$MODULE_EXTRA_CPPFLAGS -D_MAGICKLIB_"
903 CPPFLAGS="$CPPFLAGS -D_LIB"
904 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_LIB"
905 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_LIB"
907 if test "$with_threads" = 'yes'; then
908 CPPFLAGS="$CPPFLAGS -D_MT"
909 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_MT"
910 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_MT"
913 AC_SUBST(MODULE_EXTRA_CPPFLAGS)
914 AC_SUBST(LIBRARY_EXTRA_CPPFLAGS)
916 # Check standard headers
918 if ! test x"$ac_cv_header_stdc" = x"yes"; then
919 AC_MSG_WARN([configure has detected that you do not have the ANSI standard C
920 header files. Compilation cannot proceed. Please install the ANSI C
921 headers and rerun this script.]);
926 # Check additional headers
927 AC_CHECK_HEADERS(arm/limits.h arpa/inet.h complex.h errno.h fcntl.h limits.h linux/unistd.h locale.h machine/param.h mach-o/dyld.h netinet/in.h OS.h process.h sun_prefetch.h stdarg.h sys/ipc.h sys/mman.h sys/resource.h sys/sendfile.h sys/socket.h sys/syslimits.h sys/time.h sys/timeb.h sys/times.h sys/wait.h wchar.h xlocale.h)
931 # Checks for typedefs, structures, and compiler characteristics.
945 # Checks for language qualifiers and semantics.
953 # If words are stored with the most significant byte first (like
954 # Motorola and SPARC CPUs), define `WORDS_BIGENDIAN'.
957 # Define to a suitable type, if standard headers do not define it.
965 AC_TYPE_LONG_DOUBLE_WIDER
966 AC_TYPE_LONG_LONG_INT
980 AC_TYPE_UNSIGNED_LONG_LONG_INT
982 AC_CHECK_TYPES([locale_t], [], [], [[#include <xlocale.h>]])
984 # Float_t and double_t are intended to be the the most efficient type.
985 AC_CHECK_TYPES([float_t], [], [], [[#include <math.h>]])
986 AC_CHECK_TYPES([double_t], [], [], [[#include <math.h>]])
987 AC_CHECK_SIZEOF([float_t], [], [[#include <math.h>]])
988 AC_CHECK_SIZEOF([double_t], [], [[#include <math.h>]])
990 # Get size of float, double and long double for comparaison.
991 AC_CHECK_SIZEOF([float])
992 AC_CHECK_SIZEOF([double])
993 AC_CHECK_SIZEOF([long double])
995 # Obtain size of an 'signed short' and define as SIZEOF_SIGNED_SHORT
996 AC_CHECK_SIZEOF(signed short)
998 # Obtain size of an 'unsigned short' and define as SIZEOF_UNSIGNED_SHORT
999 AC_CHECK_SIZEOF(unsigned short)
1001 # Obtain size of an 'signed int' and define as SIZEOF_SIGNED_INT
1002 AC_CHECK_SIZEOF(signed int)
1004 # Obtain size of an 'unsigned int' and define as SIZEOF_UNSIGNED_INT
1005 AC_CHECK_SIZEOF(unsigned int)
1007 # Obtain size of a 'signed long' and define as SIZEOF_SIGNED_LONG
1008 AC_CHECK_SIZEOF(signed long)
1010 # Obtain size of a 'unsigned long' and define as SIZEOF_UNSIGNED_LONG
1011 AC_CHECK_SIZEOF(unsigned long)
1013 # Obtain size of a 'long long' and define as SIZEOF_SIGNED_LONG_LONG. If
1014 # 'signed long long' is not supported then the value defined is zero.
1015 AC_CHECK_SIZEOF(signed long long)
1017 # Obtain size of a 'unsigned long long' and define as
1018 # SIZEOF_UNSIGNED_LONG_LONG. If 'unsigned long long' is not
1019 # supported then the value defined is zero.
1020 AC_CHECK_SIZEOF(unsigned long long)
1022 # Obtain size of off_t and define as SIZEOF_OFF_T
1023 AC_CHECK_SIZEOF(off_t)
1025 # Obtain size of size_t and define as SIZEOF_SIZE_T
1026 AC_CHECK_SIZEOF(size_t)
1028 # Obtain size of ssize_t and define as SIZEOF_SSIZE_T
1029 AC_CHECK_SIZEOF(ssize_t)
1031 # Obtain size of an unsigned int pointer and define as SIZEOF_UNSIGNED_INTP
1032 AC_CHECK_SIZEOF(unsigned int*)
1035 # Compute sized types for current CPU and compiler options.
1038 AC_MSG_CHECKING(for signed 8-bit type)
1039 INT8_T='signed char'
1040 AC_MSG_RESULT($INT8_T)
1043 AC_MSG_CHECKING(for unsigned 8-bit type)
1044 UINT8_T='unsigned char'
1045 AC_MSG_RESULT($UINT8_T)
1048 AC_MSG_CHECKING(for signed 16-bit type)
1049 INT16_T='signed short'
1050 AC_MSG_RESULT($INT16_T)
1053 AC_MSG_CHECKING(for unsigned 16-bit type)
1054 UINT16_T='unsigned short'
1055 AC_MSG_RESULT($UINT16_T)
1058 AC_MSG_CHECKING(for signed 32-bit type)
1061 if test $ac_cv_sizeof_signed_int -eq 4; then
1062 INT32_T='signed int'
1064 elif test $ac_cv_sizeof_signed_long -eq 4; then
1065 INT32_T='signed long'
1068 AC_MSG_RESULT($INT32_T)
1072 AC_MSG_CHECKING(for unsigned 32-bit type)
1075 if test $ac_cv_sizeof_unsigned_int -eq 4; then
1076 UINT32_T='unsigned int'
1078 elif test $ac_cv_sizeof_unsigned_long -eq 4; then
1079 UINT32_T='unsigned long'
1082 AC_MSG_RESULT($UINT32_T)
1086 AC_MSG_CHECKING(for signed 64-bit type)
1089 if test $ac_cv_sizeof_signed_long -eq 8; then
1090 INT64_T='signed long'
1092 elif test $ac_cv_sizeof_signed_long_long -eq 8; then
1093 INT64_T='signed long long'
1096 case "${host_os}" in
1101 AC_MSG_RESULT($INT64_T)
1105 AC_MSG_CHECKING(for unsigned 64-bit type)
1108 if test $ac_cv_sizeof_unsigned_long -eq 8; then
1109 UINT64_T='unsigned long'
1111 elif test $ac_cv_sizeof_unsigned_long_long -eq 8; then
1112 UINT64_T='unsigned long long'
1115 case "${host_os}" in
1120 AC_MSG_RESULT($UINT64_T)
1124 AC_MSG_CHECKING(for unsigned maximum type)
1127 if test "$UINT64_T" != 'none'; then
1130 elif test "$UINT32_T" != 'none'; then
1134 AC_MSG_RESULT($UINTMAX_T)
1138 AC_MSG_CHECKING(for pointer difference type)
1141 if test $ac_cv_sizeof_unsigned_long -eq $ac_cv_sizeof_unsigned_intp; then
1142 UINTPTR_T='unsigned long'
1144 elif test $ac_cv_sizeof_unsigned_long_long -eq $ac_cv_sizeof_unsigned_intp; then
1145 UINTPTR_T='unsigned long long'
1148 AC_MSG_RESULT($UINTPTR_T)
1152 AC_MSG_CHECKING([whether our compiler supports __func__])
1154 [{ const char *func = __func__; return(func != 0 ? 0 : 1); }],
1155 AC_MSG_RESULT([yes]),
1157 AC_MSG_CHECKING([whether our compiler supports __FUNCTION__])
1159 [{ const char *func = __FUNCTION__; return(func != 0 ? 0 : 1); }],
1160 AC_MSG_RESULT([yes])
1161 AC_DEFINE(__func__, __FUNCTION__,
1162 [Define to appropriate substitue if compiler does not have __func__]),
1164 AC_DEFINE(__func__, __FILE__,
1165 [Define to appropriate substitue if compiler does not have __func__])))
1169 # Check for functions
1172 AC_FUNC_CLOSEDIR_VOID
1176 AC_FUNC_SELECT_ARGTYPES
1177 AC_FUNC_SETVBUF_REVERSED
1187 AC_CHECK_LIB(m,sqrt,MATH_LIBS="-lm",,)
1188 LIBS="$MATH_LIBS $LIBS"
1192 # Find socket library
1194 AC_SEARCH_LIBS(gethostbyname, resolv nsl)
1195 AC_SEARCH_LIBS(socket, socket,
1197 AC_DEFINE([HAVE_SOCKET],[1],[Define to 1 if you have socket support.])
1198 MAGICK_FEATURES="DPC $MAGICK_FEATURES"
1201 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 sendfile 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])
1204 # Check for clock_gettime().
1206 AC_SEARCH_LIBS(clock_gettime, rt,
1208 AC_DEFINE([HAVE_CLOCK_GETTIME],[1],[Define to 1 if you have clock_gettime.])
1209 AC_MSG_CHECKING([whether clock_gettime supports CLOCK_REALTIME])
1212 [[#include <time.h>]],
1213 [[clockid_t clockType = CLOCK_REALTIME;]])],
1216 AC_DEFINE([HAVE_CLOCK_REALTIME],[1],
1217 [Define to 1 if clock_gettime supports CLOCK_REALTIME.])
1223 AC_CHECK_FUNCS([gettimeofday ftime], [break])
1229 # Check for function prototypes
1233 AC_CHECK_DECLS([pread, pwrite],[],[],[
1234 #include <unistd.h>])
1236 AC_CHECK_DECLS([strlcpy],[],[],[
1237 #include <strings.h>])
1239 AC_CHECK_DECLS([vsnprintf],[],[],[
1241 #include <stdarg.h>])
1245 # C++ Support Tests (For Magick++)
1248 have_magick_plus_plus='no'
1249 if test "$with_magick_plus_plus" = 'yes'; then
1254 # Full set of headers used...
1255 # algorithm cctype cerrno cmath cstdio cstdlib cstring ctime exception
1256 # functional iomanip iosfwd iostream iterator list string strstream utility
1261 AX_CXX_NAMESPACE_STD
1262 AC_CXX_HAVE_STD_LIBS
1266 AC_MSG_CHECKING([whether C++ compiler is sufficient for Magick++])
1268 test $ax_cv_cxx_bool = 'yes' && \
1269 test $ax_cv_cxx_namespaces = 'yes' && \
1270 test $ac_cv_cxx_have_std_libs = 'yes' && \
1271 test $ax_cv_cxx_have_std_namespace = 'yes'; then
1272 have_magick_plus_plus='yes'
1274 have_magick_plus_plus='no (failed tests)'
1276 AC_MSG_RESULT([$have_magick_plus_plus])
1279 AM_CONDITIONAL(WITH_MAGICK_PLUS_PLUS, test "$have_magick_plus_plus" = 'yes')
1281 # Only check for delegate libraries in subdirectories if requested.
1282 if test "$enable_delegate_build" != 'no'; then
1283 # Check for delegate sub-directories and add -I & -L options as required.
1284 # This presumes that delegates are installed as detailed in the ImageMagick
1285 # README. If delegates are installed in a standard location where the
1286 # compiler will automatically find them then these options should not be
1290 # Most delegates have includes in the same directory as the library, but not all...
1293 for dir in bzlib fftw fpx gslib/src jp2 jbig/libjbig jpeg lcms/include lzma magick openjp2/include png tiff/libtiff ttf/include wand webp/src wmf/include xml/include zlib; do
1294 if test -d "$builddir/$dir"; then
1295 CPPFLAGS="$CPPFLAGS -I$builddir/$dir"
1297 if test -d "$srcdirfull/$dir"; then
1298 CPPFLAGS="$CPPFLAGS -I$srcdirfull/$dir"
1304 for dir in bzlib fftw fpx gslib/src jbig/libjbig jpeg lcms/src lzma magick openjp2 png tiff/libtiff ttf/objs wand webp wmf/src xml zlib; do
1305 if test -d "$builddir/$dir/.libs"; then
1306 LDFLAGS="$LDFLAGS -L$builddir/$dir/.libs"
1308 if test -d "$srcdirfull/$dir/.libs"; then
1309 LDFLAGS="$LDFLAGS -L$srcdirfull/$dir/.libs"
1312 if test -d "$builddir/$dir"; then
1313 LDFLAGS="$LDFLAGS -L$builddir/$dir"
1315 if test -d "$srcdirfull/$dir"; then
1316 LDFLAGS="$LDFLAGS -L$srcdirfull/$dir"
1322 # Assume that delegate headers reside under same directory as ImageMagick
1323 # installation prefix.
1324 MAGICK_CPPFLAGS="-I$INCLUDE_DIR/${PACKAGE_NAME}-$MAGICK_MAJOR_VERSION $MAGICK_CPPFLAGS"
1327 # Find the X11 RGB database
1329 AC_CACHE_CHECK(for X11 configure files,im_cv_x_configure,
1330 [# Look for the header file in a standard set of common directories.
1331 # Check X11 before X11Rn because it is often a symlink to the current release.
1340 /usr/XFree86/lib/X11 \
1348 /usr/local/X11/lib \
1349 /usr/local/X11R4/lib \
1350 /usr/local/X11R5/lib \
1351 /usr/local/X11R6/lib \
1353 /usr/local/lib/X11 \
1354 /usr/local/lib/X11R4 \
1355 /usr/local/lib/X11R5 \
1356 /usr/local/lib/X11R6 \
1357 /usr/local/lib/X11R7 \
1358 /usr/local/x11r5/lib \
1359 /usr/lpp/Xamples/lib \
1361 /usr/openwin/share/lib \
1362 /usr/unsupported/lib \
1365 if test -f "$ac_dir/X11/rgb.txt"; then
1366 im_cv_x_configure="$ac_dir/X11/"
1368 elif test -f "$ac_dir/rgb.txt"; then
1369 im_cv_x_configure="$ac_dir/"
1374 X11_CONFIGURE_PATH="$im_cv_x_configure"
1375 case "${build_os}" in
1377 X11ConfigurePath=`$WinPathScript "$X11ConfigurePath=" 1`
1380 AC_DEFINE_UNQUOTED(X11_CONFIGURE_PATH,"$X11ConfigurePath",[Location of X11 configure files])
1383 # Find OpenMP library
1386 if test "$enable_openmp" != 'no'; then
1387 if test "${GCC}" = "yes"; then
1388 # Open64 (passes for GCC but uses different OpenMP implementation)
1389 if test "x$GOMP_LIBS" = x ; then
1390 if $CC --version 2>&1 | grep Open64 > /dev/null ; then
1391 AC_CHECK_LIB(openmp,omp_get_num_procs,GOMP_LIBS="-lopenmp",,)
1395 if test "x$GOMP_LIBS" = x ; then
1396 AC_CHECK_LIB(gomp,GOMP_parallel_start,GOMP_LIBS="-lgomp",,)
1400 if test "x$GOMP_LIBS" = x ; then
1401 AC_CHECK_LIB(mtsk,sunw_mp_register_warn,GOMP_LIBS="-lmtsk",,)
1404 if test "x$GOMP_LIBS" = x ; then
1405 AC_CHECK_LIB(xlsmp,_xlsmpFlush,GOMP_LIBS="-lxlsmp",,)
1407 # SGI IRIX 6.5 MIPSpro C/C++
1408 if test "x$GOMP_LIBS" = x ; then
1409 AC_CHECK_LIB(mp,mp_destroy,GOMP_LIBS="-lmp",,)
1412 LIBS="$GOMP_LIBS $LIBS"
1417 # Check for jemalloc.
1421 if test "$with_jemalloc" != 'no'; then
1422 AC_MSG_CHECKING(for JEMALLOC support )
1426 AC_CHECK_HEADER([jemalloc/jemalloc.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
1427 AC_CHECK_LIB(jemalloc,[malloc_stats_print],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
1428 AC_MSG_CHECKING(if jemalloc memory allocation library is complete)
1429 if test $passed -gt 0; then
1430 if test $failed -gt 0; then
1431 AC_MSG_RESULT(no -- some components failed test)
1432 have_jemalloc='no (failed tests)'
1434 JEMALLOC_LIBS='-ljemalloc'
1435 LIBS="$JEMALLOC_LIBS $LIBS"
1436 AC_DEFINE(HasJEMALLOC,1,Define if you have jemalloc memory allocation library)
1444 AM_CONDITIONAL(HasJEMALLOC, test "$have_jemalloc" = 'yes')
1445 AC_SUBST(JEMALLOC_LIBS)
1452 if test "$with_umem" != 'no'; then
1453 AC_MSG_CHECKING(for UMEM support )
1457 AC_CHECK_HEADER(umem.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1458 AC_CHECK_LIB(umem,umem_alloc,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1459 AC_CHECK_LIB(umem,umem_free,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1460 AC_MSG_CHECKING(if umem memory allocation library is complete)
1461 if test $passed -gt 0; then
1462 if test $failed -gt 0; then
1463 AC_MSG_RESULT(no -- some components failed test)
1464 have_umem='no (failed tests)'
1467 LIBS="$UMEM_LIBS $LIBS"
1468 AC_DEFINE(HasUMEM,1,Define if you have umem memory allocation library)
1476 AM_CONDITIONAL(HasUMEM, test "$have_umem" = 'yes')
1480 # Add support for ccmalloc memory debugging library if requested
1484 if test "$enable_ccmalloc" = 'yes'; then
1485 AC_PATH_PROG(CCMALLOCDelegate,ccmalloc,)
1486 if test -n "$CCMALLOCDelegate"; then
1487 eval `grep PREFIX= $CCMALLOCDelegate | sed -e 's/PREFIX/CCMALLOC_PREFIX/'`
1489 # Assume that gcc is used with ccmalloc.
1490 LIBS="$LIBS $CCMALLOC_PREFIX/lib/ccmalloc-gcc.o"
1491 AC_CHECK_LIB(ccmalloc,ccmalloc_malloc,CCMALLOC_LIBS="$CCMALLOC_PREFIX/lib/ccmalloc-gcc.o -lccmalloc -ldl",,-ldl)
1492 if test -n "$CCMALLOC_LIBS"; then
1494 LIBS="$LIBS $CCMALLOC_LIBS"
1503 # Add support for 'huge pages' if requested
1505 AS_IF([test "x$enable_hugepages" != "xno"],[
1506 AC_DEFINE(HAVE_HUGEPAGES, 1, [Compile with hugepage support])
1510 # Add support for efence memory debugging library if requested
1512 if test "$enable_efence" = 'yes'; then
1513 EFENCE_LIBS='-lefence'
1514 LIBS="$EFENCE_LIBS $LIBS"
1517 dnl ===========================================================================
1523 AC_ARG_WITH([bzlib],
1524 [AC_HELP_STRING([--without-bzlib],
1525 [disable BZLIB support])],
1526 [with_bzlib=$withval],
1529 if test "$with_bzlib" != 'yes'; then
1530 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-bzlib=$with_bzlib "
1534 if test "$with_bzlib" != 'no'; then
1536 AC_MSG_RESULT([-------------------------------------------------------------])
1537 AC_MSG_CHECKING([for BZLIB])
1542 AC_CHECK_HEADER(bzlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1543 AC_CHECK_LIB(bz2,BZ2_bzDecompress,found_libbz=`expr $found_libbz + 1`,,)
1544 if test "$native_win32_build" = 'yes'; then
1545 AC_CHECK_LIB(bz2,_imp__BZ2_decompress,found_libbz=`expr $found_libbz + 1`,,)
1547 if test $found_libbz -gt 0; then
1548 passed=`expr $passed + 1`
1550 failed=`expr $failed + 1`
1552 AC_MSG_CHECKING(if BZLIB package is complete)
1553 if test $passed -gt 0; then
1554 if test $failed -gt 0; then
1555 AC_MSG_RESULT(no -- some components failed test)
1556 have_bzlib='no (failed tests)'
1559 LIBS="$BZLIB_LIBS $LIBS"
1560 AC_DEFINE(BZLIB_DELEGATE,1,Define if you have the bzip2 library)
1568 AM_CONDITIONAL(BZLIB_DELEGATE, test "$have_bzlib" = 'yes')
1569 AC_SUBST(BZLIB_LIBS)
1572 # Find the X11 include and library directories.
1579 if test "$no_x" != 'yes'; then
1580 AC_MSG_RESULT([-------------------------------------------------------------])
1581 AC_MSG_CHECKING([for X11])
1583 LDFLAGS="$LDFLAGS $X_LIBS"
1584 X11_LIBS="$X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
1585 LIBS="$X11_LIBS $LIBS"
1586 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1588 AC_DEFINE(X11_DELEGATE,1,Define if you have X11 library)dnl
1591 # Check for X11 shared memory extension
1593 # shmctl is required to support the shared memory extension
1594 AC_CHECK_FUNC([shmctl],[have_shmctl='yes'],[])
1595 if test "$have_shmctl" != 'yes'; then
1597 LIBS="$LIBS -lcygipc"
1598 AC_TRY_LINK_FUNC([shmctl],[have_shmctl='yes'; IPC_LIBS='-lcygipc'],[])
1602 if test "$have_shmctl" = 'yes'; then
1603 AC_CHECK_LIB([Xext],[XShmAttach],[XEXT_LIBS='-lXext' ; AC_DEFINE(HAVE_SHARED_MEMORY,1,X11 server supports shared memory extension)],[],[])
1607 # Check for X11 shape extension
1609 AC_CHECK_LIB([Xext],[XShapeCombineMask],[XEXT_LIBS='-lXext' ; AC_DEFINE(HAVE_SHAPE,1,X11 server supports shape extension)],[],[])
1610 AC_CHECK_LIB(Xt,XtSetEventDispatcher,XT_LIBS='-lXt',,)
1611 LIBS="$XEXT_LIBS $XT_LIBS $LIBS"
1613 if test "$no_x" != 'yes'; then
1618 AM_CONDITIONAL(X11_DELEGATE, test "$have_x" = 'yes')
1622 dnl ===========================================================================
1628 [AC_HELP_STRING([--without-zlib],
1629 [disable ZLIB support])],
1630 [with_zlib=$withval],
1633 if test "$with_zlib" != 'yes'; then
1634 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-zlib=$with_zlib "
1641 if test "x$with_zlib" = "xyes"; then
1642 AC_MSG_RESULT([-------------------------------------------------------------])
1643 PKG_CHECK_MODULES(ZLIB,[zlib >= 1.0.0], have_zlib=yes, have_zlib=no)
1647 if test "$have_zlib" = 'yes'; then
1648 AC_DEFINE(ZLIB_DELEGATE,1,Define if you have ZLIB library)
1649 CFLAGS="$ZLIB_CFLAGS $CFLAGS"
1652 AM_CONDITIONAL(ZLIB_DELEGATE, test "$have_zlib" = 'yes')
1653 AC_SUBST(ZLIB_CFLAGS)
1656 dnl ===========================================================================
1658 # whether modules are built or not.
1662 if test "$build_modules" != 'no' ; then
1663 AC_MSG_RESULT([-------------------------------------------------------------])
1664 AC_MSG_CHECKING([for libltdl])
1668 AC_CHECK_HEADER([ltdl.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
1669 AC_CHECK_LIB([ltdl],[lt_dlinit],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
1670 AC_MSG_CHECKING([if libltdl package is complete])
1671 if test $passed -gt 0 ; then
1672 if test $failed -gt 0 ; then
1673 AC_MSG_RESULT([no -- some components failed test])
1674 have_ltdl='no (failed tests)'
1677 LIBS="$LTDL_LIBS $LIBS"
1678 AC_DEFINE(LTDL_DELEGATE,1,[Define if using libltdl to support dynamically loadable modules])
1679 AC_MSG_RESULT([yes])
1685 if test "$have_ltdl" != 'yes' ; then
1686 AC_MSG_FAILURE([libltdl is required for modules build],[1])
1689 AM_CONDITIONAL(WITH_LTDL, test "$have_ltdl" != 'no')
1692 # If profiling, then check for -ldl and dlopen (required for Solaris & gcc)
1695 if test "$enable_profiling" = 'yes'; then
1696 AC_CHECK_LIB(dl,dlopen,LIB_DL='-ldl',,)
1697 LIBS="$LIB_DL $LIBS"
1701 dnl ===========================================================================
1704 # Set Apple font directory.
1706 AC_ARG_WITH([apple-font-dir],
1707 [AC_HELP_STRING([--with-apple-font-dir=DIR],
1708 [Apple font directory])],
1709 [with_apple_font_dir=$withval],
1710 [with_apple_font_dir='default'])
1712 if test "$with_apple_font_dir" != 'default'; then
1713 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-apple-font-dir=$with_apple_font_dir "
1716 dnl ===========================================================================
1719 # Check for Autotrace delegate library.
1721 AC_ARG_WITH([autotrace],
1722 [AC_HELP_STRING([--with-autotrace],
1723 [enable autotrace support])],
1724 [with_autotrace=$withval],
1725 [with_autotrace='no'])
1727 if test "$with_autotrace" != 'yes'; then
1728 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-autotrace=$with_autotrace "
1735 if test "x$with_autotrace" = "xyes"; then
1736 AC_MSG_RESULT([-------------------------------------------------------------])
1737 PKG_CHECK_MODULES(AUTOTRACE,[autotrace >= 0.31.1], have_autotrace=yes, have_autotrace=no)
1741 if test "$have_autotrace" = 'yes'; then
1742 AC_DEFINE(AUTOTRACE_DELEGATE,1,Define if you have AUTOTRACE library)
1743 CFLAGS="$AUTOTRACE_CFLAGS $CFLAGS"
1746 AM_CONDITIONAL(AUTOTRACE_DELEGATE,test "$have_autotrace" = 'yes')
1747 AC_SUBST(AUTOTRACE_CFLAGS)
1748 AC_SUBST(AUTOTRACE_LIBS)
1750 dnl ===========================================================================
1753 # Check for Display Postscript delegate library.
1756 [AC_HELP_STRING([--without-dps],
1757 [disable Display Postscript support])],
1758 [with_dps=$withval],
1761 if test "$with_dps" != 'yes'; then
1762 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-dps=$with_dps "
1767 if test "$with_dps" != 'no' && test "$with_x" != 'no'; then
1768 AC_MSG_RESULT([-------------------------------------------------------------])
1769 AC_MSG_CHECKING([for DPS])
1773 PERSIST_CPPFLAGS="$CPPFLAGS"
1774 CPPFLAGS="$CPPFLAGS -I${ac_x_includes}/X11"
1775 AC_CHECK_HEADER(DPS/dpsXclient.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1777 # XFree86-4.x needs -lXt to provide XtMalloc for -ldps.
1778 # Cygwin doesn't deliver -lXt as a DLL, which prevents a DLL build.
1779 # Adobe DPS (as delivered on Solaris) doesn't require -lXt.
1780 # ImageMagick itself doesn't use -lXt.
1783 AC_CHECK_LIB(dps,DPSInitialize,have_libdps='yes',have_libdps='no',)
1784 if test "$have_libdps" != 'yes'; then
1785 # Unset cache variable so we can try again.
1786 unset ac_cv_lib_dps_DPSInitialize
1787 AC_CHECK_LIB(dps,DPSInitialize,have_libdps='yes',have_libdps='no',-lXt)
1788 if test "$have_libdps" = 'yes'; then
1792 if test "$have_libdps" = 'yes'; then
1793 passed=`expr $passed + 1`
1795 failed=`expr $failed + 1`
1797 AC_CHECK_LIB(dpstk,XDPSPixelsPerPoint,passed=`expr $passed + 1`,failed=`expr $failed + 1`,-ldps $LIBDPS_XT)
1798 AC_MSG_CHECKING([if DPS package is complete])
1799 if test $passed -gt 0; then
1800 if test $failed -gt 0; then
1801 AC_MSG_RESULT([no -- some components failed test])
1802 have_dps='no (failed tests)'
1803 CPPFLAGS="$PERSIST_CPPFLAGS"
1805 DPS_LIBS="-ldpstk -ldps ${LIBDPS_XT}"
1806 LIBS="$DPS_LIBS $LIBS"
1807 AC_DEFINE(DPS_DELEGATE,1,Define if you have Display Postscript)
1808 AC_MSG_RESULT([yes])
1813 CPPFLAGS=$PERSIST_CPPFLAGS
1816 AM_CONDITIONAL(DPS_DELEGATE, test "$have_dps" = 'yes')
1819 dnl ===========================================================================
1822 # Set DejaVu font directory.
1824 AC_ARG_WITH([dejavu-font-dir],
1825 [AC_HELP_STRING([--with-dejavu-font-dir=DIR],
1826 [DejaVu font directory])],
1827 [with_dejavu_font_dir=$withval],
1828 [with_dejavu_font_dir='default'])
1830 if test "$with_dejavu_font_dir" != 'default'; then
1831 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-dejavu-font-dir=$with_dejavu_font_dir "
1834 dnl ===========================================================================
1837 # Check for FFTW delegate library.
1840 [AC_HELP_STRING([--without-fftw],
1841 [disable FFTW support])],
1842 [with_fftw=$withval],
1845 if test "$with_fftw" != 'yes'; then
1846 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fftw=$with_fftw "
1853 if test "x$with_fftw" = "xyes"; then
1854 AC_MSG_RESULT([-------------------------------------------------------------])
1855 PKG_CHECK_MODULES(fftw3,[fftw3 >= 3.0.0], have_fftw=yes, have_fftw=no)
1859 if test "$have_fftw" = 'yes'; then
1860 AC_DEFINE(FFTW_DELEGATE,1,Define if you have FFTW library)
1861 FFTW_CFLAGS="$fftw3_CFLAGS"
1862 FFTW_LIBS="$fftw3_LIBS"
1863 CFLAGS="$fftw3_CFLAGS $CFLAGS"
1866 AM_CONDITIONAL(FFTW_DELEGATE, test "$have_fftw" = 'yes')
1867 AC_SUBST(FFTW_CFLAGS)
1870 dnl ===========================================================================
1873 # Check for FlashPIX delegate library.
1876 [AC_HELP_STRING([--without-fpx],
1877 [disable FlashPIX support])],
1878 [with_fpx=$withval],
1881 if test "$with_fpx" != 'yes'; then
1882 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fpx=$with_fpx "
1887 if test "$with_fpx" != 'no'; then
1888 AC_MSG_RESULT([-------------------------------------------------------------])
1889 AC_MSG_CHECKING([for FlashPIX])
1894 AC_CHECK_HEADER(fpxlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1895 AC_CHECK_LIB(fpx,FPX_OpenImageByFilename,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1897 AC_MSG_CHECKING([if FlashPIX package is complete])
1898 if test $passed -gt 0; then
1899 if test $failed -gt 0; then
1900 AC_MSG_RESULT([no -- some components failed test])
1901 have_fpx='no (failed tests)'
1904 AC_DEFINE(FPX_DELEGATE,1,Define if you have FlashPIX library)
1905 AC_MSG_RESULT([yes])
1913 AM_CONDITIONAL(FPX_DELEGATE, test "$have_fpx" = 'yes')
1916 dnl ===========================================================================
1919 # Check for DJVU delegate library.
1922 [AC_HELP_STRING([--without-djvu],
1923 [disable DjVu support])],
1924 [with_djvu=$withval],
1927 if test "$with_djvu" != 'yes'; then
1928 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-djvu=$with_djvu "
1935 if test "x$with_djvu" = "xyes"; then
1936 AC_MSG_RESULT([-------------------------------------------------------------])
1937 PKG_CHECK_MODULES(ddjvuapi,[ddjvuapi >= 3.5.0], have_djvu=yes, have_djvu=no)
1941 if test "$have_djvu" = 'yes'; then
1942 AC_DEFINE(DJVU_DELEGATE,1,Define if you have DJVU library)
1943 DJVU_CFLAGS="$ddjvuapi_CFLAGS"
1944 DJVU_LIBS="$ddjvuapi_LIBS"
1945 CFLAGS="$ddjvuapi_CFLAGS $CFLAGS"
1948 AM_CONDITIONAL(DJVU_DELEGATE, test "$have_djvu" = 'yes')
1949 AC_SUBST(DJVU_CFLAGS)
1952 dnl ===========================================================================
1955 # Check for fontconfig delegate library.
1957 AC_ARG_WITH([fontconfig],
1958 [AC_HELP_STRING([--without-fontconfig],
1959 [disable fontconfig support])],
1960 [with_fontconfig=$withval],
1961 [with_fontconfig='yes'])
1963 if test "$with_fontconfig" != 'yes'; then
1964 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontconfig=$with_fontconfig "
1967 have_fontconfig='no'
1968 FONTCONFIG_CFLAGS=""
1971 if test "x$with_fontconfig" = "xyes"; then
1972 AC_MSG_RESULT([-------------------------------------------------------------])
1973 PKG_CHECK_MODULES(FONTCONFIG,[fontconfig >= 2.1.0], have_fontconfig=yes, have_fontconfig=no)
1977 if test "$have_fontconfig" = 'yes'; then
1978 AC_DEFINE(FONTCONFIG_DELEGATE,1,Define if you have FONTCONFIG library)
1979 CFLAGS="$FONTCONFIG_CFLAGS $CFLAGS"
1982 AM_CONDITIONAL(FONTCONFIG_DELEGATE,test "$have_fontconfig" = 'yes')
1983 AC_SUBST(FONTCONFIG_CFLAGS)
1984 AC_SUBST(FONTCONFIG_LIBS)
1986 dnl ===========================================================================
1989 # Check for the Freetype delegate library.
1991 AC_ARG_WITH([freetype],
1992 [AC_HELP_STRING([--without-freetype],
1993 [disable Freetype support])],
1994 [with_freetype=$withval],
1995 [with_freetype='yes'])
1997 if test "$with_freetype" != 'yes'; then
1998 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-freetype=$with_freetype "
2005 if test "x$with_freetype" = "xyes"; then
2006 AC_MSG_RESULT([-------------------------------------------------------------])
2007 PKG_CHECK_MODULES(FREETYPE,[freetype2], have_freetype=yes, have_freetype=no)
2011 if test "$have_freetype" = 'yes'; then
2012 AC_DEFINE(FREETYPE_DELEGATE,1,Define if you have FREETYPE library)
2013 CFLAGS="$FREETYPE_CFLAGS $CFLAGS"
2016 AM_CONDITIONAL(FREETYPE_DELEGATE, test "$have_freetype" = 'yes')
2017 AC_SUBST(FREETYPE_CFLAGS)
2018 AC_SUBST(FREETYPE_LIBS)
2020 dnl ===========================================================================
2023 # Check for Ghostscript library or framework.
2025 # Test for iapi.h & test for gsapi_new_instance in -lgs
2026 # or -framework Ghostscript
2028 AC_ARG_WITH([gslib],
2029 [AC_HELP_STRING([--with-gslib],
2030 [enable Ghostscript library support])],
2031 [with_gslib=$withval],
2034 gslib_framework='no'
2035 if test "$with_gslib" != 'yes'; then
2036 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gslib=$with_gslib "
2041 if test "$with_gslib" != 'no'; then
2042 AC_MSG_RESULT([-------------------------------------------------------------])
2043 AC_MSG_CHECKING([for Ghostscript])
2048 AC_CHECK_HEADER(ghostscript/iapi.h,passed=`expr $passed + 1`,
2049 failed=`expr $failed + 1`,)
2050 AC_CHECK_HEADER(ghostscript/ierrors.h,passed=`expr $passed + 1`,
2051 failed=`expr $failed + 1`,)
2052 AC_CHECK_FRAMEWORK(Ghostscript,gsapi_new_instance,framework=`expr $framework + 1`,
2053 AC_CHECK_LIB(gs,gsapi_new_instance,passed=`expr $passed + 1`,failed=`expr $failed + 1`,),)
2054 AC_MSG_CHECKING([if Ghostscript package is complete])
2055 if test $passed -gt 0; then
2056 if test $failed -gt 0; then
2057 AC_MSG_RESULT([no -- some components failed test])
2058 have_gslib='no (failed tests)'
2060 if test $framework -gt 0; then
2061 GS_LIBS='-framework Ghostscript'
2062 gslib_framework='yes'
2063 AC_MSG_RESULT([yes, using framework.])
2065 AC_MSG_RESULT([yes, using library.])
2068 LIBS="$GS_LIBS $LIBS"
2069 AC_DEFINE(GS_DELEGATE,1,Define if you have Ghostscript library or framework)
2076 AM_CONDITIONAL(GS_DELEGATE, test "$have_gslib" = 'yes')
2079 # Set default font search path
2080 AC_ARG_WITH([fontpath],
2081 [AC_HELP_STRING([--with-fontpath=DIR],
2082 [prepend to default font search path])],
2083 [with_fontpath=$withval],
2086 if test "$with_fontpath" != "yes" && test -z "$with_fontpath"; then
2089 AC_DEFINE_UNQUOTED(MAGICK_FONT_PATH,"$with_fontpath",[Define to prepend to default font search path.])
2091 if test "$with_fontpath=" != ''; then
2092 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontpath=$with_fontpath "
2095 # Set Ghostscript font directory
2096 AC_ARG_WITH([gs-font-dir],
2097 [AC_HELP_STRING([--with-gs-font-dir=DIR],
2098 [Ghostscript font directory])],
2099 [with_gs_font_dir=$withval],
2100 [with_gs_font_dir='default'])
2102 if test "$with_gs_font_dir" != 'default'; then
2103 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gs-font-dir=$with_gs_font_dir "
2106 dnl ===========================================================================
2109 # Check for GVC delegate library.
2112 [AC_HELP_STRING([--with-gvc],
2113 [enable GVC support])],
2114 [with_gvc=$withval],
2117 if test "$with_gvc" != 'yes'; then
2118 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gvc=$with_gvc "
2122 if test "x$with_gvc" = "xyes"; then
2123 AC_MSG_RESULT([-------------------------------------------------------------])
2124 PKG_CHECK_MODULES(GVC,[libgvc >= 2.9.0], have_gvc=yes, have_gvc=no)
2128 if test "$have_gvc" = 'yes'; then
2129 AC_DEFINE(GVC_DELEGATE,1,Define if you have GVC library)
2130 CFLAGS="$GVC_CFLAGS $CFLAGS"
2133 AM_CONDITIONAL(GVC_DELEGATE, test "$have_gvc" = 'yes')
2134 AC_SUBST(GVC_CFLAGS)
2137 dnl ===========================================================================
2140 # Check for JBIG delegate library.
2144 [AC_HELP_STRING([--without-jbig],
2145 [disable JBIG support])],
2146 [with_jbig=$withval],
2151 if test "$with_jbig" != 'no'; then
2152 AC_MSG_RESULT([-------------------------------------------------------------])
2153 AC_MSG_CHECKING([for JBIG])
2157 AC_CHECK_HEADER(jbig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2158 AC_CHECK_LIB(jbig,jbg_dec_init,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2159 AC_MSG_CHECKING([if JBIG package is complete])
2160 if test $passed -gt 0; then
2161 if test $failed -gt 0; then
2162 AC_MSG_RESULT([no -- some components failed test])
2163 have_jbig='no (failed tests)'
2166 LIBS="$JBIG_LIBS $LIBS"
2167 AC_DEFINE(JBIG_DELEGATE,1,Define if you have JBIG library)
2168 AC_MSG_RESULT([yes])
2175 AM_CONDITIONAL(JBIG_DELEGATE, test "$have_jbig" = 'yes')
2178 dnl ===========================================================================
2181 # Check for JPEG delegate library.
2184 [AC_HELP_STRING([--without-jpeg],
2185 [disable JPEG support])],
2186 [with_jpeg=$withval],
2189 if test "$with_jpeg" != 'yes'; then
2190 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jpeg=$with_jpeg "
2195 if test "$with_jpeg" != 'no'; then
2196 AC_MSG_RESULT([-------------------------------------------------------------])
2197 AC_MSG_CHECKING([for JPEG])
2201 AC_CHECK_HEADER(jconfig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2202 AC_CHECK_HEADER(jerror.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2203 AC_CHECK_HEADER(jmorecfg.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2204 AC_CHECK_HEADER(jpeglib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2205 AC_CHECK_LIB(jpeg,jpeg_read_header,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2207 # Test for compatible JPEG library
2208 if test "$ac_cv_jpeg_version_ok" != 'yes'; then
2209 AC_CACHE_CHECK(for JPEG library is version 6b or later, ac_cv_jpeg_version_ok,
2213 #include <jpeglib.h>
2215 changequote(<<, >>)dnl
2217 #if JPEG_LIB_VERSION < 62
2218 #error IJG JPEG library must be version 6b or newer!
2222 changequote([, ])dnl
2223 ac_cv_jpeg_version_ok='yes'; passed=`expr $passed + 1`,
2224 ac_cv_jpeg_version_ok='no'; failed=`expr $failed + 1`)])
2226 AC_MSG_CHECKING([if JPEG package is complete])
2227 if test $passed -gt 0; then
2228 if test $failed -gt 0; then
2229 AC_MSG_RESULT([no -- some components failed test])
2230 have_jpeg='no (failed tests)'
2233 LIBS="$JPEG_LIBS $LIBS"
2234 AC_DEFINE(JPEG_DELEGATE,1,Define if you have JPEG library)
2235 AC_MSG_RESULT([yes])
2242 AM_CONDITIONAL(JPEG_DELEGATE, test "$have_jpeg" = 'yes')
2245 dnl ===========================================================================
2248 # Check for LCMS delegate library.
2251 [ --without-lcms disable lcms (v1.1X) support],
2252 [with_lcms=$withval],
2254 if test "$with_lcms" != 'yes' ; then
2255 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lcms=$with_lcms "
2262 if test "x$with_lcms" = "xyes"; then
2263 AC_MSG_RESULT([-------------------------------------------------------------])
2264 PKG_CHECK_MODULES(LCMS2,[lcms2 >= 2.0.0], have_lcms=yes, have_lcms=no)
2268 if test "$have_lcms" = 'yes'; then
2269 AC_DEFINE(LCMS_DELEGATE,1,Define if you have LCMS library)
2270 LCMS_CFLAGS="$LCMS2_CFLAGS"
2271 LCMS_LIBS="$LCMS2_LIBS"
2272 CFLAGS="$LCMS2_CFLAGS $CFLAGS"
2273 AC_CHECK_HEADER(lcms2/lcms2.h,have_lcms_header='yes',,)
2274 if test "$have_lcms_header" = 'yes'; then
2275 AC_DEFINE(HAVE_LCMS2_LCMS2_H,1,Define if you have the <lcms2/lcms2.h> header file.)
2277 AC_DEFINE(HAVE_LCMS2_H,1,Define if you have the <lcms2.h> header file.)
2281 AM_CONDITIONAL(LCMS_DELEGATE, test "$have_lcms" = 'yes')
2282 AC_SUBST(LCMS_CFLAGS)
2285 dnl ===========================================================================
2288 # Check for the OpenJP2 delegate library.
2290 AC_ARG_WITH([openjp2],
2291 [AC_HELP_STRING([--without-openjp2],
2292 [disable OpenJP2 support])],
2293 [with_openjp2=$withval],
2294 [with_openjp2='yes'])
2296 if test "$with_openjp2" != 'yes'; then
2297 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-openjp2=$with_openjp2 "
2301 LIBOPENJP2_CFLAGS=""
2304 if test "x$with_openjp2" = "xyes"; then
2305 AC_MSG_RESULT([-------------------------------------------------------------])
2306 PKG_CHECK_MODULES(LIBOPENJP2,[libopenjp2 >= 2.1.0], have_openjp2=yes, have_openjp2=no)
2310 if test "$have_openjp2" = 'yes'; then
2311 AC_DEFINE(LIBOPENJP2_DELEGATE,1,Define if you have OPENJP2 library)
2312 CFLAGS="$LIBOPENJP2_CFLAGS $CFLAGS"
2315 AM_CONDITIONAL(LIBOPENJP2_DELEGATE, test "$have_openjp2" = 'yes')
2316 AC_SUBST(LIBOPENJP2_CFLAGS)
2317 AC_SUBST(LIBOPENJP2_LIBS)
2320 dnl ===========================================================================
2323 # Check for the LQR (Liquid Rescale) delegate library.
2326 [AC_HELP_STRING([--without-lqr],
2327 [disable Liquid Rescale support])],
2328 [with_lqr=$withval],
2331 if test "$with_lqr" != 'yes'; then
2332 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lqr=$with_lqr "
2339 if test "x$with_lqr" = "xyes"; then
2340 AC_MSG_RESULT([-------------------------------------------------------------])
2341 PKG_CHECK_MODULES(LQR,[lqr-1 >= 0.1.0], have_lqr=yes, have_lqr=no)
2345 if test "$have_lqr" = 'yes'; then
2346 AC_DEFINE(LQR_DELEGATE,1,Define if you have LQR library)
2347 CFLAGS="$LQR_CFLAGS $CFLAGS"
2350 AM_CONDITIONAL(LQR_DELEGATE, test "$have_lqr" = 'yes')
2351 AC_SUBST(LQR_CFLAGS)
2354 dnl ===========================================================================
2356 # Disable LZMA (lzma library)
2358 [ --without-lzma disable LZMA support],
2359 [with_lzma=$withval],
2361 if test "$with_lzma" != 'yes' ; then
2362 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lzma=$with_lzma "
2366 if test "x$with_lzma" = "xyes"; then
2367 AC_MSG_RESULT([-------------------------------------------------------------])
2368 PKG_CHECK_MODULES(LZMA,[liblzma >= 2.9.0], have_lzma=yes, have_lzma=no)
2372 if test "$have_lzma" = 'yes'; then
2373 AC_DEFINE(LZMA_DELEGATE,1,Define if you have LZMA library)
2374 CFLAGS="$LZMA_CFLAGS $CFLAGS"
2377 AM_CONDITIONAL(LZMA_DELEGATE, test "$have_lzma" = 'yes')
2378 AC_SUBST(LZMA_CFLAGS)
2381 dnl ===========================================================================
2384 # Check for the OpenEXR delegate library.
2386 AC_ARG_WITH([openexr],
2387 [AC_HELP_STRING([--without-openexr],
2388 [disable OpenEXR support])],
2389 [with_openexr=$withval],
2390 [with_openexr='yes'])
2392 if test "$with_openexr" != 'yes'; then
2393 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-openexr=$with_openexr "
2400 if test "x$with_openexr" = "xyes"; then
2401 AC_MSG_RESULT([-------------------------------------------------------------])
2402 PKG_CHECK_MODULES(OPENEXR,[OpenEXR >= 1.0.6], have_openexr=yes, have_openexr=no)
2406 if test "$have_openexr" = 'yes'; then
2407 AC_DEFINE(OPENEXR_DELEGATE,1,Define if you have OPENEXR library)
2408 CFLAGS="$OPENEXR_CFLAGS $CFLAGS"
2411 AM_CONDITIONAL(OPENEXR_DELEGATE, test "$have_openexr" = 'yes')
2412 AC_SUBST(OPENEXR_CFLAGS)
2413 AC_SUBST(OPENEXR_LIBS)
2415 dnl ===========================================================================
2418 # Check for PANGO delegate library.
2420 AC_ARG_WITH([pango],
2421 [AC_HELP_STRING([--without-pango],
2422 [disable PANGO support])],
2423 [with_pango=$withval],
2426 if test "$with_pango" != 'yes'; then
2427 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-pango=$with_pango "
2431 have_pangocairo='no'
2435 if test "x$with_pango" = "xyes"; then
2436 AC_MSG_RESULT([-------------------------------------------------------------])
2437 PKG_CHECK_MODULES(PANGO, [pangocairo >= 1.28.1], have_pangocairo=yes, have_pangocairo=no)
2439 PKG_CHECK_MODULES(PANGO, [pango >= 1.28.1], have_pango=yes, have_pango=no)
2443 if test "$have_pango" = 'yes'; then
2444 AC_DEFINE(PANGO_DELEGATE,1,Define if you have PANGO library)
2445 CFLAGS="$PANGO_CFLAGS $CFLAGS"
2448 if test "$have_pangocairo" = 'yes'; then
2449 AC_DEFINE(PANGOCAIRO_DELEGATE,1,Define if you have PANGOCAIRO library)
2450 CFLAGS="$PANGOCAIRO_CFLAGS $CFLAGS"
2453 AM_CONDITIONAL(PANGO_DELEGATE, test "$have_pango" = 'yes')
2454 AM_CONDITIONAL(PANGOCAIRO_DELEGATE, test "$have_pangocairo" = 'yes')
2455 AC_SUBST(PANGO_CFLAGS)
2456 AC_SUBST(PANGO_LIBS)
2458 dnl ===========================================================================
2461 # Check for PNG delegate library.
2464 [AC_HELP_STRING([--without-png],
2465 [disable PNG support])],
2466 [with_png=$withval],
2469 if test "$with_png" != 'yes'; then
2470 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-png=$with_png "
2477 if test "x$with_png" = "xyes"; then
2478 AC_MSG_RESULT([-------------------------------------------------------------])
2479 PKG_CHECK_MODULES(PNG,[libpng >= 1.0.0], have_png=yes, have_png=no)
2483 if test "$have_png" = 'yes'; then
2484 AC_DEFINE(PNG_DELEGATE,1,Define if you have PNG library)
2485 CFLAGS="$PNG_CFLAGS $CFLAGS"
2488 AM_CONDITIONAL(PNG_DELEGATE, test "$have_png" = 'yes')
2489 AC_SUBST(PNG_CFLAGS)
2492 dnl ===========================================================================
2495 # Check for RSVG delegate library.
2498 [AC_HELP_STRING([--with-rsvg],
2499 [enable RSVG support])],
2500 [with_rsvg=$withval],
2503 if test "$with_rsvg" != 'yes'; then
2504 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-rsvg=$with_rsvg "
2512 if test "x$with_rsvg" = "xyes"; then
2513 AC_MSG_RESULT([-------------------------------------------------------------])
2514 PKG_CHECK_MODULES(RSVG,[librsvg-2.0 >= 2.9.0], have_rsvg=yes, have_rsvg=no)
2516 PKG_CHECK_MODULES(CAIRO_SVG, cairo-svg, have_cairo=yes, have_cairo=no)
2520 if test "$have_rsvg" = 'yes'; then
2521 AC_DEFINE(RSVG_DELEGATE,1,Define if you have RSVG library)
2522 CFLAGS="$RSVG_CFLAGS $CFLAGS"
2525 if test "$have_cairo" = 'yes'; then
2526 AC_DEFINE(CAIRO_DELEGATE,1,Define if you have CAIRO library)
2527 CFLAGS="$CAIRO_SVG_CFLAGS $CFLAGS"
2530 AM_CONDITIONAL(RSVG_DELEGATE, test "$have_rsvg" = 'yes')
2531 AM_CONDITIONAL(CAIRO_DELEGATE, test "$have_cairo" = 'yes')
2532 AC_SUBST(RSVG_CFLAGS)
2535 dnl ===========================================================================
2538 # Check for TIFF delegate library.
2541 [AC_HELP_STRING([--without-tiff],
2542 [disable TIFF support])],
2543 [with_tiff=$withval],
2546 if test "$with_tiff" != 'yes'; then
2547 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-tiff=$with_tiff "
2552 if test "$with_tiff" != 'no'; then
2553 AC_MSG_RESULT([-------------------------------------------------------------])
2554 AC_MSG_CHECKING([for TIFF])
2558 AC_CHECK_HEADER(tiff.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2559 AC_CHECK_HEADER(tiffio.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2560 AC_CHECK_LIB(tiff,TIFFOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2561 AC_CHECK_LIB(tiff,TIFFClientOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2562 AC_CHECK_LIB(tiff,TIFFIsByteSwapped,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2563 AC_CHECK_LIB(tiff,TIFFReadRGBATile,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2564 AC_CHECK_LIB(tiff,TIFFReadRGBAStrip,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2565 AC_MSG_CHECKING([if TIFF package is complete])
2566 if test $passed -gt 0; then
2567 if test $failed -gt 0; then
2568 AC_MSG_RESULT([no -- some components failed test])
2569 have_tiff='no (failed tests)'
2572 LIBS="$TIFF_LIBS $LIBS"
2573 AC_DEFINE(TIFF_DELEGATE,1,Define if you have TIFF library)
2574 AC_MSG_RESULT([yes])
2576 AC_CHECK_HEADERS(tiffconf.h)
2577 AC_CHECK_FUNCS([TIFFIsCODECConfigured TIFFMergeFieldInfo \
2578 TIFFIsBigEndian TIFFReadEXIFDirectory TIFFSetErrorHandlerExt \
2579 TIFFSetTagExtender TIFFSetWarningHandlerExt \
2580 TIFFSwabArrayOfTriples])
2586 AM_CONDITIONAL(TIFF_DELEGATE, test "$have_tiff" = 'yes')
2589 dnl ===========================================================================
2592 # Check for WEBP delegate library.
2595 [AC_HELP_STRING([--without-webp],
2596 [disable WEBP support])],
2597 [with_webp=$withval],
2600 if test "$with_webp" != 'yes'; then
2601 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-webp=$with_webp "
2606 if test "$with_webp" != 'no'; then
2607 AC_MSG_RESULT([-------------------------------------------------------------])
2608 AC_MSG_CHECKING([for WEBP])
2612 AC_CHECK_HEADER(webp/decode.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2613 AC_CHECK_LIB(webp,WebPPictureInitInternal,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2614 AC_MSG_CHECKING([if WEBP package is complete])
2615 if test $passed -gt 0; then
2616 if test $failed -gt 0; then
2617 AC_MSG_RESULT([no -- some components failed test])
2618 have_webp='no (failed tests)'
2621 LIBS="$WEBP_LIBS $LIBS"
2622 AC_DEFINE(WEBP_DELEGATE,1,Define if you have WEBP library)
2623 AC_MSG_RESULT([yes])
2630 AM_CONDITIONAL(WEBP_DELEGATE,test "$have_webp" = 'yes')
2633 dnl ===========================================================================
2636 # Set Windows font directory.
2638 AC_ARG_WITH([windows-font-dir],
2639 [AC_HELP_STRING([--with-windows-font-dir=DIR],
2640 [Windows font directory])],
2641 [with_windows_font_dir=$withval],
2642 [with_windows_font_dir='default'])
2644 if test "$with_windows_font_dir" != 'default'; then
2645 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-windows-font-dir=$with_windows_font_dir "
2648 dnl ===========================================================================
2651 # Check for WMF delegate library.
2654 [AC_HELP_STRING([--with-wmf],
2655 [enable WMF support])],
2656 [with_wmf=$withval],
2659 if test "$with_wmf" != 'yes'; then
2660 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-wmf=$with_wmf "
2667 if test "$with_wmf" != 'no'; then
2668 AC_MSG_CHECKING([for WMF support ])
2671 have_libwmflite='no'
2672 have_libwmf_ipa_h='no'
2674 AC_CHECK_HEADER([libwmf/ipa.h],[have_libwmf_ipa_h='yes'],[],[$FT2BUILD_H])
2675 if test "$have_libwmf_ipa_h" = 'yes'; then
2676 AC_CHECK_LIB([wmflite],[wmf_lite_create],[have_libwmflite='yes'],[],[])
2677 if test "$have_libwmflite" = 'yes'; then
2678 AC_DEFINE(WMF_DELEGATE,1,Define if you have WMF library)
2679 WMF_LIBS='-lwmflite'
2680 LIBS="$WMF_LIBS $LIBS"
2683 AC_MSG_RESULT([no -- some components failed test])
2684 have_wmf='no (failed tests)'
2685 have_wmflite='no (failed tests)'
2691 AC_MSG_CHECKING([if WMF package is complete ])
2692 if test "$have_wmf" = 'yes'; then
2693 AC_MSG_RESULT([yes])
2697 AM_CONDITIONAL([WMF_DELEGATE], [test "$have_wmf" = 'yes'])
2698 AC_SUBST([WMF_CFLAGS])
2699 AC_SUBST([WMF_LIBS])
2701 dnl ===========================================================================
2704 # Check for XML delegate library.
2707 [AC_HELP_STRING([--without-xml],
2708 [disable XML support])],
2709 [with_xml=$withval],
2712 if test "$with_xml" != 'yes' ; then
2713 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-xml=$with_xml "
2720 if test "x$with_xml" = "xyes"; then
2721 AC_MSG_RESULT([-------------------------------------------------------------])
2722 PKG_CHECK_MODULES(XML,[libxml-2.0 >= 2.0.0], have_xml=yes, have_xml=no)
2726 if test "$have_xml" = 'yes'; then
2727 AC_DEFINE(XML_DELEGATE,1,Define if you have XML library)
2728 CFLAGS="$XML_CFLAGS $CFLAGS"
2731 AM_CONDITIONAL(XML_DELEGATE, test "$have_xml" = 'yes')
2732 AC_SUBST(XML_CFLAGS)
2735 dnl ===========================================================================
2737 # Substitute compiler name to build/link PerlMagick
2739 AC_SUBST([PERLMAINCC])
2742 # Configure install Paths
2745 # Path to ImageMagick header files
2746 INCLUDE_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
2747 INCLUDE_PATH="${INCLUDE_DIR}/${INCLUDE_RELATIVE_PATH}"
2748 DEFINE_INCLUDE_PATH="${INCLUDE_DIR}/${INCLUDE_RELATIVE_PATH}/"
2749 case "${build_os}" in
2751 DEFINE_INCLUDE_PATH=`$WinPathScript "$DEFINE_INCLUDE_PATH" 1`
2754 AC_DEFINE_UNQUOTED(INCLUDE_PATH,"$DEFINE_INCLUDE_PATH",[Directory where ImageMagick headers live.])
2755 AC_SUBST(INCLUDE_PATH)
2757 # Path to ImageMagick header files (arch part)
2758 INCLUDEARCH_PATH="${INCLUDEARCH_DIR}/${INCLUDE_RELATIVE_PATH}"
2759 DEFINE_INCLUDEARCH_PATH="${INCLUDEARCH_DIR}/${INCLUDE_RELATIVE_PATH}/"
2760 case "${build_os}" in
2762 DEFINE_INCLUDEARCH_PATH=`$WinPathScript "$DEFINE_INCLUDEARCH_PATH" 1`
2765 AC_DEFINE_UNQUOTED(INCLUDEARCH_PATH,"$DEFINE_INCLUDE_PATH",[Directory where ImageMagick architecture headers live.])
2766 AC_SUBST(INCLUDEARCH_PATH)
2768 # Subdirectory under lib to place ImageMagick lib files
2769 LIBRARY_RELATIVE_PATH="${PACKAGE_NAME}-${PACKAGE_VERSION}"
2770 AC_DEFINE_UNQUOTED(LIBRARY_RELATIVE_PATH,"$LIBRARY_RELATIVE_PATH",[Subdirectory of lib where ImageMagick architecture dependent files are installed.])
2772 # Path to ImageMagick bin directory
2773 EXECUTABLE_PATH="${BIN_DIR}"
2774 DEFINE_EXECUTABLE_PATH="${BIN_DIR}/"
2775 case "${build_os}" in
2777 DEFINE_EXECUTABLE_PATH=`$WinPathScript "$DEFINE_EXECUTABLE_PATH" 1`
2780 AC_DEFINE_UNQUOTED(EXECUTABLE_PATH,"$DEFINE_EXECUTABLE_PATH",[Directory where executables are installed.])
2781 AC_SUBST(EXECUTABLE_PATH)
2783 # Path to ImageMagick lib
2784 LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}"
2785 DEFINE_LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}/"
2786 case "${build_os}" in
2788 DEFINE_LIBRARY_PATH=`$WinPathScript "$DEFINE_LIBRARY_PATH" 1`
2791 AC_DEFINE_UNQUOTED(LIBRARY_PATH,"$DEFINE_LIBRARY_PATH",[Directory where architecture-dependent files live.])
2792 AC_SUBST(LIBRARY_PATH)
2795 # path to local binaries
2796 if test "x$LIB_BIN_BASEDIRNAME" = "x"; then
2797 LIB_BIN_BASEDIRNAME="bin"
2799 AC_DEFINE_UNQUOTED(LIB_BIN_BASEDIRNAME,"$LIB_BIN_BASEDIRNAME",[Binaries in libraries path base name (will be during install linked to bin)])
2800 AC_SUBST(LIB_BIN_BASEDIRNAME)
2802 if test "x$LIB_BIN_DIR" = "x"; then
2803 LIB_BIN_DIR=${LIB_BIN_BASEDIRNAME}-${MAGICK_ABI_SUFFIX}
2805 AC_SUBST(LIB_BIN_DIR)
2807 LIB_BIN_DIR_RELATIVE_PATH=$LIB_BIN_DIR
2808 AC_SUBST(LIB_BIN_DIR_RELATIVE_PATH)
2809 LIB_BIN_DIR_PATH="${LIBRARY_PATH}/${LIB_BIN_DIR_RELATIVE_PATH}"
2810 AC_SUBST(LIB_BIN_DIR_PATH)
2813 # path to modules lib
2814 if test "x$MODULES_BASEDIRNAME" = "x"; then
2815 MODULES_BASEDIRNAME="modules"
2817 AC_DEFINE_UNQUOTED(MODULES_BASEDIRNAME,"$MODULES_BASEDIRNAME",[Module directory name without ABI part.])
2818 AC_SUBST(MODULES_BASEDIRNAME)
2820 if test "x$MODULES_DIRNAME" = "x"; then
2821 MODULES_DIRNAME=${MODULES_BASEDIRNAME}-${MAGICK_ABI_SUFFIX}
2823 AC_DEFINE_UNQUOTED(MODULES_DIRNAME,"$MODULES_DIRNAME",[Module directory dirname])
2825 AC_SUBST(MODULES_DIRNAME)
2827 MODULES_RELATIVE_PATH="${MODULES_DIRNAME}"
2828 AC_SUBST(MODULES_RELATIVE_PATH)
2829 MODULES_PATH="${LIBRARY_PATH}/${MODULES_RELATIVE_PATH}"
2830 AC_SUBST(MODULES_PATH)
2833 # path to coders lib
2834 if test "x$CODER_DIRNAME" = "x"; then
2835 CODER_DIRNAME="coders"
2837 AC_DEFINE_UNQUOTED(CODER_DIRNAME,"$CODER_DIRNAME",[coders subdirectory.])
2838 AC_SUBST(CODER_DIRNAME)
2840 CODER_RELATIVE_PATH="${CODER_DIRNAME}"
2841 CODER_PATH="${MODULES_PATH}/${CODER_DIRNAME}"
2842 AC_SUBST(CODER_PATH)
2845 # Subdirectory under lib to place ImageMagick filter module files
2847 # path to coders lib
2848 if test "x$FILTER_DIRNAME" = "x"; then
2849 FILTER_DIRNAME="filters"
2851 AC_DEFINE_UNQUOTED(FILTER_DIRNAME,"$FILTER_DIRNAME",[filter subdirectory.])
2852 AC_SUBST(FILTER_DIRNAME)
2854 FILTER_RELATIVE_PATH="${FILTER_DIRNAME}"
2855 FILTER_PATH="${MODULES_PATH}/${FILTER_DIRNAME}"
2856 AC_SUBST(FILTER_PATH)
2859 # Path to ImageMagick documentation files
2860 DOCUMENTATION_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
2861 DOCUMENTATION_PATH="${DOC_DIR}/${DOCUMENTATION_RELATIVE_PATH}"
2862 DEFINE_DOCUMENTATION_PATH="${DOC_DIR}/${DOCUMENTATION_RELATIVE_PATH}/"
2863 case "${build_os}" in
2865 DEFINE_DOCUMENTATION_PATH=`$WinPathScript "$DEFINE_DOCUMENTATION_PATH" 1`
2868 AC_DEFINE_UNQUOTED(DOCUMENTATION_PATH,"$DEFINE_DOCUMENTATION_PATH",[Directory where ImageMagick documents live.])
2869 AC_SUBST(DOCUMENTATION_PATH)
2872 # Enable/Disable documentation
2873 AC_ARG_ENABLE([docs],
2874 [AS_HELP_STRING([--disable-docs],
2875 [disable building of documentation])],
2876 wantdocs=$enableval, wantdocs=yes)
2877 AM_CONDITIONAL([INSTALL_DOC], [test "$wantdocs" = "yes"])
2879 # Subdirectory to place architecture-dependent configuration files
2880 CONFIGURE_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
2881 AC_DEFINE_UNQUOTED(CONFIGURE_RELATIVE_PATH,"$CONFIGURE_RELATIVE_PATH",[Subdirectory of lib where architecture-dependent configuration files live.])
2882 CONFIGURE_PATH="${SYSCONF_DIR}/${CONFIGURE_RELATIVE_PATH}/"
2883 DEFINE_CONFIGURE_PATH="${SYSCONF_DIR}/${CONFIGURE_RELATIVE_PATH}/"
2884 case "${build_os}" in
2886 DEFINE_CONFIGURE_PATH=`$WinPathScript "$DEFINE_CONFIGURE_PATH" 1`
2889 AC_DEFINE_UNQUOTED(CONFIGURE_PATH,"$DEFINE_CONFIGURE_PATH",[Directory where architecture-dependent configuration files live.])
2890 AC_SUBST(CONFIGURE_PATH)
2892 # Subdirectory to place architecture-independent configuration files
2893 SHARE_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
2894 AC_DEFINE_UNQUOTED(SHARE_RELATIVE_PATH,"$SHARE_RELATIVE_PATH",[Subdirectory of lib where architecture-independent configuration files live.])
2895 SHARE_PATH="${DATA_DIR}/${SHARE_RELATIVE_PATH}"
2896 DEFINE_SHARE_PATH="${DATA_DIR}/${SHARE_RELATIVE_PATH}/"
2897 case "${build_os}" in
2899 DEFINE_SHARE_PATH=`$WinPathScript "$DEFINE_SHARE_PATH" 1`
2902 AC_DEFINE_UNQUOTED(SHARE_PATH,"$DEFINE_SHARE_PATH",[Directory where architecture-independent configuration files live.])
2903 AC_SUBST(SHARE_PATH)
2906 # Subdirectory to place architecture-dependent configuration files.
2907 if test "x$SHAREARCH_BASEDIRNAME" = "x"; then
2908 SHAREARCH_BASEDIRNAME="config"
2910 AC_DEFINE_UNQUOTED(SHAREARCH_BASEDIRNAME,"$SHAREARCH_BASEDIRNAME",[Sharearch directory name without ABI part.])
2911 AC_SUBST(SHAREARCH_BASEDIRNAME)
2913 if test "x$SHAREARCH_DIRNAME" = "x"; then
2914 SHAREARCH_DIRNAME=${SHAREARCH_BASEDIRNAME}-${MAGICK_ABI_SUFFIX}
2916 AC_DEFINE_UNQUOTED(SHAREARCH_DIRNAME,"$SHAREARCH_DIRNAME",[Sharearch directory dirname])
2918 AC_SUBST(SHAREARCH_DIRNAME)
2920 SHAREARCH_RELATIVE_PATH="${SHAREARCH_DIRNAME}"
2921 AC_SUBST(SHAREARCH_RELATIVE_PATH)
2922 SHAREARCH_PATH="${LIBRARY_PATH}/${SHAREARCH_RELATIVE_PATH}"
2923 AC_SUBST(SHAREARCH_PATH)
2926 # program_transform_name is formed for use in a Makefile, so create a
2927 # modified version for use in a shell script.
2928 configure_transform_name=`echo ${program_transform_name} | sed 's,\\$\\$,$,'`
2930 # Default delegate definitions
2931 AC_MSG_RESULT([-------------------------------------------------------------])
2932 AC_MSG_CHECKING([for ImageMagick delegate programs])
2934 AutotraceDecodeDelegateDefault='autotrace'
2935 BPGDecodeDelegateDefault='bpgdec'
2936 BPGEncodeDelegateDefault='bpgenc'
2937 BlenderDecodeDelegateDefault='blender'
2938 BZIPDelegateDefault='bzip2'
2939 BrowseDelegateDefault='xdg-open'
2940 CatDelegateDefault='cat'
2941 DNGDecodeDelegateDefault='ufraw-batch'
2942 DOCDecodeDelegateDefault='soffice'
2943 GVCDecodeDelegateDefault='dot'
2944 DVIDecodeDelegateDefault='dvips'
2945 EchoDelegateDefault='echo'
2946 EditorDelegateDefault='xterm'
2947 ConvertDelegateDefault=`echo convert | sed ${configure_transform_name}`
2948 DisplayDelegateDefault=`echo display | sed ${configure_transform_name}`
2949 MogrifyDelegateDefault=`echo mogrify | sed ${configure_transform_name}`
2950 GnuplotDecodeDelegateDefault='gnuplot'
2951 HPGLDecodeDelegateDefault='hp2xx'
2952 HTMLDecodeDelegateDefault='html2ps'
2953 ILBMDecodeDelegateDefault='ilbmtoppm'
2954 ILBMEncodeDelegateDefault='ppmtoilbm'
2955 JXRDecodeDelegateDefault='JxrDecApp'
2956 JXREncodeDelegateDefault='JxrEncApp'
2957 LPDelegateDefault='lp'
2958 LPRDelegateDefault='lpr'
2959 LaunchDelegateDefault='gimp'
2960 MANDelegateDefault='groff'
2961 MPEGDecodeDelegateDefault='avconv'
2962 MPEGEncodeDelegateDefault='avconv'
2963 MrSIDDecodeDelegateDefault='mrsidgeodecode'
2964 MVDelegateDefault='mv'
2965 PCLDelegateDefault='pcl6'
2966 PGPDecodeDelegateDefault='pgpv'
2967 POVDelegateDefault='povray'
2968 if test "$native_win32_build" = 'yes'; then
2969 PSDelegateDefault='gswin32c'
2970 elif test "$gslib_framework" = 'yes'; then
2971 PSDelegateDefault='gsc'
2973 PSDelegateDefault='gs'
2975 RLEEncodeDelegateDefault='rawtorle'
2976 RMDelegateDefault='rm'
2977 RSVGDecodeDelegateDefault='rsvg-convert'
2978 SCANDecodeDelegateDefault='scanimage'
2979 SVGDecodeDelegateDefault='inkscape'
2980 TXTDelegateDefault='enscript'
2981 UniconvertorDelegateDefault='uniconvertor'
2982 WebPDecodeDelegateDefault='dwebp'
2983 WebPEncodeDelegateDefault='cwebp'
2984 WMFDecodeDelegateDefault='wmf2eps'
2985 WWWDecodeDelegateDefault='curl'
2986 XPSDelegateDefault='gxps'
2987 ZipDelegateDefault='gzip'
2989 # Search for delegates
2990 AC_PATH_PROG(AutotraceDecodeDelegate, "$AutotraceDecodeDelegateDefault", "$AutotraceDecodeDelegateDefault")
2991 AC_PATH_PROG(BGPDecodeDelegate, "$BGPDecodeDelegateDefault", "$BGPDecodeDelegateDefault")
2992 AC_PATH_PROG(BGPEncodeDelegate, "$BGPEncodeDelegateDefault", "$BGPEncodeDelegateDefault")
2993 AC_PATH_PROG(BlenderDecodeDelegate, "$BlenderDecodeDelegateDefault", "$BlenderDecodeDelegateDefault")
2994 AC_PATH_PROG(BZIPDelegate, "$BZIPDelegateDefault", "$BZIPDelegateDefault")
2995 AC_PATH_PROGS(BrowseDelegate, "$BrowseDelegateDefault" google-chrome firefox konqueror mozilla lynx, "$BrowseDelegateDefault")
2996 AC_PATH_PROG(CatDelegate, "$CatDelegateDefault", "$CatDelegateDefault")
2997 AC_PATH_PROG(DNGDecodeDelegate, "$DNGDecodeDelegateDefault", "$DNGDecodeDelegateDefault")
2998 AC_PATH_PROG(DOCDecodeDelegate, "$DOCDecodeDelegateDefault", "$DOCDecodeDelegateDefault")
2999 AC_PATH_PROG(DVIDecodeDelegate, "$DVIDecodeDelegateDefault", "$DVIDecodeDelegateDefault")
3000 AC_PATH_PROG(ConvertDelegate, "$ConvertDelegateDefault", "$ConvertDelegateDefault")
3001 AC_PATH_PROG(DisplayDelegate, "$DisplayDelegateDefault", "$DisplayDelegateDefault")
3002 AC_PATH_PROG(EchoDelegate, "$EchoDelegateDefault", "$EchoDelegateDefault")
3003 AC_PATH_PROG(EditorDelegate, "$EditorDelegateDefault", "$EditorDelegateDefault")
3004 AC_PATH_PROG(GnuplotDecodeDelegate, "$GnuplotDecodeDelegateDefault", "$GnuplotDecodeDelegateDefault")
3005 AC_PATH_PROG(GVCDecodeDelegate, "$GVCDecodeDelegateDefault", "$GVCDecodeDelegateDefault")
3006 AC_PATH_PROG(HPGLDecodeDelegate, "$HPGLDecodeDelegateDefault", "$HPGLDecodeDelegateDefault")
3007 AC_PATH_PROG(HTMLDecodeDelegate, "$HTMLDecodeDelegateDefault", "$HTMLDecodeDelegateDefault")
3008 AC_PATH_PROG(ILBMDecodeDelegate, "$ILBMDecodeDelegateDefault", "$ILBMDecodeDelegateDefault")
3009 AC_PATH_PROG(ILBMEncodeDelegate, "$ILBMEncodeDelegateDefault", "$ILBMEncodeDelegateDefault")
3010 AC_PATH_PROG(JXRDecodeDelegate, "$JXRDecodeDelegateDefault", "$JXRDecodeDelegateDefault")
3011 AC_PATH_PROG(JXREncodeDelegate, "$JXREncodeDelegateDefault", "$JXREncodeDelegateDefault")
3012 AC_PATH_PROG(LPDelegate, "$LPDelegateDefault", no)
3013 AC_PATH_PROG(LPRDelegate, "$LPRDelegateDefault", "$LPRDelegateDefault")
3014 AC_PATH_PROG(LaunchDelegate, "$LaunchDelegateDefault", "$LaunchDelegateDefault")
3015 AC_PATH_PROG(MANDelegate, "$MANDelegateDefault", "$MANDelegateDefault")
3016 AC_PATH_PROG(MogrifyDelegate, "$MogrifyDelegateDefault", "$MogrifyDelegateDefault")
3017 AC_PATH_PROG(MPEGDecodeDelegate, "$MPEGDecodeDelegateDefault", "$MPEGDecodeDelegateDefault")
3018 if test "$MPEGDecodeDelegate" = "$MPEGDecodeDelegateDefault" ; then
3019 MPEGDecodeDelegateDefault='ffmpeg'
3020 AC_PATH_PROG(MPEGDecodeDelegate, "$MPEGDecodeDelegateDefault", "$MPEGDecodeDelegateDefault")
3022 AC_PATH_PROG(MPEGEncodeDelegate, "$MPEGEncodeDelegateDefault", "$MPEGEncodeDelegateDefault")
3023 if test "$MPEGEncodeDelegate" = "$MPEGEncodeDelegateDefault" ; then
3024 MPEGEncodeDelegateDefault='ffmpeg'
3025 AC_PATH_PROG(MPEGEncodeDelegate, "$MPEGEncodeDelegateDefault", "$MPEGEncodeDelegateDefault")
3027 AC_PATH_PROG(MrSIDDecodeDelegate, "$MrSIDDecodeDelegateDefault", "$MrSIDDecodeDelegateDefault")
3028 AC_PATH_PROG(MVDelegate, "$MVDelegateDefault", "$MVDelegateDefault")
3029 AC_PATH_PROG(PCLDelegate, "$PCLDelegateDefault", "$PCLDelegateDefault")
3030 AC_PATH_PROG(PGPDecodeDelegate, "$PGPDecodeDelegateDefault", "$PGPDecodeDelegateDefault")
3031 AC_PATH_PROG(POVDelegate, "$POVDelegateDefault", "$POVDelegateDefault")
3032 AC_PATH_PROGS(PSDelegate, gsx gsc "$PSDelegateDefault", "$PSDelegateDefault")
3033 AC_PATH_PROG(RLEEncodeDelegate, "$RLEEncodeDelegateDefault", "$RLEEncodeDelegateDefault")
3034 AC_PATH_PROG(RMDelegate, "$RMDelegateDefault", "$RMDelegateDefault")
3035 AC_PATH_PROG(RSVGDecodeDelegate, "$RSVGDecodeDelegateDefault", "$RSVGDecodeDelegateDefault")
3036 AC_PATH_PROG(SCANDecodeDelegate, "$SCANDecodeDelegateDefault", "$SCANDecodeDelegateDefault")
3037 AC_PATH_PROG(SVGDecodeDelegate, "$SVGDecodeDelegateDefault", "$SVGDecodeDelegateDefault")
3038 AC_PATH_PROG(TXTDelegate, "$TXTDelegateDefault", "$TXTDelegateDefault")
3039 AC_PATH_PROG(UniconvertorDelegate, "$UniconvertorDelegateDefault", "$UniconvertorDelegateDefault")
3040 AC_PATH_PROG(WebPDecodeDelegate, "$WebPDecodeDelegateDefault", "$WebPDecodeDelegateDefault")
3041 AC_PATH_PROG(WebPEncodeDelegate, "$WebPEncodeDelegateDefault", "$WebPEncodeDelegateDefault")
3042 AC_PATH_PROG(WMFDecodeDelegate, "$WMFDecodeDelegateDefault", "$WMFDecodeDelegateDefault")
3043 AC_PATH_PROG(WWWDecodeDelegate, "$WWWDecodeDelegateDefault", "$WWWDecodeDelegateDefault")
3044 AC_PATH_PROG(XPSDelegate, "$XPSDelegateDefault", "$XPSDelegateDefault")
3045 AC_PATH_PROG(ZipDelegate, "$ZipDelegateDefault", "$ZipDelegateDefault")
3047 # Prefer lpr to lp; lp needs options tacked on.
3048 if test "$LPRDelegate" != no; then
3049 PrintDelegate="$LPRDelegate"
3051 PrintDelegate="$LPDelegate -c -s"
3053 AC_SUBST(PrintDelegate)
3055 # Installed ImageMagick utiltity paths
3056 ConvertDelegate="${BIN_DIR}/${ConvertDelegateDefault}"
3057 DisplayDelegate="${BIN_DIR}/${DisplayDelegateDefault}"
3058 MogrifyDelegate="${BIN_DIR}/${MogrifyDelegateDefault}"
3060 # Set delegate booleans
3061 have_avconv='no'; if test "$MPEGDecodeDelegate" != "$MPEGDecodeDelegateDefault" ; then have_avconv='yes'; fi
3062 have_gs='no' ; if test "$PSDelegate" != "$PSDelegateDefault"; then have_gs='yes'; fi
3063 have_hp2xx='no' ; if test "$HPGLDecodeDelegate" != "$HPGLDecodeDelegateDefault" ; then have_hp2xx='yes'; fi
3064 have_ilbmtoppm='no' ; if test "$ILBMDecodeDelegate" != "$ILBMDecodeDelegateDefault" ; then have_ilbmtoppm='yes'; fi
3065 have_mrsid='no'; if test "$MrSIDDecodeDelegate" != "$MrSIDDecodeDelegateDefault" ; then have_mrsid='yes'; fi
3066 have_pcl='no' ; if test "$PCLDelegate" != "$PCLDelegateDefault"; then have_pcl='yes'; fi
3067 have_ppmtoilbm='no' ; if test "$ILBMEncodeDelegate" != "$ILBMEncodeDelegateDefault" ; then have_ppmtoilbm='yes'; fi
3068 have_xps='no' ; if test "$XPSDelegate" != "$XPSDelegateDefault"; then have_xps='yes'; fi
3071 # Test for font directories
3073 type_include_files=''
3076 AC_MSG_CHECKING(for Apple fonts directory)
3078 if test "${with_apple_font_dir}" != 'default'; then
3079 apple_font_dir="${with_apple_font_dir}/"
3081 for font_dir in '/Library/Fonts/'; do
3082 if test -f "${font_dir}Arial.ttf"; then
3083 apple_font_dir="${font_dir}"
3088 if test "${apple_font_dir}x" != 'x'; then
3089 type_include_files="${type_include_files} "'<include file="type-apple.xml" />'
3090 AC_MSG_RESULT([$apple_font_dir])
3092 AC_MSG_RESULT([not found!]);
3094 AC_SUBST(apple_font_dir)
3097 AC_MSG_CHECKING(for Dejavu fonts directory)
3099 if test "${with_dejavu_font_dir}" != 'default'; then
3100 dejavu_font_dir="${with_dejavu_font_dir}/"
3102 for font_dir in "${prefix}/share/dejavu/fonts/" '/usr/share/fonts/dejavu/'; do
3103 if test -f "${font_dir}DejaVuSerif.ttf"; then
3104 dejavu_font_dir="${font_dir}"
3109 if test "${dejavu_font_dir}x" != 'x'; then
3110 type_include_files="${type_include_files} "'<include file="type-dejavu.xml" />'
3111 AC_MSG_RESULT([$dejavu_font_dir])
3113 AC_MSG_RESULT([not found!]);
3115 AC_SUBST(dejavu_font_dir)
3118 AC_MSG_CHECKING(for Ghostscript fonts directory)
3119 ghostscript_font_dir=''
3120 if test "${with_gs_font_dir}" != 'default'; then
3121 ghostscript_font_dir="${with_gs_font_dir}/"
3123 if test "${native_win32_build}" = 'yes'; then
3124 # Native Windows Build
3125 for font_dir in "c:\\Program Files\\gs\\fonts\\" "c:\\Program Files \(x86\)\\gs\\fonts\\" "c:\\gs\\fonts\\"; do
3126 if test -f "${font_dir}a010013l.pfb"; then
3127 ghostscript_font_dir="$font_dir"
3131 if test "${PSDelegate}" != 'gswin32c'; then
3132 ghostscript_font_dir=`echo "${PSDelegate}" | sed -e 's:/gs/.*:/gs:;s:^/::;s/./&:/;s:/:\\\\:g'`"\\fonts\\"
3135 # Linux / Mac OS X / Unix Build
3136 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
3137 if test -f "${font_dir}a010013l.pfb"; then
3138 ghostscript_font_dir="${font_dir}"
3142 if test "${ghostscript_font_dir}x" = 'x'; then
3143 if test "$PSDelegate" != 'gs'; then
3144 ghostscript_font_dir=`echo "$PSDelegate" | sed -e 's:/bin/gs:/share/ghostscript/fonts:'`"/"
3149 if test "${ghostscript_font_dir}x" != 'x'; then
3150 type_include_files="${type_include_files} "'<include file="type-ghostscript.xml" />'
3151 AC_MSG_RESULT([$ghostscript_font_dir])
3153 AC_MSG_RESULT([not found!]);
3155 AC_SUBST(ghostscript_font_dir)
3156 case "${build_os}" in
3158 PSDelegate=`$WinPathScript "$PSDelegate" 1`
3163 AC_MSG_CHECKING(for Windows fonts directory)
3165 if test "${with_windows_font_dir}" != 'default'; then
3166 windows_font_dir="${with_windows_font_dir}/"
3168 for font_dir in '/usr/X11R6/lib/X11/fonts/truetype/' '/usr/X11R7/lib/X11/fonts/truetype/' '/usr/share/fonts/msttcore/'; do
3169 if test -f "${font_dir}arial.ttf"; then
3170 windows_font_dir="${font_dir}"
3175 if test "${windows_font_dir}x" != 'x'; then
3176 type_include_files="${type_include_files} "'<include file="type-windows.xml" />'
3177 AC_MSG_RESULT([$windows_font_dir])
3179 AC_MSG_RESULT([not found!]);
3181 AC_SUBST(windows_font_dir)
3183 AC_SUBST(type_include_files)
3186 # Handle case where user doesn't want frozen paths
3188 if test "$with_frozenpaths" != 'yes'; then
3189 # Re-set delegate definitions to default (no paths)
3190 AutotraceDecodeDelegate="$AutotraceDecodeDelegateDefault"
3191 BGPDecodeDelegate="$BGPDecodeDelegateDefault"
3192 BGPEncodeDelegate="$BGPEncodeDelegateDefault"
3193 BlenderDecodeDelegate="$BlenderDecodeDelegateDefault"
3194 BZIPDelegate="$BZIPDelegateDefault"
3195 BrowseDelegate="$BrowseDelegateDefault"
3196 CatDelegate="$CatDelegateDefault"
3197 ConvertDelegate="$ConvertDelegateDefault"
3198 DisplayDelegate="$DisplayDelegateDefault"
3199 DNGDecodeDelegate="$DNGDecodeDelegateDefault"
3200 DOCDecodeDelegate="$DOCDecodeDelegateDefault"
3201 DVIDecodeDelegate="$DVIDecodeDelegateDefault"
3202 EchoDelegate="$EchoDelegateDefault"
3203 EditorDelegate="$EditorDelegateDefault"
3204 GnuplotDecodeDelegate="$GnuplotDecodeDelegateDefault"
3205 GVCDecodeDelegate="$GVCDecodeDelegateDefault"
3206 HPGLDecodeDelegate="$HPGLDecodeDelegateDefault"
3207 HTMLDecodeDelegate="$HTMLDecodeDelegateDefault"
3208 ILBMDecodeDelegate="$ILBMDecodeDelegateDefault"
3209 ILBMEncodeDelegate="$ILBMEncodeDelegateDefault"
3210 JXRDecodeDelegate="$JXRDecodeDelegateDefault"
3211 JXREncodeDelegate="$JXREncodeDelegateDefault"
3212 LPDelegate="$LPDelegateDefault"
3213 LaunchDelegate="$LaunchDelegateDefault"
3214 MANDelegate="$MANDelegateDefault"
3215 MPEGDecodeDelegate="$MPEGDecodeDelegateDefault"
3216 MPEGEncodeDelegate="$MPEGEncodeDelegateDefault"
3217 MogrifyDelegate="$MogrifyDelegateDefault"
3218 MrSIDDecodeDelegate="$MrSIDDecodeDelegateDefault"
3219 MVDelegate="$MVDelegateDefault"
3220 PCLDelegate="$PCLDelegateDefault"
3221 PGPDecodeDelegate="$PGPDecodeDelegateDefault"
3222 POVDelegate="$POVDelegateDefault"
3223 PSDelegate="$PSDelegateDefault"
3224 RLEEncodeDelegate="$RLEEncodeDelegateDefault"
3225 RMDelegate="$RMDelegateDefault"
3226 RSVGDecodeDelegate="$RSVGDecodeDelegateDefault"
3227 SCANDecodeDelegate="$SCANDecodeDelegateDefault"
3228 SVGDecodeDelegate="$SVGDecodeDelegateDefault"
3229 ShowImageDelegate="$ShowImageDelegateDefault"
3230 TXTDelegate="$TXTDelegateDefault"
3231 UniconvertorDelegate="$UniconvertorDelegateDefault"
3232 WebPDecodeDelegate="$WebPDecodeDelegateDefault"
3233 WebPEncodeDelegate="$WebPEncodeDelegateDefault"
3234 WMFDecodeDelegate="$WMFDecodeDelegateDefault"
3235 WWWDecodeDelegate="$WWWDecodeDelegateDefault"
3236 XPSDelegate="$XPSDelegateDefault"
3237 ZipDelegate="$ZipDelegateDefault"
3240 # Delegate substitutions
3241 AC_SUBST(AutotraceDecodeDelegate)
3242 AC_SUBST(BGPDecodeDelegate)
3243 AC_SUBST(BGPEncodeDelegate)
3244 AC_SUBST(BlenderDecodeDelegate)
3245 AC_SUBST(BZIPDelegate)
3246 AC_SUBST(BrowseDelegate)
3247 AC_SUBST(CatDelegate)
3248 AC_SUBST(ConvertDelegate)
3249 AC_SUBST(GVCDecodeDelegate)
3250 AC_SUBST(DVIDecodeDelegate)
3251 AC_SUBST(EchoDelegate)
3252 AC_SUBST(EditorDelegate)
3253 AC_SUBST(GnuplotDecodeDelegate)
3254 AC_SUBST(HPGLDecodeDelegate)
3255 AC_SUBST(HTMLDecodeDelegate)
3256 AC_SUBST(ILBMDecodeDelegate)
3257 AC_SUBST(ILBMEncodeDelegate)
3258 AC_SUBST(JXRDecodeDelegate)
3259 AC_SUBST(JXREncodeDelegate)
3260 AC_SUBST(LPDelegate)
3261 AC_SUBST(LaunchDelegate)
3262 AC_SUBST(MANDelegate)
3263 AC_SUBST(MPEGDecodeDelegate)
3264 AC_SUBST(MPEGEncodeDelegate)
3265 AC_SUBST(MogrifyDelegate)
3266 AC_SUBST(MrSIDDecodeDelegate)
3267 AC_SUBST(MVDelegate)
3268 AC_SUBST(PCLDelegate)
3269 AC_SUBST(PGPDecodeDelegate)
3270 AC_SUBST(POVDelegate)
3271 AC_SUBST(PSDelegate)
3272 AC_SUBST(RLEEncodeDelegate)
3273 AC_SUBST(RMDelegate)
3274 AC_SUBST(SCANDecodeDelegate)
3275 AC_SUBST(ShowImageDelegate)
3276 AC_SUBST(TXTDelegate)
3277 AC_SUBST(UniconvertorDelegate)
3278 AC_SUBST(WMFDecodeDelegate)
3279 AC_SUBST(WebPDecodeDelegate)
3280 AC_SUBST(WebPEncodeDelegate)
3281 AC_SUBST(WWWDecodeDelegate)
3282 AC_SUBST(XPSDelegate)
3283 AC_SUBST(ZipDelegate)
3289 AC_CHECK_PROGS(TAR,gnutar gtar tar)
3290 AC_CHECK_PROGS(PERL,perl)
3291 AC_CHECK_PROGS(RPM,rpmbuild rpm)
3292 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
3293 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
3294 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
3295 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
3297 AM_CONDITIONAL(RPM_DELEGATE, test "x$RPM" != "x" )
3300 # 7ZIP support (http://p7zip.sourceforge.net/)
3303 AC_CHECK_PROGS(P7ZIP,[7za])
3305 AM_CONDITIONAL(P7ZIP_DELEGATE, test "x$P7ZIP" != "x" )
3308 # ZIP support (http://www.info-zip.org/Zip.html)
3311 AC_CHECK_PROGS(ZIP,[zip])
3313 AM_CONDITIONAL(ZIP_DELEGATE, test "x$ZIP" != "x" )
3316 # GhostPCL related configuration.
3318 PCLColorDevice=ppmraw
3319 PCLCMYKDevice=pamcmyk32
3320 PCLMonoDevice=pbmraw
3321 if test -z "$PCLVersion"; then
3322 PCLVersion='unknown'
3324 if test $have_pcl = 'yes'; then
3325 AC_MSG_RESULT([-------------------------------------------------------------])
3326 AC_MSG_CHECKING([for PCL])
3329 AC_MSG_CHECKING([for pcl color device])
3330 if $PCLDelegate -dBATCH -sDEVICE=$PCLColorDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
3333 PCLColorDevice=ppmraw
3335 AC_MSG_RESULT([$PCLColorDevice])
3338 AC_MSG_CHECKING([for pcl CMYK device])
3339 if $PCLDelegate -dBATCH -sDEVICE=$PCLColorDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
3342 PCLCMYKDevice=$PCLColorDevice
3344 AC_MSG_RESULT([$PCLCMYKDevice])
3347 AC_MSG_CHECKING([for pcl mono device])
3348 if $PCLDelegate -dBATCH -sDEVICE=$PCLMonoDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
3351 PCLMonoDevice=$PCLColorDevice
3353 AC_MSG_RESULT([$PCLMonoDevice])
3356 AC_SUBST(PCLMonoDevice)
3357 AC_SUBST(PCLColorDevice)
3358 AC_SUBST(PCLCMYKDevice)
3359 AC_SUBST(PCLVersion)
3362 # GhostXPS related configuration.
3364 XPSColorDevice=ppmraw
3365 XPSCMYKDevice=bmpsep8
3366 XPSMonoDevice=pbmraw
3367 if test -z "$XPSVersion"; then
3368 XPSVersion='unknown'
3370 if test $have_xps = 'yes'; then
3371 AC_MSG_RESULT([-------------------------------------------------------------])
3372 AC_MSG_CHECKING([for XPS])
3375 AC_MSG_CHECKING([for xps color device])
3376 if $XPSDelegate -dBATCH -sDEVICE=$XPSColorDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
3379 XPSColorDevice=ppmraw
3381 AC_MSG_RESULT([$XPSColorDevice])
3384 AC_MSG_CHECKING([for xps CMYK device])
3385 if $XPSDelegate -dBATCH -sDEVICE=$XPSColorDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
3388 XPSCMYKDevice=$XPSColorDevice
3390 AC_MSG_RESULT([$XPSCMYKDevice])
3393 AC_MSG_CHECKING([for xps mono device])
3394 if $XPSDelegate -dBATCH -sDEVICE=$XPSMonoDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
3397 XPSMonoDevice=$XPSColorDevice
3399 AC_MSG_RESULT([$XPSMonoDevice])
3402 AC_SUBST(XPSMonoDevice)
3403 AC_SUBST(XPSColorDevice)
3404 AC_SUBST(XPSCMYKDevice)
3405 AC_SUBST(XPSVersion)
3408 # Ghostscript related configuration.
3410 GSAlphaDevice=pngalpha
3411 GSColorDevice=pnmraw
3412 GSCMYKDevice=pamcmyk32
3414 GSPDFDevice=pdfwrite
3416 GSEPSDevice=eps2write
3418 if test $have_gs = 'yes'; then
3419 AC_MSG_RESULT([-------------------------------------------------------------])
3420 AC_MSG_CHECKING([for Ghostscript])
3422 AC_MSG_CHECKING([for Ghostscript version])
3423 if GSVersion=`$PSDelegate --version`; then
3426 GSVersion=`$PSDelegate --help | sed -e '1q' | awk '{ print $3 }'`
3428 AC_MSG_RESULT([$GSVersion])
3431 AC_MSG_CHECKING([for gs color device])
3432 if $PSDelegate -q -dBATCH -sDEVICE=$GSColorDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
3435 GSColorDevice=ppmraw
3437 AC_MSG_RESULT([$GSColorDevice])
3440 AC_MSG_CHECKING([for gs alpha device])
3441 if $PSDelegate -q -dBATCH -sDEVICE=$GSAlphaDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
3444 GSAlphaDevice=$GSColorDevice
3446 AC_MSG_RESULT([$GSAlphaDevice])
3449 AC_MSG_CHECKING([for gs CMYK device])
3450 if $PSDelegate -q -dBATCH -sDEVICE=$GSCMYKDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
3455 AC_MSG_RESULT([$GSCMYKDevice])
3458 AC_MSG_CHECKING([for gs mono device])
3459 if $PSDelegate -q -dBATCH -sDEVICE=$GSMonoDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
3462 GSMonoDevice=$GSColorDevice
3464 AC_MSG_RESULT([$GSMonoDevice])
3467 AC_MSG_CHECKING([for gs PDF writing device])
3468 if $PSDelegate -q -dBATCH -sDEVICE=$GSPDFDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
3471 GSPDFDevice=nodevice
3473 AC_MSG_RESULT([$GSPDFDevice])
3476 AC_MSG_CHECKING([for gs PS writing device])
3477 if $PSDelegate -q -dBATCH -sDEVICE=$GSPSDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
3482 AC_MSG_RESULT([$GSPSDevice])
3485 AC_MSG_CHECKING([for gs EPS writing device])
3486 if $PSDelegate -q -dBATCH -sDEVICE=$GSEPSDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
3489 GSEPSDevice=epswrite
3491 AC_MSG_RESULT([$GSEPSDevice])
3494 AC_SUBST(GSAlphaDevice)
3495 AC_SUBST(GSCMYKDevice)
3496 AC_SUBST(GSColorDevice)
3497 AC_SUBST(GSEPSDevice)
3498 AC_SUBST(GSMonoDevice)
3499 AC_SUBST(GSPDFDevice)
3500 AC_SUBST(GSPSDevice)
3504 # PerlMagick-related configuration
3507 # Look for PERL if PerlMagick requested
3508 # If name/path of desired PERL interpreter is specified, look for that one first
3510 if test "$with_perl" != 'no'; then
3511 AC_MSG_RESULT([-------------------------------------------------------------])
3512 AC_MSG_CHECKING([for Perl])
3514 if test "$with_perl" != 'yes'; then
3515 AC_CACHE_CHECK(for perl,ac_cv_path_PERL,ac_cv_path_PERL="$with_perl");
3516 PERL=$ac_cv_path_PERL
3518 have_perl="$ac_cv_path_PERL"
3520 AC_PATH_PROGS(PERL,perl perl5,)dnl
3521 if test "$ac_cv_path_PERL"; then
3522 have_perl="$ac_cv_path_PERL"
3527 if test "$with_perl" != 'yes' ; then
3528 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-perl=$with_perl "
3531 PERL_SUPPORTS_DESTDIR='no'
3533 with_perl_static='no'
3534 with_perl_dynamic='no'
3535 if test "$have_perl" != 'no'; then
3536 if test "$with_perl" != 'no' && test "$libtool_build_shared_libs" = 'no'; then
3537 with_perl_static='yes'
3539 if test "$with_perl" != 'no' && test "$libtool_build_shared_libs" = 'yes'; then
3540 with_perl_dynamic='yes'
3542 # Is PERL's MakeMaker new enough to support DESTDIR?
3543 AX_PROG_PERL_VERSION(5.8.1,[PERL_SUPPORTS_DESTDIR='yes'],[PERL_SUPPORTS_DESTDIR='no'])
3545 AM_CONDITIONAL(WITH_PERL, test "$have_perl" != 'no')
3546 AM_CONDITIONAL(WITH_PERL_STATIC, test $with_perl_static = 'yes')
3547 AM_CONDITIONAL(WITH_PERL_DYNAMIC, test $with_perl_dynamic = 'yes')
3548 AC_SUBST(PERL_SUPPORTS_DESTDIR)
3550 # Determine path to pick up MagickCore library from for use with building PerlMagick
3551 MAGICKCORE_PATH="${LIB_DIR}"
3552 if test $with_perl_static = 'yes'; then
3553 # Find out where libtool hides its uninstalled libraries (as libtool_objdir)
3554 libtool_objdir=$objdir
3556 # Linker search path to library, followed by -lMagickCore
3557 MAGICKCORE_PATH="${builddir}/MagickCore/${libtool_objdir}"
3559 AC_SUBST(MAGICKCORE_PATH)
3561 # Create a simple string containing format names for all delegate libraries.
3563 if test "$have_autotrace" = 'yes' ; then
3564 MAGICK_DELEGATES="$MAGICK_DELEGATES autotrace"
3566 if test "$have_bzlib" = 'yes' ; then
3567 MAGICK_DELEGATES="$MAGICK_DELEGATES bzlib"
3569 if test "$have_dps" = 'yes' ; then
3570 MAGICK_DELEGATES="$MAGICK_DELEGATES dps"
3572 if test "$have_djvu" = 'yes' ; then
3573 MAGICK_DELEGATES="$MAGICK_DELEGATES djvu"
3575 if test "$have_avconv" = 'yes' ; then
3576 MAGICK_DELEGATES="$MAGICK_DELEGATES mpeg"
3578 if test "$have_fftw" = 'yes' ; then
3579 MAGICK_DELEGATES="$MAGICK_DELEGATES fftw"
3581 if test "$have_fpx" = 'yes' ; then
3582 MAGICK_DELEGATES="$MAGICK_DELEGATES fpx"
3584 if test "$have_fontconfig" = 'yes' ; then
3585 MAGICK_DELEGATES="$MAGICK_DELEGATES fontconfig"
3587 if test "$have_freetype" = 'yes' ; then
3588 MAGICK_DELEGATES="$MAGICK_DELEGATES freetype"
3590 if test "$have_gslib" = 'yes' ; then
3591 MAGICK_DELEGATES="$MAGICK_DELEGATES gslib"
3593 if test "$have_jbig" = 'yes' ; then
3594 MAGICK_DELEGATES="$MAGICK_DELEGATES jbig"
3596 if test "$have_png$have_jpeg" = 'yesyes' ; then
3597 MAGICK_DELEGATES="$MAGICK_DELEGATES jng"
3599 if test "$have_jpeg" = 'yes' ; then
3600 MAGICK_DELEGATES="$MAGICK_DELEGATES jpeg"
3602 if test "$have_lcms" = 'yes' || test "$have_lcms2" = 'yes' ; then
3603 MAGICK_DELEGATES="$MAGICK_DELEGATES lcms"
3605 if test "$have_lqr" = 'yes' ; then
3606 MAGICK_DELEGATES="$MAGICK_DELEGATES lqr"
3608 if test "$have_lzma" = 'yes' ; then
3609 MAGICK_DELEGATES="$MAGICK_DELEGATES lzma"
3611 if test "$have_openexr" = 'yes' ; then
3612 MAGICK_DELEGATES="$MAGICK_DELEGATES openexr"
3614 if test "$have_openjp2" = 'yes' ; then
3615 MAGICK_DELEGATES="$MAGICK_DELEGATES openjp2"
3617 if test "$have_pango" = 'yes' ; then
3618 MAGICK_DELEGATES="$MAGICK_DELEGATES pango"
3620 if test "$have_png" = 'yes' ; then
3621 MAGICK_DELEGATES="$MAGICK_DELEGATES png"
3624 if test "$have_dps" = 'yes' || \
3625 test "$have_gs" = 'yes' || \
3626 test "${native_win32_build}" = 'yes' ; then
3629 if test "$have_ps" = 'yes' ; then
3630 MAGICK_DELEGATES="$MAGICK_DELEGATES ps"
3632 if test "$have_ra_ppm" = 'yes' ; then
3633 MAGICK_DELEGATES="$MAGICK_DELEGATES rad"
3635 if test "$have_rsvg" = 'yes' ; then
3636 MAGICK_DELEGATES="$MAGICK_DELEGATES rsvg"
3638 if test "$have_tiff" = 'yes' ; then
3639 MAGICK_DELEGATES="$MAGICK_DELEGATES tiff"
3641 if test "$have_ttf" = 'yes' ; then
3642 MAGICK_DELEGATES="$MAGICK_DELEGATES ttf"
3644 if test "$have_webp" = 'yes' ; then
3645 MAGICK_DELEGATES="$MAGICK_DELEGATES webp"
3647 if test "$have_wmf" = 'yes' ; then
3648 MAGICK_DELEGATES="$MAGICK_DELEGATES wmf"
3650 if test "$have_x" = 'yes' ; then
3651 MAGICK_DELEGATES="$MAGICK_DELEGATES x"
3653 if test "$have_xml" = 'yes' ; then
3654 MAGICK_DELEGATES="$MAGICK_DELEGATES xml"
3656 if test "$have_zlib" = 'yes' ; then
3657 MAGICK_DELEGATES="$MAGICK_DELEGATES zlib"
3660 # Remove extraneous spaces from output variables (asthetic)
3661 MAGICK_DELEGATES=`echo $MAGICK_DELEGATES | sed -e 's/ */ /g'`
3662 MAGICK_FEATURES=`echo $MAGICK_FEATURES | sed -e 's/ */ /g'`
3663 AC_SUBST(MAGICK_DELEGATES)
3664 AC_SUBST(MAGICK_FEATURES)
3667 # Handle special compiler flags
3670 # Add '-p' if prof source profiling support enabled
3671 if test "$enable_prof" = 'yes'; then
3673 CXXFLAGS="-p $CXXFLAGS"
3674 LDFLAGS="-p $LDFLAGS"
3677 # Add '-pg' if gprof source profiling support enabled
3678 if test "$enable_gprof" = 'yes'; then
3679 CFLAGS="-pg $CFLAGS"
3680 CXXFLAGS="-pg $CXXFLAGS"
3681 LDFLAGS="-pg $LDFLAGS"
3684 # Add '-ftest-coverage -fprofile-arcs' if gcov source profiling support enabled
3685 # This is a gcc-specific feature
3686 if test "$enable_gcov" = 'yes'; then
3687 AC_CHECK_LIB(gcov,_gcov_init)
3688 AC_CHECK_LIB(gcov,__gcov_init)
3689 case "$target_os" in
3691 OSX_GCOV_LDFLAG="-Wl,-single_module"
3697 AC_SUBST(OSX_GCOV_LDFLAG)
3698 CFLAGS="-ftest-coverage -fprofile-arcs $CFLAGS"
3699 CXXFLAGS="-ftest-coverage -fprofile-arcs $CXXFLAGS"
3700 LDFLAGS="-ftest-coverage -fprofile-arcs $LDFLAGS"
3704 # Build library dependency list for libMagickCore
3707 if test "$build_modules" != 'no'; then
3708 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"
3710 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 $LIBOPENJP2_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"
3712 AC_SUBST(MAGICK_DEP_LIBS)
3715 # Sanitize output variables (asthetic).
3717 for variable in CFLAGS CPPFLAGS CXXFLAGS LDFLAGS PCFLAGS X_CFLAGS; do
3719 eval value=$`echo $variable`
3720 for component in $value
3723 for test_component in $sanitize
3725 if test $component = $test_component; then
3730 if test $unique = yes; then
3731 sanitize="$sanitize $component"
3734 sanitize=`echo $sanitize | sed -e 's/^ *//g'`
3735 eval ${variable}=\${sanitize}
3738 # Pass only user-provided LIBS as "global" libraries
3744 #AC_SUBST(X_PRE_LIBS)
3746 #AC_SUBST(X_EXTRA_LIBS)
3748 MAGICK_CFLAGS=$CFLAGS
3749 MAGICK_CXXFLAGS="$CXXFLAGS"
3750 MAGICK_CPPFLAGS=`echo $MAGICK_CPPFLAGS | sed -e 's/ */ /g'`
3751 MAGICK_PCFLAGS=`echo $MAGICK_PCFLAGS | sed -e 's/ */ /g'`
3752 MAGICK_LDFLAGS="-L$LIB_DIR $LDFLAGS"
3753 MAGICK_LIBS="$MAGICK_DEP_LIBS"
3755 AC_SUBST(MAGICK_CFLAGS)
3756 AC_SUBST(MAGICK_CXXFLAGS)
3757 AC_SUBST(MAGICK_CPPFLAGS)
3758 AC_SUBST(MAGICK_PCFLAGS)
3759 AC_SUBST(MAGICK_LDFLAGS)
3760 AC_SUBST(MAGICK_LIBS)
3762 # Set configured scripts to executable.
3763 AC_CONFIG_COMMANDS([default],[],[])
3764 AC_CONFIG_COMMANDS([magick.sh.in],[chmod +x magick.sh])
3765 AC_CONFIG_COMMANDS([MagickCore-config.in],[chmod +x MagickCore/MagickCore-config])
3766 AC_CONFIG_COMMANDS([MagickWand-config.in],[chmod +x MagickWand/MagickWand-config])
3767 AC_CONFIG_COMMANDS([Magick++-config.in],[chmod +x Magick++/bin/Magick++-config])
3768 AC_CONFIG_COMMANDS([PerlMagick/check.sh.in],[chmod +x PerlMagick/check.sh])
3770 AC_MSG_RESULT([-------------------------------------------------------------])
3771 AC_MSG_RESULT([Update ImageMagick configuration])
3773 rm -f magick-version
3775 result_dejavu_font_dir='none'
3776 if test "${dejavu_font_dir}x" != 'x'; then
3777 result_dejavu_font_dir=$dejavu_font_dir
3780 result_ghostscript_font_dir='none'
3781 if test "${ghostscript_font_dir}x" != 'x'; then
3782 result_ghostscript_font_dir=$ghostscript_font_dir
3785 result_windows_font_dir='none'
3786 if test "${windows_font_dir}x" != 'x'; then
3787 result_windows_font_dir=${windows_font_dir}
3790 # ==============================================================================
3791 # Generate build environment
3792 # ==============================================================================
3795 config/configure.xml \
3796 config/delegates.xml \
3797 config/ImageMagick.rdf \
3798 config/MagickCore.dox \
3799 config/MagickWand.dox \
3800 config/Magick++.dox \
3801 config/type-apple.xml \
3802 config/type-dejavu.xml \
3803 config/type-ghostscript.xml \
3804 config/type-windows.xml \
3807 Magick++/bin/Magick++-config \
3808 MagickCore/ImageMagick.pc \
3809 Magick++/lib/Magick++.pc \
3810 MagickCore/MagickCore-config \
3811 MagickCore/MagickCore.pc \
3812 MagickCore/version.h \
3815 PerlMagick/check.sh \
3816 PerlMagick/default/Magick.pm \
3817 PerlMagick/Makefile.PL \
3818 PerlMagick/default/Makefile.PL \
3819 PerlMagick/quantum/Makefile.PL \
3820 PerlMagick/quantum/quantum.pm \
3821 PerlMagick/quantum/quantum.xs \
3822 PerlMagick/quantum/typemap \
3823 utilities/animate.1 \
3824 utilities/compare.1 \
3825 utilities/composite.1 \
3826 utilities/conjure.1 \
3827 utilities/convert.1 \
3828 utilities/display.1 \
3829 utilities/identify.1 \
3830 utilities/ImageMagick.1 \
3831 utilities/import.1 \
3832 utilities/mogrify.1 \
3833 utilities/montage.1 \
3834 utilities/stream.1 \
3835 MagickWand/MagickWand-config \
3836 MagickWand/MagickWand.pc ])
3839 # ==============================================================================
3840 # ImageMagick Configuration
3841 # ==============================================================================
3843 ==============================================================================
3844 ImageMagick is configured as follows. Please verify that this configuration
3845 matches your expectations.
3847 Host system type: $host
3848 Build system type: $build
3851 ------------------------------------------------------------------------------
3852 Shared libraries --enable-shared=$enable_shared $libtool_build_shared_libs
3853 Static libraries --enable-static=$enable_static $libtool_build_static_libs
3854 Module support --with-modules=$build_modules $build_modules
3855 GNU ld --with-gnu-ld=$with_gnu_ld $lt_cv_prog_gnu_ld
3856 Quantum depth --with-quantum-depth=$with_quantum_depth $with_quantum_depth
3857 High Dynamic Range Imagery
3858 --enable-hdri=$enable_hdri $enable_hdri
3860 Install documentation: $wantdocs
3862 Delegate Library Configuration:
3863 BZLIB --with-bzlib=$with_bzlib $have_bzlib
3864 Autotrace --with-autotrace=$with_autotrace $have_autotrace
3865 DJVU --with-djvu=$with_djvu $have_djvu
3866 DPS --with-dps=$with_dps $have_dps
3867 FFTW --with-fftw=$with_fftw $have_fftw
3868 FlashPIX --with-fpx=$with_fpx $have_fpx
3869 FontConfig --with-fontconfig=$with_fontconfig $have_fontconfig
3870 FreeType --with-freetype=$with_freetype $have_freetype
3871 Ghostscript lib --with-gslib=$with_gslib $have_gslib
3872 Graphviz --with-gvc=$with_gvc $have_gvc
3873 JBIG --with-jbig=$with_jbig $have_jbig
3874 JPEG v1 --with-jpeg=$with_jpeg $have_jpeg
3875 LCMS --with-lcms=$with_lcms $have_lcms
3876 LIBJPEG2 --with-openjp2=$with_openjp2 $have_openjp2
3877 LQR --with-lqr=$with_lqr $have_lqr
3878 LTDL --with-ltdl=$with_ltdl $have_ltdl
3879 LZMA --with-lzma=$with_lzma $have_lzma
3880 Magick++ --with-magick-plus-plus=$with_magick_plus_plus $have_magick_plus_plus
3881 OpenEXR --with-openexr=$with_openexr $have_openexr
3882 PANGO --with-pango=$with_pango $have_pango
3883 PERL --with-perl=$with_perl $have_perl
3884 PNG --with-png=$with_png $have_png
3885 RSVG --with-rsvg=$with_rsvg $have_rsvg
3886 TIFF --with-tiff=$with_tiff $have_tiff
3887 WEBP --with-webp=$with_webp $have_webp
3888 WMF --with-wmf=$with_wmf $have_wmf
3889 X11 --with-x=$with_x $have_x
3890 XML --with-xml=$with_xml $have_xml
3891 ZLIB --with-zlib=$with_zlib $have_zlib
3893 Delegate Program Configuration:
3894 GhostPCL None $PCLDelegate ($PCLVersion)
3895 GhostXPS None $XPSDelegate ($XPSVersion)
3896 Ghostscript None $PSDelegate ($GSVersion)
3899 Apple fonts --with-apple-font-dir=$with_apple_font_dir $result_apple_font_dir
3900 Dejavu fonts --with-dejavu-font-dir=$with_dejavu_font_dir $result_dejavu_font_dir
3901 Ghostscript fonts --with-gs-font-dir=$with_gs_font_dir $result_ghostscript_font_dir
3902 Windows fonts --with-windows-font-dir=$with_windows_font_dir $result_windows_font_dir
3905 X_CFLAGS = $X_CFLAGS
3906 X_PRE_LIBS = $X_PRE_LIBS
3908 X_EXTRA_LIBS = $X_EXTRA_LIBS
3910 Options used to compile and link:
3911 PREFIX = $PREFIX_DIR
3912 EXEC-PREFIX = $EXEC_PREFIX_DIR
3913 VERSION = $PACKAGE_VERSION
3916 CPPFLAGS = $CPPFLAGS
3922 CXXFLAGS = $CXXFLAGS
3923 FEATURES = $MAGICK_FEATURES
3924 DELEGATES = $MAGICK_DELEGATES
3925 ==============================================================================