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