1 # Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization
2 # dedicated to making software imaging solutions freely available.
4 # You may not use this file except in compliance with the License. You may
5 # obtain a copy of the License at
7 # http://www.imagemagick.org/script/license.php
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.
15 # Copyright (C) 2003 - 2008 GraphicsMagick Group
19 m4_define([magick_major_version], [6])
20 m4_define([magick_minor_version], [6])
21 m4_define([magick_micro_version], [9])
22 m4_define([magick_version],
23 [magick_major_version.magick_minor_version.magick_micro_version])
24 m4_define([magick_svn_revision], esyscmd([sh -c "svnversion | sed -r 's/([0-9]+).*/\1/'"]))
26 AC_INIT([ImageMagick],[magick_version],[http://www.imagemagick.org],[ImageMagick-magick_version])
27 AC_CONFIG_SRCDIR([magick/MagickCore.h])
28 AC_CONFIG_AUX_DIR([config])
29 AC_CONFIG_MACRO_DIR([m4])
30 AC_CONFIG_LIBOBJ_DIR([ltdl])
31 AC_CONFIG_HEADERS([config/config.h])
32 AX_PREFIX_CONFIG_H([magick/magick-config.h],[MagickCore])
34 config/configure.xml \
35 config/delegates.xml \
36 config/ImageMagick.rdf \
37 config/MagickCore.dox \
38 config/MagickWand.dox \
39 config/type-dejavu.xml \
40 config/type-ghostscript.xml \
41 config/type-windows.xml \
44 Magick++/bin/Magick++-config \
45 magick/ImageMagick.pc \
46 Magick++/lib/ImageMagick++.pc \
47 Magick++/lib/Magick++.pc \
48 magick/Magick-config \
49 magick/MagickCore-config \
50 magick/MagickCore.pc \
54 PerlMagick/Magick.pm \
55 PerlMagick/Makefile.PL \
59 utilities/composite.1 \
63 utilities/identify.1 \
64 utilities/ImageMagick.1 \
69 wand/MagickWand-config \
75 # Save initial user-tunable values
78 for var in CC CFLAGS CPPFLAGS CXX CXXCPP LDFLAGS LIBS ; do
79 eval isset=\${$var+set}
80 if test "$isset" = 'set'; then
82 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS}'${var}=${val}' "
85 AC_SUBST(DISTCHECK_CONFIG_FLAGS)
87 CONFIGURE_ARGS="$0 ${ac_configure_args}"
88 AC_SUBST(CONFIGURE_ARGS)
90 # Source file containing package/library versioning information.
91 . ${srcdir}/version.sh
93 echo "configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}${PACKAGE_VERSION_ADDENDUM}"
97 AC_CANONICAL_TARGET([])
99 MAGICK_TARGET_CPU=$target_cpu
100 AC_SUBST(MAGICK_TARGET_CPU)
102 MAGICK_TARGET_VENDOR=$target_vendor
103 AC_SUBST(MAGICK_TARGET_VENDOR)
105 MAGICK_TARGET_OS=$target_os
106 AC_SUBST(MAGICK_TARGET_OS)
108 # Substitute library versioning
109 AC_SUBST(MAGICK_LIBRARY_CURRENT)dnl
110 AC_SUBST(MAGICK_LIBRARY_REVISION)dnl
111 AC_SUBST(MAGICK_LIBRARY_AGE)dnl
112 AC_SUBST([MAGICK_LIBRARY_CURRENT_MIN],
113 [`expr $MAGICK_LIBRARY_CURRENT - $MAGICK_LIBRARY_AGE`])
114 AC_SUBST([MAGICK_LIBRARY_VERSION_INFO],
115 [$MAGICK_LIBRARY_CURRENT:$MAGICK_LIBRARY_REVISION:$MAGICK_LIBRARY_AGE])
116 AC_SUBST([MAGICK_SVN_REVISION],[magick_svn_revision])
118 AC_SUBST(PACKAGE_NAME)dnl
119 AC_SUBST(PACKAGE_VERSION)dnl
120 AC_SUBST(PACKAGE_RELEASE)dnl
121 AC_SUBST(PACKAGE_CHANGE_DATE)dnl
122 AC_SUBST(PACKAGE_LIB_VERSION)dnl
123 AC_SUBST(PACKAGE_LIB_VERSION_NUMBER)dnl
124 AC_SUBST(PACKAGE_RELEASE_DATE)dnl
125 AC_SUBST(PACKAGE_VERSION_ADDENDUM)dnl
127 # Ensure that make can run correctly
130 AM_INIT_AUTOMAKE($PACKAGE_NAME,"${PACKAGE_VERSION}${PACKAGE_VERSION_ADDENDUM}", ' ')
132 # Enable support for silent build rules
133 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
135 MAGICK_LIB_VERSION="0x"
136 if test ${MAGICK_LIBRARY_CURRENT} -lt 10 ; then
137 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
139 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_CURRENT}
140 if test ${MAGICK_LIBRARY_AGE} -lt 10 ; then
141 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
143 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_AGE}
144 if test ${MAGICK_LIBRARY_REVISION} -lt 10 ; then
145 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
147 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_REVISION}
148 AC_SUBST(MAGICK_LIB_VERSION)
150 # Definition used to define MagickLibVersionText in version.h
151 MAGICK_LIB_VERSION_TEXT="${PACKAGE_VERSION}"
152 AC_SUBST(MAGICK_LIB_VERSION_TEXT)
154 # Definition used to define MagickLibVersionNumber in version.h
155 MAGICK_LIB_VERSION_NUMBER="${MAGICK_LIBRARY_CURRENT},${MAGICK_LIBRARY_AGE},${MAGICK_LIBRARY_REVISION}"
156 AC_SUBST(MAGICK_LIB_VERSION_NUMBER)
158 # Regenerate config.status if ChangeLog or version.sh is updated.
159 AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/version.sh'])
164 MAGICK_CPPFLAGS=$CPPFLAGS_USER
165 MAGICK_PCFLAGS=$CPPFLAGS_USER
171 # Evaluate shell variable equivalents to Makefile directory variables
173 if test "x$prefix" = xNONE; then
174 prefix=$ac_default_prefix
176 # Let make expand exec_prefix.
177 if test "x$exec_prefix" = xNONE; then
178 exec_prefix='${prefix}'
182 eval "eval PREFIX_DIR=${prefix}"
184 eval "eval EXEC_PREFIX_DIR=${exec_prefix}"
185 AC_SUBST(EXEC_PREFIX_DIR)
186 eval "eval BIN_DIR=$bindir"
188 eval "eval SBIN_DIR=$sbindir"
190 eval "eval LIBEXEC_DIR=$libexecdir"
191 AC_SUBST(LIBEXEC_DIR)
192 eval "eval DATA_DIR=$datadir"
194 eval "eval DOC_DIR=$docdir"
196 eval "eval SYSCONF_DIR=$sysconfdir"
197 AC_SUBST(SYSCONF_DIR)
198 eval "eval SHAREDSTATE_DIR=$sharedstatedir"
199 AC_SUBST(SHAREDSTATE_DIR)
200 eval "eval LOCALSTATE_DIR=$localstatedir"
201 AC_SUBST(LOCALSTATE_DIR)
202 eval "eval LIB_DIR=$libdir"
204 eval "eval INCLUDE_DIR=$includedir"
205 AC_SUBST(INCLUDE_DIR)
206 eval "eval PERSISTINCLUDE_DIR=$oldincludedir"
207 AC_SUBST(PERSISTINCLUDE_DIR)
208 eval "eval INFO_DIR=$infodir"
210 eval "eval MAN_DIR=$mandir"
213 # Get full paths to source and build directories
214 srcdirfull="`cd $srcdir && pwd`"
218 # Compute variables useful for running uninstalled software.
220 MAGICK_CODER_MODULE_PATH="${builddir}/coders"
221 MAGICK_CONFIGURE_SRC_PATH="${srcdirfull}/config"
222 MAGICK_CONFIGURE_BUILD_PATH="${builddir}/config"
223 MAGICK_FILTER_MODULE_PATH="${builddir}/filters"
225 case "${build_os}" in
227 MAGICK_CODER_MODULE_PATH=`$WinPathScript "${MAGICK_CODER_MODULE_PATH}" 0`
228 MAGICK_CONFIGURE_SRC_PATH=`$WinPathScript "${MAGICK_CONFIGURE_SRC_PATH}" 0`
229 MAGICK_CONFIGURE_BUILD_PATH=`$WinPathScript "${MAGICK_CONFIGURE_BUILD_PATH}" 0`
230 MAGICK_FILTER_MODULE_PATH=`$WinPathScript "${MAGICK_FILTER_MODULE_PATH}" 0`
239 AC_SUBST(MAGICK_CODER_MODULE_PATH)
240 AC_SUBST(MAGICK_CONFIGURE_SRC_PATH)
241 AC_SUBST(MAGICK_CONFIGURE_BUILD_PATH)
242 AC_SUBST(MAGICK_FILTER_MODULE_PATH)
247 # Enable OS features.
249 AC_USE_SYSTEM_EXTENSIONS
269 # Enable run-time checking.
271 AC_ARG_ENABLE([bounds-checking],
272 [AC_HELP_STRING([--bounds-checking],
273 [enable run-time bounds-checking])],
274 [enable_bounds_checking=$enableval],
275 [enable_bounds_checking='no'])
277 if test "$enable_bounds_checking" = yes; then
278 AC_DEFINE([_FORTIFY_SOURCE], [2],
279 [enable run-time bounds-checking])
290 native_win32_build='no'
298 native_win32_build='yes'
302 if test "${GDI32_LIBS}x" != 'x'; then
303 AC_DEFINE(WINGDI32_DELEGATE,1,Define to use the Windows GDI32 library)
306 AM_CONDITIONAL(WINGDI32_DELEGATE, test "${GDI32_LIBS}x" != 'x' )
307 AM_CONDITIONAL(WIN32_NATIVE_BUILD, test "${native_win32_build}" = 'yes' )
308 AM_CONDITIONAL(CYGWIN_BUILD, test "${cygwin_build}" = 'yes' )
309 AM_CONDITIONAL(USING_CL, test "x${CC}" = 'xcl.exe' )
311 WinPathScript="${srcdirfull}/winpath.sh"
312 AC_SUBST(WinPathScript)
315 # Compiler flags tweaks
317 if test "${GCC}" != "yes"; then
320 # aCC: HP ANSI C++ B3910B A.03.34
321 CFLAGS="${CFLAGS} -Wp,-H30000"
322 if test -n "${CXXFLAGS}"; then
325 CXXFLAGS="${CXXFLAGS} -AA"
329 # Compaq alphaev68-dec-osf5.1 compiler
330 if test -n "${CXXFLAGS}"; then
331 CXXFLAGS='-std strict_ansi -noimplicit_include'
333 CXXFLAGS="${CXXFLAGS} -std strict_ansi -noimplicit_include"
338 # Check for lazy-loading.
339 AC_CACHE_CHECK([for linker lazyload option],[im_cv_ld_lazyload],
341 im_cv_ld_lazyload='none'
343 *-*-solaris2.8 | *-*-solaris2.9 | *-*-solaris2.1? )
344 if test "$lt_cv_prog_gnu_ld" != 'yes' ; then
345 im_cv_ld_lazyload='-Wl,-zlazyload'
350 if test "${im_cv_ld_lazyload}" != 'none' ; then
351 if test -z "${LDFLAGS}" ; then
352 LDFLAGS="${im_cv_ld_lazyload}"
354 LDFLAGS="${im_cv_ld_lazyload} ${LDFLAGS}"
358 dnl Platform-specific stuff
360 *darwin* | *-macos10*)
361 dnl OS X universal binary support, requires --disable-dependency-tracking
362 AC_ARG_ENABLE([osx-universal-binary],
363 AC_HELP_STRING([--enable-osx-universal-binary],
364 [build universal binary on OS X [[default=no]]]),
365 [build_osxuniversal="${enableval}"], [build_osxuniversal=no])
367 if test "${build_osxuniversal}" != no ; then
368 if test "$enable_dependency_tracking" != no ; then
369 AC_MSG_ERROR([--enable-osx-universal-binary requires --disable-dependency-tracking.
370 Please re-run configure with these options:
371 --disable-dependency-tracking --enable-osx-universal-binary
374 CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
375 CXXFLAGS="$CXXFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
376 LDFLAGS="$LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
381 # Enable support for threads
382 AC_ARG_WITH([threads],
383 [AC_HELP_STRING([--without-threads], [disable threads support])],
384 [with_threads=$withval],
385 [with_threads='yes'])
388 if test "$with_threads" != 'no'; then
390 if test "$ax_pthread_ok" = yes; then
392 DEF_THREAD="$PTHREAD_CFLAGS"
393 CFLAGS="$CFLAGS $DEF_THREAD"
394 CXXFLAGS="$CXXFLAGS $DEF_THREAD"
395 if test "$CC" != "$PTHREAD_CC"; then
396 AC_MSG_WARN([Replacing compiler $CC with compiler $PTHREAD_CC to support pthreads.])
399 AC_DEFINE(THREAD_SUPPORT,1,[Define if you have POSIX threads libraries and header files.])
403 # Enable support for OpenMP
404 if test "$have_threads" != 'yes'; then
405 ac_cv_prog_c_openmp=unsupported
408 CFLAGS="$OPENMP_CFLAGS $CFLAGS"
409 MAGICK_PCFLAGS="$MAGICK_PCFLAGS $OPENMP_CFLAGS"
410 AC_SUBST(OPENMP_CFLAGS)
411 if test "$enable_openmp" != no; then
412 if test "$ac_cv_prog_c_openmp" != 'unsupported'; then
413 MAGICK_FEATURES="OpenMP $MAGICK_FEATURES"
417 # Enable support for OpenCL
419 CFLAGS="$CL_CFLAGS $CFLAGS"
420 LIBS="$CL_LIBS $LIBS"
422 if test "$enable_opencl" != no; then
423 if test "_OPENCL" = '1'; then
424 MAGICK_FEATURES="OpenCL $MAGICK_FEATURES"
430 # Check for large file support
436 if test "$enable_largefile" != no; then
437 if test "$ac_cv_sys_file_offset_bits" != 'no'; then
438 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
440 AC_MSG_CHECKING([for native large file support])
441 AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>
443 exit(!(sizeof(off_t) == 8));
445 [ac_cv_sys_file_offset_bits=64; AC_DEFINE(_FILE_OFFSET_BITS,64)
446 AC_MSG_RESULT([yes])],
447 [AC_MSG_RESULT([no])])
449 if test "$ac_cv_sys_large_files" != 'no'; then
450 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGE_FILES=1"
452 if test "$ac_cv_sys_largefile_source" != 'no'; then
453 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGEFILE_SOURCE=1"
456 AC_SUBST(LFS_CPPFLAGS)
459 # Configure libtool & libltdl
465 AC_SUBST(LIBTOOL_DEPS)
468 LT_CONFIG_LTDL_DIR([ltdl])
469 LTDL_INIT([convenience nonrecursive])
471 # Check to see if building shared libraries
472 libtool_build_shared_libs='no'
473 if test "$enable_shared" = 'yes'; then
474 libtool_build_shared_libs='yes'
477 # Check to see if building static libraries
478 libtool_build_static_libs='no'
479 if test "$enable_static" = 'yes'; then
480 libtool_build_static_libs='yes'
483 AM_CONDITIONAL(WITH_SHARED_LIBS, test "${libtool_build_shared_libs}" = 'yes')
485 # Enable support for building loadable modules
487 AC_ARG_WITH([modules],
488 [AC_HELP_STRING([--with-modules],
489 [enable building dynamically loadable modules])],
490 [with_modules=$withval],
493 # Only allow building loadable modules if we are building shared libraries
494 if test "$with_modules" != 'no' ; then
495 if test "$libtool_build_shared_libs" = 'no'; then
496 AC_MSG_WARN([Modules may only be built if building shared libraries is enabled.])
500 if test "$with_modules" != 'no'; then
501 AC_DEFINE(BUILD_MODULES,1,Define if coders and filters are to be built as modules.)
503 AM_CONDITIONAL(WITH_MODULES, test "$with_modules" != 'no')
505 # Enable building/use of libltdl if we are building shared libraries regardless
506 # of whether modules are built or not.
508 if test "$libtool_build_shared_libs" != 'no'; then
512 AM_CONDITIONAL(WITH_LTDL, test "$with_ltdl" != 'no')
513 if test "$with_ltdl" != 'no'; then
514 AC_DEFINE(LTDL_DELEGATE,1,Define if using libltdl to support dynamically loadable modules)
517 if test X"$enable_shared" = Xyes; then
518 DLLDFLAGS=-export-dynamic
523 # Enable build using delegate libraries built in subdirectories rather than installed
524 # delegate libraries (bzlib fftw fpx gslib jp2 jbig jpeg lcms lzma png tiff ttf wmf xml zlib)
525 AC_ARG_ENABLE([delegate-build],
526 [AC_HELP_STRING([--enable-delegate-build],
527 [look for delegate libraries in build directory])],
528 [enable_delegate_build=$enableval],
529 [enable_delegate_build='no'])
531 AC_ARG_ENABLE([deprecated],
532 [AC_HELP_STRING([--disable-deprecated],
533 [exclude deprecated methods in MagickCore and MagickWand API's])],
534 [enable_deprecated=$enableval],
535 [enable_deprecated='no'])
537 if test "$enable_deprecated" = 'yes'; then
538 AC_DEFINE(EXCLUDE_DEPRECATED,1,[exclude deprecated methods in MagickCore API])
540 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-deprecated "
543 # Build a version of ImageMagick which operates uninstalled.
544 # Used to build distributions located via MAGICK_HOME / executable path
545 AC_ARG_ENABLE([installed],
546 [AC_HELP_STRING([--disable-installed],
547 [Formally install ImageMagick under PREFIX])],
548 [enable_installed=$enableval],
549 [enable_installed='yes'])
551 if test "$enable_installed" = 'yes'; then
552 AC_DEFINE(INSTALLED_SUPPORT,1,[ImageMagick is formally installed under prefix])
554 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-installed "
557 # Permit enciphering and deciphering image pixels.
558 AC_ARG_ENABLE([cipher],
559 [AC_HELP_STRING([--disable-cipher],
560 [disable enciphering and deciphering image pixels])],
561 [enable_cipher=$enableval],
562 [enable_cipher='yes'])
564 if test "$enable_cipher" = 'yes'; then
565 AC_DEFINE(CIPHER_SUPPORT,1,[permit enciphering and deciphering image pixels])
568 # Build an embeddable version of ImageMagick.
569 AC_ARG_ENABLE([embeddable],
570 [AC_HELP_STRING([--enable-embeddable],
571 [enable self-contained, embeddable, zero-configuration ImageMagick])],
572 [enable_embeddable=$enableval],
573 [enable_embeddable='no'])
575 if test "$enable_embeddable" = 'yes'; then
576 AC_DEFINE(EMBEDDABLE_SUPPORT,1,[Build self-contained, embeddable, zero-configuration ImageMagick])
579 # Build a high dynamic range version of ImageMagick.
580 AC_ARG_ENABLE([hdri],
581 [AC_HELP_STRING([--enable-hdri],
582 [accurately represent the wide range of intensity levels found in real scenes])],
583 [enable_hdri=$enableval],
587 if test "$enable_hdri" = 'yes'; then
589 AC_DEFINE(HDRI_SUPPORT,1,[accurately represent the wide range of intensity levels in real scenes])
590 MAGICK_FEATURES="HDRI $MAGICK_FEATURES"
592 AC_SUBST(MAGICK_HDRI)dnl
594 # Build a version of ImageMagick with assert statements.
595 AC_ARG_ENABLE([assert],
596 [AC_HELP_STRING([--disable-assert],
597 [disable assert() statements in build])],
598 [enable_assert=$enableval],
599 [enable_assert='yes'])
601 if test "$enable_assert" = 'no'; then
602 AC_DEFINE(NDEBUG,1,[Turn off assert statements])
605 # Add configure option --enable-maintainer-mode which enables dependency
606 # checking and generation useful to package maintainers. This is made an
607 # option to avoid confusing end users.
611 # Enable ccmalloc memory debugging support
612 AC_ARG_ENABLE([ccmalloc],
613 [AC_HELP_STRING([--enable-ccmalloc],
614 [enable 'ccmalloc' memory debug support])],
615 [enable_ccmalloc=$enableval],
616 [enable_ccmalloc='no'])
618 # Enable Electric Fence memory debugging support
619 AC_ARG_ENABLE([efence],
620 [AC_HELP_STRING([--enable-efence],
621 [enable 'efence' memory debug support])],
622 [enable_efence=$enableval],
623 [enable_efence='no'])
625 # Enable prof-based profiling support
626 AC_ARG_ENABLE([prof],
627 [AC_HELP_STRING([--enable-prof],
628 [enable 'prof' profiling support])],
629 [enable_prof=$enableval],
632 # Enable gprof-based profiling support
633 AC_ARG_ENABLE([gprof],
634 [AC_HELP_STRING([--enable-gprof],
635 [enable 'gprof' profiling support])],
636 [enable_gprof=$enableval],
639 # Enable gcov-based profiling support
640 AC_ARG_ENABLE([gcov],
641 [AC_HELP_STRING([--enable-gcov],
642 [enable 'gcov' profiling support])],
643 [enable_gcov=$enableval],
646 enable_profiling='no'
647 if test "$enable_prof" = 'yes' || test "$enable_gprof" = 'yes' || test "$enable_gcov" = 'yes'; then
648 enable_profiling='yes'
649 if test "$libtool_build_shared_libs" = 'yes'; then
650 echo "Warning: Can not profile code using shared libraries"
654 # Magick API method prefix
655 AC_ARG_WITH([method-prefix],
656 [AC_HELP_STRING([--with-method-prefix=PREFIX],
657 [prefix MagickCore API methods])],
658 [with_method_prefix=$enableval],
659 [with_method_prefix=''])
661 if test "$with_method_prefix" != ''; then
662 AC_DEFINE_UNQUOTED(NAMESPACE_PREFIX,$with_method_prefix,[Magick API method prefix])
665 # Number of bits in a Quantum
666 AC_ARG_WITH([quantum-depth],
667 [AC_HELP_STRING([--with-quantum-depth=DEPTH],
668 [number of bits in a pixel quantum (default 16)])],
669 [with_quantum_depth=$withval],
670 [with_quantum_depth=16])
672 if test "$with_quantum_depth" != '8'; then
673 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-quantum-depth=$with_quantum_depth "
676 case "${with_quantum_depth}" in
681 * ) AC_MSG_ERROR("Pixel quantum depth must have value of 8, 16, 32, or 64") ;;
683 if test "$enable_hdri" = 'yes'; then
684 with_quantum_depth=16
686 QUANTUM_DEPTH="$with_quantum_depth"
687 AC_DEFINE_UNQUOTED(QUANTUM_DEPTH,$QUANTUM_DEPTH,[Number of bits in a pixel Quantum (8/16/32/64)])
688 AC_SUBST(QUANTUM_DEPTH)dnl
690 # Set pixel cache threshold
692 [AC_HELP_STRING([--with-cache=THRESHOLD],
693 [set pixel cache threshhold in MB (default available memory)])],
694 [with_cache=$withval],
697 if test "$with_cache" != ''; then
698 AC_DEFINE_UNQUOTED(PixelCacheThreshold,$with_cache,[Pixel cache threshold in MB (defaults to available memory)])
699 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-cache=$with_cache "
702 # Disable/Enable support for full delegate paths
703 AC_ARG_WITH([frozenpaths],
704 [AC_HELP_STRING([--with-frozenpaths],
705 [freeze delegate paths])],
706 [with_frozenpaths=$withval],
707 [with_frozenpaths='no'])
709 # Enable build/install of Magick++
710 AC_ARG_WITH([magick-plus-plus],
711 [AC_HELP_STRING([--without-magick-plus-plus],
712 [disable build/install of Magick++])],
713 [with_magick_plus_plus=$withval],
714 [with_magick_plus_plus='yes'])
716 # Disable build/install of PerlMagick.
718 [AC_HELP_STRING([--with-perl],
719 [enable build/install of PerlMagick])],
720 [with_perl=$withval],
723 # Options to pass when configuring PerlMagick
724 AC_ARG_WITH([perl-options],
725 [AC_HELP_STRING([--with-perl-options=OPTIONS],
726 [options to pass on command-line when generating PerlMagick's build file])],
727 PERL_MAKE_OPTIONS=$withval)
728 AC_SUBST(PERL_MAKE_OPTIONS)
730 # Enable umem, object-caching memory allocation library.
732 [ --with-umem enable umem memory allocation library support],
733 [with_umem=$withval],
735 if test "$with_umem" != 'yes' ; then
736 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-umem=$with_umem "
740 # Specify path to shared libstdc++ if not in normal location
742 AC_ARG_WITH([libstdc],
743 [AC_HELP_STRING([--with-libstdc=DIR],
744 [ use libstdc++ in DIR (for GNU C++)])],
745 [with_libstdc=$withval],
748 if test "$with_libstdc" != ''; then
749 if test -d "$with_libstdc"; then
750 LIBSTDCLDFLAGS="-L$with_libstdc"
753 AC_SUBST(LIBSTDCLDFLAGS)
755 # Does gcc required -traditional?
756 AC_PROG_GCC_TRADITIONAL
760 # Set defines required to build DLLs and modules using MinGW
763 # These options are set for multi-thread DLL module build
764 # libMagickCore: _DLL _MAGICKMOD_ _MAGICKLIB_
766 # executable/Magick++: _DLL _MAGICKMOD_
767 MODULE_EXTRA_CPPFLAGS=''
768 LIBRARY_EXTRA_CPPFLAGS=''
769 if test "${native_win32_build}" = 'yes'; then
770 if test "${libtool_build_shared_libs}" = 'yes'; then
771 CPPFLAGS="$CPPFLAGS -D_DLL"
772 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_DLL"
773 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_DLL"
774 LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKLIB_"
775 if test "$with_modules" = 'yes'; then
776 LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKMOD_"
778 MODULE_EXTRA_CPPFLAGS="$MODULE_EXTRA_CPPFLAGS -D_MAGICKLIB_"
781 CPPFLAGS="$CPPFLAGS -D_LIB"
782 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_LIB"
783 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_LIB"
785 if test "$with_threads" = 'yes'; then
786 CPPFLAGS="$CPPFLAGS -D_MT"
787 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_MT"
788 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_MT"
791 AC_SUBST(MODULE_EXTRA_CPPFLAGS)
792 AC_SUBST(LIBRARY_EXTRA_CPPFLAGS)
794 # Check standard headers
796 if ! test x"$ac_cv_header_stdc" = x"yes"; then
797 AC_MSG_WARN([configure has detected that you do not have the ANSI standard C
798 header files. Compilation cannot proceed. Please install the ANSI C
799 headers and rerun this script.]);
804 # Check additional headers
805 AC_CHECK_HEADERS(arm/limits.h complex.h errno.h fcntl.h limits.h linux/unistd.h locale.h machine/param.h mach-o/dyld.h OS.h process.h stdarg.h sys/ipc.h sys/resource.h sys/syslimits.h sys/time.h sys/timeb.h sys/times.h sys/wait.h wchar.h)
809 # Checks for typedefs, structures, and compiler characteristics.
822 # If the C compiler supports the keyword inline, do nothing. Otherwise
823 # define inline to __inline__ or __inline if it accepts one of those,
824 # otherwise define inline to be empty.
827 # If the C compiler supports the keyword restrict, do nothing. Otherwise
828 # define restrict to __restrict__ or __restrict if it accepts one of those,
829 # otherwise define restrict to be empty.
832 # If words are stored with the most significant byte first (like
833 # Motorola and SPARC CPUs), define `WORDS_BIGENDIAN'.
836 # Define mode_t to a suitable type, if standard headers do not define it.
839 # Define off_t to a suitable type, if standard headers do not define it.
842 # Define pid_t to a suitable type, if standard headers do not define it.
845 # Define size_t to a suitable type, if standard headers do not define it.
848 # Define ssize_t to a suitable type, if standard headers do not define it.
851 # If the C compiler supports a working long double type with more range
852 # or precision than the double type, define HAVE_LONG_DOUBLE.
853 AC_TYPE_LONG_DOUBLE_WIDER
855 # If the C type char is unsigned, define __CHAR_UNSIGNED__, unless the
856 # C compiler predefines it.
859 # Obtain size of an 'signed short' and define as SIZEOF_SIGNED_SHORT
860 AC_CHECK_SIZEOF(signed short)
862 # Obtain size of an 'unsigned short' and define as SIZEOF_UNSIGNED_SHORT
863 AC_CHECK_SIZEOF(unsigned short)
865 # Obtain size of an 'signed int' and define as SIZEOF_SIGNED_INT
866 AC_CHECK_SIZEOF(signed int)
868 # Obtain size of an 'unsigned int' and define as SIZEOF_UNSIGNED_INT
869 AC_CHECK_SIZEOF(unsigned int)
871 # Obtain size of a 'signed long' and define as SIZEOF_SIGNED_LONG
872 AC_CHECK_SIZEOF(signed long)
874 # Obtain size of a 'unsigned long' and define as SIZEOF_UNSIGNED_LONG
875 AC_CHECK_SIZEOF(unsigned long)
877 # Obtain size of a 'long long' and define as SIZEOF_SIGNED_LONG_LONG. If
878 # 'signed long long' is not supported then the value defined is zero.
879 AC_CHECK_SIZEOF(signed long long)
881 # Obtain size of a 'unsigned long long' and define as
882 # SIZEOF_UNSIGNED_LONG_LONG. If 'unsigned long long' is not
883 # supported then the value defined is zero.
884 AC_CHECK_SIZEOF(unsigned long long)
886 # Obtain size of off_t and define as SIZEOF_OFF_T
887 AC_CHECK_SIZEOF(off_t)
889 # Obtain size of size_t and define as SIZEOF_SIZE_T
890 AC_CHECK_SIZEOF(size_t)
892 # Obtain size of ssize_t and define as SIZEOF_SSIZE_T
893 AC_CHECK_SIZEOF(ssize_t)
895 # Obtain size of an unsigned int pointer and define as SIZEOF_UNSIGNED_INTP
896 AC_CHECK_SIZEOF(unsigned int*)
899 # Compute sized types for current CPU and compiler options.
902 AC_MSG_CHECKING(for signed 8-bit type)
904 AC_MSG_RESULT($INT8_T)
907 AC_MSG_CHECKING(for unsigned 8-bit type)
908 UINT8_T='unsigned char'
909 AC_MSG_RESULT($UINT8_T)
912 AC_MSG_CHECKING(for signed 16-bit type)
913 INT16_T='signed short'
914 AC_MSG_RESULT($INT16_T)
917 AC_MSG_CHECKING(for unsigned 16-bit type)
918 UINT16_T='unsigned short'
919 AC_MSG_RESULT($UINT16_T)
922 AC_MSG_CHECKING(for signed 32-bit type)
924 if test $ac_cv_sizeof_signed_int -eq 4; then
926 elif test $ac_cv_sizeof_signed_long -eq 4; then
927 INT32_T='signed long'
929 AC_MSG_RESULT($INT32_T)
932 AC_MSG_CHECKING(for unsigned 32-bit type)
934 if test $ac_cv_sizeof_unsigned_int -eq 4; then
935 UINT32_T='unsigned int'
936 elif test $ac_cv_sizeof_unsigned_long -eq 4; then
937 UINT32_T='unsigned long'
939 AC_MSG_RESULT($UINT32_T)
942 AC_MSG_CHECKING(for signed 64-bit type)
944 if test $ac_cv_sizeof_signed_long -eq 8; then
945 INT64_T='signed long'
946 elif test $ac_cv_sizeof_signed_long_long -eq 8; then
947 INT64_T='signed long long'
949 AC_MSG_RESULT($INT64_T)
952 AC_MSG_CHECKING(for unsigned 64-bit type)
954 if test $ac_cv_sizeof_unsigned_long -eq 8; then
955 UINT64_T='unsigned long'
956 elif test $ac_cv_sizeof_unsigned_long_long -eq 8; then
957 UINT64_T='unsigned long long'
959 AC_MSG_RESULT($UINT64_T)
962 AC_MSG_CHECKING(for unsigned maximum type)
964 if test "$UINT64_T" != 'none'; then
966 elif test "$UINT32_T" != 'none'; then
969 AC_MSG_RESULT($UINTMAX_T)
972 AC_MSG_CHECKING(for pointer difference type)
974 if test $ac_cv_sizeof_unsigned_long -eq $ac_cv_sizeof_unsigned_intp; then
975 UINTPTR_T='unsigned long'
976 elif test $ac_cv_sizeof_unsigned_long_long -eq $ac_cv_sizeof_unsigned_intp; then
977 UINTPTR_T='unsigned long long'
979 AC_MSG_RESULT($UINTPTR_T)
982 AC_MSG_CHECKING([whether our compiler supports __func__])
984 [{ const char *func = __func__; return(func != 0 ? 0 : 1); }],
985 AC_MSG_RESULT([yes]),
987 AC_MSG_CHECKING([whether our compiler supports __FUNCTION__])
989 [{ const char *func = __FUNCTION__; return(func != 0 ? 0 : 1); }],
991 AC_DEFINE(__func__, __FUNCTION__,
992 [Define to appropriate substitue if compiler does not have __func__]),
994 AC_DEFINE(__func__, __FILE__,
995 [Define to appropriate substitue if compiler does not have __func__])))
999 # Check for functions
1002 MAGICK_FUNC_MMAP_FILEIO
1003 AC_FUNC_CLOSEDIR_VOID
1007 AC_FUNC_SELECT_ARGTYPES
1008 AC_FUNC_SETVBUF_REVERSED
1017 AC_CHECK_LIB(m,sqrt,MATH_LIBS="-lm",,)
1018 LIBS="$MATH_LIBS $LIBS"
1021 AC_CHECK_FUNCS([atoll atexit cabs carg cimag creal clock ctime_r directio _exit execvp fchmod floor fork ftime ftruncate getc_unlocked getcwd getpid getexecname getdtablesize getpagesize getrlimit getrusage gettimeofday gmtime_r j0 j1 lltostr localtime_r lstat memmove memset mkstemp munmap nanosleep _NSGetExecutablePath pclose _pclose poll popen _popen posix_fadvise posix_fallocate posix_madvise posix_memalign posix_spawnp pow pread pwrite qsort_r raise rand_r readlink readdir_r realpath select seekdir setlocale sqrt setvbuf stat strchr strerror_r strrchr strcspn strdup strpbrk strspn strstr strtol strtoul symlink sysconf sigemptyset sigaction spawnvp strerror strlcat strlcpy strcasecmp strncasecmp telldir tempnam times ulltostr usleep utime vsprintf vsnprintf waitpid _wfopen _wstat])
1024 # Check for clock_gettime().
1026 AC_SEARCH_LIBS(clock_gettime, rt,
1028 AC_DEFINE([HAVE_CLOCK_GETTIME],[1],[Define to 1 if you have clock_gettime.])
1029 AC_MSG_CHECKING([whether clock_gettime supports CLOCK_REALTIME])
1032 [[#include <time.h>]],
1033 [[clockid_t clockType = CLOCK_REALTIME;]])],
1036 AC_DEFINE([HAVE_CLOCK_REALTIME],[1],
1037 [Define to 1 if clock_gettime supports CLOCK_REALTIME.])
1043 AC_CHECK_FUNCS([gettimeofday ftime], [break])
1049 # Check for function prototypes
1053 AC_CHECK_DECLS([pread, pwrite],[],[],[
1054 #include <unistd.h>])
1056 AC_CHECK_DECLS([strlcpy],[],[],[
1057 #include <strings.h>])
1059 AC_CHECK_DECLS([vsnprintf],[],[],[
1061 #include <stdarg.h>])
1065 # C++ Support Tests (For Magick++)
1068 have_magick_plus_plus='no'
1069 if test "$with_magick_plus_plus" = 'yes'; then
1074 # Full set of headers used...
1075 # algorithm cctype cerrno cmath cstdio cstdlib cstring ctime exception
1076 # functional iomanip iosfwd iostream iterator list string strstream utility
1081 AX_CXX_NAMESPACE_STD
1082 AC_CXX_HAVE_STD_LIBS
1086 AC_MSG_CHECKING([whether C++ compiler is sufficient for Magick++])
1088 test $ax_cv_cxx_bool = 'yes' && \
1089 test $ax_cv_cxx_namespaces = 'yes' && \
1090 test $ac_cv_cxx_have_std_libs = 'yes' && \
1091 test $ax_cv_cxx_have_std_namespace = 'yes'; then
1092 have_magick_plus_plus='yes'
1094 have_magick_plus_plus='no (failed tests)'
1096 AC_MSG_RESULT([$have_magick_plus_plus])
1099 AM_CONDITIONAL(WITH_MAGICK_PLUS_PLUS, test "$have_magick_plus_plus" = 'yes')
1101 # Only check for delegate libraries in subdirectories if requested.
1102 if test "$enable_delegate_build" != 'no'; then
1103 # Check for delegate sub-directories and add -I & -L options as required.
1104 # This presumes that delegates are installed as detailed in the ImageMagick
1105 # README. If delegates are installed in a standard location where the
1106 # compiler will automatically find them then these options should not be
1110 # Most delegates have includes in the same directory as the library, but not all...
1113 for dir in bzlib fftw fpx gslib/src jp2 jp2/src/libjasper/include jbig/libjbig jpeg lcms/include lzma magick png tiff/libtiff ttf/include wand wmf/include xml/include zlib; do
1114 if test -d "$builddir/$dir"; then
1115 CPPFLAGS="$CPPFLAGS -I$builddir/$dir"
1117 if test -d "$srcdirfull/$dir"; then
1118 CPPFLAGS="$CPPFLAGS -I$srcdirfull/$dir"
1124 for dir in bzlib fftw fpx gslib/src jp2 jp2/src/libjasper jbig/libjbig jpeg lcms/src lzma magick png tiff/libtiff ttf/objs wand wmf/src xml zlib; do
1125 if test -d "$builddir/$dir/.libs"; then
1126 LDFLAGS="$LDFLAGS -L$builddir/$dir/.libs"
1128 if test -d "$srcdirfull/$dir/.libs"; then
1129 LDFLAGS="$LDFLAGS -L$srcdirfull/$dir/.libs"
1132 if test -d "$builddir/$dir"; then
1133 LDFLAGS="$LDFLAGS -L$builddir/$dir"
1135 if test -d "$srcdirfull/$dir"; then
1136 LDFLAGS="$LDFLAGS -L$srcdirfull/$dir"
1142 # Assume that delegate headers reside under same directory as ImageMagick
1143 # installation prefix.
1144 MAGICK_CPPFLAGS="-I$INCLUDE_DIR/ImageMagick $MAGICK_CPPFLAGS"
1147 # Find the X11 RGB database
1149 AC_CACHE_CHECK(for X11 configure files,im_cv_x_configure,
1150 [# Look for the header file in a standard set of common directories.
1151 # Check X11 before X11Rn because it is often a symlink to the current release.
1160 /usr/XFree86/lib/X11 \
1168 /usr/local/X11/lib \
1169 /usr/local/X11R4/lib \
1170 /usr/local/X11R5/lib \
1171 /usr/local/X11R6/lib \
1173 /usr/local/lib/X11 \
1174 /usr/local/lib/X11R4 \
1175 /usr/local/lib/X11R5 \
1176 /usr/local/lib/X11R6 \
1177 /usr/local/lib/X11R7 \
1178 /usr/local/x11r5/lib \
1179 /usr/lpp/Xamples/lib \
1181 /usr/openwin/share/lib \
1182 /usr/unsupported/lib \
1185 if test -f "$ac_dir/X11/rgb.txt"; then
1186 im_cv_x_configure="$ac_dir/X11/"
1188 elif test -f "$ac_dir/rgb.txt"; then
1189 im_cv_x_configure="$ac_dir/"
1194 X11_CONFIGURE_PATH="$im_cv_x_configure"
1195 case "${build_os}" in
1197 X11ConfigurePath=`$WinPathScript "$X11ConfigurePath=" 1`
1200 AC_DEFINE_UNQUOTED(X11_CONFIGURE_PATH,"$X11ConfigurePath",Location of X11 configure files)
1203 # Find OpenMP library
1206 if test "$enable_openmp" != 'no'; then
1207 if test "${GCC}" = "yes"; then
1208 AC_CHECK_LIB(gomp,GOMP_parallel_start,GOMP_LIBS="-lgomp",,) # gcc
1210 AC_CHECK_LIB(mtsk,sunw_mp_register_warn,GOMP_LIBS="-lmtsk",,) # solaris cc
1211 AC_CHECK_LIB(xlsmp,_xlsmpFlush,GOMP_LIBS="-lxlsmp",,) # AIX xlc
1212 AC_CHECK_LIB(mp,mp_destroy,GOMP_LIBS="-lmp",,) # SGI IRIX 6.5 MIPSpro C/C++
1214 LIBS="$GOMP_LIBS $LIBS"
1219 # Find Posix threads library
1222 if test "$with_threads" != 'no' && test "$have_threads" = 'yes'; then
1224 if test "x$PTHREAD_LIBS" = "x"; then
1225 case "${host_cpu}-${host_os}" in
1227 MAGICK_CHECK_PTHREAD_LIB(c_r,PTHREAD_LIBS=-lc_r) ;;
1231 for lib in pthread pthreads; do
1232 if test "x$PTHREAD_LIBS" = "x"; then
1233 MAGICK_CHECK_PTHREAD_LIB([$lib],[PTHREAD_LIBS=-l$lib])
1237 THREAD_LIBS="$PTHREAD_LIBS"
1238 LIBS="$LIBS $THREAD_LIBS"
1240 AC_SUBST(THREAD_LIBS)
1247 if test "$with_umem" != 'no'; then
1248 AC_MSG_CHECKING(for UMEM support )
1252 AC_CHECK_HEADER(umem.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1253 AC_CHECK_LIB(umem,umem_alloc,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1254 AC_CHECK_LIB(umem,umem_free,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1255 AC_MSG_CHECKING(if umem memory allocation library is complete)
1256 if test $passed -gt 0; then
1257 if test $failed -gt 0; then
1258 AC_MSG_RESULT(no -- some components failed test)
1259 have_umem='no (failed tests)'
1262 LIBS="$UMEM_LIBS $LIBS"
1263 AC_DEFINE(HasUMEM,1,Define if you have umem memory allocation library)
1271 AM_CONDITIONAL(HasUMEM, test "$have_umem" = 'yes')
1275 # Add support for ccmalloc memory debugging library if requested
1279 if test "$enable_ccmalloc" = 'yes'; then
1280 AC_PATH_PROG(CCMALLOCDelegate,ccmalloc,)
1281 if test -n "$CCMALLOCDelegate"; then
1282 eval `grep PREFIX= $CCMALLOCDelegate | sed -e 's/PREFIX/CCMALLOC_PREFIX/'`
1284 # Assume that gcc is used with ccmalloc.
1285 LIBS="$LIBS $CCMALLOC_PREFIX/lib/ccmalloc-gcc.o"
1286 AC_CHECK_LIB(ccmalloc,ccmalloc_malloc,CCMALLOC_LIBS="$CCMALLOC_PREFIX/lib/ccmalloc-gcc.o -lccmalloc -ldl",,-ldl)
1287 if test -n "$CCMALLOC_LIBS"; then
1289 LIBS="$LIBS $CCMALLOC_LIBS"
1298 # Add support for efence memory debugging library if requested
1300 if test "$enable_efence" = 'yes'; then
1301 EFENCE_LIBS='-lefence'
1302 LIBS="$EFENCE_LIBS $LIBS"
1305 dnl ===========================================================================
1311 AC_ARG_WITH([bzlib],
1312 [AC_HELP_STRING([--without-bzlib],
1313 [disable BZLIB support])],
1314 [with_bzlib=$withval],
1317 if test "$with_bzlib" != 'yes'; then
1318 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-bzlib=$with_bzlib "
1322 if test "$with_bzlib" != 'no'; then
1324 AC_MSG_RESULT([-------------------------------------------------------------])
1325 AC_MSG_CHECKING([for BZLIB])
1330 AC_CHECK_HEADER(bzlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1331 AC_CHECK_LIB(bz2,BZ2_bzDecompress,found_libbz=`expr $found_libbz + 1`,,)
1332 if test "$native_win32_build" = 'yes'; then
1333 AC_CHECK_LIB(bz2,_imp__BZ2_decompress,found_libbz=`expr $found_libbz + 1`,,)
1335 if test $found_libbz -gt 0; then
1336 passed=`expr $passed + 1`
1338 failed=`expr $failed + 1`
1340 AC_MSG_CHECKING(if BZLIB package is complete)
1341 if test $passed -gt 0; then
1342 if test $failed -gt 0; then
1343 AC_MSG_RESULT(no -- some components failed test)
1344 have_bzlib='no (failed tests)'
1347 LIBS="$BZLIB_LIBS $LIBS"
1348 AC_DEFINE(BZLIB_DELEGATE,1,Define if you have the bzip2 library)
1356 AM_CONDITIONAL(BZLIB_DELEGATE, test "$have_bzlib" = 'yes')
1357 AC_SUBST(BZLIB_LIBS)
1360 # Find the X11 include and library directories.
1367 if test "$no_x" != 'yes'; then
1368 AC_MSG_RESULT([-------------------------------------------------------------])
1369 AC_MSG_CHECKING([for X11])
1371 LDFLAGS="$LDFLAGS $X_LIBS"
1372 X11_LIBS="$X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
1373 LIBS="$X11_LIBS $LIBS"
1374 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1376 AC_DEFINE(X11_DELEGATE,1,Define if you have X11 library)dnl
1379 # Check for X11 shared memory extension
1381 # shmctl is required to support the shared memory extension
1382 AC_CHECK_FUNC([shmctl],[have_shmctl='yes'],[])
1383 if test "$have_shmctl" != 'yes'; then
1385 LIBS="$LIBS -lcygipc"
1386 AC_TRY_LINK_FUNC([shmctl],[have_shmctl='yes'; IPC_LIBS='-lcygipc'],[])
1390 if test "$have_shmctl" = 'yes'; then
1391 AC_CHECK_LIB([Xext],[XShmAttach],[XEXT_LIBS='-lXext' ; AC_DEFINE(HAVE_SHARED_MEMORY,1,X11 server supports shared memory extension)],[],[])
1395 # Check for X11 shape extension
1397 AC_CHECK_LIB([Xext],[XShapeCombineMask],[XEXT_LIBS='-lXext' ; AC_DEFINE(HAVE_SHAPE,1,X11 server supports shape extension)],[],[])
1398 AC_CHECK_LIB(Xt,XtSetEventDispatcher,XT_LIBS='-lXt',,)
1399 LIBS="$XEXT_LIBS $XT_LIBS $LIBS"
1401 if test "$no_x" != 'yes'; then
1406 AM_CONDITIONAL(X11_DELEGATE, test "$have_x" = 'yes')
1410 dnl ===========================================================================
1416 [AC_HELP_STRING([--without-zlib],
1417 [disable ZLIB support])],
1418 [with_zlib=$withval],
1421 if test "$with_zlib" != 'yes'; then
1422 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-zlib=$with_zlib "
1427 dnl PNG requires zlib so enable zlib check if PNG is requested
1428 if test "$with_zlib" != 'no' || test "$with_png" != 'no'; then
1429 AC_MSG_RESULT([-------------------------------------------------------------])
1430 AC_MSG_CHECKING([for ZLIB])
1435 AC_CHECK_HEADER(zconf.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1436 AC_CHECK_HEADER(zlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1437 AC_CHECK_LIB(z,compress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1438 AC_CHECK_LIB(z,uncompress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1439 AC_CHECK_LIB(z,deflate,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1440 AC_CHECK_LIB(z,inflate,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1441 AC_CHECK_LIB(z,gzseek,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1442 AC_CHECK_LIB(z,gztell,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1443 AC_MSG_CHECKING([if ZLIB package is complete])
1444 if test $passed -gt 0; then
1445 if test $failed -gt 0; then
1446 AC_MSG_RESULT([no -- some components failed test])
1447 have_zlib='no (failed tests)'
1450 LIBS="$ZLIB_LIBS $LIBS"
1451 AC_DEFINE(ZLIB_DELEGATE,1,Define if you have zlib compression library)
1452 AC_MSG_RESULT([yes])
1459 AM_CONDITIONAL(ZLIB_DELEGATE, test "$have_zlib" = 'yes')
1463 # If profiling, then check for -ldl and dlopen (required for Solaris & gcc)
1466 if test "$enable_profiling" = 'yes'; then
1467 AC_CHECK_LIB(dl,dlopen,LIB_DL='-ldl',,)
1468 LIBS="$LIB_DL $LIBS"
1472 dnl ===========================================================================
1475 # Check for Autotrace delegate library.
1477 AC_ARG_WITH([autotrace],
1478 [AC_HELP_STRING([--with-autotrace],
1479 [enable autotrace support])],
1480 [with_autotrace=$withval],
1481 [with_autotrace='no'])
1483 if test "$with_autotrace" != 'yes'; then
1484 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-autotrace=$with_autotrace "
1491 if test "x$with_autotrace" = "xyes"; then
1492 AC_MSG_RESULT([-------------------------------------------------------------])
1493 PKG_CHECK_MODULES(AUTOTRACE,[autotrace >= 0.31.1], have_autotrace=yes, have_autotrace=no)
1497 if test "$have_autotrace" = 'yes'; then
1499 AC_DEFINE(AUTOTRACE_DELEGATE,1,Define if you have AUTOTRACE library)
1500 if test "$with_modules" = 'no'; then
1501 CPPFLAGS="$AUTOTRACE_CFLAGS $CPPFLAGS"
1505 AM_CONDITIONAL(AUTOTRACE_DELEGATE,test "$have_autotrace" = 'yes')
1506 AC_SUBST(AUTOTRACE_CFLAGS)
1507 AC_SUBST(AUTOTRACE_LIBS)
1509 dnl ===========================================================================
1512 # Check for Display Postscript delegate library.
1515 [AC_HELP_STRING([--without-dps],
1516 [disable Display Postscript support])],
1517 [with_dps=$withval],
1520 if test "$with_dps" != 'yes'; then
1521 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-dps=$with_dps "
1526 if test "$with_dps" != 'no' && test "$with_x" != 'no'; then
1527 AC_MSG_RESULT([-------------------------------------------------------------])
1528 AC_MSG_CHECKING([for DPS])
1532 PERSIST_CPPFLAGS="$CPPFLAGS"
1533 CPPFLAGS="$CPPFLAGS -I${ac_x_includes}/X11"
1534 AC_CHECK_HEADER(DPS/dpsXclient.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1536 # XFree86-4.x needs -lXt to provide XtMalloc for -ldps.
1537 # Cygwin doesn't deliver -lXt as a DLL, which prevents a DLL build.
1538 # Adobe DPS (as delivered on Solaris) doesn't require -lXt.
1539 # ImageMagick itself doesn't use -lXt.
1542 AC_CHECK_LIB(dps,DPSInitialize,have_libdps='yes',have_libdps='no',)
1543 if test "$have_libdps" != 'yes'; then
1544 # Unset cache variable so we can try again.
1545 unset ac_cv_lib_dps_DPSInitialize
1546 AC_CHECK_LIB(dps,DPSInitialize,have_libdps='yes',have_libdps='no',-lXt)
1547 if test "$have_libdps" = 'yes'; then
1551 if test "$have_libdps" = 'yes'; then
1552 passed=`expr $passed + 1`
1554 failed=`expr $failed + 1`
1556 AC_CHECK_LIB(dpstk,XDPSPixelsPerPoint,passed=`expr $passed + 1`,failed=`expr $failed + 1`,-ldps $LIBDPS_XT)
1557 AC_MSG_CHECKING([if DPS package is complete])
1558 if test $passed -gt 0; then
1559 if test $failed -gt 0; then
1560 AC_MSG_RESULT([no -- some components failed test])
1561 have_dps='no (failed tests)'
1562 CPPFLAGS="$PERSIST_CPPFLAGS"
1564 DPS_LIBS="-ldpstk -ldps ${LIBDPS_XT}"
1565 LIBS="$DPS_LIBS $LIBS"
1566 AC_DEFINE(DPS_DELEGATE,1,Define if you have Display Postscript)
1567 AC_MSG_RESULT([yes])
1572 CPPFLAGS=$PERSIST_CPPFLAGS
1575 AM_CONDITIONAL(DPS_DELEGATE, test "$have_dps" = 'yes')
1578 dnl ===========================================================================
1581 # Check for DJVU delegate library.
1584 [AC_HELP_STRING([--without-djvu],
1585 [disable DjVu support])],
1586 [with_djvu=$withval],
1589 if test "$with_djvu" != 'yes'; then
1590 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-djvu=$with_djvu "
1595 if test "$with_djvu" != 'no'; then
1596 AC_MSG_RESULT([-------------------------------------------------------------])
1597 AC_MSG_CHECKING([for DJVU])
1601 AC_CHECK_HEADER(libdjvu/ddjvuapi.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1602 AC_CHECK_LIB(djvulibre,ddjvu_context_create,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1603 AC_MSG_CHECKING([if DJVU package is complete])
1604 if test $passed -gt 0; then
1605 if test $failed -gt 0; then
1606 AC_MSG_RESULT([no -- some components failed test])
1607 have_djvu='no (failed tests)'
1609 DJVU_LIBS='-ldjvulibre'
1610 LIBS="$DJVU_LIBS $LIBS"
1611 AC_DEFINE(DJVU_DELEGATE,1,Define if you have DJVU library)
1612 AC_MSG_RESULT([yes])
1619 AM_CONDITIONAL(DJVU_DELEGATE, test "$have_djvu" = 'yes')
1622 dnl ===========================================================================
1625 # Set DejaVu font directory.
1627 AC_ARG_WITH([dejavu-font-dir],
1628 [AC_HELP_STRING([--with-dejavu-font-dir=DIR],
1629 [DejaVu font directory])],
1630 [with_dejavu_font_dir=$withval],
1631 [with_dejavu_font_dir='default'])
1633 if test "$with_dejavu_font_dir" != 'default'; then
1634 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-dejavu-font-dir=$with_dejavu_font_dir "
1637 dnl ===========================================================================
1640 # Check for FFTW delegate library.
1643 [AC_HELP_STRING([--without-fftw],
1644 [disable FFTW support])],
1645 [with_fftw=$withval],
1648 if test "$with_fftw" != 'yes'; then
1649 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fftw=$with_fftw "
1654 if test "$with_fftw" != 'no'; then
1655 AC_MSG_RESULT([-------------------------------------------------------------])
1656 AC_MSG_CHECKING([for FFTW])
1660 AC_CHECK_HEADER(fftw3.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1661 AC_CHECK_LIB(fftw3,fftw_execute,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1662 AC_MSG_CHECKING([if FFTW package is complete])
1663 if test $passed -gt 0; then
1664 if test $failed -gt 0; then
1665 AC_MSG_RESULT([no -- some components failed test])
1666 have_fftw='no (failed tests)'
1669 LIBS="$FFTW_LIBS $LIBS"
1670 AC_DEFINE(FFTW_DELEGATE,1,Define if you have FFTW library)
1671 AC_MSG_RESULT([yes])
1678 AM_CONDITIONAL(FFTW_DELEGATE, test "$have_fftw" = 'yes')
1681 dnl ===========================================================================
1684 # Check for FlashPIX delegate library.
1687 [AC_HELP_STRING([--without-fpx],
1688 [disable FlashPIX support])],
1689 [with_fpx=$withval],
1692 if test "$with_fpx" != 'yes'; then
1693 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fpx=$with_fpx "
1698 if test "$with_fpx" != 'no'; then
1699 AC_MSG_RESULT([-------------------------------------------------------------])
1700 AC_MSG_CHECKING([for FlashPIX])
1705 AC_CHECK_HEADER(fpxlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1706 AC_CHECK_LIB(fpx,FPX_OpenImageByFilename,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1708 AC_MSG_CHECKING([if FlashPIX package is complete])
1709 if test $passed -gt 0; then
1710 if test $failed -gt 0; then
1711 AC_MSG_RESULT([no -- some components failed test])
1712 have_fpx='no (failed tests)'
1715 AC_DEFINE(FPX_DELEGATE,1,Define if you have FlashPIX library)
1716 AC_MSG_RESULT([yes])
1724 AM_CONDITIONAL(FPX_DELEGATE, test "$have_fpx" = 'yes')
1727 dnl ===========================================================================
1730 # Check for fontconfig delegate library.
1732 AC_ARG_WITH([fontconfig],
1733 [AC_HELP_STRING([--without-fontconfig],
1734 [disable fontconfig support])],
1735 [with_fontconfig=$withval],
1736 [with_fontconfig=$have_x])
1738 if test "$with_fontconfig" != 'yes'; then
1739 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontconfig=$with_fontconfig "
1742 have_fontconfig='no'
1743 FONTCONFIG_CFLAGS=""
1746 if test "x$with_fontconfig" = "xyes"; then
1747 AC_MSG_RESULT([-------------------------------------------------------------])
1748 PKG_CHECK_MODULES(FONTCONFIG,[fontconfig >= 2.1.0], have_fontconfig=yes, have_fontconfig=no)
1752 if test "$have_fontconfig" = 'yes'; then
1753 AC_DEFINE(FONTCONFIG_DELEGATE,1,Define if you have FONTCONFIG library)
1754 if test "$with_modules" = 'no'; then
1755 CPPFLAGS="$FONTCONFIG_CFLAGS $CPPFLAGS"
1759 AM_CONDITIONAL(FONTCONFIG_DELEGATE,test "$have_fontconfig" = 'yes')
1760 AC_SUBST(FONTCONFIG_CFLAGS)
1761 AC_SUBST(FONTCONFIG_LIBS)
1763 dnl ===========================================================================
1766 # Check for freetype delegate library.
1768 AC_ARG_WITH([freetype],
1769 [AC_HELP_STRING([--without-freetype],
1770 [disable Freetype support])],
1771 [with_freetype=$withval],
1772 [with_freetype='yes'])
1775 if test "$with_freetype" != 'yes'; then
1776 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-freetype=$with_freetype "
1781 if test "$with_freetype" != 'no'; then
1782 AC_MSG_RESULT([-------------------------------------------------------------])
1783 AC_MSG_CHECKING([for FreeType 2.0])
1787 PERSIST_LIBS="$LIBS"
1788 PERSIST_CPPFLAGS="$CPPFLAGS"
1789 if test "$enable_delegate_build" != 'no' && test -d "$builddir/freetype/include"; then
1793 AC_CHECK_PROGS(freetype_config,freetype-config,)dnl
1794 if test -n "$freetype_config"; then
1795 freetype_cflags=`$freetype_config --cflags`
1796 freetype_libs=`$freetype_config --libs`
1797 LIBS="$LIBS $freetype_libs"
1798 CPPFLAGS="$freetype_cflags $CPPFLAGS"
1802 dnl First see if there is a library
1803 if test "$FREETYPE_LIBS" = ''; then
1804 AC_CHECK_LIB(freetype,FT_Init_FreeType,FREETYPE_LIBS='-lfreetype',,)
1805 if test "$FREETYPE_LIBS" != ''; then
1806 passed=`expr $passed + 1`
1808 failed=`expr $failed + 1`
1809 LIBS="$PERSIST_LIBS"
1813 dnl Now test for the headers
1814 AC_CHECK_HEADER([ft2build.h],[FT2BUILD_H='#include <ft2build.h>'],[ft2build=''],[])
1815 AC_CHECK_HEADER(freetype/freetype.h,[have_freetype_h='yes'],[have_freetype_h='no'],[$FT2BUILD_H])
1816 if test "$ac_cv_header_ft2build_h" = 'yes' || test "$have_freetype_h" = 'yes'; then
1817 passed=`expr $passed + 1`
1819 failed=`expr $failed + 1`
1820 CPPFLAGS="$PERSIST_CPPFLAGS"
1823 AC_MSG_CHECKING([if FreeType package is complete])
1824 if test $passed -gt 0; then
1825 if test $failed -gt 0; then
1827 AC_MSG_RESULT([no -- some components failed test])
1828 have_freetype='no (failed tests)'
1830 LIBS="$FREETYPE_LIBS $LIBS"
1831 AC_DEFINE(FREETYPE_DELEGATE,1,Define if you have FreeType (TrueType font) library)
1832 if test "$ac_cv_header_ft2build_h" = 'yes'; then
1833 AC_DEFINE([HAVE_FT2BUILD_H],[1],[Define to 1 if you have the <ft2build.h> header file.])
1835 AC_MSG_RESULT([yes])
1842 AM_CONDITIONAL(FREETYPE_DELEGATE,test "$have_freetype" = 'yes')
1843 AC_SUBST(FREETYPE_LIBS)
1845 dnl ===========================================================================
1847 dnl ===========================================================================
1850 # Check for Ghostscript library or framework.
1852 # Test for iapi.h & test for gsapi_new_instance in -lgs
1853 # or -framework Ghostscript
1855 AC_ARG_WITH([gslib],
1856 [AC_HELP_STRING([--without-gslib],
1857 [enable Ghostscript library support])],
1858 [with_gslib=$withval],
1861 gslib_framework='no'
1862 if test "$with_gslib" != 'yes'; then
1863 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gslib=$with_gslib "
1868 if test "$with_gslib" != 'no'; then
1869 AC_MSG_RESULT([-------------------------------------------------------------])
1870 AC_MSG_CHECKING([for Ghostscript])
1875 AC_CHECK_HEADER(ghostscript/iapi.h,passed=`expr $passed + 1`,
1876 failed=`expr $failed + 1`,)
1877 AC_CHECK_HEADER(ghostscript/ierrors.h,passed=`expr $passed + 1`,
1878 failed=`expr $failed + 1`,)
1879 AC_CHECK_FRAMEWORK(Ghostscript,gsapi_new_instance,framework=`expr $framework + 1`,
1880 AC_CHECK_LIB(gs,gsapi_new_instance,passed=`expr $passed + 1`,failed=`expr $failed + 1`,),)
1881 AC_MSG_CHECKING([if Ghostscript package is complete])
1882 if test $passed -gt 0; then
1883 if test $failed -gt 0; then
1884 AC_MSG_RESULT([no -- some components failed test])
1885 have_gslib='no (failed tests)'
1887 if test $framework -gt 0; then
1888 GS_LIBS='-framework Ghostscript'
1889 gslib_framework='yes'
1890 AC_MSG_RESULT([yes, using framework.])
1892 AC_MSG_RESULT([yes, using library.])
1895 LIBS="$GS_LIBS $LIBS"
1896 AC_DEFINE(GS_DELEGATE,1,Define if you have Ghostscript library or framework)
1903 AM_CONDITIONAL(GS_DELEGATE, test "$have_gslib" = 'yes')
1906 # Set default font search path
1907 AC_ARG_WITH([fontpath],
1908 [AC_HELP_STRING([--with-fontpath=DIR],
1909 [prepend to default font search path])],
1910 [with_fontpath=$withval],
1913 if test "$with_fontpath" != "yes" && test -z "$with_fontpath"; then
1916 AC_DEFINE_UNQUOTED(MAGICK_FONT_PATH,"$with_fontpath",Define to prepend to default font search path.)
1918 if test "$with_fontpath=" != ''; then
1919 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontpath=$with_fontpath "
1922 # Set Ghostscript font directory
1923 AC_ARG_WITH([gs-font-dir],
1924 [AC_HELP_STRING([--with-gs-font-dir=DIR],
1925 [Ghostscript font directory])],
1926 [with_gs_font_dir=$withval],
1927 [with_gs_font_dir='default'])
1929 if test "$with_gs_font_dir" != 'default'; then
1930 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gs-font-dir=$with_gs_font_dir "
1933 dnl ===========================================================================
1936 # Check for GVC delegate library.
1939 [AC_HELP_STRING([--without-gvc],
1940 [disable GVC support])],
1941 [with_gvc=$withval],
1944 if test "$with_gvc" != 'yes'; then
1945 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gvc=$with_gvc "
1949 if test "x$with_gvc" = "xyes"; then
1950 AC_MSG_RESULT([-------------------------------------------------------------])
1951 PKG_CHECK_MODULES(GVC,[libgvc >= 2.9.0], have_gvc=yes, have_gvc=no)
1955 if test "$have_gvc" = 'yes'; then
1956 AC_DEFINE(GVC_DELEGATE,1,Define if you have GVC library)
1957 if test "$with_modules" = 'no'; then
1958 CPPFLAGS="$GVC_CFLAGS $CPPFLAGS"
1962 AM_CONDITIONAL(GVC_DELEGATE, test "$have_gvc" = 'yes')
1963 AC_SUBST(GVC_CFLAGS)
1966 dnl ===========================================================================
1969 # Check for JBIG delegate library.
1973 [AC_HELP_STRING([--without-jbig],
1974 [disable JBIG support])],
1975 [with_jbig=$withval],
1980 if test "$with_jbig" != 'no'; then
1981 AC_MSG_RESULT([-------------------------------------------------------------])
1982 AC_MSG_CHECKING([for JBIG])
1986 AC_CHECK_HEADER(jbig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1987 AC_CHECK_LIB(jbig,jbg_dec_init,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1988 AC_MSG_CHECKING([if JBIG package is complete])
1989 if test $passed -gt 0; then
1990 if test $failed -gt 0; then
1991 AC_MSG_RESULT([no -- some components failed test])
1992 have_jbig='no (failed tests)'
1995 LIBS="$JBIG_LIBS $LIBS"
1996 AC_DEFINE(JBIG_DELEGATE,1,Define if you have JBIG library)
1997 AC_MSG_RESULT([yes])
2004 AM_CONDITIONAL(JBIG_DELEGATE, test "$have_jbig" = 'yes')
2007 dnl ===========================================================================
2010 # Check for JPEG delegate library.
2013 [AC_HELP_STRING([--without-jpeg],
2014 [disable JPEG support])],
2015 [with_jpeg=$withval],
2018 if test "$with_jpeg" != 'yes'; then
2019 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jpeg=$with_jpeg "
2024 if test "$with_jpeg" != 'no'; then
2025 AC_MSG_RESULT([-------------------------------------------------------------])
2026 AC_MSG_CHECKING([for JPEG])
2030 AC_CHECK_HEADER(jconfig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2031 AC_CHECK_HEADER(jerror.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2032 AC_CHECK_HEADER(jmorecfg.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2033 AC_CHECK_HEADER(jpeglib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2034 AC_CHECK_LIB(jpeg,jpeg_read_header,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2036 # Test for compatible JPEG library
2037 if test "$ac_cv_jpeg_version_ok" != 'yes'; then
2038 AC_CACHE_CHECK(for JPEG library is version 6b or later, ac_cv_jpeg_version_ok,
2042 #include <jpeglib.h>
2044 changequote(<<, >>)dnl
2046 #if JPEG_LIB_VERSION < 62
2047 #error IJG JPEG library must be version 6b or newer!
2051 changequote([, ])dnl
2052 ac_cv_jpeg_version_ok='yes'; passed=`expr $passed + 1`,
2053 ac_cv_jpeg_version_ok='no'; failed=`expr $failed + 1`)])
2055 AC_MSG_CHECKING([if JPEG package is complete])
2056 if test $passed -gt 0; then
2057 if test $failed -gt 0; then
2058 AC_MSG_RESULT([no -- some components failed test])
2059 have_jpeg='no (failed tests)'
2062 LIBS="$JPEG_LIBS $LIBS"
2063 AC_DEFINE(JPEG_DELEGATE,1,Define if you have JPEG library)
2064 AC_MSG_RESULT([yes])
2071 AM_CONDITIONAL(JPEG_DELEGATE, test "$have_jpeg" = 'yes')
2074 dnl ===========================================================================
2077 # Check for JPEG Version 2 delegate library.
2080 [AC_HELP_STRING([--without-jp2],
2081 [disable JPEG-2000 support])],
2082 [with_jp2=$withval],
2085 if test "$with_jp2" != 'yes'; then
2086 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jp2=$with_jp2 "
2091 if test "$with_jp2" != 'no'; then
2092 AC_MSG_RESULT([-------------------------------------------------------------])
2093 AC_MSG_CHECKING([for JPEG Version 2])
2097 AC_CHECK_HEADER(jasper/jasper.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2098 AC_CHECK_LIB(jasper,jas_stream_fopen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2099 AC_MSG_CHECKING([if JPEG version 2 support package is complete])
2100 if test $passed -gt 0; then
2101 if test $failed -gt 0; then
2102 AC_MSG_RESULT([no -- some components failed test])
2103 have_jp2='no (failed tests)'
2106 LIBS="$JP2_LIBS $LIBS"
2107 AC_DEFINE(JP2_DELEGATE,1,Define if you have JPEG version 2 "Jasper" library)
2108 AC_MSG_RESULT([yes])
2115 AM_CONDITIONAL(JP2_DELEGATE, test "$have_jp2" = 'yes')
2118 dnl ===========================================================================
2121 # Check for LCMS delegate library.
2125 [ --without-lcms disable lcms (v1.1X) support],
2126 [with_lcms=$withval],
2128 if test "$with_lcms" != 'yes' ; then
2129 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lcms=$with_lcms "
2134 [ --without-lcms2 disable lcms (v2.X) support],
2135 [with_lcms2=$withval],
2137 if test "$with_lcms2" != 'yes' ; then
2138 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lcms2=$with_lcms2 "
2143 if test "$with_lcms2" != 'no'; then
2144 AC_MSG_RESULT([-------------------------------------------------------------])
2145 AC_MSG_CHECKING([for LCMS v2])
2149 have_lcms_header='no'
2151 # Check for <lcms2.h>
2152 AC_CHECK_HEADER(lcms2.h,have_lcms_header='yes',,)
2153 if test "$have_lcms_header" = 'yes'; then
2154 AC_DEFINE(HAVE_LCMS2_H,1,Define if you have the <lcms2.h> header file.)
2155 passed=`expr $passed + 1`
2158 # Check for <lcms2/lcms2.h)
2159 if test "$have_lcms_header" != 'yes'; then
2160 AC_CHECK_HEADER(lcms2/lcms2.h,have_lcms_header='yes',,)
2161 if test "$have_lcms_header" = 'yes'; then
2162 passed=`expr $passed + 1`
2163 AC_DEFINE(HAVE_LCMS2_LCMS2_H,1,Define if you have the <lcms2/lcms2.h> header file.)
2167 # Failed to find lcms header?
2168 if test "$have_lcms_header" != 'yes'; then
2169 failed=`expr $failed + 1`
2172 AC_CHECK_LIB(lcms2,cmsSetLogErrorHandler,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2173 AC_MSG_CHECKING(if LCMS v2 package is complete)
2174 if test $passed -gt 0; then
2175 if test $failed -gt 0; then
2176 AC_MSG_RESULT(no -- some components failed test)
2177 have_lcms2='no (failed tests)'
2180 LIBS="$LCMS_LIBS $LIBS"
2190 # Check for LCMS v1 (1.11 or later)
2192 if test $have_lcms2 = 'yes'; then
2197 if test "$with_lcms" != 'no'; then
2198 AC_MSG_RESULT([-------------------------------------------------------------])
2199 AC_MSG_CHECKING([for LCMS v1.1X])
2203 have_lcms_header='no'
2205 # Check for <lcms.h>
2206 if test "$have_lcms_header" != 'yes'; then
2207 AC_CHECK_HEADER(lcms.h,have_lcms_header='yes',,)
2208 if test "$have_lcms_header" = 'yes'; then
2209 passed=`expr $passed + 1`
2210 AC_DEFINE(HAVE_LCMS_H,1,Define if you have the <lcms.h> header file.)
2214 # Check for <lcms/lcms.h>
2215 if test "$have_lcms_header" != 'yes'; then
2216 AC_CHECK_HEADER(lcms/lcms.h,have_lcms_header='yes',,)
2217 if test "$have_lcms_header" = 'yes'; then
2218 passed=`expr $passed + 1`
2219 AC_DEFINE(HAVE_LCMS_LCMS_H,1,Define if you have the <lcms/lcms.h> header file.)
2223 # Failed to find lcms header?
2224 if test "$have_lcms_header" != 'yes'; then
2225 failed=`expr $failed + 1`
2228 AC_CHECK_LIB(lcms,cmsSetErrorHandler,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2229 AC_MSG_CHECKING(if LCMS package is complete)
2230 if test $passed -gt 0; then
2231 if test $failed -gt 0; then
2232 AC_MSG_RESULT(no -- some components failed test)
2233 have_lcms='no (failed tests)'
2236 LIBS="$LCMS_LIBS $LIBS"
2245 AM_CONDITIONAL(LCMS_DELEGATE, test "$have_lcms2" = 'yes' -o "$have_lcms" = 'yes')
2246 if test "$have_lcms2" = 'yes' -o "$have_lcms" = 'yes'; then
2247 AC_DEFINE(LCMS_DELEGATE,1,[Define if you have LCMS (v1.11 or later) library])
2252 dnl ===========================================================================
2255 # Check for the LQR (Liquid Rescale) delegate library.
2258 [AC_HELP_STRING([--without-lqr],
2259 [disable Liquid Rescale support])],
2260 [with_lqr=$withval],
2263 if test "$with_lqr" != 'yes'; then
2264 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lqr=$with_lqr "
2271 if test "x$with_lqr" = "xyes"; then
2272 AC_MSG_RESULT([-------------------------------------------------------------])
2273 PKG_CHECK_MODULES(LQR,[lqr-1 >= 0.1.0], have_lqr=yes, have_lqr=no)
2277 if test "$have_lqr" = 'yes'; then
2278 AC_DEFINE(LQR_DELEGATE,1,Define if you have LQR library)
2279 CFLAGS="$LQR_CFLAGS $CFLAGS"
2282 AM_CONDITIONAL(LQR_DELEGATE, test "$have_lqr" = 'yes')
2283 AC_SUBST(LQR_CFLAGS)
2286 dnl ===========================================================================
2288 # Disable LZMA (lzma library)
2290 [ --without-lzma disable LZMA support],
2291 [with_lzma=$withval],
2293 if test "$with_lzma" != 'yes' ; then
2294 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lzma=$with_lzma "
2302 if test "$with_lzma" != 'no' || test "$with_tiff" != 'no'; then
2303 AC_MSG_RESULT([-------------------------------------------------------------])
2304 AC_MSG_CHECKING(for LZMA)
2308 AC_CHECK_HEADER(lzma.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2309 AC_CHECK_LIB(lzma,lzma_code,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2310 AC_MSG_CHECKING(if LZMA package is complete)
2311 if test $passed -gt 0; then
2312 if test $failed -gt 0; then
2313 AC_MSG_RESULT(no -- some components failed test)
2314 have_lzma='no (failed tests)'
2317 LIBS="$LZMA_LIBS $LIBS"
2318 AC_DEFINE(LZMA_DELEGATE,1,Define if you have lzma compression library)
2326 AM_CONDITIONAL(LZMA_DELEGATE, test "$have_lzma" = 'yes')
2329 dnl ===========================================================================
2332 # Check for the OpenEXR delegate library.
2334 AC_ARG_WITH([openexr],
2335 [AC_HELP_STRING([--without-openexr],
2336 [disable OpenEXR support])],
2337 [with_openexr=$withval],
2338 [with_openexr='yes'])
2340 if test "$with_openexr" != 'yes'; then
2341 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-openexr=$with_openexr "
2348 if test "x$with_openexr" = "xyes"; then
2349 AC_MSG_RESULT([-------------------------------------------------------------])
2350 PKG_CHECK_MODULES(OPENEXR,[OpenEXR >= 1.0.6], have_openexr=yes, have_openexr=no)
2354 if test "$have_openexr" = 'yes'; then
2355 AC_DEFINE(OPENEXR_DELEGATE,1,Define if you have OPENEXR library)
2356 if test "$with_modules" = 'no'; then
2357 CFLAGS="$OPENEXR_CFLAGS $CFLAGS"
2361 AM_CONDITIONAL(OPENEXR_DELEGATE, test "$have_openexr" = 'yes')
2362 AC_SUBST(OPENEXR_CFLAGS)
2363 AC_SUBST(OPENEXR_LIBS)
2365 dnl ===========================================================================
2368 # Check for PNG delegate library.
2371 [AC_HELP_STRING([--without-png],
2372 [disable PNG support])],
2373 [with_png=$withval],
2376 if test "$with_png" != 'yes'; then
2377 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-png=$with_png "
2382 if test "$with_png" != 'no'; then
2383 AC_MSG_RESULT([-------------------------------------------------------------])
2384 AC_MSG_CHECKING([for PNG])
2388 AC_CHECK_HEADER(png.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2389 AC_CHECK_LIB(png,png_get_io_ptr,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2390 AC_MSG_CHECKING([if PNG package is complete])
2391 if test $passed -gt 0; then
2392 if test $failed -gt 0; then
2393 AC_MSG_RESULT([no -- some components failed test])
2394 have_png='no (failed tests)'
2397 LIBS="$PNG_LIBS $LIBS"
2398 AC_DEFINE(PNG_DELEGATE,1,Define if you have PNG library)
2399 AC_MSG_RESULT([yes])
2406 AM_CONDITIONAL(PNG_DELEGATE,test "$have_png" = 'yes')
2409 dnl ===========================================================================
2412 # Check for RSVG delegate library.
2415 [AC_HELP_STRING([--without-rsvg],
2416 [disable RSVG support])],
2417 [with_rsvg=$withval],
2418 [with_rsvg=$have_x])
2420 if test "$with_rsvg" != 'yes'; then
2421 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-rsvg=$with_rsvg "
2429 if test "x$with_rsvg" = "xyes"; then
2430 AC_MSG_RESULT([-------------------------------------------------------------])
2431 PKG_CHECK_MODULES(RSVG,[librsvg-2.0 >= 2.9.0], have_rsvg=yes, have_rsvg=no)
2433 PKG_CHECK_MODULES(CAIRO_SVG, cairo-svg, have_cairo=yes, have_cairo=no)
2437 if test "$have_rsvg" = 'yes'; then
2438 AC_DEFINE(RSVG_DELEGATE,1,Define if you have RSVG library)
2439 if test "$with_modules" = 'no'; then
2440 CPPFLAGS="$RSVG_CFLAGS $CPPFLAGS"
2444 if test "$have_cairo" = 'yes'; then
2445 AC_DEFINE(CAIRO_DELEGATE,1,Define if you have CAIRO library)
2446 if test "$with_modules" = 'no'; then
2447 CPPFLAGS="$CAIRO_SVG_CFLAGS $CPPFLAGS"
2451 AM_CONDITIONAL(RSVG_DELEGATE, test "$have_rsvg" = 'yes')
2452 AM_CONDITIONAL(CAIRO_DELEGATE, test "$have_cairo" = 'yes')
2453 AC_SUBST(RSVG_CFLAGS)
2456 dnl ===========================================================================
2459 # Check for TIFF delegate library.
2462 [AC_HELP_STRING([--without-tiff],
2463 [disable TIFF support])],
2464 [with_tiff=$withval],
2467 if test "$with_tiff" != 'yes'; then
2468 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-tiff=$with_tiff "
2473 if test "$with_tiff" != 'no'; then
2474 AC_MSG_RESULT([-------------------------------------------------------------])
2475 AC_MSG_CHECKING([for TIFF])
2479 AC_CHECK_HEADER(tiff.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2480 AC_CHECK_HEADER(tiffio.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2481 AC_CHECK_LIB(tiff,TIFFOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2482 AC_CHECK_LIB(tiff,TIFFClientOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2483 AC_CHECK_LIB(tiff,TIFFIsBigEndian,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2484 AC_CHECK_LIB(tiff,TIFFIsByteSwapped,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2485 AC_CHECK_LIB(tiff,TIFFReadRGBATile,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2486 AC_CHECK_LIB(tiff,TIFFReadRGBAStrip,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2487 AC_MSG_CHECKING([if TIFF package is complete])
2488 if test $passed -gt 0; then
2489 if test $failed -gt 0; then
2490 AC_MSG_RESULT([no -- some components failed test])
2491 have_tiff='no (failed tests)'
2494 LIBS="$TIFF_LIBS $LIBS"
2495 AC_DEFINE(TIFF_DELEGATE,1,Define if you have TIFF library)
2496 AC_MSG_RESULT([yes])
2498 AC_CHECK_HEADERS(tiffconf.h)
2499 AC_CHECK_FUNCS([TIFFIsCODECConfigured TIFFMergeFieldInfo \
2500 TIFFReadEXIFDirectory TIFFSetErrorHandlerExt TIFFSetTagExtender \
2501 TIFFSetWarningHandlerExt TIFFSwabArrayOfTriples])
2507 AM_CONDITIONAL(TIFF_DELEGATE, test "$have_tiff" = 'yes')
2510 dnl ===========================================================================
2513 # Check for WEBP delegate library.
2516 [AC_HELP_STRING([--without-webp],
2517 [disable WEBP support])],
2518 [with_webp=$withval],
2521 if test "$with_webp" != 'yes'; then
2522 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-webp=$with_webp "
2527 if test "$with_webp" != 'no'; then
2528 AC_MSG_RESULT([-------------------------------------------------------------])
2529 AC_MSG_CHECKING([for WEBP])
2533 AC_CHECK_HEADER(webp/decode.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2534 AC_CHECK_LIB(webp,WebPDecodeRGB,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2535 AC_MSG_CHECKING([if WEBP package is complete])
2536 if test $passed -gt 0; then
2537 if test $failed -gt 0; then
2538 AC_MSG_RESULT([no -- some components failed test])
2539 have_webp='no (failed tests)'
2542 LIBS="$WEBP_LIBS $LIBS"
2543 AC_DEFINE(WEBP_DELEGATE,1,Define if you have WEBP library)
2544 AC_MSG_RESULT([yes])
2551 AM_CONDITIONAL(WEBP_DELEGATE,test "$have_webp" = 'yes')
2554 dnl ===========================================================================
2557 # Set Windows font directory.
2559 AC_ARG_WITH(windows-font-dir,
2560 [AC_HELP_STRING([--with-windows-font-dir=DIR],
2561 [directory containing MS-Windows fonts])],
2562 [with_windows_font_dir=$withval],
2563 [with_windows_font_dir=''])
2564 if test "$with_windows_font_dir" != '' ; then
2565 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-windows-font-dir=$with_windows_font_dir "
2568 dnl ===========================================================================
2571 # Check for WMF delegate library.
2574 [AC_HELP_STRING([--without-wmf],
2575 [disable WMF support])],
2576 [with_wmf=$withval],
2579 if test "$with_wmf" != 'yes'; then
2580 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-wmf=$with_wmf "
2585 if test "$with_wmf" != 'no'; then
2586 AC_MSG_RESULT([-------------------------------------------------------------])
2587 AC_MSG_CHECKING([for WMF])
2591 AC_CHECK_HEADER(libwmf/eps.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2592 AC_CHECK_LIB(wmf,wmf_eps_function,passed=`expr $passed + 1`,failed=`expr $failed + 1`,"-lwmflite")
2593 AC_MSG_CHECKING([if WMF package is complete])
2594 if test $passed -gt 0; then
2595 if test $failed -gt 0; then
2596 AC_MSG_RESULT([no -- some components failed test])
2597 have_wmf='no (failed tests)'
2599 WMF_LIBS='-lwmf -lwmflite'
2600 LIBS="$WMF_LIBS $LIBS"
2601 AC_DEFINE(WMF_DELEGATE,1,Define if you have WMF library)
2602 AC_MSG_RESULT([yes])
2609 AM_CONDITIONAL(WMF_DELEGATE,test "$have_wmf" = 'yes')
2612 dnl ===========================================================================
2615 dnl ===========================================================================
2618 # Check for XML delegate library.
2621 [AC_HELP_STRING([--without-xml],
2622 [disable XML support])],
2623 [with_xml=$withval],
2626 if test "$with_xml" != 'yes' ; then
2627 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-xml=$with_xml "
2632 if test "$with_xml" != 'no'; then
2633 AC_MSG_RESULT([-------------------------------------------------------------])
2634 AC_MSG_CHECKING([for XML])
2636 PERSIST_LDFLAGS=$LDFLAGS
2637 PERSIST_CPPFLAGS=$CPPFLAGS
2639 AC_CHECK_PROGS(xml2_config,xml2-config,)dnl
2640 if test -n "$xml2_config"; then
2641 # Debian installs libxml headers under /usr/include/libxml2/libxml with
2642 # the shared library installed under /usr/lib, whereas the package
2643 # installs itself under $prefix/libxml and $prefix/lib.
2644 xml2_prefix=`xml2-config --prefix`
2645 if test -d "${xml2_prefix}/include/libxml2"; then
2646 CPPFLAGS="$CPPFLAGS -I${xml2_prefix}/include/libxml2"
2648 if test "${xml2_prefix}" != '/usr'; then
2649 LDFLAGS="$LDFLAGS -L${xml2_prefix}/lib"
2654 AC_CHECK_HEADER(libxml/parser.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2655 AC_CHECK_LIB(xml2,xmlParseExternalEntity,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2656 AC_MSG_CHECKING([if XML package is complete])
2657 if test $passed -gt 0; then
2658 if test $failed -gt 0; then
2659 AC_MSG_RESULT([no -- some components failed test])
2660 have_xml='no (failed tests)'
2661 LDFLAGS="$PERSIST_LDFLAGS"
2662 CPPFLAGS="$PERSIST_CPPFLAGS"
2665 LIBS="$XML_LIBS $LIBS"
2666 AC_DEFINE(XML_DELEGATE,1,Define if you have XML library)
2667 AC_MSG_RESULT([yes])
2674 AM_CONDITIONAL(XML_DELEGATE,test "$have_xml" = 'yes')
2677 dnl ===========================================================================
2679 # Substitute compiler name to build/link PerlMagick
2681 AC_SUBST(PERLMAINCC)
2684 # Configure install Paths
2687 # Subdirectory under lib to place ImageMagick lib files
2688 LIBRARY_RELATIVE_PATH="${PACKAGE_NAME}-${PACKAGE_VERSION}"
2689 AC_DEFINE_UNQUOTED(LIBRARY_RELATIVE_PATH,"$LIBRARY_RELATIVE_PATH",Subdirectory of lib where ImageMagick architecture dependent files are installed)
2691 # Path to ImageMagick bin directory
2692 EXECUTABLE_PATH="${BIN_DIR}"
2693 DEFINE_EXECUTABLE_PATH="${BIN_DIR}/"
2694 case "${build_os}" in
2696 DEFINE_EXECUTABLE_PATH=`$WinPathScript "$DEFINE_EXECUTABLE_PATH" 1`
2699 AC_DEFINE_UNQUOTED(EXECUTABLE_PATH,"$DEFINE_EXECUTABLE_PATH",Directory where executables are installed.)
2700 AC_SUBST(EXECUTABLE_PATH)
2702 # Path to ImageMagick lib
2703 LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}"
2704 DEFINE_LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}/"
2705 case "${build_os}" in
2707 DEFINE_LIBRARY_PATH=`$WinPathScript "$DEFINE_LIBRARY_PATH" 1`
2710 AC_DEFINE_UNQUOTED(LIBRARY_PATH,"$DEFINE_LIBRARY_PATH",Directory where architecture-dependent files live.)
2711 AC_SUBST(LIBRARY_PATH)
2714 # Subdirectory under lib to place ImageMagick coder module files
2715 CODER_RELATIVE_PATH="${LIBRARY_RELATIVE_PATH}/modules-Q${QUANTUM_DEPTH}/coders"
2716 AC_DEFINE_UNQUOTED(CODER_RELATIVE_PATH,"$CODER_RELATIVE_PATH",Subdirectory of lib where coder modules are installed)
2717 CODER_PATH="${LIB_DIR}/${CODER_RELATIVE_PATH}"
2718 DEFINE_CODER_PATH="${LIB_DIR}/${CODER_RELATIVE_PATH}/"
2719 case "${build_os}" in
2721 DEFINE_CODER_PATH=`$WinPathScript "$DEFINE_CODER_PATH" 1`
2724 AC_DEFINE_UNQUOTED(CODER_PATH,"$DEFINE_CODER_PATH",Location of coder modules)
2725 AC_SUBST(CODER_PATH)
2728 # Subdirectory under lib to place ImageMagick filter module files
2729 FILTER_RELATIVE_PATH="${LIBRARY_RELATIVE_PATH}/modules-Q${QUANTUM_DEPTH}/filters"
2730 AC_DEFINE_UNQUOTED(FILTER_RELATIVE_PATH,"$FILTER_RELATIVE_PATH",Subdirectory of lib where filter modules are installed)
2731 FILTER_PATH="${LIB_DIR}/${FILTER_RELATIVE_PATH}"
2732 DEFINE_FILTER_PATH="${LIB_DIR}/${FILTER_RELATIVE_PATH}/"
2733 case "${build_os}" in
2735 DEFINE_FILTER_PATH=`$WinPathScript "$DEFINE_FILTER_PATH" 1`
2738 AC_DEFINE_UNQUOTED(FILTER_PATH,"$DEFINE_FILTER_PATH",Location of filter modules)
2739 AC_SUBST(FILTER_PATH)
2742 # Path to ImageMagick documentation files
2743 DOCUMENTATION_RELATIVE_PATH=""
2744 DOCUMENTATION_PATH="${DOC_DIR}/${DOCUMENTATION_RELATIVE_PATH}"
2745 DEFINE_DOCUMENTATION_PATH="${DOC_DIR}/${DOCUMENTATION_RELATIVE_PATH}/"
2746 case "${build_os}" in
2748 DEFINE_DOCUMENTATION_PATH=`$WinPathScript "$DEFINE_DOCUMENTATION_PATH" 1`
2751 AC_DEFINE_UNQUOTED(DOCUMENTATION_PATH,"$DEFINE_DOCUMENTATION_PATH",Directory where ImageMagick documents live.)
2752 AC_SUBST(DOCUMENTATION_PATH)
2755 # Path to ImageMagick share files
2756 SHARE_RELATIVE_PATH="${PACKAGE_NAME}-${PACKAGE_VERSION}"
2757 SHARE_PATH="${DATA_DIR}/${SHARE_RELATIVE_PATH}"
2758 DEFINE_SHARE_PATH="${DATA_DIR}/${SHARE_RELATIVE_PATH}/"
2759 case "${build_os}" in
2761 DEFINE_SHARE_PATH=`$WinPathScript "$DEFINE_SHARE_PATH" 1`
2764 AC_DEFINE_UNQUOTED(SHARE_PATH,"$DEFINE_SHARE_PATH",Directory where architecture-independent files live.)
2765 AC_SUBST(SHARE_PATH)
2767 # Subdirectory to place ImageMagick configuration files
2768 CONFIGURE_RELATIVE_PATH="${PACKAGE_NAME}"
2769 AC_DEFINE_UNQUOTED(CONFIGURE_RELATIVE_PATH,"$CONFIGURE_RELATIVE_PATH",Subdirectory of lib where architecture-dependent configuration files live.)
2770 CONFIGURE_PATH="${SYSCONF_DIR}/${CONFIGURE_RELATIVE_PATH}/"
2771 DEFINE_CONFIGURE_PATH="${SYSCONF_DIR}/${CONFIGURE_RELATIVE_PATH}/"
2772 case "${build_os}" in
2774 DEFINE_CONFIGURE_PATH=`$WinPathScript "$DEFINE_CONFIGURE_PATH" 1`
2777 AC_DEFINE_UNQUOTED(CONFIGURE_PATH,"$DEFINE_CONFIGURE_PATH",Directory where architecture-dependent configuration files live.)
2778 AC_SUBST(CONFIGURE_PATH)
2780 # Subdirectory to place ImageMagick configuration files
2781 SHARE_CONFIGURE_RELATIVE_PATH="${LIBRARY_RELATIVE_PATH}/config"
2782 AC_DEFINE_UNQUOTED(SHARE_CONFIGURE_RELATIVE_PATH,"$SHARE_CONFIGURE_RELATIVE_PATH",Subdirectory of lib where architecture-independent configuration files live.)
2783 SHARE_CONFIGURE_PATH="${DATA_DIR}/${SHARE_CONFIGURE_RELATIVE_PATH}"
2784 DEFINE_SHARE_CONFIGURE_PATH="${DATA_DIR}/${SHARE_CONFIGURE_RELATIVE_PATH}/"
2785 case "${build_os}" in
2787 DEFINE_SHARE_CONFIGURE_PATH=`$WinPathScript "$DEFINE_SHARE_CONFIGURE_PATH" 1`
2790 AC_DEFINE_UNQUOTED(SHARE_CONFIGURE_PATH,"$DEFINE_SHARE_CONFIGURE_PATH",Directory where architecture-independent configuration files live.)
2791 AC_SUBST(SHARE_CONFIGURE_PATH)
2794 # program_transform_name is formed for use in a Makefile, so create a
2795 # modified version for use in a shell script.
2796 configure_transform_name=`echo ${program_transform_name} | sed 's,\\$\\$,$,'`
2798 # Default delegate definitions
2799 AC_MSG_RESULT([-------------------------------------------------------------])
2800 AC_MSG_CHECKING([for ImageMagick delegate programs])
2802 AutotraceDecodeDelegateDefault='autotrace'
2803 BlenderDecodeDelegateDefault='blender'
2804 BZIPDelegateDefault='bzip2'
2805 BrowseDelegateDefault='xdg-open'
2806 CGMDecodeDelegateDefault='ralcgm'
2807 CatDelegateDefault='cat'
2808 DNGDecodeDelegateDefault='ufraw-batch'
2809 GVCDecodeDelegateDefault='dot'
2810 DVIDecodeDelegateDefault='dvips'
2811 EchoDelegateDefault='echo'
2812 EditorDelegateDefault='xterm'
2813 FIGDecodeDelegateDefault='fig2dev'
2814 ConvertDelegateDefault=`echo convert | sed ${configure_transform_name}`
2815 DisplayDelegateDefault=`echo display | sed ${configure_transform_name}`
2816 MogrifyDelegateDefault=`echo mogrify | sed ${configure_transform_name}`
2817 GnuplotDecodeDelegateDefault='gnuplot'
2818 HPGLDecodeDelegateDefault='hp2xx'
2819 HTMLDecodeDelegateDefault='html2ps'
2820 ILBMDecodeDelegateDefault='ilbmtoppm'
2821 ILBMEncodeDelegateDefault='ppmtoilbm'
2822 LPDelegateDefault='lp'
2823 LPRDelegateDefault='lpr'
2824 LZWDecodeDelegateDefault='uncompress'
2825 LZWEncodeDelegateDefault='compress'
2826 LaunchDelegateDefault='gimp'
2827 MANDelegateDefault='groff'
2828 MPEGDecodeDelegateDefault='ffmpeg'
2829 MPEGEncodeDelegateDefault='ffmpeg'
2830 MrSIDDecodeDelegateDefault='mrsidgeodecode'
2831 MVDelegateDefault='mv'
2832 PCLDelegateDefault='pcl6'
2833 PGPDecodeDelegateDefault='pgpv'
2834 POVDelegateDefault='povray'
2835 if test "$native_win32_build" = 'yes'; then
2836 PSDelegateDefault='gswin32c'
2837 elif test "$gslib_framework" = 'yes'; then
2838 PSDelegateDefault='gsc'
2840 PSDelegateDefault='gs'
2842 RLEEncodeDelegateDefault='rawtorle'
2843 RMDelegateDefault='rm'
2844 RSVGDecodeDelegateDefault='rsvg'
2845 SCANDecodeDelegateDefault='scanimage'
2846 TXTDelegateDefault='enscript'
2847 UniconvertorDelegateDefault='uniconvertor'
2848 WMFDecodeDelegateDefault='wmf2eps'
2849 WWWDecodeDelegateDefault='curl'
2850 XPSDelegateDefault='gxps'
2851 ZipDelegateDefault='gzip'
2853 # Search for delegates
2854 AC_PATH_PROG(AutotraceDecodeDelegate, "$AutotraceDecodeDelegateDefault", "$AutotraceDecodeDelegateDefault")
2855 AC_PATH_PROG(BlenderDecodeDelegate, "$BlenderDecodeDelegateDefault", "$BlenderDecodeDelegateDefault")
2856 AC_PATH_PROG(BZIPDelegate, "$BZIPDelegateDefault", "$BZIPDelegateDefault")
2857 AC_PATH_PROG(BrowseDelegate, "$BrowseDelegateDefault" mozilla firefox netscape, "$BrowseDelegateDefault")
2858 AC_PATH_PROG(CGMDecodeDelegate, "$CGMDecodeDelegateDefault", "$CGMDecodeDelegateDefault")
2859 AC_PATH_PROG(CatDelegate, "$CatDelegateDefault", "$CatDelegateDefault")
2860 AC_PATH_PROG(DNGDecodeDelegate, "$DNGDecodeDelegateDefault", "$DNGDecodeDelegateDefault")
2861 AC_PATH_PROG(GVCDecodeDelegate, "$GVCDecodeDelegateDefault", "$GVCDecodeDelegateDefault")
2862 AC_PATH_PROG(DVIDecodeDelegate, "$DVIDecodeDelegateDefault", "$DVIDecodeDelegateDefault")
2863 AC_PATH_PROG(EchoDelegate, "$EchoDelegateDefault", "$EchoDelegateDefault")
2864 AC_PATH_PROG(EditorDelegate, "$EditorDelegateDefault", "$EditorDelegateDefault")
2865 AC_PATH_PROG(FIGDecodeDelegate, "$FIGDecodeDelegateDefault", "$FIGDecodeDelegateDefault")
2866 AC_PATH_PROG(ConvertDelegate, "$ConvertDelegateDefault", "$ConvertDelegateDefault")
2867 AC_PATH_PROG(DisplayDelegate, "$DisplayDelegateDefault", "$DisplayDelegateDefault")
2868 AC_PATH_PROG(MogrifyDelegate, "$MogrifyDelegateDefault", "$MogrifyDelegateDefault")
2869 AC_PATH_PROG(GnuplotDecodeDelegate, "$GnuplotDecodeDelegateDefault", "$GnuplotDecodeDelegateDefault")
2870 AC_PATH_PROG(HPGLDecodeDelegate, "$HPGLDecodeDelegateDefault", "$HPGLDecodeDelegateDefault")
2871 AC_PATH_PROG(HTMLDecodeDelegate, "$HTMLDecodeDelegateDefault", "$HTMLDecodeDelegateDefault")
2872 AC_PATH_PROG(ILBMDecodeDelegate, "$ILBMDecodeDelegateDefault", "$ILBMDecodeDelegateDefault")
2873 AC_PATH_PROG(ILBMEncodeDelegate, "$ILBMEncodeDelegateDefault", "$ILBMEncodeDelegateDefault")
2874 AC_PATH_PROG(LPDelegate, "$LPDelegateDefault", no)
2875 AC_PATH_PROG(LPRDelegate, "$LPRDelegateDefault", "$LPRDelegateDefault")
2876 AC_PATH_PROG(LZWDecodeDelegate, "$LZWDecodeDelegateDefault", "$LZWDecodeDelegateDefault")
2877 AC_PATH_PROG(LZWEncodeDelegate, "$LZWEncodeDelegateDefault", "$LZWEncodeDelegateDefault")
2878 AC_PATH_PROG(LaunchDelegate, "$LaunchDelegateDefault", "$LaunchDelegateDefault")
2879 AC_PATH_PROG(MANDelegate, "$MANDelegateDefault", "$MANDelegateDefault")
2880 AC_PATH_PROG(MPEGDecodeDelegate, "$MPEGDecodeDelegateDefault", "$MPEGDecodeDelegateDefault")
2881 AC_PATH_PROG(MPEGEncodeDelegate, "$MPEGEncodeDelegateDefault", "$MPEGEncodeDelegateDefault")
2882 AC_PATH_PROG(MrSIDDecodeDelegate, "$MrSIDDecodeDelegateDefault", "$MrSIDDecodeDelegateDefault")
2883 AC_PATH_PROG(MVDelegate, "$MVDelegateDefault", "$MVDelegateDefault")
2884 AC_PATH_PROG(PCLDelegate, "$PCLDelegateDefault", "$PCLDelegateDefault")
2885 AC_PATH_PROG(PGPDecodeDelegate, "$PGPDecodeDelegateDefault", "$PGPDecodeDelegateDefault")
2886 AC_PATH_PROG(POVDelegate, "$POVDelegateDefault", "$POVDelegateDefault")
2887 AC_PATH_PROGS(PSDelegate, gsx gsc "$PSDelegateDefault", "$PSDelegateDefault")
2888 AC_PATH_PROG(RLEEncodeDelegate, "$RLEEncodeDelegateDefault", "$RLEEncodeDelegateDefault")
2889 AC_PATH_PROG(RMDelegate, "$RMDelegateDefault", "$RMDelegateDefault")
2890 AC_PATH_PROG(RSVGDecodeDelegate, "$RSVGDecodeDelegateDefault", "$RSVGDecodeDelegateDefault")
2891 AC_PATH_PROG(SCANDecodeDelegate, "$SCANDecodeDelegateDefault", "$SCANDecodeDelegateDefault")
2892 AC_PATH_PROG(TXTDelegate, "$TXTDelegateDefault", "$TXTDelegateDefault")
2893 AC_PATH_PROG(UniconvertorDelegate, "$UniconvertorDelegateDefault", "$UniconvertorDelegateDefault")
2894 AC_PATH_PROG(WMFDecodeDelegate, "$WMFDecodeDelegateDefault", "$WMFDecodeDelegateDefault")
2895 AC_PATH_PROG(WWWDecodeDelegate, "$WWWDecodeDelegateDefault", "$WWWDecodeDelegateDefault")
2896 AC_PATH_PROG(XPSDelegate, "$XPSDelegateDefault", "$XPSDelegateDefault")
2897 AC_PATH_PROG(ZipDelegate, "$ZipDelegateDefault", "$ZipDelegateDefault")
2899 # Prefer lpr to lp; lp needs options tacked on.
2900 if test "$LPRDelegate" != no; then
2901 PrintDelegate="$LPRDelegate"
2903 PrintDelegate="$LPDelegate -c -s"
2905 AC_SUBST(PrintDelegate)
2907 # Installed ImageMagick utiltity paths
2908 ConvertDelegate="${BIN_DIR}/${ConvertDelegateDefault}"
2909 DisplayDelegate="${BIN_DIR}/${DisplayDelegateDefault}"
2910 MogrifyDelegate="${BIN_DIR}/${MogrifyDelegateDefault}"
2912 # Set delegate booleans
2913 have_ffmpeg='no'; if test "$MPEGDecodeDelegate" != "$MPEGDecodeDelegateDefault" ; then have_ffmpeg='yes'; fi
2914 have_fig2dev='no' ; if test "$FIGDecodeDelegate" != "$FIGDecodeDelegateDefault" ; then have_fig2dev='yes'; fi
2915 have_gs='no' ; if test "$PSDelegate" != "$PSDelegateDefault"; then have_gs='yes'; fi
2916 have_hp2xx='no' ; if test "$HPGLDecodeDelegate" != "$HPGLDecodeDelegateDefault" ; then have_hp2xx='yes'; fi
2917 have_ilbmtoppm='no' ; if test "$ILBMDecodeDelegate" != "$ILBMDecodeDelegateDefault" ; then have_ilbmtoppm='yes'; fi
2918 have_mrsid='no'; if test "$MrSIDDecodeDelegate" != "$MrSIDDecodeDelegateDefault" ; then have_mrsid='yes'; fi
2919 have_pcl='no' ; if test "$PCLDelegate" != "$PCLDelegateDefault"; then have_pcl='yes'; fi
2920 have_ppmtoilbm='no' ; if test "$ILBMEncodeDelegate" != "$ILBMEncodeDelegateDefault" ; then have_ppmtoilbm='yes'; fi
2921 have_ralcgm='no' ; if test "$CGMDecodeDelegate" != "$CGMDecodeDelegateDefault" ; then have_ralcgm='yes'; fi
2922 have_xps='no' ; if test "$XPSDelegate" != "$XPSDelegateDefault"; then have_xps='yes'; fi
2925 # Test for font directories
2927 type_include_files=''
2930 AC_MSG_CHECKING(for Dejavu fonts directory)
2932 if test "${with_dejavu_font_dir}" != 'default'; then
2933 dejavu_font_dir="${with_dejavu_font_dir}/"
2935 for font_dir in "${prefix}/share/dejavu/fonts/" '/usr/share/fonts/dejavu/'; do
2936 if test -f "${font_dir}DejaVuSerif.ttf"; then
2937 dejavu_font_dir="${font_dir}"
2942 if test "${dejavu_font_dir}x" != 'x'; then
2943 type_include_files="${type_include_files} "'<include file="type-dejavu.xml" />'
2944 AC_MSG_RESULT([$dejavu_font_dir])
2946 AC_MSG_RESULT([not found!]);
2948 AC_SUBST(dejavu_font_dir)
2952 if test "$with_windows_font_dir" != "no" && test -n "$with_windows_font_dir"; then
2953 windows_font_dir="${with_windows_font_dir}/"
2955 if test "${windows_font_dir}x" != 'x'; then
2956 if test -f '/usr/X11R6/lib/X11/fonts/truetype/arial.ttf'; then
2957 windows_font_dir='/usr/X11R6/lib/X11/fonts/truetype/'
2959 if test -f '/usr/X11R7/lib/X11/fonts/truetype/arial.ttf'; then
2960 windows_font_dir='/usr/X11R7/lib/X11/fonts/truetype/'
2962 if test -f '/usr/share/fonts/msttcore/arial.ttf'; then
2963 windows_font_dir='/usr/share/fonts/msttcore/truetype/'
2966 if test "${windows_font_dir}x" != 'x'; then
2967 type_include_files="$type_include_files "'<include file="type-windows.xml" />'
2969 AC_SUBST(windows_font_dir)
2972 AC_MSG_CHECKING(for Ghostscript fonts directory)
2973 ghostscript_font_dir=''
2974 if test "${with_gs_font_dir}" != 'default'; then
2975 ghostscript_font_dir="${with_gs_font_dir}/"
2977 if test "${native_win32_build}" = 'yes'; then
2978 # Native Windows Build
2979 for font_dir in "c:\\Program Files\\gs\\fonts\\" "c:\\Program Files \(x86\)\\gs\\fonts\\" "c:\\gs\\fonts\\"; do
2980 if test -f "${font_dir}a010013l.pfb"; then
2981 ghostscript_font_dir="$font_dir"
2985 if test "${PSDelegate}" != 'gswin32c'; then
2986 ghostscript_font_dir=`echo "${PSDelegate}" | sed -e 's:/gs/.*:/gs:;s:^/::;s/./&:/;s:/:\\\\:g'`"\\fonts\\"
2989 # Linux / Mac OS X / Unix Build
2990 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
2991 if test -f "${font_dir}a010013l.pfb"; then
2992 ghostscript_font_dir="${font_dir}"
2996 if test "${ghostscript_font_dir}x" = 'x'; then
2997 if test "$PSDelegate" != 'gs'; then
2998 ghostscript_font_dir=`echo "$PSDelegate" | sed -e 's:/bin/gs:/share/ghostscript/fonts:'`"/"
3003 if test "${ghostscript_font_dir}x" != 'x'; then
3004 type_include_files="${type_include_files} "'<include file="type-ghostscript.xml" />'
3005 AC_MSG_RESULT([$ghostscript_font_dir])
3007 AC_MSG_RESULT([not found!]);
3009 AC_SUBST(ghostscript_font_dir)
3010 case "${build_os}" in
3012 PSDelegate=`$WinPathScript "$PSDelegate" 1`
3016 AC_SUBST(type_include_files)
3019 # Handle case where user doesn't want frozen paths
3021 if test "$with_frozenpaths" != 'yes'; then
3022 # Re-set delegate definitions to default (no paths)
3023 AutotraceDecodeDelegate="$AutotraceDecodeDelegateDefault"
3024 BlenderDecodeDelegate="$BlenderDecodeDelegateDefault"
3025 BZIPDelegate="$BZIPDelegateDefault"
3026 BrowseDelegate="$BrowseDelegateDefault"
3027 CGMDecodeDelegate="$CGMDecodeDelegateDefault"
3028 CatDelegate="$CatDelegateDefault"
3029 ConvertDelegate="$ConvertDelegateDefault"
3030 GVCDecodeDelegate="$GVCDecodeDelegateDefault"
3031 DVIDecodeDelegate="$DVIDecodeDelegateDefault"
3032 EchoDelegate="$EchoDelegateDefault"
3033 EditorDelegate="$EditorDelegateDefault"
3034 FIGDecodeDelegate="$FIGDecodeDelegateDefault"
3035 GnuplotDecodeDelegate="$GnuplotDecodeDelegateDefault"
3036 HPGLDecodeDelegate="$HPGLDecodeDelegateDefault"
3037 HTMLDecodeDelegate="$HTMLDecodeDelegateDefault"
3038 ILBMDecodeDelegate="$ILBMDecodeDelegateDefault"
3039 ILBMEncodeDelegate="$ILBMEncodeDelegateDefault"
3040 LPDelegate="$LPDelegateDefault"
3041 LZWDecodeDelegate="$LZWDecodeDelegateDefault"
3042 LZWEncodeDelegate="$LZWEncodeDelegateDefault"
3043 LaunchDelegate="$LaunchDelegateDefault"
3044 MANDelegate="$MANDelegateDefault"
3045 MPEGDecodeDelegate="$MPEGDecodeDelegateDefault"
3046 MPEGEncodeDelegate="$MPEGEncodeDelegateDefault"
3047 MogrifyDelegate="$MogrifyDelegateDefault"
3048 MrSIDDecodeDelegate="$MrSIDDecodeDelegateDefault"
3049 MVDelegate="$MVDelegateDefault"
3050 PCLDelegate="$PCLDelegateDefault"
3051 PGPDecodeDelegate="$PGPDecodeDelegateDefault"
3052 POVDelegate="$POVDelegateDefault"
3053 PSDelegate="$PSDelegateDefault"
3054 RLEEncodeDelegate="$RLEEncodeDelegateDefault"
3055 RMDelegate="$RMDelegateDefault"
3056 RSVGDecodeDelegate="$RSVGDecodeDelegateDefault"
3057 SCANDecodeDelegate="$SCANDecodeDelegateDefault"
3058 ShowImageDelegate="$ShowImageDelegateDefault"
3059 TXTDelegate="$TXTDelegateDefault"
3060 UniconvertorDelegate="$UniconvertorDelegateDefault"
3061 WMFDecodeDelegate="$WMFDecodeDelegateDefault"
3062 WWWDecodeDelegate="$WWWDecodeDelegateDefault"
3063 XPSDelegate="$XPSDelegateDefault"
3064 ZipDelegate="$ZipDelegateDefault"
3067 # Delegate substitutions
3068 AC_SUBST(AutotraceDecodeDelegate)
3069 AC_SUBST(BlenderDecodeDelegate)
3070 AC_SUBST(BZIPDelegate)
3071 AC_SUBST(BrowseDelegate)
3072 AC_SUBST(CGMDecodeDelegate)
3073 AC_SUBST(CatDelegate)
3074 AC_SUBST(ConvertDelegate)
3075 AC_SUBST(GVCDecodeDelegate)
3076 AC_SUBST(DVIDecodeDelegate)
3077 AC_SUBST(EchoDelegate)
3078 AC_SUBST(EditorDelegate)
3079 AC_SUBST(FIGDecodeDelegate)
3080 AC_SUBST(GnuplotDecodeDelegate)
3081 AC_SUBST(HPGLDecodeDelegate)
3082 AC_SUBST(HTMLDecodeDelegate)
3083 AC_SUBST(ILBMDecodeDelegate)
3084 AC_SUBST(ILBMEncodeDelegate)
3085 AC_SUBST(LPDelegate)
3086 AC_SUBST(LZWDecodeDelegate)
3087 AC_SUBST(LZWEncodeDelegate)
3088 AC_SUBST(LaunchDelegate)
3089 AC_SUBST(MANDelegate)
3090 AC_SUBST(MPEGDecodeDelegate)
3091 AC_SUBST(MPEGEncodeDelegate)
3092 AC_SUBST(MogrifyDelegate)
3093 AC_SUBST(MrSIDDecodeDelegate)
3094 AC_SUBST(MVDelegate)
3095 AC_SUBST(PCLDelegate)
3096 AC_SUBST(PGPDecodeDelegate)
3097 AC_SUBST(POVDelegate)
3098 AC_SUBST(PSDelegate)
3099 AC_SUBST(RLEEncodeDelegate)
3100 AC_SUBST(RMDelegate)
3101 AC_SUBST(SCANDecodeDelegate)
3102 AC_SUBST(ShowImageDelegate)
3103 AC_SUBST(TXTDelegate)
3104 AC_SUBST(UniconvertorDelegate)
3105 AC_SUBST(WMFDecodeDelegate)
3106 AC_SUBST(WWWDecodeDelegate)
3107 AC_SUBST(XPSDelegate)
3108 AC_SUBST(ZipDelegate)
3114 AC_CHECK_PROGS(TAR,gnutar gtar tar)
3115 AC_CHECK_PROGS(PERL,perl)
3116 AC_CHECK_PROGS(RPM,rpmbuild rpm)
3117 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
3118 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
3119 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
3120 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
3122 AM_CONDITIONAL(RPM_DELEGATE, test "x$RPM" != "x" )
3125 # 7ZIP support (http://p7zip.sourceforge.net/)
3128 AC_CHECK_PROGS(P7ZIP,[7za])
3130 AM_CONDITIONAL(P7ZIP_DELEGATE, test "x$P7ZIP" != "x" )
3133 # ZIP support (http://www.info-zip.org/Zip.html)
3136 AC_CHECK_PROGS(ZIP,[zip])
3138 AM_CONDITIONAL(ZIP_DELEGATE, test "x$ZIP" != "x" )
3141 # GhostPCL related configuration.
3143 PCLColorDevice=ppmraw
3144 PCLCMYKDevice=bmpsep8
3145 PCLMonoDevice=pbmraw
3146 if test -z "$PCLVersion"; then
3147 PCLVersion='unknown'
3149 if test $have_pcl = 'yes'; then
3150 AC_MSG_RESULT([-------------------------------------------------------------])
3151 AC_MSG_CHECKING([for PCL])
3154 AC_MSG_CHECKING([for pcl color device])
3155 if $PCLDelegate -dBATCH -sDEVICE=$PCLColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3158 PCLColorDevice=ppmraw
3160 AC_MSG_RESULT([$PCLColorDevice])
3163 AC_MSG_CHECKING([for pcl CMYK device])
3164 if $PCLDelegate -dBATCH -sDEVICE=$PCLColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3167 PCLCMYKDevice=$PCLColorDevice
3169 AC_MSG_RESULT([$PCLCMYKDevice])
3172 AC_MSG_CHECKING([for pcl mono device])
3173 if $PCLDelegate -dBATCH -sDEVICE=$PCLMonoDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3176 PCLMonoDevice=$PCLColorDevice
3178 AC_MSG_RESULT([$PCLMonoDevice])
3181 AC_SUBST(PCLMonoDevice)
3182 AC_SUBST(PCLColorDevice)
3183 AC_SUBST(PCLCMYKDevice)
3184 AC_SUBST(PCLVersion)
3187 # GhostXPS related configuration.
3189 XPSColorDevice=ppmraw
3190 XPSCMYKDevice=bmpsep8
3191 XPSMonoDevice=pbmraw
3192 if test -z "$XPSVersion"; then
3193 XPSVersion='unknown'
3195 if test $have_xps = 'yes'; then
3196 AC_MSG_RESULT([-------------------------------------------------------------])
3197 AC_MSG_CHECKING([for XPS])
3200 AC_MSG_CHECKING([for xps color device])
3201 if $XPSDelegate -dBATCH -sDEVICE=$XPSColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3204 XPSColorDevice=ppmraw
3206 AC_MSG_RESULT([$XPSColorDevice])
3209 AC_MSG_CHECKING([for xps CMYK device])
3210 if $XPSDelegate -dBATCH -sDEVICE=$XPSColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3213 XPSCMYKDevice=$XPSColorDevice
3215 AC_MSG_RESULT([$XPSCMYKDevice])
3218 AC_MSG_CHECKING([for xps mono device])
3219 if $XPSDelegate -dBATCH -sDEVICE=$XPSMonoDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3222 XPSMonoDevice=$XPSColorDevice
3224 AC_MSG_RESULT([$XPSMonoDevice])
3227 AC_SUBST(XPSMonoDevice)
3228 AC_SUBST(XPSColorDevice)
3229 AC_SUBST(XPSCMYKDevice)
3230 AC_SUBST(XPSVersion)
3233 # Ghostscript related configuration.
3235 GSAlphaDevice=pngalpha
3236 GSColorDevice=pnmraw
3239 GSPDFDevice=pdfwrite
3241 GSEPSDevice=epswrite
3243 if test $have_gs = 'yes'; then
3244 AC_MSG_RESULT([-------------------------------------------------------------])
3245 AC_MSG_CHECKING([for Ghostscript])
3247 AC_MSG_CHECKING([for Ghostscript version])
3248 if GSVersion=`$PSDelegate --version`; then
3251 GSVersion=`$PSDelegate --help | sed -e '1q' | awk '{ print $3 }'`
3253 AC_MSG_RESULT([$GSVersion])
3256 AC_MSG_CHECKING([for gs alpha device])
3257 if $PSDelegate -q -dBATCH -sDEVICE=$GSAlphaDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3260 GSAlphaDevice=pnmraw
3262 AC_MSG_RESULT([$GSAlphaDevice])
3265 AC_MSG_CHECKING([for gs color device])
3266 if $PSDelegate -q -dBATCH -sDEVICE=$GSColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3269 GSColorDevice=pnmraw
3271 AC_MSG_RESULT([$GSColorDevice])
3274 AC_MSG_CHECKING([for gs CMYK device])
3275 if $PSDelegate -q -dBATCH -sDEVICE=$GSCMYKDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3278 GSCMYKDevice=bmpsep8
3280 AC_MSG_RESULT([$GSCMYKDevice])
3283 AC_MSG_CHECKING([for gs mono device])
3284 if $PSDelegate -q -dBATCH -sDEVICE=$GSMonoDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3287 GSMonoDevice=$GSColorDevice
3289 AC_MSG_RESULT([$GSMonoDevice])
3292 AC_MSG_CHECKING([for gs PDF writing device])
3293 if $PSDelegate -q -dBATCH -sDEVICE=$GSPDFDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3296 GSPDFDevice=nodevice
3298 AC_MSG_RESULT([$GSPDFDevice])
3301 AC_MSG_CHECKING([for gs PS writing device])
3302 if $PSDelegate -q -dBATCH -sDEVICE=$GSPSDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3307 AC_MSG_RESULT([$GSPSDevice])
3310 AC_MSG_CHECKING([for gs EPS writing device])
3311 if $PSDelegate -q -dBATCH -sDEVICE=$GSEPSDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3314 GSEPSDevice=nodevice
3316 AC_MSG_RESULT([$GSEPSDevice])
3319 AC_SUBST(GSAlphaDevice)
3320 AC_SUBST(GSCMYKDevice)
3321 AC_SUBST(GSColorDevice)
3322 AC_SUBST(GSEPSDevice)
3323 AC_SUBST(GSMonoDevice)
3324 AC_SUBST(GSPDFDevice)
3325 AC_SUBST(GSPSDevice)
3329 # PerlMagick-related configuration
3332 # Look for PERL if PerlMagick requested
3333 # If name/path of desired PERL interpreter is specified, look for that one first
3335 if test "$with_perl" != 'no'; then
3336 AC_MSG_RESULT([-------------------------------------------------------------])
3337 AC_MSG_CHECKING([for Perl])
3339 if test "$with_perl" != 'yes'; then
3340 AC_CACHE_CHECK(for perl,ac_cv_path_PERL,ac_cv_path_PERL="$with_perl");
3341 PERL=$ac_cv_path_PERL
3343 have_perl="$ac_cv_path_PERL"
3345 AC_PATH_PROGS(PERL,perl perl5,)dnl
3346 if test "$ac_cv_path_PERL"; then
3347 have_perl="$ac_cv_path_PERL"
3352 if test "$with_perl" != 'yes' ; then
3353 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-perl=$with_perl "
3356 PERL_SUPPORTS_DESTDIR='no'
3358 with_perl_static='no'
3359 with_perl_dynamic='no'
3360 if test "$have_perl" != 'no'; then
3361 if test "$with_perl" != 'no' && test "$libtool_build_shared_libs" = 'no'; then
3362 with_perl_static='yes'
3364 if test "$with_perl" != 'no' && test "$libtool_build_shared_libs" = 'yes'; then
3365 with_perl_dynamic='yes'
3367 # Is PERL's MakeMaker new enough to support DESTDIR?
3368 AX_PROG_PERL_VERSION(5.8.1,[PERL_SUPPORTS_DESTDIR='yes'],[PERL_SUPPORTS_DESTDIR='no'])
3370 AM_CONDITIONAL(WITH_PERL, test "$have_perl" != 'no')
3371 AM_CONDITIONAL(WITH_PERL_STATIC, test $with_perl_static = 'yes')
3372 AM_CONDITIONAL(WITH_PERL_DYNAMIC, test $with_perl_dynamic = 'yes')
3373 AC_SUBST(PERL_SUPPORTS_DESTDIR)
3375 # Determine path to pick up MagickCore library from for use with building PerlMagick
3376 MAGICKCORE_PATH="${LIB_DIR}"
3377 if test $with_perl_static = 'yes'; then
3378 # Find out where libtool hides its uninstalled libraries (as libtool_objdir)
3379 libtool_objdir=$objdir
3381 # Linker search path to library, followed by -lMagickCore
3382 MAGICKCORE_PATH="${builddir}/magick/${libtool_objdir}"
3384 AC_SUBST(MAGICKCORE_PATH)
3386 # Create a simple string containing format names for all delegate libraries
3388 if test "$have_autotrace" = 'yes'; then DELEGATES="$DELEGATES autotrace"; fi
3389 if test "$have_bzlib" = 'yes'; then DELEGATES="$DELEGATES bzlib"; fi
3390 if test "$have_djvu" = 'yes'; then DELEGATES="$DELEGATES djvu"; fi
3391 if test "$have_dps" = 'yes'; then DELEGATES="$DELEGATES dps"; fi
3392 if test "$have_fftw" = 'yes'; then DELEGATES="$DELEGATES fftw"; fi
3393 if test "$have_fpx" = 'yes'; then DELEGATES="$DELEGATES fpx"; fi
3394 if test "$have_fontconfig" = 'yes'; then DELEGATES="$DELEGATES fontconfig"; fi
3395 if test "$have_freetype" = 'yes'; then DELEGATES="$DELEGATES freetype"; fi
3396 if test "$have_gslib" = 'yes'; then DELEGATES="$DELEGATES gs"; fi
3397 if test "$have_gvc" = 'yes'; then DELEGATES="$DELEGATES gvc"; fi
3398 if test "$have_jbig" = 'yes'; then DELEGATES="$DELEGATES jbig"; fi
3399 if test "$have_jpeg" = 'yes'; then
3400 DELEGATES="$DELEGATES jpeg";
3401 if test "$have_png" = 'yes'; then DELEGATES="$DELEGATES jng"; fi
3403 if test "$have_jp2" = 'yes'; then DELEGATES="$DELEGATES jp2"; fi
3404 if test "$have_lcms2" = 'yes'; then DELEGATES="$DELEGATES lcms2"; fi
3405 if test "$have_lcms" = 'yes'; then DELEGATES="$DELEGATES lcms"; fi
3406 if test "$have_lqr" = 'yes'; then DELEGATES="$DELEGATES lqr"; fi
3407 if test "$have_lzma" = 'yes'; then DELEGATES="$DELEGATES lzma"; fi
3408 if test "$have_ffmpeg" = 'yes'; then DELEGATES="$DELEGATES mpeg"; fi
3409 if test "$have_openexr" = 'yes'; then DELEGATES="$DELEGATES openexr"; fi
3410 if test "$have_png" = 'yes'; then DELEGATES="$DELEGATES png"; fi
3411 if test "$have_rsvg" = 'yes'; then DELEGATES="$DELEGATES rsvg"; fi
3412 if test "$have_tiff" = 'yes'; then DELEGATES="$DELEGATES tiff"; fi
3413 if test "$have_x" = 'yes'; then DELEGATES="$DELEGATES x11"; fi
3414 if test "$have_xml" = 'yes'; then DELEGATES="$DELEGATES xml"; fi
3415 if test "$have_wmf" = 'yes'; then DELEGATES="$DELEGATES wmf"; fi
3416 if test "$have_zlib" = 'yes'; then DELEGATES="$DELEGATES zlib"; fi
3421 # Handle special compiler flags
3424 # Add '-p' if prof source profiling support enabled
3425 if test "$enable_prof" = 'yes'; then
3427 CXXFLAGS="-p $CXXFLAGS"
3428 LDFLAGS="-p $LDFLAGS"
3431 # Add '-pg' if gprof source profiling support enabled
3432 if test "$enable_gprof" = 'yes'; then
3433 CFLAGS="-pg $CFLAGS"
3434 CXXFLAGS="-pg $CXXFLAGS"
3435 LDFLAGS="-pg $LDFLAGS"
3438 # Add '-ftest-coverage -fprofile-arcs' if gcov source profiling support enabled
3439 # This is a gcc-specific feature
3440 if test "$enable_gcov" = 'yes'; then
3441 AC_CHECK_LIB(gcov,_gcov_init)
3442 AC_CHECK_LIB(gcov,__gcov_init)
3443 case "$target_os" in
3445 OSX_GCOV_LDFLAG="-Wl,-single_module"
3451 AC_SUBST(OSX_GCOV_LDFLAG)
3452 CFLAGS="-ftest-coverage -fprofile-arcs $CFLAGS"
3453 CXXFLAGS="-ftest-coverage -fprofile-arcs $CXXFLAGS"
3454 LDFLAGS="-ftest-coverage -fprofile-arcs $LDFLAGS"
3458 # Build library dependency list for libMagickCore
3461 MAGICK_LIBLTDL='' # Libltdl for build
3462 MAGICK_API_LIBLTDL='' # libltdl for dependent application (API) build
3463 MAGICK_LTDLDEPS='' # extra libltdl dependencies
3464 if test "$with_ltdl" != 'no'
3466 if test \( "$with_included_ltdl" = 'no' -o "$enable_ltdl_convenience" = 'no' \) -o "$enable_ltdl_install" = 'yes'; then
3467 MAGICK_API_LIBLTDL='-lltdl'
3469 MAGICK_LIBLTDL=${LIBLTDL}
3470 MAGICK_LTDLDEPS=${LTDLDEPS}
3472 AC_SUBST(MAGICK_LIBLTDL)
3473 AC_SUBST(MAGICK_LTDLDEPS)
3475 if test "$with_modules" != 'no'; then
3476 MAGICK_DEP_LIBS="$LCMS_LIBS $TIFF_LIBS $FREETYPE_LIBS $JPEG_LIBS $LQR_LIBS $FFTW_LIBS $FONTCONFIG_LIBS $XEXT_LIBS $IPC_LIBS $X11_LIBS $XT_LIBS $LZMA_LIBS $BZLIB_LIBS $ZLIB_LIBS $GDI32_LIBS $MATH_LIBS $CCMALLOC_LIBS $EFENCE_LIBS $UMEM_LIBS $GOMP_LIBS $CL_LIBS $THREAD_LIBS"
3478 MAGICK_DEP_LIBS="$JBIG_LIBS $LCMS_LIBS $TIFF_LIBS $FREETYPE_LIBS $JP2_LIBS $JPEG_LIBS $GS_LIBS $LQR_LIBS $PNG_LIBS $AUTOTRACE_LIBS $DJVU_LIBS $FFTW_LIBS $FPX_LIBS $FONTCONFIG_LIBS $WEBP_LIBS $WMF_LIBS $DPS_LIBS $XEXT_LIBS $XT_LIBS $IPC_LIBS $X11_LIBS $LZMA_LIBS $BZLIB_LIBS $OPENEXR_LIBS $RSVG_LIBS $XML_LIBS $GVC_LIBS $ZLIB_LIBS $GDI32_LIBS $MATH_LIBS $CCMALLOC_LIBS $EFENCE_LIBS $UMEM_LIBS $GOMP_LIBS $CL_LIBS $THREAD_LIBS"
3480 AC_SUBST(MAGICK_DEP_LIBS)
3483 # Remove extraneous spaces from output variables (asthetic)
3485 X_CFLAGS=`echo $X_CFLAGS | sed -e 's/ */ /g'`
3486 X_PRE_LIBS=`echo $X_PRE_LIBS | sed -e 's/ */ /g'`
3487 X_LIBS=`echo $X_LIBS | sed -e 's/ */ /g'`
3488 X_EXTRA_LIBS=`echo $X_EXTRA_LIBS | sed -e 's/ */ /g'`
3490 CC=`echo $CC | sed -e 's/ */ /g'`
3491 CFLAGS=`echo $CFLAGS | sed -e 's/ */ /g'`
3492 CPPFLAGS=`echo $CPPFLAGS | sed -e 's/ */ /g'`
3493 CXXFLAGS=`echo $CXXFLAGS | sed -e 's/ */ /g'`
3494 DELEGATES=`echo $DELEGATES | sed -e 's/^ //g'`
3495 DISTCHECK_CONFIG_FLAGS=`echo $DISTCHECK_CONFIG_FLAGS | sed -e 's/ */ /g'`
3496 LDFLAGS=`echo $LDFLAGS | sed -e 's/ */ /g'`
3497 TESTED_LIBS=`echo $LIBS | sed -e 's/ */ /g'`
3498 MAGICK_DEP_LIBS=`echo $MAGICK_DEP_LIBS | sed -e 's/ */ /g'`
3499 #LIBS=`echo $LIBS | sed -e 's/ */ /g'`
3501 # Pass only user-provided LIBS as "global" libraries
3507 #AC_SUBST(X_PRE_LIBS)
3509 #AC_SUBST(X_EXTRA_LIBS)
3511 MAGICK_CFLAGS=$CFLAGS
3512 MAGICK_CXXFLAGS="$CXXFLAGS"
3513 MAGICK_CPPFLAGS=`echo $MAGICK_CPPFLAGS | sed -e 's/ */ /g'`
3514 MAGICK_PCFLAGS=`echo $MAGICK_PCFLAGS | sed -e 's/ */ /g'`
3515 MAGICK_LDFLAGS="-L$LIB_DIR $LDFLAGS"
3516 MAGICK_LIBS="-lMagickCore $MAGICK_DEP_LIBS $MAGICK_API_LIBLTDL"
3518 AC_SUBST(MAGICK_CFLAGS)
3519 AC_SUBST(MAGICK_CXXFLAGS)
3520 AC_SUBST(MAGICK_CPPFLAGS)
3521 AC_SUBST(MAGICK_PCFLAGS)
3522 AC_SUBST(MAGICK_LDFLAGS)
3523 AC_SUBST(MAGICK_LIBS)
3524 AC_SUBST(MAGICK_FEATURES)
3526 # Set configured scripts to executable.
3527 AC_CONFIG_COMMANDS([default],[],[])
3528 AC_CONFIG_COMMANDS([MagickCore-config.in],[chmod +x magick/MagickCore-config])
3529 AC_CONFIG_COMMANDS([Magick-config.in],[chmod +x magick/Magick-config])
3530 AC_CONFIG_COMMANDS([MagickWand-config.in],[chmod +x wand/MagickWand-config])
3531 AC_CONFIG_COMMANDS([Wand-config.in],[chmod +x wand/Wand-config])
3532 AC_CONFIG_COMMANDS([Magick++-config.in],[chmod +x Magick++/bin/Magick++-config])
3533 AC_CONFIG_COMMANDS([PerlMagick/check.sh.in],[chmod +x PerlMagick/check.sh])
3535 AC_MSG_RESULT([-------------------------------------------------------------])
3536 AC_MSG_RESULT([Update ImageMagick configuration])
3539 rm -f magick-version
3541 result_dejavu_font_dir='none'
3542 if test "${dejavu_font_dir}x" != 'x'; then
3543 result_dejavu_font_dir=$dejavu_font_dir
3546 result_ghostscript_font_dir='none'
3547 if test "${ghostscript_font_dir}x" != 'x'; then
3548 result_ghostscript_font_dir=$ghostscript_font_dir
3551 result_windows_font_dir='none'
3552 if test "${windows_font_dir}x" != 'x'; then
3553 result_windows_font_dir=${windows_font_dir}
3557 ImageMagick is configured as follows. Please verify that this configuration
3558 matches your expectations.
3560 Host system type: $host
3561 Build system type: $build
3564 -------------------------------------------------------------------------------
3565 Shared libraries --enable-shared=$enable_shared $libtool_build_shared_libs
3566 Static libraries --enable-static=$enable_static $libtool_build_static_libs
3567 Module support --with-modules=$with_modules $with_modules
3568 GNU ld --with-gnu-ld=$with_gnu_ld $lt_cv_prog_gnu_ld
3569 Quantum depth --with-quantum-depth=$with_quantum_depth $with_quantum_depth
3570 High Dynamic Range Imagery
3571 --enable-hdri=$enable_hdri $enable_hdri
3573 Delegate Configuration:
3574 BZLIB --with-bzlib=$with_bzlib $have_bzlib
3575 Autotrace --with-autotrace=$with_autotrace $have_autotrace
3576 Dejavu fonts --with-dejavu-font-dir=$with_dejavu_font_dir $result_dejavu_font_dir
3577 DJVU --with-djvu=$with_djvu $have_djvu
3578 DPS --with-dps=$with_dps $have_dps
3579 FFTW --with-fftw=$with_fftw $have_fftw
3580 FlashPIX --with-fpx=$with_fpx $have_fpx
3581 FontConfig --with-fontconfig=$with_fontconfig $have_fontconfig
3582 FreeType --with-freetype=$with_freetype $have_freetype
3583 GhostPCL None $PCLDelegate ($PCLVersion)
3584 GhostXPS None $XPSDelegate ($XPSVersion)
3585 Ghostscript None $PSDelegate ($GSVersion)
3586 Ghostscript fonts --with-gs-font-dir=$with_gs_font_dir $result_ghostscript_font_dir
3587 Ghostscript lib --with-gslib=$with_gslib $have_gslib
3588 Graphviz --with-gvc=$with_gvc $have_gvc
3589 JBIG --with-jbig=$with_jbig $have_jbig
3590 JPEG v1 --with-jpeg=$with_jpeg $have_jpeg
3591 JPEG-2000 --with-jp2=$with_jp2 $have_jp2
3592 LCMS v1 --with-lcms=$with_lcms $have_lcms
3593 LCMS v2 --with-lcms2=$with_lcms2 $have_lcms2
3594 LQR --with-lqr=$with_lqr $have_lqr
3595 LZMA --with-lzma=$with_lzma $have_lzma
3596 Magick++ --with-magick-plus-plus=$with_magick_plus_plus $have_magick_plus_plus
3597 OpenEXR --with-openexr=$with_openexr $have_openexr
3598 PERL --with-perl=$with_perl $have_perl
3599 PNG --with-png=$with_png $have_png
3600 RSVG --with-rsvg=$with_rsvg $have_rsvg
3601 TIFF --with-tiff=$with_tiff $have_tiff
3602 WEBP --with-webp=$with_webp $have_webp
3603 Windows fonts --with-windows-font-dir=$with_windows_font_dir $result_windows_font_dir
3604 WMF --with-wmf=$with_wmf $have_wmf
3605 X11 --with-x=$with_x $have_x
3606 XML --with-xml=$with_xml $have_xml
3607 ZLIB --with-zlib=$with_zlib $have_zlib
3610 X_CFLAGS = $X_CFLAGS
3611 X_PRE_LIBS = $X_PRE_LIBS
3613 X_EXTRA_LIBS = $X_EXTRA_LIBS
3615 Options used to compile and link:
3616 PREFIX = $PREFIX_DIR
3617 EXEC-PREFIX = $EXEC_PREFIX_DIR
3618 VERSION = $PACKAGE_VERSION
3621 CPPFLAGS = $MAGICK_CPPFLAGS
3622 PCFLAGS = $MAGICK_PCFLAGS
3625 MAGICK_LDFLAGS = $MAGICK_LDFLAGS
3628 CXXFLAGS = $CXXFLAGS
3629 FEATURES = $MAGICK_FEATURES