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