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