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