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