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