Home | History | Annotate | Download | only in ImageMagick
      1 #  Copyright 1999-2016 ImageMagick Studio LLC, a non-profit organization
      2 #  dedicated to making software imaging solutions freely available.
      3 #
      4 #  You may not use this file except in compliance with the License.  You may
      5 #  obtain a copy of the License at
      6 #
      7 #    http://www.imagemagick.org/script/license.php
      8 #
      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.
     14 #
     15 #  Copyright (C) 2003 - 2008 GraphicsMagick Group
     16 #
     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.
     20 
     21 # Process this file with autoconf to create configure script.
     22 AC_PREREQ(2.69)
     23 
     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], [2])
     30 m4_define([magick_patchlevel_version], [5])
     31 m4_define([magick_version],
     32           [magick_major_version.magick_minor_version.magick_micro_version-magick_patchlevel_version])
     33 m4_define([magick_git_revision], esyscmd([sh -c "(gitversion .) | tr -d '\n'"]))
     34 m4_define([magick_tar_name],[ImageMagick])
     35 
     36 # ==============================================================================
     37 # Initalize Automake
     38 # ==============================================================================
     39 AC_INIT([ImageMagick],
     40         [magick_version],
     41         [https://github.com/ImageMagick/ImageMagick/issues],
     42         [magick_tar_name],
     43         [http://www.imagemagick.org])
     44 AC_CONFIG_SRCDIR([MagickCore/MagickCore.h])
     45 AC_CONFIG_AUX_DIR([config])
     46 AC_REQUIRE_AUX_FILE([tap-driver.sh])
     47 AC_CONFIG_MACRO_DIR([m4])
     48 AC_CONFIG_HEADERS([config/config.h])
     49 AX_PREFIX_CONFIG_H([MagickCore/magick-baseconfig.h],[MagickCore])
     50 AC_CANONICAL_SYSTEM
     51 AC_CANONICAL_TARGET
     52 AM_INIT_AUTOMAKE([foreign color-tests -Wall -Wno-portability subdir-objects dist-bzip2 dist-lzip dist-xz dist-zip tar-ustar])
     53 AM_SILENT_RULES([yes])
     54 
     55 #
     56 # Save initial user-tunable values
     57 #
     58 USER_LIBS=$LIBS
     59 for var in CC CFLAGS CPPFLAGS CXX CXXCPP LDFLAGS LIBS ; do
     60   eval isset=\${$var+set}
     61     if test "$isset" = 'set'; then
     62         eval val=$`echo $var`
     63         DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS}'${var}=${val}' "
     64     fi
     65 done
     66 AC_SUBST(DISTCHECK_CONFIG_FLAGS)
     67 
     68 CONFIGURE_ARGS="$0 ${ac_configure_args}"
     69 AC_SUBST(CONFIGURE_ARGS)
     70 
     71 AC_ARG_ENABLE([reproducible-build],
     72     [AC_HELP_STRING([--enable-reproducible-build],
     73                     [enable reproducible build])],
     74     [enable_reproducible_build=$enableval],
     75     [enable_reproducible_build='no'])
     76 
     77 # Source file containing package/library versioning information.
     78 . ${srcdir}/version.sh
     79 
     80 echo "configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}${PACKAGE_VERSION_ADDENDUM}"
     81 
     82 MAGICK_TARGET_CPU=$host_cpu
     83 AC_SUBST(MAGICK_TARGET_CPU)
     84 AC_DEFINE_UNQUOTED(MAGICK_TARGET_CPU,$MAGICK_TARGET_CPU,[Target Host CPU])
     85 
     86 MAGICK_TARGET_VENDOR=$host_vendor
     87 AC_SUBST(MAGICK_TARGET_VENDOR)
     88 AC_DEFINE_UNQUOTED(MAGICK_TARGET_VENDOR,$MAGICK_TARGET_VENDOR,[Target Host Vendor])
     89 
     90 MAGICK_TARGET_OS=$host_os
     91 AC_SUBST(MAGICK_TARGET_OS)
     92 AC_DEFINE_UNQUOTED(MAGICK_TARGET_OS,$MAGICK_TARGET_OS,[Target Host OS])
     93 
     94 
     95 # Substitute versioning
     96 AC_SUBST([MAGICK_MAJOR_VERSION],[magick_major_version])
     97 AC_SUBST([MAGICK_MINOR_VERSION],[magick_minor_version])
     98 AC_SUBST([MAGICK_MICRO_VERSION],[magick_micro_version])
     99 AC_SUBST([MAGICK_PATCHLEVEL_VERSION],[magick_patchlevel_version])
    100 AC_SUBST([MAGICK_VERSION],[magick_version])
    101 AC_SUBST([MAGICK_GIT_REVISION],[magick_git_revision])
    102 
    103 # Substitute library versioning
    104 AC_SUBST(MAGICK_LIBRARY_CURRENT)dnl
    105 AC_SUBST(MAGICK_LIBRARY_REVISION)dnl
    106 AC_SUBST(MAGICK_LIBRARY_AGE)dnl
    107 AC_SUBST([MAGICK_LIBRARY_CURRENT_MIN],
    108          [`expr $MAGICK_LIBRARY_CURRENT - $MAGICK_LIBRARY_AGE`])
    109 AC_SUBST([MAGICK_LIBRARY_VERSION_INFO],
    110          [$MAGICK_LIBRARY_CURRENT:$MAGICK_LIBRARY_REVISION:$MAGICK_LIBRARY_AGE])
    111 
    112 AC_SUBST(MAGICKPP_LIBRARY_CURRENT)dnl
    113 AC_SUBST(MAGICKPP_LIBRARY_REVISION)dnl
    114 AC_SUBST(MAGICKPP_LIBRARY_AGE)dnl
    115 AC_SUBST([MAGICKPP_LIBRARY_CURRENT_MIN],
    116          [`expr $MAGICKPP_LIBRARY_CURRENT - $MAGICKPP_LIBRARY_AGE`])
    117 AC_SUBST([MAGICKPP_LIBRARY_VERSION_INFO],
    118          [$MAGICKPP_LIBRARY_CURRENT:$MAGICKPP_LIBRARY_REVISION:$MAGICKPP_LIBRARY_AGE])
    119 
    120 AC_SUBST(PACKAGE_NAME)dnl
    121 AC_SUBST(PACKAGE_VERSION)dnl
    122 AC_SUBST(PACKAGE_PERL_VERSION)dnl
    123 AC_SUBST(PACKAGE_RELEASE)dnl
    124 AC_SUBST(PACKAGE_CHANGE_DATE)dnl
    125 AC_SUBST(PACKAGE_LIB_VERSION)dnl
    126 AC_SUBST(PACKAGE_LIB_VERSION_NUMBER)dnl
    127 AS_IF([test X$enable_reproducible_build = Xyes],
    128  [PACKAGE_RELEASE_DATE=$PACKAGE_RELEASE_DATE_REPRODUCIBLE],
    129  [PACKAGE_RELEASE_DATE=$PACKAGE_RELEASE_DATE_RAW],
    130 )
    131 AC_SUBST(PACKAGE_RELEASE_DATE)dnl
    132 
    133 AC_SUBST(PACKAGE_VERSION_ADDENDUM)dnl
    134 
    135 # Ensure that make can run correctly
    136 AM_SANITY_CHECK
    137 
    138 # versioning of library
    139 MAGICK_LIB_VERSION="0x"
    140 if test ${MAGICK_LIBRARY_CURRENT} -lt 10 ; then
    141   MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
    142 fi
    143 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_CURRENT}
    144 if test ${MAGICK_LIBRARY_AGE} -lt 10 ; then
    145   MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
    146 fi
    147 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_AGE}
    148 if test ${MAGICK_LIBRARY_REVISION} -lt 10 ; then
    149   MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
    150 fi
    151 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_REVISION}
    152 AC_SUBST(MAGICK_LIB_VERSION)
    153 
    154 # Definition used to define MagickLibVersionText in version.h
    155 MAGICK_LIB_VERSION_TEXT="${PACKAGE_VERSION}"
    156 AC_SUBST(MAGICK_LIB_VERSION_TEXT)
    157 
    158 # Definition used to define MagickLibVersionNumber in version.h
    159 MAGICK_LIB_VERSION_NUMBER="${MAGICK_LIBRARY_CURRENT},${MAGICK_LIBRARY_AGE},${MAGICK_LIBRARY_REVISION}"
    160 AC_SUBST(MAGICK_LIB_VERSION_NUMBER)
    161 
    162 MAGICKPP_LIB_VERSION="0x"
    163 if test ${MAGICKPP_LIBRARY_CURRENT} -lt 10 ; then
    164   MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}0
    165 fi
    166 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}${MAGICKPP_LIBRARY_CURRENT}
    167 if test ${MAGICKPP_LIBRARY_AGE} -lt 10 ; then
    168   MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}0
    169 fi
    170 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}${MAGICKPP_LIBRARY_AGE}
    171 if test ${MAGICKPP_LIBRARY_REVISION} -lt 10 ; then
    172   MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}0
    173 fi
    174 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}${MAGICKPP_LIBRARY_REVISION}
    175 AC_SUBST(MAGICKPP_LIB_VERSION)
    176 
    177 # Definition used to define MagickLibVersionText in version.h
    178 MAGICKPP_LIB_VERSION_TEXT="${PACKAGE_VERSION}"
    179 AC_SUBST(MAGICKPP_LIB_VERSION_TEXT)
    180 
    181 # Definition used to define MagickLibVersionNumber in version.h
    182 MAGICK_LIB_VERSION_NUMBER="${MAGICK_LIBRARY_CURRENT},${MAGICK_LIBRARY_AGE},${MAGICK_LIBRARY_REVISION}"
    183 AC_SUBST(MAGICK_LIB_VERSION_NUMBER)
    184 
    185 
    186 
    187 # Regenerate config.status if ChangeLog or version.sh is updated.
    188 AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/version.sh'])
    189 
    190 PERLMAINCC=$CC
    191 
    192 MAGICK_CFLAGS=''
    193 MAGICK_CPPFLAGS=$CPPFLAGS_USER
    194 MAGICK_PCFLAGS=$CPPFLAGS_USER
    195 MAGICK_LDFLAGS=''
    196 MAGICK_LIBS=''
    197 MAGICK_FEATURES=''
    198 
    199 #
    200 # Evaluate shell variable equivalents to Makefile directory variables
    201 #
    202 if test "x$prefix" = xNONE; then
    203     prefix=$ac_default_prefix
    204 fi
    205 # Let make expand exec_prefix.
    206 if test "x$exec_prefix" = xNONE; then
    207     exec_prefix='${prefix}'
    208 fi
    209 
    210 #
    211 eval "eval PREFIX_DIR=${prefix}"
    212 AC_SUBST(PREFIX_DIR)
    213 eval "eval EXEC_PREFIX_DIR=${exec_prefix}"
    214 AC_SUBST(EXEC_PREFIX_DIR)
    215 eval "eval BIN_DIR=$bindir"
    216 AC_SUBST(BIN_DIR)
    217 eval "eval SBIN_DIR=$sbindir"
    218 AC_SUBST(SBIN_DIR)
    219 eval "eval LIBEXEC_DIR=$libexecdir"
    220 AC_SUBST(LIBEXEC_DIR)
    221 eval "eval DATA_DIR=$datadir"
    222 AC_SUBST(DATA_DIR)
    223 eval "eval DOC_DIR=$datadir/doc"
    224 AC_SUBST(DOC_DIR)
    225 eval "eval SYSCONF_DIR=$sysconfdir"
    226 AC_SUBST(SYSCONF_DIR)
    227 eval "eval SHAREDSTATE_DIR=$sharedstatedir"
    228 AC_SUBST(SHAREDSTATE_DIR)
    229 eval "eval LOCALSTATE_DIR=$localstatedir"
    230 AC_SUBST(LOCALSTATE_DIR)
    231 eval "eval LIB_DIR=$libdir"
    232 AC_SUBST(LIB_DIR)
    233 eval "eval INCLUDE_DIR=$includedir"
    234 AC_SUBST(INCLUDE_DIR)
    235 eval "eval PERSISTINCLUDE_DIR=$oldincludedir"
    236 AC_SUBST(PERSISTINCLUDE_DIR)
    237 eval "eval INFO_DIR=$infodir"
    238 AC_SUBST(INFO_DIR)
    239 eval "eval MAN_DIR=$mandir"
    240 AC_SUBST(MAN_DIR)
    241 
    242 # Get full paths to source and build directories
    243 srcdirfull="`cd $srcdir && pwd`"
    244 builddir="`pwd`"
    245 
    246 #
    247 # Compute variables useful for running uninstalled software.
    248 #
    249 MAGICK_CODER_MODULE_PATH="${builddir}/coders"
    250 MAGICK_CONFIGURE_SRC_PATH="${srcdirfull}/config"
    251 MAGICK_CONFIGURE_BUILD_PATH="${builddir}/config"
    252 MAGICK_FILTER_MODULE_PATH="${builddir}/filters"
    253 DIRSEP=':'
    254 case "${build_os}" in
    255     mingw* )
    256         MAGICK_CODER_MODULE_PATH=`$WinPathScript "${MAGICK_CODER_MODULE_PATH}" 0`
    257         MAGICK_CONFIGURE_SRC_PATH=`$WinPathScript "${MAGICK_CONFIGURE_SRC_PATH}" 0`
    258         MAGICK_CONFIGURE_BUILD_PATH=`$WinPathScript "${MAGICK_CONFIGURE_BUILD_PATH}" 0`
    259         MAGICK_FILTER_MODULE_PATH=`$WinPathScript "${MAGICK_FILTER_MODULE_PATH}" 0`
    260         DIRSEP=';'
    261     ;;
    262 esac
    263 case "${host_os}" in
    264   mingw* )
    265     DIRSEP=';'
    266     ;;
    267 esac
    268 AC_SUBST(MAGICK_CODER_MODULE_PATH)
    269 AC_SUBST(MAGICK_CONFIGURE_SRC_PATH)
    270 AC_SUBST(MAGICK_CONFIGURE_BUILD_PATH)
    271 AC_SUBST(MAGICK_FILTER_MODULE_PATH)
    272 AC_SUBST(DIRSEP)
    273 
    274 
    275 #
    276 # Enable OS features.
    277 #
    278 AC_USE_SYSTEM_EXTENSIONS
    279 
    280 # ==============================================================================
    281 # Find required base packages
    282 # ==============================================================================
    283 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
    284 AC_PROG_CC
    285 AC_PROG_CXX
    286 AC_PROG_CC_STDC
    287 AC_PROG_CPP
    288 AC_PROG_LD
    289 AC_SUBST(LD)
    290 AC_PROG_CC_C99
    291 AM_PROG_CC_C_O
    292 AX_CFLAGS_WARN_ALL
    293 AC_PROG_INSTALL
    294 AC_PROG_MAKE_SET
    295 AC_PROG_LN_S
    296 AC_PROG_SED
    297 AC_PROG_AWK
    298 AM_WITH_DMALLOC
    299 AX_C___ATTRIBUTE__
    300 AX_GCC_ARCHFLAG([yes])
    301 PKG_PROG_PKG_CONFIG([0.20])
    302 AC_CANONICAL_BUILD
    303 AC_CANONICAL_HOST
    304 
    305 # Test for 64-bit build.
    306 AC_CHECK_SIZEOF([size_t])
    307 
    308 AX_COMPILER_VENDOR
    309 AX_COMPILER_FLAGS
    310 # The AX_CFLAGS_WARN_ALL macro doesn't currently work for sunpro
    311 # compiler.
    312 if test "$ax_cv_c_compiler_vendor" != "sun"; then
    313   AX_CFLAGS_WARN_ALL
    314 fi
    315 
    316 if test "x$GCC" = "xyes"; then
    317   CFLAGS="$CFLAGS -fexceptions"
    318   touch local.exp
    319 else
    320   cat > local.exp <<EOF
    321 set CC_FOR_TARGET "$CC"
    322 EOF
    323 fi
    324 
    325 # Check for linker script support
    326 gl_LD_VERSION_SCRIPT
    327 
    328 #
    329 # Enable run-time checking.
    330 #
    331 AC_ARG_ENABLE([bounds-checking],
    332     [AC_HELP_STRING([--enable-bounds-checking],
    333                     [enable run-time bounds-checking])],
    334     [enable_bounds_checking=$enableval],
    335     [enable_bounds_checking='no'])
    336 
    337 if test "$enable_bounds_checking" = yes; then
    338   AC_DEFINE([_FORTIFY_SOURCE], [2],
    339     [enable run-time bounds-checking])
    340 fi
    341 
    342 #
    343 # Tests for Windows
    344 #
    345 AC_EXEEXT
    346 AC_OBJEXT
    347 
    348 GDI32_LIBS=''
    349 native_win32_build='no'
    350 cygwin_build='no'
    351 case "${host_os}" in
    352     cygwin* )
    353         cygwin_build='yes'
    354         GDI32_LIBS='-lgdi32'
    355     ;;
    356     mingw* )
    357         native_win32_build='yes'
    358         GDI32_LIBS='-lgdi32'
    359     ;;
    360 esac
    361 if test "${GDI32_LIBS}x" != 'x'; then
    362     AC_DEFINE(WINGDI32_DELEGATE,1,Define to use the Windows GDI32 library)
    363 fi
    364 AC_SUBST(GDI32_LIBS)
    365 AM_CONDITIONAL(WINGDI32_DELEGATE, test "${GDI32_LIBS}x" != 'x' )
    366 AM_CONDITIONAL(WIN32_NATIVE_BUILD, test "${native_win32_build}" = 'yes' )
    367 AM_CONDITIONAL(CYGWIN_BUILD, test "${cygwin_build}" = 'yes' )
    368 AM_CONDITIONAL(USING_CL, test "x${CC}" = 'xcl.exe' )
    369 
    370 WinPathScript="${srcdirfull}/winpath.sh"
    371 AC_SUBST(WinPathScript)
    372 
    373 #
    374 # Compiler flags tweaks
    375 #
    376 if test "${GCC}" != "yes"; then
    377     case "${host}" in
    378         *-*-hpux* )
    379             # aCC: HP ANSI C++ B3910B A.03.34
    380             CFLAGS="${CFLAGS} -Wp,-H30000"
    381             if test -n "${CXXFLAGS}"; then
    382                 CXXFLAGS='-AA'
    383             else
    384                 CXXFLAGS="${CXXFLAGS} -AA"
    385             fi
    386         ;;
    387         *-dec-osf5.* )
    388             # Compaq alphaev68-dec-osf5.1 compiler
    389             if test -n "${CXXFLAGS}"; then
    390                 CXXFLAGS='-std strict_ansi -noimplicit_include'
    391             else
    392                 CXXFLAGS="${CXXFLAGS} -std strict_ansi -noimplicit_include"
    393             fi
    394   esac
    395 fi
    396 
    397 # Check for lazy-loading.
    398 AC_CACHE_CHECK([for linker lazyload option],[im_cv_ld_lazyload],
    399 [
    400 im_cv_ld_lazyload='none'
    401 case "${host}" in
    402   *-*-solaris2.8 | *-*-solaris2.9 | *-*-solaris2.1? )
    403     if test "$lt_cv_prog_gnu_ld" != 'yes' ; then
    404        im_cv_ld_lazyload='-Wl,-zlazyload'
    405     fi
    406     ;;
    407 esac
    408 ])
    409 if test "${im_cv_ld_lazyload}" != 'none' ; then
    410   if test -z "${LDFLAGS}" ; then
    411     LDFLAGS="${im_cv_ld_lazyload}"
    412   else
    413     LDFLAGS="${im_cv_ld_lazyload} ${LDFLAGS}"
    414   fi
    415 fi
    416 
    417 dnl Platform-specific stuff
    418 case "$host" in
    419   *darwin* | *-macos10*)
    420     dnl Disable FORTIFY_SOURCE to fix a bug in LVVM / OpenMP support
    421     CFLAGS="${CFLAGS} -D_FORTIFY_SOURCE=0"
    422     dnl OS X universal binary support, requires --disable-dependency-tracking
    423     AC_ARG_ENABLE([osx-universal-binary],
    424         AC_HELP_STRING([--enable-osx-universal-binary],
    425            [build universal binary on OS X [[default=no]]]),
    426         [build_osxuniversal="${enableval}"], [build_osxuniversal=no])
    427 
    428     if test "${build_osxuniversal}" != no ; then
    429       if test "$enable_dependency_tracking" != no ; then
    430         AC_MSG_ERROR([--enable-osx-universal-binary requires --disable-dependency-tracking.
    431 Please re-run configure with these options:
    432   --disable-dependency-tracking --enable-osx-universal-binary
    433         ])
    434       fi
    435       CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
    436       CXXFLAGS="$CXXFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
    437       LDFLAGS="$LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
    438   fi
    439   ;;
    440 esac
    441 
    442 #
    443 # ARCH specific include directory
    444 #
    445 AC_ARG_WITH([includearch-dir],
    446     [AC_HELP_STRING([--includearch-dir=DIR],
    447                     [ARCH specific include directory])],
    448                     [includearch_dir=$withval],
    449                     [includearch_dir=$INCLUDE_DIR])
    450 
    451 eval "eval INCLUDEARCH_DIR=$includearch_dir"
    452 AC_SUBST(INCLUDEARCH_DIR)
    453 
    454 #
    455 # ARCH specific configuration directory
    456 #
    457 AC_ARG_WITH([sharearch-dir],
    458     [AC_HELP_STRING([--sharearch-dir=DIR],
    459                     [ARCH specific config directory])],
    460                     [sharearch_dir=$withval],
    461                     [sharearch_dir="${LIB_DIR}"])
    462 
    463 eval "eval SHAREARCH_DIR=$sharearch_dir"
    464 AC_SUBST(SHAREARCH_DIR)
    465 
    466 # Path to the pkgconfig folder
    467 AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=DIR],
    468             [Path to the pkgconfig directory @<:@LIBDIR/pkgconfig@:>@]),
    469             [pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
    470 AC_SUBST([pkgconfigdir])
    471 
    472 #
    473 # Enable support for threads
    474 #
    475 # Find Posix threads library
    476 #
    477 AC_ARG_WITH([threads],
    478     [AC_HELP_STRING([--without-threads], [disable threads support])],
    479     [with_threads=$withval],
    480     [with_threads='yes'])
    481 
    482 THREAD_LIBS=''
    483 have_threads=no
    484 if test "$with_threads" != 'no'; then
    485     AX_PTHREAD()
    486     if test "$ax_pthread_ok" = yes; then
    487         have_threads=yes
    488         DEF_THREAD="$PTHREAD_CFLAGS"
    489         CFLAGS="$CFLAGS $DEF_THREAD"
    490         CXXFLAGS="$CXXFLAGS $DEF_THREAD"
    491 	THREAD_LIBS="$PTHREAD_LIBS"
    492         if test "$CC" != "$PTHREAD_CC"; then
    493             AC_MSG_WARN([Replacing compiler $CC with compiler $PTHREAD_CC to support pthreads.])
    494             CC="$PTHREAD_CC"
    495         fi
    496         AC_DEFINE(THREAD_SUPPORT,1,[Define if you have POSIX threads libraries and header files.])
    497     fi
    498 fi
    499 LIBS="$LIBS $THREAD_LIBS"
    500 AC_SUBST(THREAD_LIBS)
    501 
    502 # Enable support for OpenMP
    503 if test "$have_threads" != 'yes'; then
    504   ac_cv_prog_c_openmp=unsupported
    505 fi
    506 AC_OPENMP([C])
    507 CFLAGS="$OPENMP_CFLAGS $CFLAGS"
    508 MAGICK_PCFLAGS="$MAGICK_PCFLAGS $OPENMP_CFLAGS"
    509 AC_SUBST(OPENMP_CFLAGS)
    510 if test "$enable_openmp" != no; then
    511   if test "$ac_cv_prog_c_openmp" != 'unsupported'; then
    512     MAGICK_FEATURES="OpenMP $MAGICK_FEATURES"
    513   fi
    514 fi
    515 
    516 # Enable support for OpenCL
    517 AX_OPENCL([C])
    518 CFLAGS="$CL_CFLAGS $CFLAGS"
    519 CPPFLAGS="$CL_CFLAGS $CPPFLAGS"
    520 LIBS="$CL_LIBS $LIBS"
    521 AC_SUBST(CL_CFLAGS)
    522 if test "$enable_opencl" != no; then
    523   if test "X$ax_cv_check_cl_libcl" != Xno; then :
    524     MAGICK_FEATURES="OpenCL $MAGICK_FEATURES"
    525   fi
    526 fi
    527 
    528 ########
    529 #
    530 # Check for large file support
    531 #
    532 ########
    533 AC_SYS_LARGEFILE
    534 AC_FUNC_FSEEKO
    535 LFS_CPPFLAGS=''
    536 if test "$enable_largefile" != no; then
    537     case $ac_cv_sys_file_offset_bits in
    538     no)
    539         # nothing to do here as the host supports LFS fine
    540         ;;
    541     unknown)
    542         AC_MSG_CHECKING([for native large file support])
    543         AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>
    544           main () {
    545           exit(!(sizeof(off_t) == 8));
    546         }])],
    547         [ac_cv_sys_file_offset_bits=64; AC_DEFINE(_FILE_OFFSET_BITS,64)
    548          AC_MSG_RESULT([yes])],
    549         [AC_MSG_RESULT([no])])
    550         ;;
    551     *)
    552         LFS_CPPFLAGS="$LFS_CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
    553         ;;
    554     esac
    555     if test "$ac_cv_sys_large_files" != 'no'; then
    556         LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGE_FILES=1"
    557     fi
    558     if test "$ac_cv_sys_largefile_source" != 'no'; then
    559         LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGEFILE_SOURCE=1"
    560     fi
    561 fi
    562 AC_SUBST(LFS_CPPFLAGS)
    563 
    564 # Configure libtool
    565 AC_LIBTOOL_DLOPEN
    566 LT_INIT([win32-dll])
    567 LT_LANG([C++])
    568 AC_SUBST(LIBTOOL_DEPS)
    569 
    570 # Check to see if building shared libraries
    571 libtool_build_shared_libs='no'
    572 if test "$enable_shared" = 'yes'; then
    573     libtool_build_shared_libs='yes'
    574 fi
    575 
    576 # Check to see if building static libraries
    577 libtool_build_static_libs='no'
    578 if test "$enable_static" = 'yes'; then
    579     libtool_build_static_libs='yes'
    580 fi
    581 
    582 AM_CONDITIONAL(WITH_SHARED_LIBS, test "${libtool_build_shared_libs}" = 'yes')
    583 #
    584 # Enable support for building loadable modules
    585 #
    586 build_modules='no'
    587 AC_ARG_WITH([modules],
    588     [AC_HELP_STRING([--with-modules],
    589                     [enable building dynamically loadable modules])],
    590     [with_modules=$withval],
    591     [with_modules='no'])
    592 
    593 # Only allow building loadable modules if we are building shared libraries
    594 if test "$with_modules" != 'no' ; then
    595     if test "$libtool_build_shared_libs" = 'no'; then
    596         AC_MSG_WARN([Modules may only be built if building shared libraries is enabled.])
    597     build_modules='no'
    598   else
    599     build_modules='yes'
    600   fi
    601 fi
    602 if test "$build_modules" != 'no' ; then
    603     AC_DEFINE(BUILD_MODULES,1,Define if coders and filters are to be built as modules.)
    604     MAGICK_FEATURES="$MAGICK_FEATURES Modules"
    605 fi
    606 AM_CONDITIONAL(WITH_MODULES, test "$build_modules" != 'no')
    607 
    608 # Enable build using delegate libraries built in subdirectories rather than installed
    609 # delegate libraries (bzlib fftw fpx gslib jp2 jbig jpeg lcms lzma png tiff ttf wmf xml zlib)
    610 AC_ARG_ENABLE([delegate-build],
    611     [AC_HELP_STRING([--enable-delegate-build],
    612                     [look for delegate libraries in build directory])],
    613     [enable_delegate_build=$enableval],
    614     [enable_delegate_build='no'])
    615 
    616 AC_ARG_ENABLE([deprecated],
    617     [AC_HELP_STRING([--disable-deprecated],
    618                     [exclude deprecated methods in MagickCore and MagickWand APIs])],
    619     [enable_deprecated=$enableval],
    620     [enable_deprecated='no'])
    621 
    622 if test "$enable_deprecated" = 'yes'; then
    623   AC_DEFINE(EXCLUDE_DEPRECATED,1,[exclude deprecated methods in MagickCore API])
    624 else
    625   DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-deprecated "
    626 fi
    627 
    628 # Build a version of ImageMagick which operates uninstalled.
    629 # Used to build distributions located via MAGICK_HOME / executable path
    630 AC_ARG_ENABLE([installed],
    631     [AC_HELP_STRING([--disable-installed],
    632                     [Formally install ImageMagick under PREFIX])],
    633     [enable_installed=$enableval],
    634     [enable_installed='yes'])
    635 
    636 if test "$enable_installed" = 'yes'; then
    637     AC_DEFINE(INSTALLED_SUPPORT,1,[ImageMagick is formally installed under prefix])
    638 else
    639     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-installed "
    640 fi
    641 
    642 # Permit enciphering and deciphering image pixels.
    643 AC_ARG_ENABLE([cipher],
    644     [AC_HELP_STRING([--disable-cipher],
    645                     [disable enciphering and deciphering image pixels])],
    646     [enable_cipher=$enableval],
    647     [enable_cipher='yes'])
    648 
    649 if test "$enable_cipher" = 'yes'; then
    650     AC_DEFINE(CIPHER_SUPPORT,1,[permit enciphering and deciphering image pixels])
    651     MAGICK_FEATURES="Cipher $MAGICK_FEATURES"
    652 fi
    653 
    654 # Build a zero-configuration version of ImageMagick.
    655 AC_ARG_ENABLE([zero-configuration],
    656     [AC_HELP_STRING([--enable-zero-configuration],
    657                     [enable self-contained, embeddable, zero-configuration ImageMagick])],
    658     [enable_zero_configuration=$enableval],
    659     [enable_zero_configuration='no'])
    660 
    661 if test "$enable_zero_configuration" = 'yes'; then
    662     AC_DEFINE(ZERO_CONFIGURATION_SUPPORT,1,[Build self-contained, embeddable, zero-configuration ImageMagick])
    663     MAGICK_FEATURES="Zero-configuration $MAGICK_FEATURES"
    664 fi
    665 
    666 # Build a high dynamic range version of ImageMagick.
    667 AC_ARG_ENABLE([hdri],
    668     [AC_HELP_STRING([--enable-hdri],
    669                     [accurately represent the wide range of intensity levels found in real scenes])],
    670     [enable_hdri=$enableval],
    671     [enable_hdri='yes'])
    672 
    673 MAGICK_HDRI=""
    674 if test "$enable_hdri" = 'yes'; then
    675     MAGICK_HDRI="HDRI"
    676     magick_hdri_enable='1';
    677     MAGICK_FEATURES="HDRI $MAGICK_FEATURES"
    678 else
    679     magick_hdri_enable='0'
    680 fi
    681 AC_DEFINE_UNQUOTED(HDRI_ENABLE_OBSOLETE_IN_H,$magick_hdri_enable,[Whether hdri is enabled or not])
    682 AC_SUBST(MAGICK_HDRI)dnl
    683 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -DMAGICKCORE_HDRI_ENABLE=$magick_hdri_enable"
    684 CFLAGS="$CFLAGS -DMAGICKCORE_HDRI_ENABLE=$magick_hdri_enable"
    685 CPPFLAGS="$CPPFLAGS -DMAGICKCORE_HDRI_ENABLE=$magick_hdri_enable"
    686 
    687 # Enable pipes (|) in filenames.
    688 AC_ARG_ENABLE([pipes],
    689     [AC_HELP_STRING([--enable-pipes],
    690                     [enable pipes (|) in filenames])],
    691     [enable_pipes=$enableval],
    692     [enable_pipes='no'])
    693 
    694 if test "$enable_pipes" = 'yes'; then
    695     AC_DEFINE(PIPES_SUPPORT,1,[enable pipes (|) in filenames])
    696     MAGICK_FEATURES="Pipes $MAGICK_FEATURES"
    697 fi
    698 
    699 # Build a version of ImageMagick with assert statements.
    700 AC_ARG_ENABLE([assert],
    701     [AC_HELP_STRING([--disable-assert],
    702                     [disable assert() statements in build])],
    703     [enable_assert=$enableval],
    704     [enable_assert='yes'])
    705 
    706 if test "$enable_assert" = 'no'; then
    707     AC_DEFINE(NDEBUG,1,[Turn off assert statements])
    708 fi
    709 
    710 # Don't emit "rebuild rules" for configure, Makefile.ins, etc.
    711 AM_MAINTAINER_MODE
    712 
    713 # Enable hugepages support
    714 AC_ARG_ENABLE([hugepages],
    715     [AC_HELP_STRING([--enable-hugepages],
    716                     [enable 'huge pages' support])],
    717     [enable_hugepages=$enableval],
    718     [enable_hugepages='no'])
    719 
    720 # Enable ccmalloc memory debugging support
    721 AC_ARG_ENABLE([ccmalloc],
    722     [AC_HELP_STRING([--enable-ccmalloc],
    723                     [enable 'ccmalloc' memory debug support])],
    724     [enable_ccmalloc=$enableval],
    725     [enable_ccmalloc='no'])
    726 
    727 # Enable Electric Fence memory debugging support
    728 AC_ARG_ENABLE([efence],
    729     [AC_HELP_STRING([--enable-efence],
    730                     [enable 'efence' memory debug support])],
    731     [enable_efence=$enableval],
    732     [enable_efence='no'])
    733 
    734 # Enable prof-based profiling support
    735 AC_ARG_ENABLE([prof],
    736     [AC_HELP_STRING([--enable-prof],
    737                     [enable 'prof' profiling support])],
    738     [enable_prof=$enableval],
    739     [enable_prof='no'])
    740 
    741 # Enable gprof-based profiling support
    742 AC_ARG_ENABLE([gprof],
    743     [AC_HELP_STRING([--enable-gprof],
    744                     [enable 'gprof' profiling support])],
    745     [enable_gprof=$enableval],
    746     [enable_gprof='no'])
    747 
    748 # Enable gcov-based profiling support
    749 AC_ARG_ENABLE([gcov],
    750     [AC_HELP_STRING([--enable-gcov],
    751                     [enable 'gcov' profiling support])],
    752     [enable_gcov=$enableval],
    753     [enable_gcov='no'])
    754 
    755 enable_profiling='no'
    756 if test "$enable_prof" = 'yes' || test "$enable_gprof" = 'yes' || test "$enable_gcov" = 'yes'; then
    757     enable_profiling='yes'
    758     if test "$libtool_build_shared_libs" = 'yes'; then
    759         echo "Warning: Can not profile code using shared libraries"
    760     fi
    761 fi
    762 
    763 # Magick API method prefix
    764 AC_ARG_WITH([method-prefix],
    765     [AC_HELP_STRING([--with-method-prefix=PREFIX],
    766                     [prefix MagickCore API methods])],
    767     [with_method_prefix=$withval],
    768     [with_method_prefix='no'])
    769 
    770 if test "$with_method_prefix" != 'no'; then
    771     AC_DEFINE_UNQUOTED(NAMESPACE_PREFIX,$with_method_prefix,[Magick API method prefix])
    772     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-method-prefix "
    773 fi
    774 
    775 # Enable legacy support (default no)
    776 AC_ARG_ENABLE(legacy-support,
    777               [  --enable-legacy-support  install legacy command-line utilities (default disabled)],
    778               [with_legacy_support=$enableval],
    779               [with_legacy_support='no'])
    780 AM_CONDITIONAL(LEGACY_SUPPORT, test "$with_legacy_support" != 'no')
    781 
    782 # Number of bits in a Quantum
    783 AC_ARG_WITH([quantum-depth],
    784     [AC_HELP_STRING([--with-quantum-depth=DEPTH],
    785                     [number of bits in a pixel quantum (default 16)])],
    786     [with_quantum_depth=$withval],
    787     [with_quantum_depth=16])
    788 
    789 if test "$with_quantum_depth" != '8'; then
    790     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-quantum-depth=$with_quantum_depth "
    791 fi
    792 
    793 case "${with_quantum_depth}" in
    794     8 ) ;;
    795     16 ) ;;
    796     32 ) ;;
    797     64 ) ;;
    798     * ) AC_MSG_ERROR("Pixel quantum depth must have value of 8, 16, 32, or 64") ;;
    799 esac
    800 QUANTUM_DEPTH="$with_quantum_depth"
    801 AC_DEFINE_UNQUOTED(QUANTUM_DEPTH_OBSOLETE_IN_H,$QUANTUM_DEPTH,[Number of bits in a pixel Quantum (8/16/32/64)])
    802 AC_SUBST(QUANTUM_DEPTH)dnl
    803 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -DMAGICKCORE_QUANTUM_DEPTH=$QUANTUM_DEPTH"
    804 CFLAGS="$CFLAGS -DMAGICKCORE_QUANTUM_DEPTH=$QUANTUM_DEPTH"
    805 CPPFLAGS="$CPPFLAGS -DMAGICKCORE_QUANTUM_DEPTH=$QUANTUM_DEPTH"
    806 
    807 # define a lib suffix for abi purpose
    808 MAGICK_ABI_SUFFIX="Q${QUANTUM_DEPTH}"
    809 if test "$enable_hdri" = 'yes'; then
    810   MAGICK_ABI_SUFFIX="Q${QUANTUM_DEPTH}${MAGICK_HDRI}"
    811 fi
    812 AC_SUBST(MAGICK_ABI_SUFFIX)
    813 
    814 # Set pixel cache threshold
    815 AC_ARG_WITH([cache],
    816     [AC_HELP_STRING([--with-cache=THRESHOLD],
    817                     [set pixel cache threshhold in MB (default available memory)])],
    818     [with_cache=$withval],
    819     [with_cache=''])
    820 
    821 if test "$with_cache" != ''; then
    822     AC_DEFINE_UNQUOTED(PixelCacheThreshold,$with_cache,[Pixel cache threshold in MB (defaults to available memory)])
    823     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-cache=$with_cache "
    824 fi
    825 
    826 # Disable/Enable support for full delegate paths
    827 AC_ARG_WITH([frozenpaths],
    828     [AC_HELP_STRING([--with-frozenpaths],
    829                     [freeze delegate paths])],
    830     [with_frozenpaths=$withval],
    831     [with_frozenpaths='no'])
    832 
    833 # Enable build/install of Magick++
    834 AC_ARG_WITH([magick-plus-plus],
    835     [AC_HELP_STRING([--without-magick-plus-plus],
    836                     [disable build/install of Magick++])],
    837     [with_magick_plus_plus=$withval],
    838     [with_magick_plus_plus='yes'])
    839 
    840 # Encode the this name into the shared library.
    841 AC_ARG_WITH([package-release-name],
    842     [AC_HELP_STRING([--with-package-release-name=NAME],
    843                     [encode this name into the shared library])],
    844 [MAGICK_LT_RELEASE_OPTS="-release $withval"])
    845 AC_SUBST(MAGICK_LT_RELEASE_OPTS)
    846 
    847 # Disable build/install of PerlMagick.
    848 AC_ARG_WITH([perl],
    849     [AC_HELP_STRING([--with-perl],
    850                     [enable build/install of PerlMagick])],
    851     [with_perl=$withval],
    852     [with_perl='no'])
    853 
    854 # Options to pass when configuring PerlMagick
    855 AC_ARG_WITH([perl-options],
    856     [AC_HELP_STRING([--with-perl-options=OPTIONS],
    857                     [options to pass on command-line when generating PerlMagick build file])],
    858 PERL_MAKE_OPTIONS=$withval)
    859 AC_SUBST(PERL_MAKE_OPTIONS)
    860 
    861 # Enable jemalloc, object-caching memory allocation library.
    862 AC_ARG_WITH(jemalloc,
    863         [  --with-jemalloc         enable jemalloc memory allocation library support],
    864         [with_jemalloc=$withval],
    865         [with_jemalloc='no'])
    866 if test "$with_jemalloc" != 'yes' ; then
    867     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jemalloc=$with_jemalloc "
    868 fi
    869 
    870 # Enable umem, object-caching memory allocation library.
    871 AC_ARG_WITH(umem,
    872         [  --with-umem             enable umem memory allocation library support],
    873         [with_umem=$withval],
    874         [with_umem='no'])
    875 if test "$with_umem" != 'yes' ; then
    876     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-umem=$with_umem "
    877 fi
    878 
    879 #
    880 # Specify path to shared libstdc++ if not in normal location
    881 #
    882 AC_ARG_WITH([libstdc],
    883     [AC_HELP_STRING([--with-libstdc=DIR],
    884                     [ use libstdc++ in DIR (for GNU C++)])],
    885     [with_libstdc=$withval],
    886     [with_libstdc=''])
    887 
    888 if test "$with_libstdc" != ''; then
    889     if test -d "$with_libstdc"; then
    890         LIBSTDCLDFLAGS="-L$with_libstdc"
    891     fi
    892 fi
    893 AC_SUBST(LIBSTDCLDFLAGS)
    894 
    895 # Does gcc required -traditional?
    896 AC_PROG_GCC_TRADITIONAL
    897 
    898 ########
    899 #
    900 # Set defines required to build DLLs and modules using MinGW
    901 #
    902 ########
    903 # These options are set for multi-thread DLL module build
    904 #  libMagickCore:           _DLL _MAGICKMOD_ _MAGICKLIB_
    905 #  module:              _DLL
    906 #  executable/Magick++: _DLL _MAGICKMOD_
    907 MODULE_EXTRA_CPPFLAGS=''
    908 LIBRARY_EXTRA_CPPFLAGS=''
    909 if test "${native_win32_build}" = 'yes'; then
    910     if test "${libtool_build_shared_libs}" = 'yes'; then
    911         CPPFLAGS="$CPPFLAGS -D_DLL"
    912         MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_DLL"
    913         MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_DLL"
    914         LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKLIB_"
    915         if test "$build_modules" = 'yes'; then
    916             LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKMOD_"
    917         else
    918             MODULE_EXTRA_CPPFLAGS="$MODULE_EXTRA_CPPFLAGS -D_MAGICKLIB_"
    919         fi
    920     else
    921         CPPFLAGS="$CPPFLAGS -D_LIB"
    922         MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_LIB"
    923         MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_LIB"
    924     fi
    925     if test "$with_threads" = 'yes'; then
    926          CPPFLAGS="$CPPFLAGS -D_MT"
    927          MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_MT"
    928          MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_MT"
    929     fi
    930 fi
    931 AC_SUBST(MODULE_EXTRA_CPPFLAGS)
    932 AC_SUBST(LIBRARY_EXTRA_CPPFLAGS)
    933 
    934 # Check standard headers
    935 AC_HEADER_STDC
    936 if ! test x"$ac_cv_header_stdc" = x"yes"; then
    937     AC_MSG_WARN([configure has detected that you do not have the ANSI standard C
    938     header files.  Compilation cannot proceed.  Please install the ANSI C
    939     headers and rerun this script.]);
    940 fi
    941 AC_HEADER_ASSERT
    942 AC_HEADER_DIRENT
    943 
    944 # Check additional headers
    945 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 utime.h wchar.h xlocale.h)
    946 
    947 ########
    948 #
    949 # Checks for typedefs, structures, and compiler characteristics.
    950 #
    951 ########
    952 
    953 AC_HEADER_STDBOOL
    954 AC_C_VOLATILE
    955 AC_C_STRINGIZE
    956 AC_HEADER_STAT
    957 AC_HEADER_TIME
    958 AC_STRUCT_TM
    959 AC_STRUCT_TIMEZONE
    960 AC_SYS_INTERPRETER
    961 
    962 #
    963 # Checks for language qualifiers and semantics.
    964 #
    965 AC_C_CHAR_UNSIGNED
    966 AC_C_CONST
    967 AC_C_INLINE
    968 AC_C_RESTRICT
    969 AC_C_VOLATILE
    970 
    971 # If words are stored with the most significant byte first (like
    972 # Motorola and SPARC CPUs), define `WORDS_BIGENDIAN'.
    973 AC_C_BIGENDIAN
    974 
    975 # Define to a suitable type, if standard headers do not define it.
    976 AC_TYPE_INT8_T
    977 AC_TYPE_INT16_T
    978 AC_TYPE_INT32_T
    979 AC_TYPE_INT64_T
    980 AC_TYPE_INTMAX_T
    981 AC_TYPE_INTPTR_T
    982 AC_TYPE_LONG_DOUBLE
    983 AC_TYPE_LONG_DOUBLE_WIDER
    984 AC_TYPE_LONG_LONG_INT
    985 AC_TYPE_MBSTATE_T
    986 AC_TYPE_MODE_T
    987 AC_TYPE_OFF_T
    988 AC_TYPE_PID_T
    989 AC_TYPE_SIZE_T
    990 AC_TYPE_SSIZE_T
    991 AC_TYPE_UID_T
    992 AC_TYPE_UINT8_T
    993 AC_TYPE_UINT16_T
    994 AC_TYPE_UINT32_T
    995 AC_TYPE_UINT64_T
    996 AC_TYPE_UINTMAX_T
    997 AC_TYPE_UINTPTR_T
    998 AC_TYPE_UNSIGNED_LONG_LONG_INT
    999 
   1000 AC_CHECK_TYPES([locale_t], [], [], [[#include <xlocale.h>]])
   1001 
   1002 # Float_t and double_t are intended to be the the most efficient type.
   1003 AC_CHECK_TYPES([float_t], [], [], [[#include <math.h>]])
   1004 AC_CHECK_TYPES([double_t], [], [], [[#include <math.h>]])
   1005 AC_CHECK_SIZEOF([float_t], [], [[#include <math.h>]])
   1006 AC_CHECK_SIZEOF([double_t], [], [[#include <math.h>]])
   1007 
   1008 # Get size of float, double and long double for comparaison.
   1009 AC_CHECK_SIZEOF([float])
   1010 AC_CHECK_SIZEOF([double])
   1011 AC_CHECK_SIZEOF([long double])
   1012 
   1013 # Obtain size of an 'signed short' and define as SIZEOF_SIGNED_SHORT
   1014 AC_CHECK_SIZEOF(signed short)
   1015 
   1016 # Obtain size of an 'unsigned short' and define as SIZEOF_UNSIGNED_SHORT
   1017 AC_CHECK_SIZEOF(unsigned short)
   1018 
   1019 # Obtain size of an 'signed int' and define as SIZEOF_SIGNED_INT
   1020 AC_CHECK_SIZEOF(signed int)
   1021 
   1022 # Obtain size of an 'unsigned int' and define as SIZEOF_UNSIGNED_INT
   1023 AC_CHECK_SIZEOF(unsigned int)
   1024 
   1025 # Obtain size of a 'signed long' and define as SIZEOF_SIGNED_LONG
   1026 AC_CHECK_SIZEOF(signed long)
   1027 
   1028 # Obtain size of a 'unsigned long' and define as SIZEOF_UNSIGNED_LONG
   1029 AC_CHECK_SIZEOF(unsigned long)
   1030 
   1031 # Obtain size of a 'long long' and define as SIZEOF_SIGNED_LONG_LONG.  If
   1032 # 'signed long long' is not supported then the value defined is zero.
   1033 AC_CHECK_SIZEOF(signed long long)
   1034 
   1035 # Obtain size of a 'unsigned long long' and define as
   1036 # SIZEOF_UNSIGNED_LONG_LONG.  If 'unsigned long long' is not
   1037 # supported then the value defined is zero.
   1038 AC_CHECK_SIZEOF(unsigned long long)
   1039 
   1040 # Obtain size of off_t and define as SIZEOF_OFF_T
   1041 AC_CHECK_SIZEOF(off_t)
   1042 
   1043 # Obtain size of size_t and define as SIZEOF_SIZE_T
   1044 AC_CHECK_SIZEOF(size_t)
   1045 
   1046 # Obtain size of ssize_t and define as SIZEOF_SSIZE_T
   1047 AC_CHECK_SIZEOF(ssize_t)
   1048 
   1049 # Obtain size of an unsigned int pointer and define as SIZEOF_UNSIGNED_INTP
   1050 AC_CHECK_SIZEOF(unsigned int*)
   1051 
   1052 #
   1053 # Compute sized types for current CPU and compiler options.
   1054 #
   1055 
   1056 AC_MSG_CHECKING(for signed 8-bit type)
   1057 INT8_T='signed char'
   1058 AC_MSG_RESULT($INT8_T)
   1059 AC_SUBST(INT8_T)
   1060 
   1061 AC_MSG_CHECKING(for unsigned 8-bit type)
   1062 UINT8_T='unsigned char'
   1063 AC_MSG_RESULT($UINT8_T)
   1064 AC_SUBST(UINT8_T)
   1065 
   1066 AC_MSG_CHECKING(for signed 16-bit type)
   1067 INT16_T='signed short'
   1068 AC_MSG_RESULT($INT16_T)
   1069 AC_SUBST(INT16_T)
   1070 
   1071 AC_MSG_CHECKING(for unsigned 16-bit type)
   1072 UINT16_T='unsigned short'
   1073 AC_MSG_RESULT($UINT16_T)
   1074 AC_SUBST(UINT16_T)
   1075 
   1076 AC_MSG_CHECKING(for signed 32-bit type)
   1077 INT32_T='none'
   1078 INT32_F='none'
   1079 if test $ac_cv_sizeof_signed_int -eq 4; then
   1080   INT32_T='signed int'
   1081   INT32_F='""'
   1082 elif test $ac_cv_sizeof_signed_long -eq 4; then
   1083   INT32_T='signed long'
   1084   INT32_F='"l"'
   1085 fi
   1086 AC_MSG_RESULT($INT32_T)
   1087 AC_SUBST(INT32_T)
   1088 AC_SUBST(INT32_F)
   1089 
   1090 AC_MSG_CHECKING(for unsigned 32-bit type)
   1091 UINT32_T='none'
   1092 UINT32_F='none'
   1093 if test $ac_cv_sizeof_unsigned_int -eq 4; then
   1094   UINT32_T='unsigned int'
   1095   UINT32_F='""'
   1096 elif test $ac_cv_sizeof_unsigned_long -eq 4; then
   1097   UINT32_T='unsigned long'
   1098   UINT32_F='"l"'
   1099 fi
   1100 AC_MSG_RESULT($UINT32_T)
   1101 AC_SUBST(UINT32_T)
   1102 AC_SUBST(UINT32_F)
   1103 
   1104 AC_MSG_CHECKING(for signed 64-bit type)
   1105 INT64_T='none'
   1106 INT64_F='none'
   1107 if test $ac_cv_sizeof_signed_long -eq 8; then
   1108   INT64_T='signed long'
   1109   INT64_F='"l"'
   1110 elif test $ac_cv_sizeof_signed_long_long -eq 8; then
   1111   INT64_T='signed long long'
   1112   INT64_F='"ll"'
   1113 fi
   1114 case "${host_os}" in
   1115   mingw* )
   1116     INT64_F='"I64"'
   1117     ;;
   1118 esac
   1119 AC_MSG_RESULT($INT64_T)
   1120 AC_SUBST(INT64_T)
   1121 AC_SUBST(INT64_F)
   1122 
   1123 AC_MSG_CHECKING(for unsigned 64-bit type)
   1124 UINT64_T='none'
   1125 UINT64_F='none'
   1126 if test $ac_cv_sizeof_unsigned_long -eq 8; then
   1127   UINT64_T='unsigned long'
   1128   UINT64_F='"l"'
   1129 elif test $ac_cv_sizeof_unsigned_long_long -eq 8; then
   1130   UINT64_T='unsigned long long'
   1131   UINT64_F='"ll"'
   1132 fi
   1133 case "${host_os}" in
   1134   mingw* )
   1135     UINT64_F='"I64"'
   1136     ;;
   1137 esac
   1138 AC_MSG_RESULT($UINT64_T)
   1139 AC_SUBST(UINT64_T)
   1140 AC_SUBST(UINT64_F)
   1141 
   1142 AC_MSG_CHECKING(for unsigned maximum type)
   1143 UINTMAX_T='none'
   1144 UINTMAX_F='none'
   1145 if test "$UINT64_T" != 'none'; then
   1146   UINTMAX_T=$UINT64_T
   1147   UINTMAX_F=$UINT64_F
   1148 elif test "$UINT32_T" != 'none'; then
   1149   UINTMAX_T=$UINT32_T
   1150   UINTMAX_F=$UINT32_F
   1151 fi
   1152 AC_MSG_RESULT($UINTMAX_T)
   1153 AC_SUBST(UINTMAX_T)
   1154 AC_SUBST(UINTMAX_F)
   1155 
   1156 AC_MSG_CHECKING(for pointer difference type)
   1157 UINTPTR_T='none'
   1158 UINTPTR_F='none'
   1159 if test $ac_cv_sizeof_unsigned_long -eq $ac_cv_sizeof_unsigned_intp; then
   1160   UINTPTR_T='unsigned long'
   1161   UINTPTR_F='"l"'
   1162 elif test $ac_cv_sizeof_unsigned_long_long -eq $ac_cv_sizeof_unsigned_intp; then
   1163   UINTPTR_T='unsigned long long'
   1164   UINTPTR_F='"ll"'
   1165 fi
   1166 AC_MSG_RESULT($UINTPTR_T)
   1167 AC_SUBST(UINTPTR_T)
   1168 AC_SUBST(UINTPTR_F)
   1169 
   1170 AC_MSG_CHECKING([whether our compiler supports __func__])
   1171 AC_TRY_COMPILE([],
   1172  [{ const char *func = __func__; return(func != 0 ? 0 : 1); }],
   1173  AC_MSG_RESULT([yes]),
   1174  AC_MSG_RESULT([no])
   1175  AC_MSG_CHECKING([whether our compiler supports __FUNCTION__])
   1176  AC_TRY_COMPILE([],
   1177    [{ const char *func = __FUNCTION__; return(func != 0 ? 0 : 1); }],
   1178    AC_MSG_RESULT([yes])
   1179    AC_DEFINE(__func__, __FUNCTION__,
   1180      [Define to appropriate substitue if compiler does not have __func__]),
   1181    AC_MSG_RESULT([no])
   1182    AC_DEFINE(__func__, __FILE__,
   1183      [Define to appropriate substitue if compiler does not have __func__])))
   1184 
   1185 ########
   1186 #
   1187 # Check for functions
   1188 #
   1189 ########
   1190 AC_FUNC_CLOSEDIR_VOID
   1191 AC_FUNC_MMAP
   1192 AC_FUNC_FORK
   1193 AC_FUNC_MEMCMP
   1194 AC_FUNC_SELECT_ARGTYPES
   1195 AC_FUNC_SETVBUF_REVERSED
   1196 AC_TYPE_SIGNAL
   1197 AC_FUNC_STRTOD
   1198 AC_FUNC_STRERROR_R
   1199 AC_FUNC_VPRINTF
   1200 
   1201 #
   1202 # Find math library
   1203 #
   1204 MATH_LIBS=''
   1205 AC_CHECK_LIB(m,sqrt,MATH_LIBS="-lm",,)
   1206 LIBS="$MATH_LIBS $LIBS"
   1207 AC_SUBST(MATH_LIBS)
   1208 
   1209 #
   1210 # Find socket library
   1211 #
   1212 AC_SEARCH_LIBS(gethostbyname, resolv nsl)
   1213 AC_SEARCH_LIBS(socket, socket,
   1214 [
   1215   AC_DEFINE([HAVE_SOCKET],[1],[Define to 1 if you have socket support.])
   1216   MAGICK_FEATURES="DPC $MAGICK_FEATURES"
   1217 ])
   1218 
   1219 AC_CHECK_FUNCS([acosh _aligned_malloc asinh atanh atoll atexit cabs carg cimag creal clock ctime_r directio erf _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])
   1220 
   1221 #
   1222 # Check for clock_gettime().
   1223 #
   1224 AC_SEARCH_LIBS(clock_gettime, rt,
   1225 [
   1226   AC_DEFINE([HAVE_CLOCK_GETTIME],[1],[Define to 1 if you have clock_gettime.])
   1227   AC_MSG_CHECKING([whether clock_gettime supports CLOCK_REALTIME])
   1228   AC_COMPILE_IFELSE([
   1229     AC_LANG_PROGRAM(
   1230       [[#include <time.h>]],
   1231        [[clockid_t clockType = CLOCK_REALTIME;]])],
   1232       [
   1233         AC_MSG_RESULT(yes)
   1234         AC_DEFINE([HAVE_CLOCK_REALTIME],[1],
   1235           [Define to 1 if clock_gettime supports CLOCK_REALTIME.])
   1236       ],
   1237       AC_MSG_RESULT(no)
   1238     )
   1239   ],
   1240   [
   1241     AC_CHECK_FUNCS([gettimeofday ftime], [break])
   1242   ]
   1243 )
   1244 
   1245 ########
   1246 #
   1247 # Check for function prototypes
   1248 #
   1249 ########
   1250 
   1251 AC_CHECK_DECLS([pread, pwrite],[],[],[
   1252 #include <unistd.h>])
   1253 
   1254 AC_CHECK_DECLS([strlcpy],[],[],[
   1255 #include <strings.h>])
   1256 
   1257 AC_CHECK_DECLS([vsnprintf],[],[],[
   1258 #include <stdio.h>
   1259 #include <stdarg.h>])
   1260 
   1261 ########
   1262 #
   1263 # C++ Support Tests (For Magick++)
   1264 #
   1265 ########
   1266 have_magick_plus_plus='no'
   1267 if test "$with_magick_plus_plus" = 'yes'; then
   1268     OLIBS="$LIBS"
   1269     LIBS=''
   1270     AC_LANG_PUSH(C++)
   1271 
   1272     # Full set of headers used...
   1273     # algorithm cctype cerrno cmath cstdio cstdlib cstring ctime exception
   1274     # functional iomanip iosfwd iostream iterator list string strstream utility
   1275     AC_LANG([C++])
   1276     AC_PROG_CXX
   1277     AX_CXX_BOOL
   1278     AX_CXX_NAMESPACES
   1279     AX_CXX_NAMESPACE_STD
   1280     AC_CXX_HAVE_STD_LIBS
   1281     AC_OPENMP([C++])
   1282     AC_LANG_POP
   1283 
   1284     AC_MSG_CHECKING([whether C++ compiler is sufficient for Magick++])
   1285     if \
   1286         test $ax_cv_cxx_bool = 'yes' && \
   1287         test $ax_cv_cxx_namespaces = 'yes' && \
   1288         test $ac_cv_cxx_have_std_libs = 'yes' && \
   1289         test $ax_cv_cxx_have_std_namespace = 'yes'; then
   1290         have_magick_plus_plus='yes'
   1291     else
   1292         have_magick_plus_plus='no (failed tests)'
   1293     fi
   1294     AC_MSG_RESULT([$have_magick_plus_plus])
   1295     LIBS="$OLIBS"
   1296 fi
   1297 AM_CONDITIONAL(WITH_MAGICK_PLUS_PLUS, test "$have_magick_plus_plus" = 'yes')
   1298 
   1299 # Only check for delegate libraries in subdirectories if requested.
   1300 if test "$enable_delegate_build" != 'no'; then
   1301     # Check for delegate sub-directories and add -I & -L options as required.
   1302     # This presumes that delegates are installed as detailed in the ImageMagick
   1303     # README. If delegates are installed in a standard location where the
   1304     # compiler will automatically find them then these options should not be
   1305     # required.
   1306 
   1307     #
   1308     # Most delegates have includes in the same directory as the library, but not all...
   1309     #
   1310     # Includes
   1311     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
   1312         if test -d "$builddir/$dir"; then
   1313             CPPFLAGS="$CPPFLAGS -I$builddir/$dir"
   1314         else
   1315             if test -d "$srcdirfull/$dir"; then
   1316                 CPPFLAGS="$CPPFLAGS -I$srcdirfull/$dir"
   1317             fi
   1318         fi
   1319     done
   1320 
   1321     # Libraries
   1322     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
   1323     if test -d "$builddir/$dir/.libs"; then
   1324         LDFLAGS="$LDFLAGS -L$builddir/$dir/.libs"
   1325     else
   1326         if test -d "$srcdirfull/$dir/.libs"; then
   1327             LDFLAGS="$LDFLAGS -L$srcdirfull/$dir/.libs"
   1328         fi
   1329     fi
   1330     if test -d "$builddir/$dir"; then
   1331         LDFLAGS="$LDFLAGS -L$builddir/$dir"
   1332     else
   1333         if test -d "$srcdirfull/$dir"; then
   1334             LDFLAGS="$LDFLAGS -L$srcdirfull/$dir"
   1335         fi
   1336     fi
   1337   done
   1338 fi
   1339 
   1340 # Assume that delegate headers reside under same directory as ImageMagick
   1341 # installation prefix.
   1342 MAGICK_CPPFLAGS="-I$INCLUDE_DIR/${PACKAGE_NAME}-$MAGICK_MAJOR_VERSION $MAGICK_CPPFLAGS"
   1343 
   1344 #
   1345 # Find the X11 RGB database
   1346 #
   1347 AC_CACHE_CHECK(for X11 configure files,im_cv_x_configure,
   1348 [# Look for the header file in a standard set of common directories.
   1349 # Check X11 before X11Rn because it is often a symlink to the current release.
   1350     for ac_dir in          \
   1351     /lib/usr/lib/X11       \
   1352     /usr/X11/lib           \
   1353     /usr/X11R4/lib         \
   1354     /usr/X11R5/lib         \
   1355     /usr/X11R6/lib         \
   1356     /usr/X11R7/lib         \
   1357     /usr/X386/lib          \
   1358     /usr/XFree86/lib/X11   \
   1359     /usr/athena/lib        \
   1360     /usr/lib               \
   1361     /usr/lib/X11           \
   1362     /usr/lib/X11R4         \
   1363     /usr/lib/X11R5         \
   1364     /usr/lib/X11R6         \
   1365     /usr/lib/X11R7         \
   1366     /usr/local/X11/lib     \
   1367     /usr/local/X11R4/lib   \
   1368     /usr/local/X11R5/lib   \
   1369     /usr/local/X11R6/lib   \
   1370     /usr/local/lib         \
   1371     /usr/local/lib/X11     \
   1372     /usr/local/lib/X11R4   \
   1373     /usr/local/lib/X11R5   \
   1374     /usr/local/lib/X11R6   \
   1375     /usr/local/lib/X11R7   \
   1376     /usr/local/x11r5/lib   \
   1377     /usr/lpp/Xamples/lib   \
   1378     /usr/openwin/lib       \
   1379     /usr/openwin/share/lib \
   1380     /usr/unsupported/lib   \
   1381     /usr/x386/lib          \
   1382     ; do
   1383     if test -f "$ac_dir/X11/rgb.txt"; then
   1384       im_cv_x_configure="$ac_dir/X11/"
   1385       break
   1386     elif test -f "$ac_dir/rgb.txt"; then
   1387       im_cv_x_configure="$ac_dir/"
   1388       break
   1389     fi
   1390 
   1391   done])
   1392 X11_CONFIGURE_PATH="$im_cv_x_configure"
   1393 case "${build_os}" in
   1394   mingw* )
   1395     X11ConfigurePath=`$WinPathScript "$X11ConfigurePath=" 1`
   1396   ;;
   1397 esac
   1398 AC_DEFINE_UNQUOTED(X11_CONFIGURE_PATH,"$X11ConfigurePath",[Location of X11 configure files])
   1399 
   1400 #
   1401 # Find OpenMP library
   1402 #
   1403 GOMP_LIBS=''
   1404 if test "$enable_openmp" != 'no'; then
   1405   if test "${GCC}" = "yes"; then
   1406     # Open64 (passes for GCC but uses different OpenMP implementation)
   1407     if test "x$GOMP_LIBS" = x ; then
   1408       if $CC --version 2>&1 | grep Open64 > /dev/null ; then
   1409         AC_CHECK_LIB(openmp,omp_get_num_procs,GOMP_LIBS="-lopenmp",,)
   1410       fi
   1411     fi
   1412     # GCC
   1413     if test "x$GOMP_LIBS" = x ; then
   1414       AC_CHECK_LIB(gomp,GOMP_parallel_start,GOMP_LIBS="-lgomp",,)
   1415     fi
   1416   else
   1417     # Sun CC
   1418     if test "x$GOMP_LIBS" = x ; then
   1419       AC_CHECK_LIB(mtsk,sunw_mp_register_warn,GOMP_LIBS="-lmtsk",,)
   1420     fi
   1421     # AIX xlc
   1422     if test "x$GOMP_LIBS" = x ; then
   1423     AC_CHECK_LIB(xlsmp,_xlsmpFlush,GOMP_LIBS="-lxlsmp",,)
   1424     fi
   1425     # SGI IRIX 6.5 MIPSpro C/C++
   1426     if test "x$GOMP_LIBS" = x ; then
   1427     AC_CHECK_LIB(mp,mp_destroy,GOMP_LIBS="-lmp",,)
   1428     fi
   1429   fi
   1430   LIBS="$GOMP_LIBS $LIBS"
   1431 fi
   1432 AC_SUBST(GOMP_LIBS)
   1433 
   1434 #
   1435 # Check for jemalloc.
   1436 #
   1437 have_jemalloc='no'
   1438 JEMALLOC_LIBS=''
   1439 if test "$with_jemalloc" != 'no'; then
   1440   AC_MSG_CHECKING(for JEMALLOC support )
   1441   AC_MSG_RESULT()
   1442   failed=0
   1443   passed=0
   1444   AC_CHECK_HEADER([jemalloc/jemalloc.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
   1445   AC_CHECK_LIB(jemalloc,[malloc_stats_print],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
   1446   AC_MSG_CHECKING(if jemalloc memory allocation library is complete)
   1447   if test $passed -gt 0; then
   1448     if test $failed -gt 0; then
   1449       AC_MSG_RESULT(no -- some components failed test)
   1450       have_jemalloc='no (failed tests)'
   1451     else
   1452       JEMALLOC_LIBS='-ljemalloc'
   1453       LIBS="$JEMALLOC_LIBS $LIBS"
   1454       AC_DEFINE(HasJEMALLOC,1,Define if you have jemalloc memory allocation library)
   1455       AC_MSG_RESULT(yes)
   1456       have_jemalloc='yes'
   1457     fi
   1458   else
   1459     AC_MSG_RESULT(no)
   1460   fi
   1461 fi
   1462 AM_CONDITIONAL(HasJEMALLOC, test "$have_jemalloc" = 'yes')
   1463 AC_SUBST(JEMALLOC_LIBS)
   1464 
   1465 #
   1466 # Check for umem.
   1467 #
   1468 have_umem='no'
   1469 UMEM_LIBS=''
   1470 if test "$with_umem" != 'no'; then
   1471   AC_MSG_CHECKING(for UMEM support )
   1472   AC_MSG_RESULT()
   1473   failed=0
   1474   passed=0
   1475   AC_CHECK_HEADER(umem.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
   1476   AC_CHECK_LIB(umem,umem_alloc,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
   1477   AC_CHECK_LIB(umem,umem_free,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
   1478   AC_MSG_CHECKING(if umem memory allocation library is complete)
   1479   if test $passed -gt 0; then
   1480     if test $failed -gt 0; then
   1481       AC_MSG_RESULT(no -- some components failed test)
   1482       have_umem='no (failed tests)'
   1483     else
   1484       UMEM_LIBS='-lumem'
   1485       LIBS="$UMEM_LIBS $LIBS"
   1486       AC_DEFINE(HasUMEM,1,Define if you have umem memory allocation library)
   1487       AC_MSG_RESULT(yes)
   1488       have_umem='yes'
   1489     fi
   1490   else
   1491     AC_MSG_RESULT(no)
   1492   fi
   1493 fi
   1494 AM_CONDITIONAL(HasUMEM, test "$have_umem" = 'yes')
   1495 AC_SUBST(UMEM_LIBS)
   1496 
   1497 #
   1498 # Add support for ccmalloc memory debugging library if requested
   1499 #
   1500 have_ccmalloc='no'
   1501 CCMALLOC_LIBS=''
   1502 if test "$enable_ccmalloc" = 'yes'; then
   1503     AC_PATH_PROG(CCMALLOCDelegate,ccmalloc,)
   1504     if test -n "$CCMALLOCDelegate"; then
   1505         eval `grep PREFIX= $CCMALLOCDelegate | sed -e 's/PREFIX/CCMALLOC_PREFIX/'`
   1506         OLIBS="$LIBS"
   1507         # Assume that gcc is used with ccmalloc.
   1508         LIBS="$LIBS $CCMALLOC_PREFIX/lib/ccmalloc-gcc.o"
   1509        AC_CHECK_LIB(ccmalloc,ccmalloc_malloc,CCMALLOC_LIBS="$CCMALLOC_PREFIX/lib/ccmalloc-gcc.o -lccmalloc -ldl",,-ldl)
   1510         if test -n "$CCMALLOC_LIBS"; then
   1511             LIBS="$OLIBS"
   1512             LIBS="$LIBS $CCMALLOC_LIBS"
   1513             have_ccmalloc='yes'
   1514         else
   1515             LIBS="$OLIBS"
   1516         fi
   1517     fi
   1518 fi
   1519 
   1520 #
   1521 # Add support for 'huge pages' if requested
   1522 #
   1523 AS_IF([test "x$enable_hugepages" != "xno"],[
   1524   AC_DEFINE(HAVE_HUGEPAGES, 1, [Compile with hugepage support])
   1525 ])
   1526 
   1527 #
   1528 # Add support for efence memory debugging library if requested
   1529 #
   1530 if test "$enable_efence" = 'yes'; then
   1531     EFENCE_LIBS='-lefence'
   1532     LIBS="$EFENCE_LIBS $LIBS"
   1533 fi
   1534 
   1535 dnl ===========================================================================
   1536 
   1537 #
   1538 # Check for BZLIB
   1539 #
   1540 
   1541 AC_ARG_WITH([bzlib],
   1542     [AC_HELP_STRING([--without-bzlib],
   1543                     [disable BZLIB support])],
   1544     [with_bzlib=$withval],
   1545     [with_bzlib='yes'])
   1546 
   1547 if test "$with_bzlib" != 'yes'; then
   1548     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-bzlib=$with_bzlib "
   1549 fi
   1550 
   1551 have_bzlib='no'
   1552 if test "$with_bzlib" != 'no'; then
   1553     BZLIB_LIBS=''
   1554     AC_MSG_RESULT([-------------------------------------------------------------])
   1555     AC_MSG_CHECKING([for BZLIB])
   1556     AC_MSG_RESULT([])
   1557     failed=0
   1558     passed=0
   1559     found_libbz=0
   1560     AC_CHECK_HEADER(bzlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
   1561     AC_CHECK_LIB(bz2,BZ2_bzDecompress,found_libbz=`expr $found_libbz + 1`,,)
   1562     if test "$native_win32_build" = 'yes'; then
   1563       AC_CHECK_LIB(bz2,_imp__BZ2_decompress,found_libbz=`expr $found_libbz + 1`,,)
   1564     fi
   1565     if test $found_libbz -gt 0; then
   1566       passed=`expr $passed + 1`
   1567     else
   1568       failed=`expr $failed + 1`
   1569     fi
   1570     AC_MSG_CHECKING(if BZLIB package is complete)
   1571     if test $passed -gt 0; then
   1572       if test $failed -gt 0; then
   1573         AC_MSG_RESULT(no -- some components failed test)
   1574         have_bzlib='no (failed tests)'
   1575       else
   1576         BZLIB_LIBS='-lbz2'
   1577         LIBS="$BZLIB_LIBS $LIBS"
   1578         AC_DEFINE(BZLIB_DELEGATE,1,Define if you have the bzip2 library)
   1579         AC_MSG_RESULT(yes)
   1580         have_bzlib='yes'
   1581       fi
   1582     else
   1583       AC_MSG_RESULT(no)
   1584     fi
   1585 fi
   1586 AM_CONDITIONAL(BZLIB_DELEGATE, test "$have_bzlib" = 'yes')
   1587 AC_SUBST(BZLIB_LIBS)
   1588 
   1589 #
   1590 # Find the X11 include and library directories.
   1591 #
   1592 IPC_LIBS=''
   1593 X11_LIBS=''
   1594 XEXT_LIBS=''
   1595 XT_LIBS=''
   1596 AC_PATH_XTRA
   1597 if test "$no_x" != 'yes'; then
   1598     AC_MSG_RESULT([-------------------------------------------------------------])
   1599     AC_MSG_CHECKING([for X11])
   1600     AC_MSG_RESULT([])
   1601     LDFLAGS="$LDFLAGS $X_LIBS"
   1602     X11_LIBS="$X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
   1603     LIBS="$X11_LIBS $LIBS"
   1604     CPPFLAGS="$CPPFLAGS $X_CFLAGS"
   1605 
   1606     AC_DEFINE(X11_DELEGATE,1,Define if you have X11 library)dnl
   1607 
   1608     #
   1609     # Check for X11 shared memory extension
   1610     #
   1611     # shmctl is required to support the shared memory extension
   1612     AC_CHECK_FUNC([shmctl],[have_shmctl='yes'],[])
   1613     if test "$have_shmctl" != 'yes'; then
   1614         PERSIST_LIBS=$LIBS
   1615         LIBS="$LIBS -lcygipc"
   1616         AC_TRY_LINK_FUNC([shmctl],[have_shmctl='yes'; IPC_LIBS='-lcygipc'],[])
   1617         LIBS=$PERSIST_LIBS
   1618     fi
   1619 
   1620     if test "$have_shmctl" = 'yes'; then
   1621         AC_CHECK_LIB([Xext],[XShmAttach],[XEXT_LIBS='-lXext' ; AC_DEFINE(HAVE_SHARED_MEMORY,1,X11 server supports shared memory extension)],[],[])
   1622     fi
   1623 
   1624     #
   1625     # Check for X11 shape extension
   1626     #
   1627     AC_CHECK_LIB([Xext],[XShapeCombineMask],[XEXT_LIBS='-lXext' ; AC_DEFINE(HAVE_SHAPE,1,X11 server supports shape extension)],[],[])
   1628     AC_CHECK_LIB(Xt,XtSetEventDispatcher,XT_LIBS='-lXt',,)
   1629     LIBS="$XEXT_LIBS $XT_LIBS $LIBS"
   1630 fi
   1631 if test "$no_x" != 'yes'; then
   1632   have_x='yes'
   1633 else
   1634   have_x='no'
   1635 fi
   1636 AM_CONDITIONAL(X11_DELEGATE, test "$have_x" = 'yes')
   1637 AC_SUBST(X11_LIBS)
   1638 AC_SUBST(XEXT_LIBS)
   1639 
   1640 dnl ===========================================================================
   1641 
   1642 #
   1643 # Check for ZLIB
   1644 #
   1645 AC_ARG_WITH([zlib],
   1646     [AC_HELP_STRING([--without-zlib],
   1647                     [disable ZLIB support])],
   1648     [with_zlib=$withval],
   1649     [with_zlib='yes'])
   1650 
   1651 if test "$with_zlib" != 'yes'; then
   1652     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-zlib=$with_zlib "
   1653 fi
   1654 
   1655 have_zlib='no'
   1656 ZLIB_CFLAGS=""
   1657 ZLIB_LIBS=""
   1658 ZLIB_PKG=""
   1659 if test "x$with_zlib" = "xyes"; then
   1660   AC_MSG_RESULT([-------------------------------------------------------------])
   1661   PKG_CHECK_MODULES(ZLIB,[zlib >= 1.0.0], have_zlib=yes, have_zlib=no)
   1662   AC_MSG_RESULT([])
   1663 fi
   1664 
   1665 if test "$have_zlib" = 'yes'; then
   1666   AC_DEFINE(ZLIB_DELEGATE,1,Define if you have ZLIB library)
   1667   CFLAGS="$ZLIB_CFLAGS $CFLAGS"
   1668 fi
   1669 
   1670 AM_CONDITIONAL(ZLIB_DELEGATE, test "$have_zlib" = 'yes')
   1671 AC_SUBST(ZLIB_CFLAGS)
   1672 AC_SUBST(ZLIB_LIBS)
   1673 
   1674 dnl ===========================================================================
   1675 
   1676 # whether modules are built or not.
   1677 with_ltdl='yes'
   1678 have_ltdl='no'
   1679 LTDL_LIBS=''
   1680 if test "$build_modules" != 'no' ; then
   1681   AC_MSG_RESULT([-------------------------------------------------------------])
   1682   AC_MSG_CHECKING([for libltdl])
   1683   AC_MSG_RESULT([])
   1684   failed=0
   1685   passed=0
   1686   AC_CHECK_HEADER([ltdl.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
   1687   AC_CHECK_LIB([ltdl],[lt_dlinit],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],)
   1688   AC_MSG_CHECKING([if libltdl package is complete])
   1689   if test $passed -gt 0 ; then
   1690     if test $failed -gt 0 ; then
   1691       AC_MSG_RESULT([no -- some components failed test])
   1692       have_ltdl='no (failed tests)'
   1693     else
   1694       LTDL_LIBS='-lltdl'
   1695       LIBS="$LTDL_LIBS $LIBS"
   1696       AC_DEFINE(LTDL_DELEGATE,1,[Define if using libltdl to support dynamically loadable modules])
   1697       AC_MSG_RESULT([yes])
   1698       have_ltdl='yes'
   1699     fi
   1700   else
   1701     AC_MSG_RESULT([no])
   1702   fi
   1703   if test "$have_ltdl" != 'yes' ; then
   1704     AC_MSG_FAILURE([libltdl is required for modules build],[1])
   1705   fi
   1706 fi
   1707 AM_CONDITIONAL(WITH_LTDL, test "$have_ltdl" != 'no')
   1708 
   1709 #
   1710 # If profiling, then check for -ldl and dlopen (required for Solaris & gcc)
   1711 #
   1712 LIB_DL=''
   1713 if test "$enable_profiling" = 'yes'; then
   1714     AC_CHECK_LIB(dl,dlopen,LIB_DL='-ldl',,)
   1715     LIBS="$LIB_DL $LIBS"
   1716 fi
   1717 AC_SUBST(LIB_DL)
   1718 
   1719 dnl ===========================================================================
   1720 
   1721 #
   1722 # Set Apple font directory.
   1723 #
   1724 AC_ARG_WITH([apple-font-dir],
   1725     [AC_HELP_STRING([--with-apple-font-dir=DIR],
   1726                     [Apple font directory])],
   1727     [with_apple_font_dir=$withval],
   1728     [with_apple_font_dir='default'])
   1729 
   1730 if test "$with_apple_font_dir" != 'default'; then
   1731     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-apple-font-dir=$with_apple_font_dir "
   1732 fi
   1733 
   1734 dnl ===========================================================================
   1735 
   1736 #
   1737 # Check for Autotrace delegate library.
   1738 #
   1739 AC_ARG_WITH([autotrace],
   1740     [AC_HELP_STRING([--with-autotrace],
   1741                     [enable autotrace support])],
   1742         [with_autotrace=$withval],
   1743         [with_autotrace='no'])
   1744 
   1745 if test "$with_autotrace" != 'yes'; then
   1746     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-autotrace=$with_autotrace "
   1747 fi
   1748 
   1749 have_autotrace='no'
   1750 AUTOTRACE_CFLAGS=""
   1751 AUTOTRACE_LIBS=""
   1752 AUTOTRACE_PKG=""
   1753 if test "x$with_autotrace" = "xyes"; then
   1754   AC_MSG_RESULT([-------------------------------------------------------------])
   1755   PKG_CHECK_MODULES(AUTOTRACE,[autotrace >= 0.31.1], have_autotrace=yes, have_autotrace=no)
   1756   AC_MSG_RESULT([])
   1757 fi
   1758 
   1759 if test "$have_autotrace" = 'yes'; then
   1760   AC_DEFINE(AUTOTRACE_DELEGATE,1,Define if you have AUTOTRACE library)
   1761   CFLAGS="$AUTOTRACE_CFLAGS $CFLAGS"
   1762 fi
   1763 
   1764 AM_CONDITIONAL(AUTOTRACE_DELEGATE,test "$have_autotrace" = 'yes')
   1765 AC_SUBST(AUTOTRACE_CFLAGS)
   1766 AC_SUBST(AUTOTRACE_LIBS)
   1767 
   1768 dnl ===========================================================================
   1769 
   1770 #
   1771 # Check for Display Postscript delegate library.
   1772 #
   1773 AC_ARG_WITH([dps],
   1774     [AC_HELP_STRING([--without-dps],
   1775                     [disable Display Postscript support])],
   1776     [with_dps=$withval],
   1777     [with_dps='yes'])
   1778 
   1779 if test "$with_dps" != 'yes'; then
   1780     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-dps=$with_dps "
   1781 fi
   1782 
   1783 have_dps='no'
   1784 DPS_LIBS=''
   1785 if test "$with_dps" != 'no' && test "$with_x" != 'no'; then
   1786     AC_MSG_RESULT([-------------------------------------------------------------])
   1787     AC_MSG_CHECKING([for DPS])
   1788     AC_MSG_RESULT([])
   1789     failed=0
   1790     passed=0
   1791     PERSIST_CPPFLAGS="$CPPFLAGS"
   1792     CPPFLAGS="$CPPFLAGS -I${ac_x_includes}/X11"
   1793     AC_CHECK_HEADER(DPS/dpsXclient.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
   1794     # DPS issues:
   1795     # XFree86-4.x needs -lXt to provide XtMalloc for -ldps.
   1796     # Cygwin doesn't deliver -lXt as a DLL, which prevents a DLL build.
   1797     # Adobe DPS (as delivered on Solaris) doesn't require -lXt.
   1798     # ImageMagick itself doesn't use -lXt.
   1799     have_libdps='no'
   1800     LIBDPS_XT=''
   1801     AC_CHECK_LIB(dps,DPSInitialize,have_libdps='yes',have_libdps='no',)
   1802     if test "$have_libdps" != 'yes'; then
   1803         # Unset cache variable so we can try again.
   1804         unset ac_cv_lib_dps_DPSInitialize
   1805         AC_CHECK_LIB(dps,DPSInitialize,have_libdps='yes',have_libdps='no',-lXt)
   1806         if test "$have_libdps" = 'yes'; then
   1807             LIBDPS_XT='-lXt'
   1808         fi
   1809     fi
   1810     if test "$have_libdps" = 'yes'; then
   1811         passed=`expr $passed + 1`
   1812     else
   1813         failed=`expr $failed + 1`
   1814     fi
   1815     AC_CHECK_LIB(dpstk,XDPSPixelsPerPoint,passed=`expr $passed + 1`,failed=`expr $failed + 1`,-ldps $LIBDPS_XT)
   1816     AC_MSG_CHECKING([if DPS package is complete])
   1817     if test $passed -gt 0; then
   1818         if test $failed -gt 0; then
   1819             AC_MSG_RESULT([no -- some components failed test])
   1820             have_dps='no (failed tests)'
   1821             CPPFLAGS="$PERSIST_CPPFLAGS"
   1822         else
   1823             DPS_LIBS="-ldpstk -ldps ${LIBDPS_XT}"
   1824             LIBS="$DPS_LIBS $LIBS"
   1825             AC_DEFINE(DPS_DELEGATE,1,Define if you have Display Postscript)
   1826             AC_MSG_RESULT([yes])
   1827             have_dps='yes'
   1828         fi
   1829     else
   1830         AC_MSG_RESULT([no])
   1831         CPPFLAGS=$PERSIST_CPPFLAGS
   1832     fi
   1833 fi
   1834 AM_CONDITIONAL(DPS_DELEGATE, test "$have_dps" = 'yes')
   1835 AC_SUBST(DPS_LIBS)
   1836 
   1837 dnl ===========================================================================
   1838 
   1839 #
   1840 # Set DejaVu font directory.
   1841 #
   1842 AC_ARG_WITH([dejavu-font-dir],
   1843     [AC_HELP_STRING([--with-dejavu-font-dir=DIR],
   1844                     [DejaVu font directory])],
   1845     [with_dejavu_font_dir=$withval],
   1846     [with_dejavu_font_dir='default'])
   1847 
   1848 if test "$with_dejavu_font_dir" != 'default'; then
   1849     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-dejavu-font-dir=$with_dejavu_font_dir "
   1850 fi
   1851 
   1852 dnl ===========================================================================
   1853 
   1854 #
   1855 # Check for FFTW delegate library.
   1856 #
   1857 AC_ARG_WITH([fftw],
   1858     [AC_HELP_STRING([--without-fftw],
   1859                     [disable FFTW support])],
   1860     [with_fftw=$withval],
   1861     [with_fftw='yes'])
   1862 
   1863 if test "$with_fftw" != 'yes'; then
   1864     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fftw=$with_fftw "
   1865 fi
   1866 
   1867 have_fftw='no'
   1868 FFTW_CFLAGS=""
   1869 FFTW_LIBS=""
   1870 FFTW_PKG=""
   1871 if test "x$with_fftw" = "xyes"; then
   1872   AC_MSG_RESULT([-------------------------------------------------------------])
   1873   PKG_CHECK_MODULES(fftw3,[fftw3 >= 3.0.0], have_fftw=yes, have_fftw=no)
   1874   AC_MSG_RESULT([])
   1875 fi
   1876 
   1877 if test "$have_fftw" = 'yes'; then
   1878   AC_DEFINE(FFTW_DELEGATE,1,Define if you have FFTW library)
   1879   FFTW_CFLAGS="$fftw3_CFLAGS"
   1880   FFTW_LIBS="$fftw3_LIBS"
   1881   CFLAGS="$fftw3_CFLAGS $CFLAGS"
   1882 fi
   1883 
   1884 AM_CONDITIONAL(FFTW_DELEGATE, test "$have_fftw" = 'yes')
   1885 AC_SUBST(FFTW_CFLAGS)
   1886 AC_SUBST(FFTW_LIBS)
   1887 
   1888 dnl ===========================================================================
   1889 
   1890 #
   1891 # Check for FLIF delegate library.
   1892 #
   1893 AC_ARG_WITH(flif,
   1894     [AC_HELP_STRING([--without-flif],
   1895                     [disable FLIF support])],
   1896     [with_flif=$withval],
   1897     [with_flif='yes'])
   1898 
   1899 if test "$with_flif" != 'yes'; then
   1900     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-flif=$with_flif "
   1901 fi
   1902 
   1903 have_flif='no'
   1904 FLIF_LIBS=''
   1905 if test "$with_flif" != 'no'; then
   1906     AC_MSG_RESULT([-------------------------------------------------------------])
   1907     AC_MSG_CHECKING([for FLIF])
   1908     AC_MSG_RESULT([])
   1909     failed=0
   1910     passed=0
   1911     AC_CHECK_HEADER(flif.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
   1912     AC_CHECK_LIB(flif,flif_create_decoder,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
   1913     AC_MSG_CHECKING([if FLIF package is complete])
   1914     if test $passed -gt 0; then
   1915         if test $failed -gt 0; then
   1916             AC_MSG_RESULT([no -- some components failed test])
   1917             have_flif='no (failed tests)'
   1918         else
   1919             FLIF_LIBS='-lflif'
   1920             LIBS="$FLIF_LIBS $LIBS"
   1921             AC_DEFINE(FLIF_DELEGATE,1,Define if you have FLIF library)
   1922             AC_MSG_RESULT([yes])
   1923             have_flif='yes'
   1924         fi
   1925     else
   1926         AC_MSG_RESULT([no])
   1927     fi
   1928 fi
   1929 AM_CONDITIONAL(FLIF_DELEGATE,test "$have_flif" = 'yes')
   1930 AC_SUBST(FLIF_LIBS)
   1931 
   1932 dnl ===========================================================================
   1933 
   1934 #
   1935 # Check for FlashPIX delegate library.
   1936 #
   1937 AC_ARG_WITH([fpx],
   1938     [AC_HELP_STRING([--without-fpx],
   1939                     [disable FlashPIX support])],
   1940     [with_fpx=$withval],
   1941     [with_fpx='yes'])
   1942 
   1943 if test "$with_fpx" != 'yes'; then
   1944     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fpx=$with_fpx "
   1945 fi
   1946 
   1947 have_fpx='no'
   1948 FPX_LIBS=''
   1949 if test "$with_fpx" != 'no'; then
   1950     AC_MSG_RESULT([-------------------------------------------------------------])
   1951     AC_MSG_CHECKING([for FlashPIX])
   1952     AC_MSG_RESULT([])
   1953     failed=0
   1954     passed=0
   1955     AC_LANG_PUSH(C++)
   1956     AC_CHECK_HEADER(fpxlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
   1957     AC_CHECK_LIB(fpx,FPX_OpenImageByFilename,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
   1958     AC_LANG_POP
   1959     AC_MSG_CHECKING([if FlashPIX package is complete])
   1960     if test $passed -gt 0; then
   1961         if test $failed -gt 0; then
   1962             AC_MSG_RESULT([no -- some components failed test])
   1963             have_fpx='no (failed tests)'
   1964         else
   1965             FPX_LIBS='-lfpx'
   1966             AC_DEFINE(FPX_DELEGATE,1,Define if you have FlashPIX library)
   1967             AC_MSG_RESULT([yes])
   1968             have_fpx='yes'
   1969             PERLMAINCC="$CXX"
   1970         fi
   1971     else
   1972         AC_MSG_RESULT([no])
   1973     fi
   1974 fi
   1975 AM_CONDITIONAL(FPX_DELEGATE, test "$have_fpx" = 'yes')
   1976 AC_SUBST(FPX_LIBS)
   1977 
   1978 dnl ===========================================================================
   1979 
   1980 #
   1981 # Check for DJVU delegate library.
   1982 #
   1983 AC_ARG_WITH([djvu],
   1984     [AC_HELP_STRING([--without-djvu],
   1985                     [disable DjVu support])],
   1986     [with_djvu=$withval],
   1987     [with_djvu='yes'])
   1988 
   1989 if test "$with_djvu" != 'yes'; then
   1990     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-djvu=$with_djvu "
   1991 fi
   1992 
   1993 have_djvu='no'
   1994 DJVU_CFLAGS=""
   1995 DJVU_LIBS=""
   1996 DJVU_PKG=""
   1997 if test "x$with_djvu" = "xyes"; then
   1998   AC_MSG_RESULT([-------------------------------------------------------------])
   1999   PKG_CHECK_MODULES(ddjvuapi,[ddjvuapi >= 3.5.0], have_djvu=yes, have_djvu=no)
   2000   AC_MSG_RESULT([])
   2001 fi
   2002 
   2003 if test "$have_djvu" = 'yes'; then
   2004   AC_DEFINE(DJVU_DELEGATE,1,Define if you have DJVU library)
   2005   DJVU_CFLAGS="$ddjvuapi_CFLAGS"
   2006   DJVU_LIBS="$ddjvuapi_LIBS"
   2007   CFLAGS="$ddjvuapi_CFLAGS $CFLAGS"
   2008 fi
   2009 
   2010 AM_CONDITIONAL(DJVU_DELEGATE, test "$have_djvu" = 'yes')
   2011 AC_SUBST(DJVU_CFLAGS)
   2012 AC_SUBST(DJVU_LIBS)
   2013 
   2014 dnl ===========================================================================
   2015 
   2016 #
   2017 # Check for fontconfig delegate library.
   2018 #
   2019 AC_ARG_WITH([fontconfig],
   2020     [AC_HELP_STRING([--without-fontconfig],
   2021                     [disable fontconfig support])],
   2022         [with_fontconfig=$withval],
   2023         [with_fontconfig='yes'])
   2024 
   2025 if test "$with_fontconfig" != 'yes'; then
   2026     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontconfig=$with_fontconfig "
   2027 fi
   2028 
   2029 have_fontconfig='no'
   2030 FONTCONFIG_CFLAGS=""
   2031 FONTCONFIG_LIBS=""
   2032 FONTCONFIG_PKG=""
   2033 if test "x$with_fontconfig" = "xyes"; then
   2034   AC_MSG_RESULT([-------------------------------------------------------------])
   2035   PKG_CHECK_MODULES(FONTCONFIG,[fontconfig >= 2.1.0], have_fontconfig=yes, have_fontconfig=no)
   2036   AC_MSG_RESULT([])
   2037 fi
   2038 
   2039 if test "$have_fontconfig" = 'yes'; then
   2040   AC_DEFINE(FONTCONFIG_DELEGATE,1,Define if you have FONTCONFIG library)
   2041   CFLAGS="$FONTCONFIG_CFLAGS $CFLAGS"
   2042 fi
   2043 
   2044 AM_CONDITIONAL(FONTCONFIG_DELEGATE,test "$have_fontconfig" = 'yes')
   2045 AC_SUBST(FONTCONFIG_CFLAGS)
   2046 AC_SUBST(FONTCONFIG_LIBS)
   2047 
   2048 dnl ===========================================================================
   2049 
   2050 #
   2051 # Check for the Freetype delegate library.
   2052 #
   2053 AC_ARG_WITH([freetype],
   2054     [AC_HELP_STRING([--without-freetype],
   2055                     [disable Freetype support])],
   2056     [with_freetype=$withval],
   2057     [with_freetype='yes'])
   2058 
   2059 if test "$with_freetype" != 'yes'; then
   2060     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-freetype=$with_freetype "
   2061 fi
   2062 
   2063 have_freetype='no'
   2064 FREETYPE_CFLAGS=""
   2065 FREETYPE_LIBS=""
   2066 FREETYPE_PKG=""
   2067 if test "x$with_freetype" = "xyes"; then
   2068   AC_MSG_RESULT([-------------------------------------------------------------])
   2069   PKG_CHECK_MODULES(FREETYPE,[freetype2], have_freetype=yes, have_freetype=no)
   2070   AC_MSG_RESULT([])
   2071 fi
   2072 
   2073 if test "$have_freetype" = 'yes'; then
   2074   AC_DEFINE(FREETYPE_DELEGATE,1,Define if you have FREETYPE library)
   2075   CFLAGS="$FREETYPE_CFLAGS $CFLAGS"
   2076 fi
   2077 
   2078 AM_CONDITIONAL(FREETYPE_DELEGATE, test "$have_freetype" = 'yes')
   2079 AC_SUBST(FREETYPE_CFLAGS)
   2080 AC_SUBST(FREETYPE_LIBS)
   2081 
   2082 dnl ===========================================================================
   2083 
   2084 #
   2085 # Check for the raqm delegate library.
   2086 #
   2087 AC_ARG_WITH([raqm],
   2088     [AC_HELP_STRING([--without-raqm],
   2089                     [disable Raqm support])],
   2090     [with_raqm=$withval],
   2091     [with_raqm='yes'])
   2092 
   2093 if test "$with_raqm" != 'yes'; then
   2094     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-raqm=$with_raqm "
   2095 fi
   2096 
   2097 have_raqm='no'
   2098 RAQM_CFLAGS=""
   2099 RAQM_LIBS=""
   2100 RAQM_PKG=""
   2101 if test "x$with_raqm" = "xyes"; then
   2102   AC_MSG_RESULT([-------------------------------------------------------------])
   2103   PKG_CHECK_MODULES(RAQM,[raqm], have_raqm=yes, have_raqm=no)
   2104   AC_MSG_RESULT([])
   2105 fi
   2106 
   2107 if test "$have_raqm" = 'yes'; then
   2108   AC_DEFINE(RAQM_DELEGATE,1,Define if you have RAQM library)
   2109   CFLAGS="$RAQM_CFLAGS $CFLAGS"
   2110 fi
   2111 
   2112 AM_CONDITIONAL(RAQM_DELEGATE, test "$have_raqm" = 'yes')
   2113 AC_SUBST(RAQM_CFLAGS)
   2114 AC_SUBST(RAQM_LIBS)
   2115 
   2116 dnl ===========================================================================
   2117 
   2118 #
   2119 # Check for Ghostscript library or framework.
   2120 #
   2121 # Test for iapi.h & test for gsapi_new_instance in -lgs
   2122 # or -framework Ghostscript
   2123 
   2124 AC_ARG_WITH([gslib],
   2125     [AC_HELP_STRING([--with-gslib],
   2126                     [enable Ghostscript library support])],
   2127     [with_gslib=$withval],
   2128     [with_gslib='no'])
   2129 
   2130 gslib_framework='no'
   2131 if test "$with_gslib" != 'yes'; then
   2132     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gslib=$with_gslib "
   2133 fi
   2134 
   2135 have_gslib='no'
   2136 GS_LIBS=''
   2137 if test "$with_gslib" != 'no'; then
   2138     AC_MSG_RESULT([-------------------------------------------------------------])
   2139     AC_MSG_CHECKING([for Ghostscript])
   2140     AC_MSG_RESULT([])
   2141     framework=0
   2142     failed=0
   2143     passed=0
   2144     AC_CHECK_HEADER(ghostscript/iapi.h,passed=`expr $passed + 1`,
   2145         failed=`expr $failed + 1`,)
   2146     AC_CHECK_HEADER(ghostscript/ierrors.h,passed=`expr $passed + 1`,
   2147         failed=`expr $failed + 1`,)
   2148     AC_CHECK_FRAMEWORK(Ghostscript,gsapi_new_instance,framework=`expr $framework + 1`,
   2149     AC_CHECK_LIB(gs,gsapi_new_instance,passed=`expr $passed + 1`,failed=`expr $failed + 1`,),)
   2150     AC_MSG_CHECKING([if Ghostscript package is complete])
   2151     if test $passed -gt 0; then
   2152         if test $failed -gt 0; then
   2153             AC_MSG_RESULT([no -- some components failed test])
   2154             have_gslib='no (failed tests)'
   2155         else
   2156             if test $framework -gt 0; then
   2157                 GS_LIBS='-framework Ghostscript'
   2158                 gslib_framework='yes'
   2159                 AC_MSG_RESULT([yes, using framework.])
   2160             else
   2161                 AC_MSG_RESULT([yes, using library.])
   2162                 GS_LIBS='-lgs'
   2163             fi
   2164             LIBS="$GS_LIBS $LIBS"
   2165             AC_DEFINE(GS_DELEGATE,1,Define if you have Ghostscript library or framework)
   2166             have_gslib='yes'
   2167         fi
   2168     else
   2169         AC_MSG_RESULT([no])
   2170     fi
   2171 fi
   2172 AM_CONDITIONAL(GS_DELEGATE, test "$have_gslib" = 'yes')
   2173 AC_SUBST(GS_LIBS)
   2174 
   2175 # Set default font search path
   2176 AC_ARG_WITH([fontpath],
   2177     [AC_HELP_STRING([--with-fontpath=DIR],
   2178                     [prepend to default font search path])],
   2179     [with_fontpath=$withval],
   2180     [with_fontpath=''])
   2181 
   2182 if test "$with_fontpath" != "yes" && test -z "$with_fontpath"; then
   2183     with_fontpath=''
   2184 else
   2185     AC_DEFINE_UNQUOTED(MAGICK_FONT_PATH,"$with_fontpath",[Define to prepend to default font search path.])
   2186 fi
   2187 if test "$with_fontpath=" != ''; then
   2188     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontpath=$with_fontpath "
   2189 fi
   2190 
   2191 # Set Ghostscript font directory
   2192 AC_ARG_WITH([gs-font-dir],
   2193     [AC_HELP_STRING([--with-gs-font-dir=DIR],
   2194                     [Ghostscript font directory])],
   2195     [with_gs_font_dir=$withval],
   2196     [with_gs_font_dir='default'])
   2197 
   2198 if test "$with_gs_font_dir" != 'default'; then
   2199     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gs-font-dir=$with_gs_font_dir "
   2200 fi
   2201 
   2202 dnl ===========================================================================
   2203 
   2204 #
   2205 # Check for GVC delegate library.
   2206 #
   2207 AC_ARG_WITH(gvc,
   2208     [AC_HELP_STRING([--with-gvc],
   2209                     [enable GVC support])],
   2210     [with_gvc=$withval],
   2211     [with_gvc='yes'])
   2212 
   2213 if test "$with_gvc" != 'yes'; then
   2214     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gvc=$with_gvc "
   2215 fi
   2216 
   2217 GVC_PKG=""
   2218 if test "x$with_gvc" = "xyes"; then
   2219   AC_MSG_RESULT([-------------------------------------------------------------])
   2220   PKG_CHECK_MODULES(GVC,[libgvc >= 2.9.0], have_gvc=yes, have_gvc=no)
   2221   AC_MSG_RESULT([])
   2222 fi
   2223 
   2224 if test "$have_gvc" = 'yes'; then
   2225   AC_DEFINE(GVC_DELEGATE,1,Define if you have GVC library)
   2226   CFLAGS="$GVC_CFLAGS $CFLAGS"
   2227 fi
   2228 
   2229 AM_CONDITIONAL(GVC_DELEGATE, test "$have_gvc" = 'yes')
   2230 AC_SUBST(GVC_CFLAGS)
   2231 AC_SUBST(GVC_LIBS)
   2232 
   2233 dnl ===========================================================================
   2234 
   2235 #
   2236 # Check for JBIG delegate library.
   2237 #
   2238 
   2239 AC_ARG_WITH([jbig],
   2240     [AC_HELP_STRING([--without-jbig],
   2241                     [disable JBIG support])],
   2242     [with_jbig=$withval],
   2243     [with_jbig='yes'])
   2244 
   2245 have_jbig='no'
   2246 JBIG_LIBS=''
   2247 if test "$with_jbig" != 'no'; then
   2248     AC_MSG_RESULT([-------------------------------------------------------------])
   2249     AC_MSG_CHECKING([for JBIG])
   2250     AC_MSG_RESULT([])
   2251     failed=0
   2252     passed=0
   2253     AC_CHECK_HEADER(jbig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
   2254     AC_CHECK_LIB(jbig,jbg_dec_init,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
   2255     AC_MSG_CHECKING([if JBIG package is complete])
   2256     if test $passed -gt 0; then
   2257         if test $failed -gt 0; then
   2258             AC_MSG_RESULT([no -- some components failed test])
   2259             have_jbig='no (failed tests)'
   2260         else
   2261             JBIG_LIBS='-ljbig'
   2262             LIBS="$JBIG_LIBS $LIBS"
   2263             AC_DEFINE(JBIG_DELEGATE,1,Define if you have JBIG library)
   2264             AC_MSG_RESULT([yes])
   2265             have_jbig='yes'
   2266         fi
   2267     else
   2268         AC_MSG_RESULT([no])
   2269     fi
   2270 fi
   2271 AM_CONDITIONAL(JBIG_DELEGATE, test "$have_jbig" = 'yes')
   2272 AC_SUBST(JBIG_LIBS)
   2273 
   2274 dnl ===========================================================================
   2275 
   2276 #
   2277 # Check for JPEG delegate library.
   2278 #
   2279 AC_ARG_WITH([jpeg],
   2280     [AC_HELP_STRING([--without-jpeg],
   2281                     [disable JPEG support])],
   2282     [with_jpeg=$withval],
   2283     [with_jpeg='yes'])
   2284 
   2285 if test "$with_jpeg" != 'yes'; then
   2286     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jpeg=$with_jpeg "
   2287 fi
   2288 
   2289 have_jpeg='no'
   2290 JPEG_LIBS=''
   2291 if test "$with_jpeg" != 'no'; then
   2292     AC_MSG_RESULT([-------------------------------------------------------------])
   2293     AC_MSG_CHECKING([for JPEG])
   2294     AC_MSG_RESULT([])
   2295     failed=0
   2296     passed=0
   2297     AC_CHECK_HEADER(jconfig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
   2298     AC_CHECK_HEADER(jerror.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
   2299     AC_CHECK_HEADER(jmorecfg.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
   2300     AC_CHECK_HEADER(jpeglib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
   2301     AC_CHECK_LIB(jpeg,jpeg_read_header,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
   2302 
   2303 # Test for compatible JPEG library
   2304 if test "$ac_cv_jpeg_version_ok" != 'yes'; then
   2305 AC_CACHE_CHECK(for JPEG library is version 6b or later, ac_cv_jpeg_version_ok,
   2306 [AC_TRY_COMPILE(
   2307 #include <stdio.h>
   2308 #include <stdlib.h>
   2309 #include <jpeglib.h>
   2310 ,
   2311 changequote(<<, >>)dnl
   2312 <<
   2313 #if JPEG_LIB_VERSION < 62
   2314 #error IJG JPEG library must be version 6b or newer!
   2315 #endif
   2316 return 0;
   2317 >>,
   2318 changequote([, ])dnl
   2319 ac_cv_jpeg_version_ok='yes'; passed=`expr $passed + 1`,
   2320 ac_cv_jpeg_version_ok='no'; failed=`expr $failed + 1`)])
   2321 fi
   2322     AC_MSG_CHECKING([if JPEG package is complete])
   2323     if test $passed -gt 0; then
   2324         if test $failed -gt 0; then
   2325             AC_MSG_RESULT([no -- some components failed test])
   2326             have_jpeg='no (failed tests)'
   2327         else
   2328             JPEG_LIBS='-ljpeg'
   2329             LIBS="$JPEG_LIBS $LIBS"
   2330             AC_DEFINE(JPEG_DELEGATE,1,Define if you have JPEG library)
   2331             AC_MSG_RESULT([yes])
   2332             have_jpeg='yes'
   2333         fi
   2334     else
   2335         AC_MSG_RESULT([no])
   2336     fi
   2337 fi
   2338 AM_CONDITIONAL(JPEG_DELEGATE, test "$have_jpeg" = 'yes')
   2339 AC_SUBST(JPEG_LIBS)
   2340 
   2341 dnl ===========================================================================
   2342 
   2343 #
   2344 # Check for LCMS delegate library.
   2345 #
   2346 AC_ARG_WITH(lcms,
   2347         [  --without-lcms          disable lcms (v1.1X) support],
   2348         [with_lcms=$withval],
   2349         [with_lcms='yes'])
   2350 if test "$with_lcms" != 'yes' ; then
   2351     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lcms=$with_lcms "
   2352 fi
   2353 
   2354 have_lcms='no'
   2355 LCMS_CFLAGS=""
   2356 LCMS_LIBS=""
   2357 LCMS_PKG=""
   2358 if test "x$with_lcms" = "xyes"; then
   2359   AC_MSG_RESULT([-------------------------------------------------------------])
   2360   PKG_CHECK_MODULES(LCMS2,[lcms2 >= 2.0.0], have_lcms=yes, have_lcms=no)
   2361   AC_MSG_RESULT([])
   2362 fi
   2363 
   2364 if test "$have_lcms" = 'yes'; then
   2365   AC_DEFINE(LCMS_DELEGATE,1,Define if you have LCMS library)
   2366   LCMS_CFLAGS="$LCMS2_CFLAGS"
   2367   LCMS_LIBS="$LCMS2_LIBS"
   2368   CFLAGS="$LCMS2_CFLAGS $CFLAGS"
   2369   AC_CHECK_HEADER(lcms2/lcms2.h,have_lcms_header='yes',,)
   2370   if test "$have_lcms_header" = 'yes'; then
   2371     AC_DEFINE(HAVE_LCMS2_LCMS2_H,1,Define if you have the <lcms2/lcms2.h> header file.)
   2372   else
   2373     AC_DEFINE(HAVE_LCMS2_H,1,Define if you have the <lcms2.h> header file.)
   2374   fi
   2375 fi
   2376 
   2377 AM_CONDITIONAL(LCMS_DELEGATE, test "$have_lcms" = 'yes')
   2378 AC_SUBST(LCMS_CFLAGS)
   2379 AC_SUBST(LCMS_LIBS)
   2380 
   2381 dnl ===========================================================================
   2382 
   2383 #
   2384 # Check for the OpenJP2 delegate library.
   2385 #
   2386 AC_ARG_WITH([openjp2],
   2387     [AC_HELP_STRING([--without-openjp2],
   2388                     [disable OpenJP2 support])],
   2389     [with_openjp2=$withval],
   2390     [with_openjp2='yes'])
   2391 
   2392 if test "$with_openjp2" != 'yes'; then
   2393     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-openjp2=$with_openjp2 "
   2394 fi
   2395 
   2396 have_openjp2='no'
   2397 LIBOPENJP2_CFLAGS=""
   2398 LIBOPENJP2_LIBS=""
   2399 LIBOPENJP2_PKG=""
   2400 if test "x$with_openjp2" = "xyes"; then
   2401   AC_MSG_RESULT([-------------------------------------------------------------])
   2402   PKG_CHECK_MODULES(LIBOPENJP2,[libopenjp2 >= 2.1.0], have_openjp2=yes, have_openjp2=no)
   2403   AC_MSG_RESULT([])
   2404 fi
   2405 
   2406 if test "$have_openjp2" = 'yes'; then
   2407   AC_DEFINE(LIBOPENJP2_DELEGATE,1,Define if you have OPENJP2 library)
   2408   CFLAGS="$LIBOPENJP2_CFLAGS $CFLAGS"
   2409 fi
   2410 
   2411 AM_CONDITIONAL(LIBOPENJP2_DELEGATE, test "$have_openjp2" = 'yes')
   2412 AC_SUBST(LIBOPENJP2_CFLAGS)
   2413 AC_SUBST(LIBOPENJP2_LIBS)
   2414 
   2415 
   2416 dnl ===========================================================================
   2417 
   2418 #
   2419 # Check for the LQR (Liquid Rescale) delegate library.
   2420 #
   2421 AC_ARG_WITH([lqr],
   2422     [AC_HELP_STRING([--without-lqr],
   2423                     [disable Liquid Rescale support])],
   2424     [with_lqr=$withval],
   2425     [with_lqr='yes'])
   2426 
   2427 if test "$with_lqr" != 'yes'; then
   2428     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lqr=$with_lqr "
   2429 fi
   2430 
   2431 have_lqr='no'
   2432 LQR_CFLAGS=""
   2433 LQR_LIBS=""
   2434 LQR_PKG=""
   2435 if test "x$with_lqr" = "xyes"; then
   2436   AC_MSG_RESULT([-------------------------------------------------------------])
   2437   PKG_CHECK_MODULES(LQR,[lqr-1 >= 0.1.0], have_lqr=yes, have_lqr=no)
   2438   AC_MSG_RESULT([])
   2439 fi
   2440 
   2441 if test "$have_lqr" = 'yes'; then
   2442   AC_DEFINE(LQR_DELEGATE,1,Define if you have LQR library)
   2443   CFLAGS="$LQR_CFLAGS $CFLAGS"
   2444 fi
   2445 
   2446 AM_CONDITIONAL(LQR_DELEGATE, test "$have_lqr" = 'yes')
   2447 AC_SUBST(LQR_CFLAGS)
   2448 AC_SUBST(LQR_LIBS)
   2449 
   2450 dnl ===========================================================================
   2451 
   2452 # Disable LZMA (lzma library)
   2453 AC_ARG_WITH(lzma,
   2454             [  --without-lzma          disable LZMA support],
   2455             [with_lzma=$withval],
   2456             [with_lzma='yes'])
   2457 if test "$with_lzma" != 'yes' ; then
   2458     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lzma=$with_lzma "
   2459 fi
   2460 
   2461 LZMA_PKG=""
   2462 if test "x$with_lzma" = "xyes"; then
   2463   AC_MSG_RESULT([-------------------------------------------------------------])
   2464   PKG_CHECK_MODULES(LZMA,[liblzma >= 2.9.0], have_lzma=yes, have_lzma=no)
   2465   AC_MSG_RESULT([])
   2466 fi
   2467 
   2468 if test "$have_lzma" = 'yes'; then
   2469   AC_DEFINE(LZMA_DELEGATE,1,Define if you have LZMA library)
   2470   CFLAGS="$LZMA_CFLAGS $CFLAGS"
   2471 fi
   2472 
   2473 AM_CONDITIONAL(LZMA_DELEGATE, test "$have_lzma" = 'yes')
   2474 AC_SUBST(LZMA_CFLAGS)
   2475 AC_SUBST(LZMA_LIBS)
   2476 
   2477 dnl ===========================================================================
   2478 
   2479 #
   2480 # Check for the OpenEXR delegate library.
   2481 #
   2482 AC_ARG_WITH([openexr],
   2483     [AC_HELP_STRING([--without-openexr],
   2484                     [disable OpenEXR support])],
   2485     [with_openexr=$withval],
   2486     [with_openexr='yes'])
   2487 
   2488 if test "$with_openexr" != 'yes'; then
   2489     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-openexr=$with_openexr "
   2490 fi
   2491 
   2492 have_openexr='no'
   2493 OPENEXR_CFLAGS=""
   2494 OPENEXR_LIBS=""
   2495 OPENEXR_PKG=""
   2496 if test "x$with_openexr" = "xyes"; then
   2497   AC_MSG_RESULT([-------------------------------------------------------------])
   2498   PKG_CHECK_MODULES(OPENEXR,[OpenEXR >= 1.0.6], have_openexr=yes, have_openexr=no)
   2499   AC_MSG_RESULT([])
   2500 fi
   2501 
   2502 if test "$have_openexr" = 'yes'; then
   2503   AC_DEFINE(OPENEXR_DELEGATE,1,Define if you have OPENEXR library)
   2504   CFLAGS="$OPENEXR_CFLAGS $CFLAGS"
   2505 fi
   2506 
   2507 AM_CONDITIONAL(OPENEXR_DELEGATE, test "$have_openexr" = 'yes')
   2508 AC_SUBST(OPENEXR_CFLAGS)
   2509 AC_SUBST(OPENEXR_LIBS)
   2510 
   2511 dnl ===========================================================================
   2512 
   2513 #
   2514 # Check for PANGO delegate library.
   2515 #
   2516 AC_ARG_WITH([pango],
   2517     [AC_HELP_STRING([--without-pango],
   2518                     [disable PANGO support])],
   2519     [with_pango=$withval],
   2520     [with_pango='yes'])
   2521 
   2522 if test "$with_pango" != 'yes'; then
   2523     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-pango=$with_pango "
   2524 fi
   2525 
   2526 have_pango='no'
   2527 have_pangocairo='no'
   2528 PANGO_CFLAGS=""
   2529 PANGO_LIBS=""
   2530 PANGO_PKG=""
   2531 if test "x$with_pango" = "xyes"; then
   2532   AC_MSG_RESULT([-------------------------------------------------------------])
   2533   PKG_CHECK_MODULES(PANGO, [pangocairo >= 1.28.1], have_pangocairo=yes, have_pangocairo=no)
   2534   AC_MSG_RESULT([])
   2535   PKG_CHECK_MODULES(PANGO, [pango >= 1.28.1], have_pango=yes, have_pango=no)
   2536   AC_MSG_RESULT([])
   2537 fi
   2538 
   2539 if test "$have_pango" = 'yes'; then
   2540   AC_DEFINE(PANGO_DELEGATE,1,Define if you have PANGO library)
   2541   CFLAGS="$PANGO_CFLAGS $CFLAGS"
   2542 fi
   2543 
   2544 if test "$have_pangocairo" = 'yes'; then
   2545   AC_DEFINE(PANGOCAIRO_DELEGATE,1,Define if you have PANGOCAIRO library)
   2546   CFLAGS="$PANGOCAIRO_CFLAGS $CFLAGS"
   2547 fi
   2548 
   2549 AM_CONDITIONAL(PANGO_DELEGATE, test "$have_pango" = 'yes')
   2550 AM_CONDITIONAL(PANGOCAIRO_DELEGATE, test "$have_pangocairo" = 'yes')
   2551 AC_SUBST(PANGO_CFLAGS)
   2552 AC_SUBST(PANGO_LIBS)
   2553 
   2554 dnl ===========================================================================
   2555 
   2556 #
   2557 # Check for PNG delegate library.
   2558 #
   2559 AC_ARG_WITH(png,
   2560     [AC_HELP_STRING([--without-png],
   2561                     [disable PNG support])],
   2562     [with_png=$withval],
   2563     [with_png='yes'])
   2564 
   2565 if test "$with_png" != 'yes'; then
   2566     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-png=$with_png "
   2567 fi
   2568 
   2569 have_png='no'
   2570 PNG_CFLAGS=""
   2571 PNG_LIBS=""
   2572 PNG_PKG=""
   2573 if test "x$with_png" = "xyes"; then
   2574   AC_MSG_RESULT([-------------------------------------------------------------])
   2575   PKG_CHECK_MODULES(PNG,[libpng >= 1.0.0], have_png=yes, have_png=no)
   2576   AC_MSG_RESULT([])
   2577 fi
   2578 
   2579 if test "$have_png" = 'yes'; then
   2580   AC_DEFINE(PNG_DELEGATE,1,Define if you have PNG library)
   2581   CFLAGS="$PNG_CFLAGS $CFLAGS"
   2582 fi
   2583 
   2584 AM_CONDITIONAL(PNG_DELEGATE, test "$have_png" = 'yes')
   2585 AC_SUBST(PNG_CFLAGS)
   2586 AC_SUBST(PNG_LIBS)
   2587 
   2588 dnl ===========================================================================
   2589 
   2590 #
   2591 # Check for RSVG delegate library.
   2592 #
   2593 AC_ARG_WITH([rsvg],
   2594     [AC_HELP_STRING([--with-rsvg],
   2595                     [enable RSVG support])],
   2596     [with_rsvg=$withval],
   2597     [with_rsvg='no'])
   2598 
   2599 if test "$with_rsvg" != 'yes'; then
   2600     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-rsvg=$with_rsvg "
   2601 fi
   2602 
   2603 have_rsvg='no'
   2604 have_cairo='no'
   2605 RSVG_CFLAGS=""
   2606 RSVG_LIBS=""
   2607 RSVG_PKG=""
   2608 if test "x$with_rsvg" = "xyes"; then
   2609   AC_MSG_RESULT([-------------------------------------------------------------])
   2610   PKG_CHECK_MODULES(RSVG,[librsvg-2.0 >= 2.9.0], have_rsvg=yes, have_rsvg=no)
   2611   AC_MSG_RESULT([])
   2612   PKG_CHECK_MODULES(CAIRO_SVG, cairo-svg, have_cairo=yes, have_cairo=no)
   2613   AC_MSG_RESULT([])
   2614 fi
   2615 
   2616 if test "$have_rsvg" = 'yes'; then
   2617   AC_DEFINE(RSVG_DELEGATE,1,Define if you have RSVG library)
   2618   CFLAGS="$RSVG_CFLAGS $CFLAGS"
   2619 fi
   2620 
   2621 if test "$have_cairo" = 'yes'; then
   2622   AC_DEFINE(CAIRO_DELEGATE,1,Define if you have CAIRO library)
   2623   CFLAGS="$CAIRO_SVG_CFLAGS $CFLAGS"
   2624 fi
   2625 
   2626 AM_CONDITIONAL(RSVG_DELEGATE, test "$have_rsvg" = 'yes')
   2627 AM_CONDITIONAL(CAIRO_DELEGATE, test "$have_cairo" = 'yes')
   2628 AC_SUBST(RSVG_CFLAGS)
   2629 AC_SUBST(RSVG_LIBS)
   2630 
   2631 dnl ===========================================================================
   2632 
   2633 #
   2634 # Check for TIFF delegate library.
   2635 #
   2636 AC_ARG_WITH([tiff],
   2637     [AC_HELP_STRING([--without-tiff],
   2638                     [disable TIFF support])],
   2639     [with_tiff=$withval],
   2640     [with_tiff='yes'])
   2641 
   2642 if test "$with_tiff" != 'yes'; then
   2643     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-tiff=$with_tiff "
   2644 fi
   2645 
   2646 have_tiff='no'
   2647 TIFF_LIBS=''
   2648 if test "$with_tiff" != 'no'; then
   2649     AC_MSG_RESULT([-------------------------------------------------------------])
   2650     AC_MSG_CHECKING([for TIFF])
   2651     AC_MSG_RESULT([])
   2652     failed=0
   2653     passed=0
   2654     AC_CHECK_HEADER(tiff.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
   2655     AC_CHECK_HEADER(tiffio.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
   2656     AC_CHECK_LIB(tiff,TIFFOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
   2657     AC_CHECK_LIB(tiff,TIFFClientOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
   2658     AC_CHECK_LIB(tiff,TIFFIsByteSwapped,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
   2659     AC_CHECK_LIB(tiff,TIFFReadRGBATile,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
   2660     AC_CHECK_LIB(tiff,TIFFReadRGBAStrip,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
   2661     AC_MSG_CHECKING([if TIFF package is complete])
   2662     if test $passed -gt 0; then
   2663         if test $failed -gt 0; then
   2664             AC_MSG_RESULT([no -- some components failed test])
   2665             have_tiff='no (failed tests)'
   2666         else
   2667             TIFF_LIBS='-ltiff'
   2668             LIBS="$TIFF_LIBS $LIBS"
   2669             AC_DEFINE(TIFF_DELEGATE,1,Define if you have TIFF library)
   2670             AC_MSG_RESULT([yes])
   2671             have_tiff='yes'
   2672             AC_CHECK_HEADERS(tiffconf.h)
   2673             AC_CHECK_FUNCS([TIFFIsCODECConfigured TIFFMergeFieldInfo \
   2674               TIFFIsBigEndian TIFFReadEXIFDirectory TIFFSetErrorHandlerExt \
   2675               TIFFSetTagExtender TIFFSetWarningHandlerExt \
   2676               TIFFSwabArrayOfTriples])
   2677         fi
   2678     else
   2679         AC_MSG_RESULT([no])
   2680     fi
   2681 fi
   2682 AM_CONDITIONAL(TIFF_DELEGATE, test "$have_tiff" = 'yes')
   2683 AC_SUBST(TIFF_LIBS)
   2684 
   2685 dnl ===========================================================================
   2686 
   2687 #
   2688 # Check for WEBP delegate library.
   2689 #
   2690 AC_ARG_WITH(webp,
   2691     [AC_HELP_STRING([--without-webp],
   2692                     [disable WEBP support])],
   2693     [with_webp=$withval],
   2694     [with_webp='yes'])
   2695 
   2696 if test "$with_webp" != 'yes'; then
   2697     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-webp=$with_webp "
   2698 fi
   2699 
   2700 have_webp='no'
   2701 WEBP_LIBS=''
   2702 if test "$with_webp" != 'no'; then
   2703     AC_MSG_RESULT([-------------------------------------------------------------])
   2704     AC_MSG_CHECKING([for WEBP])
   2705     AC_MSG_RESULT([])
   2706     failed=0
   2707     passed=0
   2708     AC_CHECK_HEADER(webp/decode.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
   2709     AC_CHECK_LIB(webp,WebPPictureInitInternal,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
   2710     AC_MSG_CHECKING([if WEBP package is complete])
   2711     if test $passed -gt 0; then
   2712         if test $failed -gt 0; then
   2713             AC_MSG_RESULT([no -- some components failed test])
   2714             have_webp='no (failed tests)'
   2715         else
   2716             WEBP_LIBS='-lwebp'
   2717             LIBS="$WEBP_LIBS $LIBS"
   2718             AC_DEFINE(WEBP_DELEGATE,1,Define if you have WEBP library)
   2719             AC_MSG_RESULT([yes])
   2720             have_webp='yes'
   2721         fi
   2722     else
   2723         AC_MSG_RESULT([no])
   2724     fi
   2725 fi
   2726 AM_CONDITIONAL(WEBP_DELEGATE,test "$have_webp" = 'yes')
   2727 AC_SUBST(WEBP_LIBS)
   2728 
   2729 dnl ===========================================================================
   2730 
   2731 #
   2732 # Set Windows font directory.
   2733 #
   2734 AC_ARG_WITH([windows-font-dir],
   2735     [AC_HELP_STRING([--with-windows-font-dir=DIR],
   2736                     [Windows font directory])],
   2737     [with_windows_font_dir=$withval],
   2738     [with_windows_font_dir='default'])
   2739 
   2740 if test "$with_windows_font_dir" != 'default'; then
   2741     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-windows-font-dir=$with_windows_font_dir "
   2742 fi
   2743 
   2744 dnl ===========================================================================
   2745 
   2746 #
   2747 # Check for WMF delegate library.
   2748 #
   2749 AC_ARG_WITH([wmf],
   2750     [AC_HELP_STRING([--with-wmf],
   2751                     [enable WMF support])],
   2752     [with_wmf=$withval],
   2753     [with_wmf='yes'])
   2754 
   2755 if test "$with_wmf" != 'yes'; then
   2756     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-wmf=$with_wmf "
   2757 fi
   2758 
   2759 have_wmf='no'
   2760 WMF_LIBS=''
   2761 WMF_CFLAGS=''
   2762 OLIBS="$LIBS"
   2763 if test "$with_wmf" != 'no'; then
   2764   AC_MSG_CHECKING([for WMF support ])
   2765   AC_MSG_RESULT([])
   2766 
   2767   have_libwmflite='no'
   2768   have_libwmf_ipa_h='no'
   2769 
   2770   AC_CHECK_HEADER([libwmf/ipa.h],[have_libwmf_ipa_h='yes'],[],[$FT2BUILD_H])
   2771   if test "$have_libwmf_ipa_h" = 'yes'; then
   2772     AC_CHECK_LIB([wmflite],[wmf_lite_create],[have_libwmflite='yes'],[],[])
   2773     if test "$have_libwmflite" = 'yes'; then
   2774       AC_DEFINE(WMF_DELEGATE,1,Define if you have WMF library)
   2775       WMF_LIBS='-lwmflite'
   2776       LIBS="$WMF_LIBS $LIBS"
   2777       have_wmf='yes'
   2778     else
   2779       AC_MSG_RESULT([no -- some components failed test])
   2780       have_wmf='no (failed tests)'
   2781       have_wmflite='no (failed tests)'
   2782       LIBS="$OLIBS"
   2783       WMF_LIBS=''
   2784     fi
   2785   fi
   2786 fi
   2787 AC_MSG_CHECKING([if WMF package is complete ])
   2788 if test "$have_wmf" = 'yes'; then
   2789   AC_MSG_RESULT([yes])
   2790 else
   2791   AC_MSG_RESULT([no])
   2792 fi
   2793 AM_CONDITIONAL([WMF_DELEGATE], [test "$have_wmf" = 'yes'])
   2794 AC_SUBST([WMF_CFLAGS])
   2795 AC_SUBST([WMF_LIBS])
   2796 
   2797 dnl ===========================================================================
   2798 
   2799 #
   2800 # Check for XML delegate library.
   2801 #
   2802 AC_ARG_WITH([xml],
   2803     [AC_HELP_STRING([--without-xml],
   2804                     [disable XML support])],
   2805     [with_xml=$withval],
   2806     [with_xml='yes'])
   2807 
   2808 if test "$with_xml" != 'yes' ; then
   2809     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-xml=$with_xml "
   2810 fi
   2811 
   2812 have_xml='no'
   2813 XML_CFLAGS=""
   2814 XML_LIBS=""
   2815 XML_PKG=""
   2816 if test "x$with_xml" = "xyes"; then
   2817   AC_MSG_RESULT([-------------------------------------------------------------])
   2818   PKG_CHECK_MODULES(XML,[libxml-2.0 >= 2.0.0], have_xml=yes, have_xml=no)
   2819   AC_MSG_RESULT([])
   2820 fi
   2821 
   2822 if test "$have_xml" = 'yes'; then
   2823   AC_DEFINE(XML_DELEGATE,1,Define if you have XML library)
   2824   CFLAGS="$XML_CFLAGS $CFLAGS"
   2825 fi
   2826 
   2827 AM_CONDITIONAL(XML_DELEGATE, test "$have_xml" = 'yes')
   2828 AC_SUBST(XML_CFLAGS)
   2829 AC_SUBST(XML_LIBS)
   2830 
   2831 dnl ===========================================================================
   2832 
   2833 # Substitute compiler name to build/link PerlMagick
   2834 #
   2835 AC_SUBST([PERLMAINCC])
   2836 
   2837 #
   2838 # Configure install Paths
   2839 #
   2840 
   2841 # Path to ImageMagick header files
   2842 INCLUDE_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
   2843 INCLUDE_PATH="${INCLUDE_DIR}/${INCLUDE_RELATIVE_PATH}"
   2844 DEFINE_INCLUDE_PATH="${INCLUDE_DIR}/${INCLUDE_RELATIVE_PATH}/"
   2845 case "${build_os}" in
   2846   mingw* )
   2847     DEFINE_INCLUDE_PATH=`$WinPathScript "$DEFINE_INCLUDE_PATH" 1`
   2848     ;;
   2849 esac
   2850 AC_DEFINE_UNQUOTED(INCLUDE_PATH,"$DEFINE_INCLUDE_PATH",[Directory where ImageMagick headers live.])
   2851 AC_SUBST(INCLUDE_PATH)
   2852 
   2853 # Path to ImageMagick header files (arch part)
   2854 INCLUDEARCH_PATH="${INCLUDEARCH_DIR}/${INCLUDE_RELATIVE_PATH}"
   2855 DEFINE_INCLUDEARCH_PATH="${INCLUDEARCH_DIR}/${INCLUDE_RELATIVE_PATH}/"
   2856 case "${build_os}" in
   2857   mingw* )
   2858     DEFINE_INCLUDEARCH_PATH=`$WinPathScript "$DEFINE_INCLUDEARCH_PATH" 1`
   2859     ;;
   2860 esac
   2861 AC_DEFINE_UNQUOTED(INCLUDEARCH_PATH,"$DEFINE_INCLUDE_PATH",[Directory where ImageMagick architecture headers live.])
   2862 AC_SUBST(INCLUDEARCH_PATH)
   2863 
   2864 # Subdirectory under lib to place ImageMagick lib files
   2865 LIBRARY_RELATIVE_PATH="${PACKAGE_NAME}-${PACKAGE_VERSION}"
   2866 AC_DEFINE_UNQUOTED(LIBRARY_RELATIVE_PATH,"$LIBRARY_RELATIVE_PATH",[Subdirectory of lib where ImageMagick architecture dependent files are installed.])
   2867 
   2868 # Path to ImageMagick bin directory
   2869 EXECUTABLE_PATH="${BIN_DIR}"
   2870 DEFINE_EXECUTABLE_PATH="${BIN_DIR}/"
   2871 case "${build_os}" in
   2872   mingw* )
   2873     DEFINE_EXECUTABLE_PATH=`$WinPathScript "$DEFINE_EXECUTABLE_PATH" 1`
   2874     ;;
   2875 esac
   2876 AC_DEFINE_UNQUOTED(EXECUTABLE_PATH,"$DEFINE_EXECUTABLE_PATH",[Directory where executables are installed.])
   2877 AC_SUBST(EXECUTABLE_PATH)
   2878 
   2879 # Path to ImageMagick lib
   2880 LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}"
   2881 DEFINE_LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}/"
   2882 case "${build_os}" in
   2883   mingw* )
   2884     DEFINE_LIBRARY_PATH=`$WinPathScript "$DEFINE_LIBRARY_PATH" 1`
   2885     ;;
   2886 esac
   2887 AC_DEFINE_UNQUOTED(LIBRARY_PATH,"$DEFINE_LIBRARY_PATH",[Directory where architecture-dependent files live.])
   2888 AC_SUBST(LIBRARY_PATH)
   2889 
   2890 #
   2891 # path to local binaries
   2892 if test "x$LIB_BIN_BASEDIRNAME" = "x"; then
   2893    LIB_BIN_BASEDIRNAME="bin"
   2894 fi
   2895 AC_DEFINE_UNQUOTED(LIB_BIN_BASEDIRNAME,"$LIB_BIN_BASEDIRNAME",[Binaries in libraries path base name (will be during install linked to bin)])
   2896 AC_SUBST(LIB_BIN_BASEDIRNAME)
   2897 
   2898 if test "x$LIB_BIN_DIR" = "x"; then
   2899    LIB_BIN_DIR=${LIB_BIN_BASEDIRNAME}-${MAGICK_ABI_SUFFIX}
   2900 fi
   2901 AC_SUBST(LIB_BIN_DIR)
   2902 
   2903 LIB_BIN_DIR_RELATIVE_PATH=$LIB_BIN_DIR
   2904 AC_SUBST(LIB_BIN_DIR_RELATIVE_PATH)
   2905 LIB_BIN_DIR_PATH="${LIBRARY_PATH}/${LIB_BIN_DIR_RELATIVE_PATH}"
   2906 AC_SUBST(LIB_BIN_DIR_PATH)
   2907 
   2908 #
   2909 # path to modules lib
   2910 if test "x$MODULES_BASEDIRNAME" = "x"; then
   2911    MODULES_BASEDIRNAME="modules"
   2912 fi
   2913 AC_DEFINE_UNQUOTED(MODULES_BASEDIRNAME,"$MODULES_BASEDIRNAME",[Module directory name without ABI part.])
   2914 AC_SUBST(MODULES_BASEDIRNAME)
   2915 
   2916 if test "x$MODULES_DIRNAME" = "x"; then
   2917   MODULES_DIRNAME=${MODULES_BASEDIRNAME}-${MAGICK_ABI_SUFFIX}
   2918 else
   2919   AC_DEFINE_UNQUOTED(MODULES_DIRNAME,"$MODULES_DIRNAME",[Module directory dirname])
   2920 fi
   2921 AC_SUBST(MODULES_DIRNAME)
   2922 
   2923 MODULES_RELATIVE_PATH="${MODULES_DIRNAME}"
   2924 AC_SUBST(MODULES_RELATIVE_PATH)
   2925 MODULES_PATH="${LIBRARY_PATH}/${MODULES_RELATIVE_PATH}"
   2926 AC_SUBST(MODULES_PATH)
   2927 
   2928 #
   2929 # path to coders lib
   2930 if test "x$CODER_DIRNAME" = "x"; then
   2931    CODER_DIRNAME="coders"
   2932 fi
   2933 AC_DEFINE_UNQUOTED(CODER_DIRNAME,"$CODER_DIRNAME",[coders subdirectory.])
   2934 AC_SUBST(CODER_DIRNAME)
   2935 
   2936 CODER_RELATIVE_PATH="${CODER_DIRNAME}"
   2937 CODER_PATH="${MODULES_PATH}/${CODER_DIRNAME}"
   2938 AC_SUBST(CODER_PATH)
   2939 
   2940 #
   2941 # Subdirectory under lib to place ImageMagick filter module files
   2942 #
   2943 # path to coders lib
   2944 if test "x$FILTER_DIRNAME" = "x"; then
   2945    FILTER_DIRNAME="filters"
   2946 fi
   2947 AC_DEFINE_UNQUOTED(FILTER_DIRNAME,"$FILTER_DIRNAME",[filter subdirectory.])
   2948 AC_SUBST(FILTER_DIRNAME)
   2949 
   2950 FILTER_RELATIVE_PATH="${FILTER_DIRNAME}"
   2951 FILTER_PATH="${MODULES_PATH}/${FILTER_DIRNAME}"
   2952 AC_SUBST(FILTER_PATH)
   2953 
   2954 #
   2955 # Path to ImageMagick documentation files
   2956 DOCUMENTATION_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
   2957 DOCUMENTATION_PATH="${DOC_DIR}/${DOCUMENTATION_RELATIVE_PATH}"
   2958 DEFINE_DOCUMENTATION_PATH="${DOC_DIR}/${DOCUMENTATION_RELATIVE_PATH}/"
   2959 case "${build_os}" in
   2960   mingw* )
   2961     DEFINE_DOCUMENTATION_PATH=`$WinPathScript "$DEFINE_DOCUMENTATION_PATH" 1`
   2962     ;;
   2963 esac
   2964 AC_DEFINE_UNQUOTED(DOCUMENTATION_PATH,"$DEFINE_DOCUMENTATION_PATH",[Directory where ImageMagick documents live.])
   2965 AC_SUBST(DOCUMENTATION_PATH)
   2966 
   2967 #
   2968 # Enable/Disable documentation
   2969 AC_ARG_ENABLE([docs],
   2970   [AS_HELP_STRING([--disable-docs],
   2971     [disable building of documentation])],
   2972   wantdocs=$enableval, wantdocs=yes)
   2973 AM_CONDITIONAL([INSTALL_DOC], [test "$wantdocs" = "yes"])
   2974 
   2975 # Subdirectory to place architecture-dependent configuration files
   2976 CONFIGURE_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
   2977 AC_DEFINE_UNQUOTED(CONFIGURE_RELATIVE_PATH,"$CONFIGURE_RELATIVE_PATH",[Subdirectory of lib where architecture-dependent configuration files live.])
   2978 CONFIGURE_PATH="${SYSCONF_DIR}/${CONFIGURE_RELATIVE_PATH}/"
   2979 DEFINE_CONFIGURE_PATH="${SYSCONF_DIR}/${CONFIGURE_RELATIVE_PATH}/"
   2980 case "${build_os}" in
   2981   mingw* )
   2982     DEFINE_CONFIGURE_PATH=`$WinPathScript "$DEFINE_CONFIGURE_PATH" 1`
   2983     ;;
   2984 esac
   2985 AC_DEFINE_UNQUOTED(CONFIGURE_PATH,"$DEFINE_CONFIGURE_PATH",[Directory where architecture-dependent configuration files live.])
   2986 AC_SUBST(CONFIGURE_PATH)
   2987 
   2988 # Subdirectory to place architecture-independent configuration files
   2989 SHARE_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
   2990 AC_DEFINE_UNQUOTED(SHARE_RELATIVE_PATH,"$SHARE_RELATIVE_PATH",[Subdirectory of lib where architecture-independent configuration files live.])
   2991 SHARE_PATH="${DATA_DIR}/${SHARE_RELATIVE_PATH}"
   2992 DEFINE_SHARE_PATH="${DATA_DIR}/${SHARE_RELATIVE_PATH}/"
   2993 case "${build_os}" in
   2994   mingw* )
   2995     DEFINE_SHARE_PATH=`$WinPathScript "$DEFINE_SHARE_PATH" 1`
   2996     ;;
   2997 esac
   2998 AC_DEFINE_UNQUOTED(SHARE_PATH,"$DEFINE_SHARE_PATH",[Directory where architecture-independent configuration files live.])
   2999 AC_SUBST(SHARE_PATH)
   3000 
   3001 #
   3002 # Subdirectory to place architecture-dependent configuration files.
   3003 if test "x$SHAREARCH_BASEDIRNAME" = "x"; then
   3004    SHAREARCH_BASEDIRNAME="config"
   3005 fi
   3006 AC_DEFINE_UNQUOTED(SHAREARCH_BASEDIRNAME,"$SHAREARCH_BASEDIRNAME",[Sharearch directory name without ABI part.])
   3007 AC_SUBST(SHAREARCH_BASEDIRNAME)
   3008 
   3009 if test "x$SHAREARCH_DIRNAME" = "x"; then
   3010   SHAREARCH_DIRNAME=${SHAREARCH_BASEDIRNAME}-${MAGICK_ABI_SUFFIX}
   3011 else
   3012   AC_DEFINE_UNQUOTED(SHAREARCH_DIRNAME,"$SHAREARCH_DIRNAME",[Sharearch directory dirname])
   3013 fi
   3014 AC_SUBST(SHAREARCH_DIRNAME)
   3015 
   3016 SHAREARCH_RELATIVE_PATH="${SHAREARCH_DIRNAME}"
   3017 AC_SUBST(SHAREARCH_RELATIVE_PATH)
   3018 SHAREARCH_PATH="${LIBRARY_PATH}/${SHAREARCH_RELATIVE_PATH}"
   3019 AC_SUBST(SHAREARCH_PATH)
   3020 
   3021 #
   3022 # program_transform_name is formed for use in a Makefile, so create a
   3023 # modified version for use in a shell script.
   3024 configure_transform_name=`echo ${program_transform_name} | sed 's,\\$\\$,$,'`
   3025 
   3026 # Default delegate definitions
   3027 AC_MSG_RESULT([-------------------------------------------------------------])
   3028 AC_MSG_CHECKING([for ImageMagick delegate programs])
   3029 AC_MSG_RESULT([])
   3030 BPGDecodeDelegateDefault='bpgdec'
   3031 BPGEncodeDelegateDefault='bpgenc'
   3032 BlenderDecodeDelegateDefault='blender'
   3033 BrowseDelegateDefault='xdg-open'
   3034 DNGDecodeDelegateDefault='ufraw-batch'
   3035 DOCDecodeDelegateDefault='soffice'
   3036 GVCDecodeDelegateDefault='dot'
   3037 DVIDecodeDelegateDefault='dvips'
   3038 EditorDelegateDefault='xterm'
   3039 ConvertDelegateDefault=`echo magick | sed ${configure_transform_name}`
   3040 DisplayDelegateDefault=`echo magick | sed ${configure_transform_name}`
   3041 MogrifyDelegateDefault=`echo magick | sed ${configure_transform_name}`
   3042 HPGLDecodeDelegateDefault='hp2xx'
   3043 HTMLDecodeDelegateDefault='html2ps'
   3044 ILBMDecodeDelegateDefault='ilbmtoppm'
   3045 ILBMEncodeDelegateDefault='ppmtoilbm'
   3046 JXRDecodeDelegateDefault='JxrDecApp'
   3047 JXREncodeDelegateDefault='JxrEncApp'
   3048 LPDelegateDefault='lp'
   3049 LPRDelegateDefault='lpr'
   3050 LaunchDelegateDefault='gimp'
   3051 MPEGDecodeDelegateDefault='avconv'
   3052 MPEGEncodeDelegateDefault='avconv'
   3053 MrSIDDecodeDelegateDefault='mrsidgeodecode'
   3054 MVDelegateDefault='mv'
   3055 PCLDelegateDefault='pcl6'
   3056 if test "$native_win32_build" = 'yes'; then
   3057     PSDelegateDefault='gswin32c'
   3058 elif test "$gslib_framework" = 'yes'; then
   3059     PSDelegateDefault='gsc'
   3060 else
   3061     PSDelegateDefault='gs'
   3062 fi
   3063 RMDelegateDefault='rm'
   3064 RSVGDecodeDelegateDefault='rsvg-convert'
   3065 SVGDecodeDelegateDefault='inkscape'
   3066 UniconvertorDelegateDefault='uniconvertor'
   3067 WebPDecodeDelegateDefault='dwebp'
   3068 WebPEncodeDelegateDefault='cwebp'
   3069 WWWDecodeDelegateDefault='curl'
   3070 XPSDelegateDefault='gxps'
   3071 
   3072 # Search for delegates
   3073 AC_PATH_PROG(BPGDecodeDelegate, "$BPGDecodeDelegateDefault", "$BPGDecodeDelegateDefault")
   3074 AC_PATH_PROG(BPGEncodeDelegate, "$BPGEncodeDelegateDefault", "$BPGEncodeDelegateDefault")
   3075 AC_PATH_PROG(BlenderDecodeDelegate, "$BlenderDecodeDelegateDefault", "$BlenderDecodeDelegateDefault")
   3076 AC_PATH_PROGS(BrowseDelegate, "$BrowseDelegateDefault" google-chrome firefox konqueror mozilla lynx, "$BrowseDelegateDefault")
   3077 AC_PATH_PROG(DNGDecodeDelegate, "$DNGDecodeDelegateDefault", "$DNGDecodeDelegateDefault")
   3078 AC_PATH_PROG(DOCDecodeDelegate, "$DOCDecodeDelegateDefault", "$DOCDecodeDelegateDefault")
   3079 AC_PATH_PROG(DVIDecodeDelegate, "$DVIDecodeDelegateDefault", "$DVIDecodeDelegateDefault")
   3080 AC_PATH_PROG(ConvertDelegate, "$ConvertDelegateDefault", "$ConvertDelegateDefault")
   3081 AC_PATH_PROG(DisplayDelegate, "$DisplayDelegateDefault", "$DisplayDelegateDefault")
   3082 AC_PATH_PROG(EditorDelegate, "$EditorDelegateDefault", "$EditorDelegateDefault")
   3083 AC_PATH_PROG(GVCDecodeDelegate, "$GVCDecodeDelegateDefault", "$GVCDecodeDelegateDefault")
   3084 AC_PATH_PROG(HPGLDecodeDelegate, "$HPGLDecodeDelegateDefault", "$HPGLDecodeDelegateDefault")
   3085 AC_PATH_PROG(HTMLDecodeDelegate, "$HTMLDecodeDelegateDefault", "$HTMLDecodeDelegateDefault")
   3086 AC_PATH_PROG(ILBMDecodeDelegate, "$ILBMDecodeDelegateDefault", "$ILBMDecodeDelegateDefault")
   3087 AC_PATH_PROG(ILBMEncodeDelegate, "$ILBMEncodeDelegateDefault", "$ILBMEncodeDelegateDefault")
   3088 AC_PATH_PROG(JXRDecodeDelegate, "$JXRDecodeDelegateDefault", "$JXRDecodeDelegateDefault")
   3089 AC_PATH_PROG(JXREncodeDelegate, "$JXREncodeDelegateDefault", "$JXREncodeDelegateDefault")
   3090 AC_PATH_PROG(LPDelegate, "$LPDelegateDefault", no)
   3091 AC_PATH_PROG(LPRDelegate, "$LPRDelegateDefault", "$LPRDelegateDefault")
   3092 AC_PATH_PROG(LaunchDelegate, "$LaunchDelegateDefault", "$LaunchDelegateDefault")
   3093 AC_PATH_PROG(MogrifyDelegate, "$MogrifyDelegateDefault", "$MogrifyDelegateDefault")
   3094 AC_PATH_PROG(MPEGDecodeDelegate, "$MPEGDecodeDelegateDefault", "$MPEGDecodeDelegateDefault")
   3095 if test "$MPEGDecodeDelegate" = "$MPEGDecodeDelegateDefault" ; then
   3096   MPEGDecodeDelegateDefault='ffmpeg'
   3097   AC_PATH_PROG(MPEGDecodeDelegate, "$MPEGDecodeDelegateDefault", "$MPEGDecodeDelegateDefault")
   3098 fi;
   3099 AC_PATH_PROG(MPEGEncodeDelegate, "$MPEGEncodeDelegateDefault", "$MPEGEncodeDelegateDefault")
   3100 if test "$MPEGEncodeDelegate" = "$MPEGEncodeDelegateDefault" ; then
   3101   MPEGEncodeDelegateDefault='ffmpeg'
   3102   AC_PATH_PROG(MPEGEncodeDelegate, "$MPEGEncodeDelegateDefault", "$MPEGEncodeDelegateDefault")
   3103 fi;
   3104 AC_PATH_PROG(MrSIDDecodeDelegate, "$MrSIDDecodeDelegateDefault", "$MrSIDDecodeDelegateDefault")
   3105 AC_PATH_PROG(MVDelegate, "$MVDelegateDefault", "$MVDelegateDefault")
   3106 AC_PATH_PROG(PCLDelegate, "$PCLDelegateDefault", "$PCLDelegateDefault")
   3107 AC_PATH_PROGS(PSDelegate, gsx gsc "$PSDelegateDefault", "$PSDelegateDefault")
   3108 AC_PATH_PROG(RMDelegate, "$RMDelegateDefault", "$RMDelegateDefault")
   3109 AC_PATH_PROG(RSVGDecodeDelegate, "$RSVGDecodeDelegateDefault", "$RSVGDecodeDelegateDefault")
   3110 AC_PATH_PROG(SVGDecodeDelegate, "$SVGDecodeDelegateDefault", "$SVGDecodeDelegateDefault")
   3111 AC_PATH_PROG(UniconvertorDelegate, "$UniconvertorDelegateDefault", "$UniconvertorDelegateDefault")
   3112 AC_PATH_PROG(WebPDecodeDelegate, "$WebPDecodeDelegateDefault", "$WebPDecodeDelegateDefault")
   3113 AC_PATH_PROG(WebPEncodeDelegate, "$WebPEncodeDelegateDefault", "$WebPEncodeDelegateDefault")
   3114 AC_PATH_PROG(WWWDecodeDelegate, "$WWWDecodeDelegateDefault", "$WWWDecodeDelegateDelegateDefault")
   3115 AC_PATH_PROG(XPSDelegate, "$XPSDelegateDefault", "$XPSDelegateDefault")
   3116 
   3117 # Prefer lpr to lp; lp needs options tacked on.
   3118 if test "$LPRDelegate" != no; then
   3119     PrintDelegate="$LPRDelegate"
   3120 else
   3121     PrintDelegate="$LPDelegate -c -s"
   3122 fi
   3123 AC_SUBST(PrintDelegate)
   3124 
   3125 # Installed ImageMagick utiltity paths
   3126 ConvertDelegate="${BIN_DIR}/${ConvertDelegateDefault}"
   3127 DisplayDelegate="${BIN_DIR}/${DisplayDelegateDefault}"
   3128 MogrifyDelegate="${BIN_DIR}/${MogrifyDelegateDefault}"
   3129 
   3130 # Set delegate booleans
   3131 have_avconv='no'; if test "$MPEGDecodeDelegate" != "$MPEGDecodeDelegateDefault" ; then have_avconv='yes'; fi
   3132 have_gs='no'         ; if test "$PSDelegate" != "$PSDelegateDefault"; then have_gs='yes'; fi
   3133 have_hp2xx='no'      ; if test "$HPGLDecodeDelegate" !=  "$HPGLDecodeDelegateDefault" ; then have_hp2xx='yes'; fi
   3134 have_ilbmtoppm='no'  ; if test "$ILBMDecodeDelegate" != "$ILBMDecodeDelegateDefault" ; then have_ilbmtoppm='yes'; fi
   3135 have_mrsid='no'; if test "$MrSIDDecodeDelegate" != "$MrSIDDecodeDelegateDefault" ; then have_mrsid='yes'; fi
   3136 have_pcl='no'        ; if test "$PCLDelegate" != "$PCLDelegateDefault"; then have_pcl='yes'; fi
   3137 have_ppmtoilbm='no'  ; if test "$ILBMEncodeDelegate" != "$ILBMEncodeDelegateDefault" ; then have_ppmtoilbm='yes'; fi
   3138 have_xps='no'        ; if test "$XPSDelegate" != "$XPSDelegateDefault"; then have_xps='yes'; fi
   3139 
   3140 #
   3141 # Test for font directories
   3142 #
   3143 type_include_files=''
   3144 
   3145 # Apple fonts.
   3146 AC_MSG_CHECKING(for Apple fonts directory)
   3147 apple_font_dir=''
   3148 if test "${with_apple_font_dir}" != 'default'; then
   3149   apple_font_dir="${with_apple_font_dir}/"
   3150 else
   3151   for font_dir in '/Library/Fonts/'; do
   3152     if test -f "${font_dir}Arial.ttf"; then
   3153       apple_font_dir="${font_dir}"
   3154       break 1
   3155     fi
   3156   done
   3157 fi
   3158 if test "${apple_font_dir}x" != 'x'; then
   3159   type_include_files="${type_include_files} "'<include file="type-apple.xml" />'
   3160   AC_MSG_RESULT([$apple_font_dir])
   3161 else
   3162   AC_MSG_RESULT([not found!]);
   3163 fi
   3164 AC_SUBST(apple_font_dir)
   3165 
   3166 # Dejavu fonts.
   3167 AC_MSG_CHECKING(for Dejavu fonts directory)
   3168 dejavu_font_dir=''
   3169 if test "${with_dejavu_font_dir}" != 'default'; then
   3170   dejavu_font_dir="${with_dejavu_font_dir}/"
   3171 else
   3172   for font_dir in "${prefix}/share/dejavu/fonts/" '/usr/share/fonts/dejavu/'; do
   3173     if test -f "${font_dir}DejaVuSerif.ttf"; then
   3174       dejavu_font_dir="${font_dir}"
   3175       break 1
   3176     fi
   3177   done
   3178 fi
   3179 if test "${dejavu_font_dir}x" != 'x'; then
   3180   type_include_files="${type_include_files} "'<include file="type-dejavu.xml" />'
   3181   AC_MSG_RESULT([$dejavu_font_dir])
   3182 else
   3183   AC_MSG_RESULT([not found!]);
   3184 fi
   3185 AC_SUBST(dejavu_font_dir)
   3186 
   3187 # Ghostscript
   3188 AC_MSG_CHECKING(for Ghostscript fonts directory)
   3189 ghostscript_font_dir=''
   3190 if test "${with_gs_font_dir}" != 'default'; then
   3191   ghostscript_font_dir="${with_gs_font_dir}/"
   3192 else
   3193   if test "${native_win32_build}" = 'yes'; then
   3194     # Native Windows Build
   3195     for font_dir in "c:\\Program Files\\gs\\fonts\\" "c:\\Program Files \(x86\)\\gs\\fonts\\" "c:\\gs\\fonts\\"; do
   3196       if test -f "${font_dir}a010013l.pfb"; then
   3197         ghostscript_font_dir="$font_dir"
   3198         break 1
   3199       fi
   3200     done
   3201     if test "${PSDelegate}" != 'gswin32c'; then
   3202       ghostscript_font_dir=`echo "${PSDelegate}" | sed -e 's:/gs/.*:/gs:;s:^/::;s/./&:/;s:/:\\\\:g'`"\\fonts\\"
   3203     fi
   3204   else
   3205     # Linux / Mac OS X / Unix Build
   3206     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
   3207       if test -f "${font_dir}a010013l.pfb"; then
   3208         ghostscript_font_dir="${font_dir}"
   3209         break 1
   3210       fi
   3211     done
   3212     if test "${ghostscript_font_dir}x" = 'x'; then
   3213       if test "$PSDelegate" != 'gs'; then
   3214         ghostscript_font_dir=`echo "$PSDelegate" | sed -e 's:/bin/gs:/share/ghostscript/fonts:'`"/"
   3215       fi
   3216     fi
   3217   fi
   3218 fi
   3219 if test "${ghostscript_font_dir}x" != 'x'; then
   3220   type_include_files="${type_include_files} "'<include file="type-ghostscript.xml" />'
   3221   AC_MSG_RESULT([$ghostscript_font_dir])
   3222 else
   3223   AC_MSG_RESULT([not found!]);
   3224 fi
   3225 AC_SUBST(ghostscript_font_dir)
   3226 case "${build_os}" in
   3227   mingw* )
   3228     PSDelegate=`$WinPathScript "$PSDelegate" 1`
   3229     ;;
   3230 esac
   3231 
   3232 # Windows fonts.
   3233 AC_MSG_CHECKING(for Windows fonts directory)
   3234 windows_font_dir=''
   3235 if test "${with_windows_font_dir}" != 'default'; then
   3236   windows_font_dir="${with_windows_font_dir}/"
   3237 else
   3238   for font_dir in '/usr/X11R6/lib/X11/fonts/truetype/' '/usr/X11R7/lib/X11/fonts/truetype/' '/usr/share/fonts/msttcore/'; do
   3239     if test -f "${font_dir}arial.ttf"; then
   3240       windows_font_dir="${font_dir}"
   3241       break 1
   3242     fi
   3243   done
   3244 fi
   3245 if test "${windows_font_dir}x" != 'x'; then
   3246   type_include_files="${type_include_files} "'<include file="type-windows.xml" />'
   3247   AC_MSG_RESULT([$windows_font_dir])
   3248 else
   3249   AC_MSG_RESULT([not found!]);
   3250 fi
   3251 AC_SUBST(windows_font_dir)
   3252 
   3253 AC_SUBST(type_include_files)
   3254 
   3255 #
   3256 # Handle case where user doesn't want frozen paths
   3257 #
   3258 if test "$with_frozenpaths" != 'yes'; then
   3259   # Re-set delegate definitions to default (no paths)
   3260   BPGDecodeDelegate="$BPGDecodeDelegateDefault"
   3261   BPGEncodeDelegate="$BPGEncodeDelegateDefault"
   3262   BlenderDecodeDelegate="$BlenderDecodeDelegateDefault"
   3263   BrowseDelegate="$BrowseDelegateDefault"
   3264   ConvertDelegate="$ConvertDelegateDefault"
   3265   DisplayDelegate="$DisplayDelegateDefault"
   3266   DNGDecodeDelegate="$DNGDecodeDelegateDefault"
   3267   DOCDecodeDelegate="$DOCDecodeDelegateDefault"
   3268   DVIDecodeDelegate="$DVIDecodeDelegateDefault"
   3269   EditorDelegate="$EditorDelegateDefault"
   3270   GVCDecodeDelegate="$GVCDecodeDelegateDefault"
   3271   HPGLDecodeDelegate="$HPGLDecodeDelegateDefault"
   3272   HTMLDecodeDelegate="$HTMLDecodeDelegateDefault"
   3273   ILBMDecodeDelegate="$ILBMDecodeDelegateDefault"
   3274   ILBMEncodeDelegate="$ILBMEncodeDelegateDefault"
   3275   JXRDecodeDelegate="$JXRDecodeDelegateDefault"
   3276   JXREncodeDelegate="$JXREncodeDelegateDefault"
   3277   LPDelegate="$LPDelegateDefault"
   3278   LaunchDelegate="$LaunchDelegateDefault"
   3279   MPEGDecodeDelegate="$MPEGDecodeDelegateDefault"
   3280   MPEGEncodeDelegate="$MPEGEncodeDelegateDefault"
   3281   MogrifyDelegate="$MogrifyDelegateDefault"
   3282   MrSIDDecodeDelegate="$MrSIDDecodeDelegateDefault"
   3283   PCLDelegate="$PCLDelegateDefault"
   3284   PSDelegate="$PSDelegateDefault"
   3285   RSVGDecodeDelegate="$RSVGDecodeDelegateDefault"
   3286   SVGDecodeDelegate="$SVGDecodeDelegateDefault"
   3287   ShowImageDelegate="$ShowImageDelegateDefault"
   3288   UniconvertorDelegate="$UniconvertorDelegateDefault"
   3289   WebPDecodeDelegate="$WebPDecodeDelegateDefault"
   3290   WebPEncodeDelegate="$WebPEncodeDelegateDefault"
   3291   WWWDecodeDelegate="$WWWDecodeDelegateDefault"
   3292   XPSDelegate="$XPSDelegateDefault"
   3293 fi
   3294 
   3295 # Delegate substitutions
   3296 AC_SUBST(BPGDecodeDelegate)
   3297 AC_SUBST(BPGEncodeDelegate)
   3298 AC_SUBST(BlenderDecodeDelegate)
   3299 AC_SUBST(BrowseDelegate)
   3300 AC_SUBST(ConvertDelegate)
   3301 AC_SUBST(GVCDecodeDelegate)
   3302 AC_SUBST(DVIDecodeDelegate)
   3303 AC_SUBST(EditorDelegate)
   3304 AC_SUBST(HPGLDecodeDelegate)
   3305 AC_SUBST(HTMLDecodeDelegate)
   3306 AC_SUBST(ILBMDecodeDelegate)
   3307 AC_SUBST(ILBMEncodeDelegate)
   3308 AC_SUBST(JXRDecodeDelegate)
   3309 AC_SUBST(JXREncodeDelegate)
   3310 AC_SUBST(LPDelegate)
   3311 AC_SUBST(LaunchDelegate)
   3312 AC_SUBST(MPEGDecodeDelegate)
   3313 AC_SUBST(MPEGEncodeDelegate)
   3314 AC_SUBST(MogrifyDelegate)
   3315 AC_SUBST(MrSIDDecodeDelegate)
   3316 AC_SUBST(PCLDelegate)
   3317 AC_SUBST(PSDelegate)
   3318 AC_SUBST(ShowImageDelegate)
   3319 AC_SUBST(UniconvertorDelegate)
   3320 AC_SUBST(WebPDecodeDelegate)
   3321 AC_SUBST(WebPEncodeDelegate)
   3322 AC_SUBST(WWWDecodeDelegate)
   3323 AC_SUBST(XPSDelegate)
   3324 
   3325 #
   3326 # RPM support.
   3327 #
   3328 RPM=''
   3329 AC_CHECK_PROGS(TAR,gnutar gtar tar)
   3330 AC_CHECK_PROGS(PERL,perl)
   3331 AC_CHECK_PROGS(RPM,rpmbuild rpm)
   3332 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
   3333 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
   3334 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
   3335 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
   3336 AC_SUBST(RPM)
   3337 AM_CONDITIONAL(RPM_DELEGATE, test "x$RPM" != "x" )
   3338 
   3339 #
   3340 # 7ZIP support (http://p7zip.sourceforge.net/)
   3341 #
   3342 P7ZIP=''
   3343 AC_CHECK_PROGS(P7ZIP,[7za])
   3344 AC_SUBST(P7ZIP)
   3345 AM_CONDITIONAL(P7ZIP_DELEGATE, test "x$P7ZIP" != "x" )
   3346 
   3347 #
   3348 # ZIP support (http://www.info-zip.org/Zip.html)
   3349 #
   3350 ZIP=''
   3351 AC_CHECK_PROGS(ZIP,[zip])
   3352 AC_SUBST(ZIP)
   3353 AM_CONDITIONAL(ZIP_DELEGATE, test "x$ZIP" != "x" )
   3354 
   3355 #
   3356 # GhostPCL related configuration.
   3357 #
   3358 PCLColorDevice=ppmraw
   3359 PCLCMYKDevice=pamcmyk32
   3360 PCLMonoDevice=pbmraw
   3361 if test -z "$PCLVersion"; then
   3362     PCLVersion='unknown'
   3363 fi
   3364 if test $have_pcl = 'yes'; then
   3365     AC_MSG_RESULT([-------------------------------------------------------------])
   3366     AC_MSG_CHECKING([for PCL])
   3367     AC_MSG_RESULT([])
   3368     # PCLColorDevice
   3369     AC_MSG_CHECKING([for pcl color device])
   3370     if $PCLDelegate -dBATCH -sDEVICE=$PCLColorDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
   3371         :
   3372     else
   3373         PCLColorDevice=ppmraw
   3374     fi
   3375     AC_MSG_RESULT([$PCLColorDevice])
   3376 
   3377     # PCLCMYKDevice
   3378     AC_MSG_CHECKING([for pcl CMYK device])
   3379     if $PCLDelegate -dBATCH -sDEVICE=$PCLColorDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
   3380         :
   3381     else
   3382         PCLCMYKDevice=$PCLColorDevice
   3383     fi
   3384     AC_MSG_RESULT([$PCLCMYKDevice])
   3385 
   3386     # PCLMonoDevice
   3387     AC_MSG_CHECKING([for pcl mono device])
   3388     if $PCLDelegate -dBATCH -sDEVICE=$PCLMonoDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
   3389         :
   3390     else
   3391         PCLMonoDevice=$PCLColorDevice
   3392     fi
   3393     AC_MSG_RESULT([$PCLMonoDevice])
   3394 fi
   3395 
   3396 AC_SUBST(PCLMonoDevice)
   3397 AC_SUBST(PCLColorDevice)
   3398 AC_SUBST(PCLCMYKDevice)
   3399 AC_SUBST(PCLVersion)
   3400 
   3401 #
   3402 # GhostXPS related configuration.
   3403 #
   3404 XPSColorDevice=ppmraw
   3405 XPSCMYKDevice=bmpsep8
   3406 XPSMonoDevice=pbmraw
   3407 if test -z "$XPSVersion"; then
   3408     XPSVersion='unknown'
   3409 fi
   3410 if test $have_xps = 'yes'; then
   3411     AC_MSG_RESULT([-------------------------------------------------------------])
   3412     AC_MSG_CHECKING([for XPS])
   3413     AC_MSG_RESULT([])
   3414     # XPSColorDevice
   3415     AC_MSG_CHECKING([for xps color device])
   3416     if $XPSDelegate -dBATCH -sDEVICE=$XPSColorDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
   3417         :
   3418     else
   3419         XPSColorDevice=ppmraw
   3420     fi
   3421     AC_MSG_RESULT([$XPSColorDevice])
   3422 
   3423     # XPSCMYKDevice
   3424     AC_MSG_CHECKING([for xps CMYK device])
   3425     if $XPSDelegate -dBATCH -sDEVICE=$XPSColorDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
   3426         :
   3427     else
   3428         XPSCMYKDevice=$XPSColorDevice
   3429     fi
   3430     AC_MSG_RESULT([$XPSCMYKDevice])
   3431 
   3432     # XPSMonoDevice
   3433     AC_MSG_CHECKING([for xps mono device])
   3434     if $XPSDelegate -dBATCH -sDEVICE=$XPSMonoDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
   3435         :
   3436     else
   3437         XPSMonoDevice=$XPSColorDevice
   3438     fi
   3439     AC_MSG_RESULT([$XPSMonoDevice])
   3440 fi
   3441 
   3442 AC_SUBST(XPSMonoDevice)
   3443 AC_SUBST(XPSColorDevice)
   3444 AC_SUBST(XPSCMYKDevice)
   3445 AC_SUBST(XPSVersion)
   3446 
   3447 #
   3448 # Ghostscript related configuration.
   3449 #
   3450 GSAlphaDevice=pngalpha
   3451 GSColorDevice=pnmraw
   3452 GSCMYKDevice=pamcmyk32
   3453 GSMonoDevice=pbmraw
   3454 GSPDFDevice=pdfwrite
   3455 GSPSDevice=ps2write
   3456 GSEPSDevice=eps2write
   3457 GSVersion='unknown'
   3458 if test $have_gs = 'yes'; then
   3459     AC_MSG_RESULT([-------------------------------------------------------------])
   3460     AC_MSG_CHECKING([for Ghostscript])
   3461     AC_MSG_RESULT([])
   3462     AC_MSG_CHECKING([for Ghostscript version])
   3463     if GSVersion=`$PSDelegate --version`; then
   3464         :
   3465     else
   3466         GSVersion=`$PSDelegate --help | sed -e '1q' | awk '{ print $3 }'`
   3467     fi
   3468     AC_MSG_RESULT([$GSVersion])
   3469 
   3470     # GSColorDevice
   3471     AC_MSG_CHECKING([for gs color device])
   3472     if $PSDelegate -q -dBATCH -sDEVICE=$GSColorDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
   3473         :
   3474     else
   3475         GSColorDevice=ppmraw
   3476     fi
   3477     AC_MSG_RESULT([$GSColorDevice])
   3478 
   3479     # GSAlphaDevice
   3480     AC_MSG_CHECKING([for gs alpha device])
   3481     if $PSDelegate -q -dBATCH -sDEVICE=$GSAlphaDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
   3482         :
   3483     else
   3484         GSAlphaDevice=$GSColorDevice
   3485     fi
   3486     AC_MSG_RESULT([$GSAlphaDevice])
   3487 
   3488     # GSCMYKDevice
   3489     AC_MSG_CHECKING([for gs CMYK device])
   3490     if $PSDelegate -q -dBATCH -sDEVICE=$GSCMYKDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
   3491         :
   3492     else
   3493         GSCMYKDevice=pam
   3494     fi
   3495     AC_MSG_RESULT([$GSCMYKDevice])
   3496 
   3497     # GSMonoDevice
   3498     AC_MSG_CHECKING([for gs mono device])
   3499     if $PSDelegate -q -dBATCH -sDEVICE=$GSMonoDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
   3500         :
   3501     else
   3502         GSMonoDevice=$GSColorDevice
   3503     fi
   3504     AC_MSG_RESULT([$GSMonoDevice])
   3505 
   3506     # GSPDFDevice
   3507     AC_MSG_CHECKING([for gs PDF writing device])
   3508     if $PSDelegate -q -dBATCH -sDEVICE=$GSPDFDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
   3509         :
   3510     else
   3511         GSPDFDevice=nodevice
   3512     fi
   3513     AC_MSG_RESULT([$GSPDFDevice])
   3514 
   3515     # GSPSDevice
   3516     AC_MSG_CHECKING([for gs PS writing device])
   3517     if $PSDelegate -q -dBATCH -sDEVICE=$GSPSDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
   3518         :
   3519     else
   3520         GSPSDevice=pswrite
   3521     fi
   3522     AC_MSG_RESULT([$GSPSDevice])
   3523 
   3524     # GSEPSDevice
   3525     AC_MSG_CHECKING([for gs EPS writing device])
   3526     if $PSDelegate -q -dBATCH -sDEVICE=$GSEPSDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
   3527         :
   3528     else
   3529         GSEPSDevice=epswrite
   3530     fi
   3531     AC_MSG_RESULT([$GSEPSDevice])
   3532 fi
   3533 
   3534 AC_SUBST(GSAlphaDevice)
   3535 AC_SUBST(GSCMYKDevice)
   3536 AC_SUBST(GSColorDevice)
   3537 AC_SUBST(GSEPSDevice)
   3538 AC_SUBST(GSMonoDevice)
   3539 AC_SUBST(GSPDFDevice)
   3540 AC_SUBST(GSPSDevice)
   3541 AC_SUBST(GSVersion)
   3542 
   3543 #
   3544 # PerlMagick-related configuration
   3545 #
   3546 
   3547 # Look for PERL if PerlMagick requested
   3548 # If name/path of desired PERL interpreter is specified, look for that one first
   3549 have_perl='no'
   3550 if test "$with_perl" != 'no'; then
   3551     AC_MSG_RESULT([-------------------------------------------------------------])
   3552     AC_MSG_CHECKING([for Perl])
   3553     AC_MSG_RESULT([])
   3554     if test "$with_perl" != 'yes'; then
   3555         AC_CACHE_CHECK(for perl,ac_cv_path_PERL,ac_cv_path_PERL="$with_perl");
   3556         PERL=$ac_cv_path_PERL
   3557         AC_SUBST(PERL)dnl
   3558         have_perl="$ac_cv_path_PERL"
   3559     else
   3560         AC_PATH_PROGS(PERL,perl perl5,)dnl
   3561         if test "$ac_cv_path_PERL"; then
   3562             have_perl="$ac_cv_path_PERL"
   3563         fi
   3564     fi
   3565 fi
   3566 
   3567 if test "$with_perl" != 'yes' ; then
   3568     DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-perl=$with_perl "
   3569 fi
   3570 
   3571 PERL_SUPPORTS_DESTDIR='no'
   3572 
   3573 with_perl_static='no'
   3574 with_perl_dynamic='no'
   3575 if test "$have_perl" != 'no'; then
   3576     if test "$with_perl" != 'no' && test "$libtool_build_shared_libs" = 'no'; then
   3577         with_perl_static='yes'
   3578     fi
   3579     if test "$with_perl" != 'no' && test "$libtool_build_shared_libs" = 'yes'; then
   3580         with_perl_dynamic='yes'
   3581     fi
   3582     # Is PERL's MakeMaker new enough to support DESTDIR?
   3583     AX_PROG_PERL_VERSION(5.8.1,[PERL_SUPPORTS_DESTDIR='yes'],[PERL_SUPPORTS_DESTDIR='no'])
   3584 fi
   3585 AM_CONDITIONAL(WITH_PERL, test "$have_perl" != 'no')
   3586 AM_CONDITIONAL(WITH_PERL_STATIC, test $with_perl_static = 'yes')
   3587 AM_CONDITIONAL(WITH_PERL_DYNAMIC, test $with_perl_dynamic = 'yes')
   3588 AC_SUBST(PERL_SUPPORTS_DESTDIR)
   3589 
   3590 # Determine path to pick up MagickCore library from for use with building PerlMagick
   3591 MAGICKCORE_PATH="${LIB_DIR}"
   3592 if test $with_perl_static = 'yes'; then
   3593     # Find out where libtool hides its uninstalled libraries (as libtool_objdir)
   3594     libtool_objdir=$objdir
   3595 
   3596     # Linker search path to library, followed by -lMagickCore
   3597     MAGICKCORE_PATH="${builddir}/MagickCore/${libtool_objdir}"
   3598 fi
   3599 AC_SUBST(MAGICKCORE_PATH)
   3600 
   3601 # Create a simple string containing format names for all delegate libraries.
   3602 MAGICK_DELEGATES=''
   3603 if test "$have_autotrace"  = 'yes' ; then
   3604    MAGICK_DELEGATES="$MAGICK_DELEGATES autotrace"
   3605 fi
   3606 if test "$have_bzlib"  = 'yes' ; then
   3607    MAGICK_DELEGATES="$MAGICK_DELEGATES bzlib"
   3608 fi
   3609 if test "$have_dps"    = 'yes' ; then
   3610    MAGICK_DELEGATES="$MAGICK_DELEGATES dps"
   3611 fi
   3612 if test "$have_djvu"    = 'yes' ; then
   3613    MAGICK_DELEGATES="$MAGICK_DELEGATES djvu"
   3614 fi
   3615 if test "$have_avconv"   = 'yes' ; then
   3616    MAGICK_DELEGATES="$MAGICK_DELEGATES mpeg"
   3617 fi
   3618 if test "$have_fftw"    = 'yes' ; then
   3619    MAGICK_DELEGATES="$MAGICK_DELEGATES fftw"
   3620 fi
   3621 if test "$have_flif"    = 'yes' ; then
   3622    MAGICK_DELEGATES="$MAGICK_DELEGATES flif"
   3623 fi
   3624 if test "$have_fpx"    = 'yes' ; then
   3625    MAGICK_DELEGATES="$MAGICK_DELEGATES fpx"
   3626 fi
   3627 if test "$have_fontconfig"    = 'yes' ; then
   3628    MAGICK_DELEGATES="$MAGICK_DELEGATES fontconfig"
   3629 fi
   3630 if test "$have_freetype"    = 'yes' ; then
   3631    MAGICK_DELEGATES="$MAGICK_DELEGATES freetype"
   3632 fi
   3633 if test "$have_gslib"    = 'yes' ; then
   3634    MAGICK_DELEGATES="$MAGICK_DELEGATES gslib"
   3635 fi
   3636 if test "$have_jbig"    = 'yes' ; then
   3637    MAGICK_DELEGATES="$MAGICK_DELEGATES jbig"
   3638 fi
   3639 if test "$have_png$have_jpeg" = 'yesyes' ; then
   3640    MAGICK_DELEGATES="$MAGICK_DELEGATES jng"
   3641 fi
   3642 if test "$have_jpeg"   = 'yes' ; then
   3643    MAGICK_DELEGATES="$MAGICK_DELEGATES jpeg"
   3644 fi
   3645 if test "$have_lcms" = 'yes' || test "$have_lcms2" = 'yes' ; then
   3646    MAGICK_DELEGATES="$MAGICK_DELEGATES lcms"
   3647 fi
   3648 if test "$have_lqr"    = 'yes' ; then
   3649    MAGICK_DELEGATES="$MAGICK_DELEGATES lqr"
   3650 fi
   3651 if test "$have_lzma"    = 'yes' ; then
   3652    MAGICK_DELEGATES="$MAGICK_DELEGATES lzma"
   3653 fi
   3654 if test "$have_openexr"    = 'yes' ; then
   3655    MAGICK_DELEGATES="$MAGICK_DELEGATES openexr"
   3656 fi
   3657 if test "$have_openjp2"    = 'yes' ; then
   3658    MAGICK_DELEGATES="$MAGICK_DELEGATES openjp2"
   3659 fi
   3660 if test "$have_pango"    = 'yes' ; then
   3661    MAGICK_DELEGATES="$MAGICK_DELEGATES pango"
   3662 fi
   3663 if test "$have_png"    = 'yes' ; then
   3664    MAGICK_DELEGATES="$MAGICK_DELEGATES png"
   3665 fi
   3666 have_ps='no'
   3667 if test "$have_dps"    = 'yes' || \
   3668    test "$have_gs" = 'yes' || \
   3669    test "${native_win32_build}" = 'yes' ; then
   3670    have_ps='yes'
   3671 fi
   3672 if test "$have_ps"     = 'yes' ; then
   3673    MAGICK_DELEGATES="$MAGICK_DELEGATES ps"
   3674 fi
   3675 if test "$have_raqm"    = 'yes' ; then
   3676    MAGICK_DELEGATES="$MAGICK_DELEGATES raqm"
   3677 fi
   3678 if test "$have_ra_ppm" = 'yes' ; then
   3679    MAGICK_DELEGATES="$MAGICK_DELEGATES rad"
   3680 fi
   3681 if test "$have_rsvg"   = 'yes' ; then
   3682    MAGICK_DELEGATES="$MAGICK_DELEGATES rsvg"
   3683 fi
   3684 if test "$have_tiff"   = 'yes' ; then
   3685    MAGICK_DELEGATES="$MAGICK_DELEGATES tiff"
   3686 fi
   3687 if test "$have_ttf"    = 'yes' ; then
   3688    MAGICK_DELEGATES="$MAGICK_DELEGATES ttf"
   3689 fi
   3690 if test "$have_webp"    = 'yes' ; then
   3691    MAGICK_DELEGATES="$MAGICK_DELEGATES webp"
   3692 fi
   3693 if test "$have_wmf"    = 'yes' ; then
   3694    MAGICK_DELEGATES="$MAGICK_DELEGATES wmf"
   3695 fi
   3696 if test "$have_x"      = 'yes' ; then
   3697    MAGICK_DELEGATES="$MAGICK_DELEGATES x"
   3698 fi
   3699 if test "$have_xml"      = 'yes' ; then
   3700    MAGICK_DELEGATES="$MAGICK_DELEGATES xml"
   3701 fi
   3702 if test "$have_zlib"   = 'yes' ; then
   3703    MAGICK_DELEGATES="$MAGICK_DELEGATES zlib"
   3704 fi
   3705 
   3706 # Remove extraneous spaces from output variables (asthetic)
   3707 MAGICK_DELEGATES=`echo $MAGICK_DELEGATES | sed -e 's/  */ /g'`
   3708 MAGICK_FEATURES=`echo $MAGICK_FEATURES | sed -e 's/  */ /g'`
   3709 AC_SUBST(MAGICK_DELEGATES)
   3710 AC_SUBST(MAGICK_FEATURES)
   3711 
   3712 #
   3713 # Handle special compiler flags
   3714 #
   3715 
   3716 # Add '-p' if prof source profiling support enabled
   3717 if test "$enable_prof" = 'yes'; then
   3718     CFLAGS="-p $CFLAGS"
   3719     CXXFLAGS="-p $CXXFLAGS"
   3720     LDFLAGS="-p $LDFLAGS"
   3721 fi
   3722 
   3723 # Add '-pg' if gprof source profiling support enabled
   3724 if test "$enable_gprof" = 'yes'; then
   3725     CFLAGS="-pg $CFLAGS"
   3726     CXXFLAGS="-pg $CXXFLAGS"
   3727     LDFLAGS="-pg $LDFLAGS"
   3728 fi
   3729 
   3730 # Add '-ftest-coverage -fprofile-arcs' if gcov source profiling support enabled
   3731 # This is a gcc-specific feature
   3732 if test "$enable_gcov" = 'yes'; then
   3733     AC_CHECK_LIB(gcov,_gcov_init)
   3734     AC_CHECK_LIB(gcov,__gcov_init)
   3735     case "$target_os" in
   3736         darwin*)
   3737             OSX_GCOV_LDFLAG="-Wl,-single_module"
   3738         ;;
   3739         *)
   3740             OSX_GCOV_LDFLAG=""
   3741         ;;
   3742     esac
   3743     AC_SUBST(OSX_GCOV_LDFLAG)
   3744     CFLAGS="-ftest-coverage -fprofile-arcs  $CFLAGS"
   3745     CXXFLAGS="-ftest-coverage -fprofile-arcs  $CXXFLAGS"
   3746     LDFLAGS="-ftest-coverage -fprofile-arcs $LDFLAGS"
   3747 fi
   3748 
   3749 #
   3750 # Build library dependency list for libMagickCore
   3751 #
   3752 
   3753 if test "$build_modules" != 'no'; then
   3754     MAGICK_DEP_LIBS="$USER_LIBS $LCMS_LIBS $FREETYPE_LIBS $RAQM_LIBS $LQR_LIBS $FFTW_LIBS $FLIF_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"
   3755 else
   3756     MAGICK_DEP_LIBS="$USER_LIBS $JBIG_LIBS $LCMS_LIBS $TIFF_LIBS $FREETYPE_LIBS $RAQM_LIBS $JPEG_LIBS $GS_LIBS $LQR_LIBS $PNG_LIBS $AUTOTRACE_LIBS $DJVU_LIBS $FFTW_LIBS $FLIF_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"
   3757 fi
   3758 AC_SUBST(MAGICK_DEP_LIBS)
   3759 
   3760 # Pass only user-provided LIBS as "global" libraries
   3761 LIBS=$USER_LIBS
   3762 
   3763 #AC_SUBST(CPPFLAGS)
   3764 AC_SUBST(X_CFLAGS)
   3765 #AC_SUBST(LDFLAGS)
   3766 #AC_SUBST(X_PRE_LIBS)
   3767 #AC_SUBST(X_LIBS)
   3768 #AC_SUBST(X_EXTRA_LIBS)
   3769 
   3770 MAGICK_CFLAGS=$CFLAGS
   3771 MAGICK_CXXFLAGS="$CXXFLAGS"
   3772 MAGICK_CPPFLAGS=`echo $MAGICK_CPPFLAGS | sed -e 's/  */ /g'`
   3773 MAGICK_PCFLAGS=`echo $MAGICK_PCFLAGS | sed -e 's/  */ /g'`
   3774 MAGICK_LDFLAGS="-L$LIB_DIR $LDFLAGS"
   3775 MAGICK_LIBS="$MAGICK_DEP_LIBS"
   3776 
   3777 AC_SUBST(MAGICK_CFLAGS)
   3778 AC_SUBST(MAGICK_CXXFLAGS)
   3779 AC_SUBST(MAGICK_CPPFLAGS)
   3780 AC_SUBST(MAGICK_PCFLAGS)
   3781 AC_SUBST(MAGICK_LDFLAGS)
   3782 AC_SUBST(MAGICK_LIBS)
   3783 
   3784 # Set configured scripts to executable.
   3785 AC_CONFIG_COMMANDS([default],[],[])
   3786 AC_CONFIG_COMMANDS([magick.sh.in],[chmod +x magick.sh])
   3787 AC_CONFIG_COMMANDS([MagickCore-config.in],[chmod +x MagickCore/MagickCore-config])
   3788 AC_CONFIG_COMMANDS([MagickWand-config.in],[chmod +x MagickWand/MagickWand-config])
   3789 AC_CONFIG_COMMANDS([Magick++-config.in],[chmod +x Magick++/bin/Magick++-config])
   3790 AC_CONFIG_COMMANDS([PerlMagick/check.sh.in],[chmod +x PerlMagick/check.sh])
   3791 
   3792 AC_MSG_RESULT([-------------------------------------------------------------])
   3793 AC_MSG_RESULT([Update ImageMagick configuration])
   3794 
   3795 rm -f magick-version
   3796 
   3797 result_dejavu_font_dir='none'
   3798 if test "${dejavu_font_dir}x" != 'x'; then
   3799     result_dejavu_font_dir=$dejavu_font_dir
   3800 fi
   3801 
   3802 result_ghostscript_font_dir='none'
   3803 if test "${ghostscript_font_dir}x" != 'x'; then
   3804     result_ghostscript_font_dir=$ghostscript_font_dir
   3805 fi
   3806 
   3807 result_windows_font_dir='none'
   3808 if test "${windows_font_dir}x" != 'x'; then
   3809     result_windows_font_dir=${windows_font_dir}
   3810 fi
   3811 
   3812 # ==============================================================================
   3813 # Generate build environment
   3814 # ==============================================================================
   3815 AC_CONFIG_FILES([\
   3816     common.shi \
   3817     config/configure.xml \
   3818     config/delegates.xml \
   3819     config/ImageMagick.rdf \
   3820     config/MagickCore.dox \
   3821     config/MagickWand.dox \
   3822     config/Magick++.dox \
   3823     config/type-apple.xml \
   3824     config/type-dejavu.xml \
   3825     config/type-ghostscript.xml \
   3826     config/type-windows.xml \
   3827     config/type.xml \
   3828     ImageMagick.spec \
   3829     Magick++/bin/Magick++-config \
   3830     MagickCore/ImageMagick.pc \
   3831     Magick++/lib/Magick++.pc \
   3832     MagickCore/MagickCore-config \
   3833     MagickCore/MagickCore.pc \
   3834     MagickCore/version.h \
   3835     Makefile \
   3836     magick.sh \
   3837     PerlMagick/check.sh \
   3838     PerlMagick/default/Magick.pm \
   3839     PerlMagick/Makefile.PL \
   3840     PerlMagick/default/Makefile.PL \
   3841     PerlMagick/quantum/Makefile.PL \
   3842     PerlMagick/quantum/quantum.pm \
   3843     PerlMagick/quantum/quantum.xs \
   3844     PerlMagick/quantum/typemap \
   3845     utilities/animate.1 \
   3846     utilities/compare.1 \
   3847     utilities/composite.1 \
   3848     utilities/conjure.1 \
   3849     utilities/convert.1 \
   3850     utilities/display.1 \
   3851     utilities/identify.1 \
   3852     utilities/ImageMagick.1 \
   3853     utilities/import.1 \
   3854     utilities/magick.1 \
   3855     utilities/magick-script.1 \
   3856     utilities/mogrify.1 \
   3857     utilities/montage.1 \
   3858     utilities/stream.1 \
   3859     MagickWand/MagickWand-config \
   3860     MagickWand/MagickWand.pc ])
   3861 AC_OUTPUT
   3862 
   3863 # ==============================================================================
   3864 # ImageMagick Configuration
   3865 # ==============================================================================
   3866 AC_MSG_NOTICE([
   3867 ==============================================================================
   3868 ImageMagick is configured as follows. Please verify that this configuration
   3869 matches your expectations.
   3870 
   3871   Host system type: $host
   3872   Build system type: $build
   3873 
   3874                  Option                        Value
   3875   ------------------------------------------------------------------------------
   3876   Shared libraries  --enable-shared=$enable_shared		$libtool_build_shared_libs
   3877   Static libraries  --enable-static=$enable_static		$libtool_build_static_libs
   3878   Module support    --with-modules=$build_modules		$build_modules
   3879   GNU ld            --with-gnu-ld=$with_gnu_ld		$lt_cv_prog_gnu_ld
   3880   Quantum depth     --with-quantum-depth=$with_quantum_depth	$with_quantum_depth
   3881   High Dynamic Range Imagery
   3882                     --enable-hdri=$enable_hdri		$enable_hdri
   3883 
   3884   Install documentation:			$wantdocs
   3885 
   3886   Delegate Library Configuration:
   3887   BZLIB             --with-bzlib=$with_bzlib		$have_bzlib
   3888   Autotrace         --with-autotrace=$with_autotrace		$have_autotrace
   3889   DJVU              --with-djvu=$with_djvu		$have_djvu
   3890   DPS               --with-dps=$with_dps		$have_dps
   3891   FFTW              --with-fftw=$with_fftw		$have_fftw
   3892   FLIF              --with-flif=$with_flif		$have_flif
   3893   FlashPIX          --with-fpx=$with_fpx		$have_fpx
   3894   FontConfig        --with-fontconfig=$with_fontconfig	$have_fontconfig
   3895   FreeType          --with-freetype=$with_freetype		$have_freetype
   3896   Ghostscript lib   --with-gslib=$with_gslib		$have_gslib
   3897   Graphviz          --with-gvc=$with_gvc		$have_gvc
   3898   JBIG              --with-jbig=$with_jbig		$have_jbig
   3899   JPEG v1           --with-jpeg=$with_jpeg		$have_jpeg
   3900   LCMS              --with-lcms=$with_lcms		$have_lcms
   3901   LQR               --with-lqr=$with_lqr		$have_lqr
   3902   LTDL              --with-ltdl=$with_ltdl		$have_ltdl
   3903   LZMA              --with-lzma=$with_lzma		$have_lzma
   3904   Magick++          --with-magick-plus-plus=$with_magick_plus_plus	$have_magick_plus_plus
   3905   OpenEXR           --with-openexr=$with_openexr		$have_openexr
   3906   OpenJP2           --with-openjp2=$with_openjp2		$have_openjp2
   3907   PANGO             --with-pango=$with_pango		$have_pango
   3908   PERL              --with-perl=$with_perl		$have_perl
   3909   PNG               --with-png=$with_png		$have_png
   3910   RAQM              --with-raqm=$with_raqm		$have_raqm
   3911   RSVG              --with-rsvg=$with_rsvg		$have_rsvg
   3912   TIFF              --with-tiff=$with_tiff		$have_tiff
   3913   WEBP              --with-webp=$with_webp		$have_webp
   3914   WMF               --with-wmf=$with_wmf		$have_wmf
   3915   X11               --with-x=$with_x			$have_x
   3916   XML               --with-xml=$with_xml		$have_xml
   3917   ZLIB              --with-zlib=$with_zlib		$have_zlib
   3918 
   3919   Delegate Program Configuration:
   3920   GhostPCL          None				$PCLDelegate ($PCLVersion)
   3921   GhostXPS          None				$XPSDelegate ($XPSVersion)
   3922   Ghostscript       None				$PSDelegate ($GSVersion)
   3923 
   3924   Font Configuration:
   3925   Apple fonts       --with-apple-font-dir=$with_apple_font_dir	$result_apple_font_dir
   3926   Dejavu fonts      --with-dejavu-font-dir=$with_dejavu_font_dir	$result_dejavu_font_dir
   3927   Ghostscript fonts --with-gs-font-dir=$with_gs_font_dir	$result_ghostscript_font_dir
   3928   Windows fonts     --with-windows-font-dir=$with_windows_font_dir	$result_windows_font_dir
   3929 
   3930   X11 Configuration:
   3931         X_CFLAGS        = $X_CFLAGS
   3932         X_PRE_LIBS      = $X_PRE_LIBS
   3933         X_LIBS          = $X_LIBS
   3934         X_EXTRA_LIBS    = $X_EXTRA_LIBS
   3935 
   3936   Options used to compile and link:
   3937     PREFIX          = $PREFIX_DIR
   3938     EXEC-PREFIX     = $EXEC_PREFIX_DIR
   3939     VERSION         = $PACKAGE_VERSION
   3940     CC              = $CC
   3941     CFLAGS          = $CFLAGS
   3942     CPPFLAGS        = $CPPFLAGS
   3943     PCFLAGS         = $PCFLAGS
   3944     DEFS            = $DEFS
   3945     LDFLAGS         = $LDFLAGS
   3946     LIBS            = $LIBS
   3947     CXX             = $CXX
   3948     CXXFLAGS        = $CXXFLAGS
   3949     FEATURES        = $MAGICK_FEATURES
   3950     DELEGATES       = $MAGICK_DELEGATES
   3951 ==============================================================================
   3952 ])
   3953