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