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