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