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