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], [8])
22 m4_define([magick_version],
23 [magick_major_version.magick_minor_version.magick_micro_version])
25 AC_INIT([ImageMagick],[magick_version],[http://www.imagemagick.org],[ImageMagick-magick_version])
26 AC_CONFIG_SRCDIR([magick/MagickCore.h])
27 AC_CONFIG_AUX_DIR([config])
28 AC_CONFIG_MACRO_DIR([m4])
29 AC_CONFIG_LIBOBJ_DIR([ltdl])
30 AC_CONFIG_HEADERS([config/config.h])
31 AX_PREFIX_CONFIG_H([magick/magick-config.h],[MagickCore])
33 config/configure.xml \
34 config/delegates.xml \
35 config/ImageMagick.rdf \
36 config/MagickCore.dox \
37 config/MagickWand.dox \
38 config/type-dejavu.xml \
39 config/type-ghostscript.xml \
40 config/type-windows.xml \
43 Magick++/bin/Magick++-config \
44 magick/ImageMagick.pc \
45 Magick++/lib/ImageMagick++.pc \
46 Magick++/lib/Magick++.pc \
47 magick/Magick-config \
48 magick/MagickCore-config \
49 magick/MagickCore.pc \
53 PerlMagick/Magick.pm \
54 PerlMagick/Makefile.PL \
58 utilities/composite.1 \
62 utilities/identify.1 \
63 utilities/ImageMagick.1 \
68 wand/MagickWand-config \
74 # Save initial user-tunable values
77 for var in CC CFLAGS CPPFLAGS CXX CXXCPP LDFLAGS LIBS ; do
78 eval isset=\${$var+set}
79 if test "$isset" = 'set'; then
81 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS}'${var}=${val}' "
84 AC_SUBST(DISTCHECK_CONFIG_FLAGS)
86 CONFIGURE_ARGS="$0 ${ac_configure_args}"
87 AC_SUBST(CONFIGURE_ARGS)
89 # Source file containing package/library versioning information.
90 . ${srcdir}/version.sh
92 echo "configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}${PACKAGE_VERSION_ADDENDUM}"
96 AC_CANONICAL_TARGET([])
98 MAGICK_TARGET_CPU=$target_cpu
99 AC_SUBST(MAGICK_TARGET_CPU)
101 MAGICK_TARGET_VENDOR=$target_vendor
102 AC_SUBST(MAGICK_TARGET_VENDOR)
104 MAGICK_TARGET_OS=$target_os
105 AC_SUBST(MAGICK_TARGET_OS)
107 # Substitute library versioning
108 AC_SUBST(MAGICK_LIBRARY_CURRENT)dnl
109 AC_SUBST(MAGICK_LIBRARY_REVISION)dnl
110 AC_SUBST(MAGICK_LIBRARY_AGE)dnl
111 AC_SUBST([MAGICK_LIBRARY_CURRENT_MIN],
112 [`expr $MAGICK_LIBRARY_CURRENT - $MAGICK_LIBRARY_AGE`])
113 AC_SUBST([MAGICK_LIBRARY_VERSION_INFO],
114 [$MAGICK_LIBRARY_CURRENT:$MAGICK_LIBRARY_REVISION:$MAGICK_LIBRARY_AGE])
116 AC_SUBST(PACKAGE_NAME)dnl
117 AC_SUBST(PACKAGE_VERSION)dnl
118 AC_SUBST(PACKAGE_RELEASE)dnl
119 AC_SUBST(PACKAGE_CHANGE_DATE)dnl
120 AC_SUBST(PACKAGE_LIB_VERSION)dnl
121 AC_SUBST(PACKAGE_LIB_VERSION_NUMBER)dnl
122 AC_SUBST(PACKAGE_RELEASE_DATE)dnl
123 AC_SUBST(PACKAGE_VERSION_ADDENDUM)dnl
125 # Ensure that make can run correctly
128 AM_INIT_AUTOMAKE($PACKAGE_NAME,"${PACKAGE_VERSION}${PACKAGE_VERSION_ADDENDUM}", ' ')
130 # Enable support for silent build rules
131 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
133 MAGICK_LIB_VERSION="0x"
134 if test ${MAGICK_LIBRARY_CURRENT} -lt 10 ; then
135 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
137 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_CURRENT}
138 if test ${MAGICK_LIBRARY_AGE} -lt 10 ; then
139 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
141 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_AGE}
142 if test ${MAGICK_LIBRARY_REVISION} -lt 10 ; then
143 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
145 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_REVISION}
146 AC_SUBST(MAGICK_LIB_VERSION)
148 # Definition used to define MagickLibVersionText in version.h
149 MAGICK_LIB_VERSION_TEXT="${PACKAGE_VERSION}"
150 AC_SUBST(MAGICK_LIB_VERSION_TEXT)
152 # Definition used to define MagickLibVersionNumber in version.h
153 MAGICK_LIB_VERSION_NUMBER="${MAGICK_LIBRARY_CURRENT},${MAGICK_LIBRARY_AGE},${MAGICK_LIBRARY_REVISION}"
154 AC_SUBST(MAGICK_LIB_VERSION_NUMBER)
156 # Regenerate config.status if ChangeLog or version.sh is updated.
157 AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/version.sh'])
162 MAGICK_CPPFLAGS=$CPPFLAGS_USER
163 MAGICK_PCFLAGS=$CPPFLAGS_USER
169 # Evaluate shell variable equivalents to Makefile directory variables
171 if test "x$prefix" = xNONE; then
172 prefix=$ac_default_prefix
174 # Let make expand exec_prefix.
175 if test "x$exec_prefix" = xNONE; then
176 exec_prefix='${prefix}'
180 eval "eval PREFIX_DIR=${prefix}"
182 eval "eval EXEC_PREFIX_DIR=${exec_prefix}"
183 AC_SUBST(EXEC_PREFIX_DIR)
184 eval "eval BIN_DIR=$bindir"
186 eval "eval SBIN_DIR=$sbindir"
188 eval "eval LIBEXEC_DIR=$libexecdir"
189 AC_SUBST(LIBEXEC_DIR)
190 eval "eval DATA_DIR=$datadir"
192 eval "eval DOC_DIR=$docdir"
194 eval "eval SYSCONF_DIR=$sysconfdir"
195 AC_SUBST(SYSCONF_DIR)
196 eval "eval SHAREDSTATE_DIR=$sharedstatedir"
197 AC_SUBST(SHAREDSTATE_DIR)
198 eval "eval LOCALSTATE_DIR=$localstatedir"
199 AC_SUBST(LOCALSTATE_DIR)
200 eval "eval LIB_DIR=$libdir"
202 eval "eval INCLUDE_DIR=$includedir"
203 AC_SUBST(INCLUDE_DIR)
204 eval "eval PERSISTINCLUDE_DIR=$oldincludedir"
205 AC_SUBST(PERSISTINCLUDE_DIR)
206 eval "eval INFO_DIR=$infodir"
208 eval "eval MAN_DIR=$mandir"
211 # Get full paths to source and build directories
212 srcdirfull="`cd $srcdir && pwd`"
216 # Compute variables useful for running uninstalled software.
218 MAGICK_CODER_MODULE_PATH="${builddir}/coders"
219 MAGICK_CONFIGURE_SRC_PATH="${srcdirfull}/config"
220 MAGICK_CONFIGURE_BUILD_PATH="${builddir}/config"
221 MAGICK_FILTER_MODULE_PATH="${builddir}/filters"
223 case "${build_os}" in
225 MAGICK_CODER_MODULE_PATH=`$WinPathScript "${MAGICK_CODER_MODULE_PATH}" 0`
226 MAGICK_CONFIGURE_SRC_PATH=`$WinPathScript "${MAGICK_CONFIGURE_SRC_PATH}" 0`
227 MAGICK_CONFIGURE_BUILD_PATH=`$WinPathScript "${MAGICK_CONFIGURE_BUILD_PATH}" 0`
228 MAGICK_FILTER_MODULE_PATH=`$WinPathScript "${MAGICK_FILTER_MODULE_PATH}" 0`
237 AC_SUBST(MAGICK_CODER_MODULE_PATH)
238 AC_SUBST(MAGICK_CONFIGURE_SRC_PATH)
239 AC_SUBST(MAGICK_CONFIGURE_BUILD_PATH)
240 AC_SUBST(MAGICK_FILTER_MODULE_PATH)
245 # Enable OS features.
247 AC_USE_SYSTEM_EXTENSIONS
267 # Enable run-time checking.
269 AC_ARG_ENABLE([bounds-checking],
270 [AC_HELP_STRING([--bounds-checking],
271 [enable run-time bounds-checking])],
272 [enable_bounds_checking=$enableval],
273 [enable_bounds_checking='no'])
275 if test "$enable_bounds_checking" = yes; then
276 AC_DEFINE([_FORTIFY_SOURCE], [2],
277 [enable run-time bounds-checking])
288 native_win32_build='no'
296 native_win32_build='yes'
300 if test "${GDI32_LIBS}x" != 'x'; then
301 AC_DEFINE(WINGDI32_DELEGATE,1,Define to use the Windows GDI32 library)
304 AM_CONDITIONAL(WINGDI32_DELEGATE, test "${GDI32_LIBS}x" != 'x' )
305 AM_CONDITIONAL(WIN32_NATIVE_BUILD, test "${native_win32_build}" = 'yes' )
306 AM_CONDITIONAL(CYGWIN_BUILD, test "${cygwin_build}" = 'yes' )
307 AM_CONDITIONAL(USING_CL, test "x${CC}" = 'xcl.exe' )
309 WinPathScript="${srcdirfull}/winpath.sh"
310 AC_SUBST(WinPathScript)
313 # Compiler flags tweaks
315 if test "${GCC}" != "yes"; then
318 # aCC: HP ANSI C++ B3910B A.03.34
319 CFLAGS="${CFLAGS} -Wp,-H30000"
320 if test -n "${CXXFLAGS}"; then
323 CXXFLAGS="${CXXFLAGS} -AA"
327 # Compaq alphaev68-dec-osf5.1 compiler
328 if test -n "${CXXFLAGS}"; then
329 CXXFLAGS='-std strict_ansi -noimplicit_include'
331 CXXFLAGS="${CXXFLAGS} -std strict_ansi -noimplicit_include"
336 # Check for lazy-loading.
337 AC_CACHE_CHECK([for linker lazyload option],[im_cv_ld_lazyload],
339 im_cv_ld_lazyload='none'
341 *-*-solaris2.8 | *-*-solaris2.9 | *-*-solaris2.1? )
342 if test "$lt_cv_prog_gnu_ld" != 'yes' ; then
343 im_cv_ld_lazyload='-Wl,-zlazyload'
348 if test "${im_cv_ld_lazyload}" != 'none' ; then
349 if test -z "${LDFLAGS}" ; then
350 LDFLAGS="${im_cv_ld_lazyload}"
352 LDFLAGS="${im_cv_ld_lazyload} ${LDFLAGS}"
356 dnl Platform-specific stuff
358 *darwin* | *-macos10*)
359 dnl OS X universal binary support, requires --disable-dependency-tracking
360 AC_ARG_ENABLE([osx-universal-binary],
361 AC_HELP_STRING([--enable-osx-universal-binary],
362 [build universal binary on OS X [[default=no]]]),
363 [build_osxuniversal="${enableval}"], [build_osxuniversal=no])
365 if test "${build_osxuniversal}" != no ; then
366 if test "$enable_dependency_tracking" != no ; then
367 AC_MSG_ERROR([--enable-osx-universal-binary requires --disable-dependency-tracking.
368 Please re-run configure with these options:
369 --disable-dependency-tracking --enable-osx-universal-binary
372 CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
373 CXXFLAGS="$CXXFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
374 LDFLAGS="$LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
379 # Enable support for threads
380 AC_ARG_WITH([threads],
381 [AC_HELP_STRING([--without-threads], [disable threads support])],
382 [with_threads=$withval],
383 [with_threads='yes'])
386 if test "$with_threads" != 'no'; then
388 if test "$ax_pthread_ok" = yes; then
390 DEF_THREAD="$PTHREAD_CFLAGS"
391 CFLAGS="$CFLAGS $DEF_THREAD"
392 CXXFLAGS="$CXXFLAGS $DEF_THREAD"
393 if test "$CC" != "$PTHREAD_CC"; then
394 AC_MSG_WARN([Replacing compiler $CC with compiler $PTHREAD_CC to support pthreads.])
397 AC_DEFINE(THREAD_SUPPORT,1,[Define if you have POSIX threads libraries and header files.])
401 # Enable support for OpenMP
402 if test "$have_threads" != 'yes'; then
403 ac_cv_prog_c_openmp=unsupported
406 CFLAGS="$OPENMP_CFLAGS $CFLAGS"
407 MAGICK_PCFLAGS="$MAGICK_PCFLAGS $OPENMP_CFLAGS"
408 AC_SUBST(OPENMP_CFLAGS)
409 if test "$enable_openmp" != no; then
410 if test "$ac_cv_prog_c_openmp" != 'unsupported'; then
411 MAGICK_FEATURES="OpenMP $MAGICK_FEATURES"
415 # Enable support for OpenCL
417 CFLAGS="$CL_CFLAGS $CFLAGS"
418 LIBS="$CL_LIBS $LIBS"
420 if test "$enable_opencl" != no; then
421 if test "_OPENCL" = '1'; then
422 MAGICK_FEATURES="OpenCL $MAGICK_FEATURES"
428 # Check for large file support
434 if test "$enable_largefile" != no; then
435 if test "$ac_cv_sys_file_offset_bits" != 'no'; then
436 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
438 AC_MSG_CHECKING([for native large file support])
439 AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>
441 exit(!(sizeof(off_t) == 8));
443 [ac_cv_sys_file_offset_bits=64; AC_DEFINE(_FILE_OFFSET_BITS,64)
444 AC_MSG_RESULT([yes])],
445 [AC_MSG_RESULT([no])])
447 if test "$ac_cv_sys_large_files" != 'no'; then
448 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGE_FILES=1"
450 if test "$ac_cv_sys_largefile_source" != 'no'; then
451 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGEFILE_SOURCE=1"
454 AC_SUBST(LFS_CPPFLAGS)
457 # Configure libtool & libltdl
463 AC_SUBST(LIBTOOL_DEPS)
466 LT_CONFIG_LTDL_DIR([ltdl])
467 LTDL_INIT([convenience nonrecursive])
469 # Check to see if building shared libraries
470 libtool_build_shared_libs='no'
471 if test "$enable_shared" = 'yes'; then
472 libtool_build_shared_libs='yes'
475 # Check to see if building static libraries
476 libtool_build_static_libs='no'
477 if test "$enable_static" = 'yes'; then
478 libtool_build_static_libs='yes'
481 AM_CONDITIONAL(WITH_SHARED_LIBS, test "${libtool_build_shared_libs}" = 'yes')
483 # Enable support for building loadable modules
485 AC_ARG_WITH([modules],
486 [AC_HELP_STRING([--with-modules],
487 [enable building dynamically loadable modules])],
488 [with_modules=$withval],
491 # Only allow building loadable modules if we are building shared libraries
492 if test "$with_modules" != 'no' ; then
493 if test "$libtool_build_shared_libs" = 'no'; then
494 AC_MSG_WARN([Modules may only be built if building shared libraries is enabled.])
498 if test "$with_modules" != 'no'; then
499 AC_DEFINE(BUILD_MODULES,1,Define if coders and filters are to be built as modules.)
501 AM_CONDITIONAL(WITH_MODULES, test "$with_modules" != 'no')
503 # Enable building/use of libltdl if we are building shared libraries regardless
504 # of whether modules are built or not.
506 if test "$libtool_build_shared_libs" != 'no'; then
510 AM_CONDITIONAL(WITH_LTDL, test "$with_ltdl" != 'no')
511 if test "$with_ltdl" != 'no'; then
512 AC_DEFINE(LTDL_DELEGATE,1,Define if using libltdl to support dynamically loadable modules)
515 if test X"$enable_shared" = Xyes; then
516 DLLDFLAGS=-export-dynamic
521 # Enable build using delegate libraries built in subdirectories rather than installed
522 # delegate libraries (bzlib fftw fpx gslib jp2 jbig jpeg lcms lzma png tiff ttf wmf xml zlib)
523 AC_ARG_ENABLE([delegate-build],
524 [AC_HELP_STRING([--enable-delegate-build],
525 [look for delegate libraries in build directory])],
526 [enable_delegate_build=$enableval],
527 [enable_delegate_build='no'])
529 AC_ARG_ENABLE([deprecated],
530 [AC_HELP_STRING([--disable-deprecated],
531 [exclude deprecated methods in MagickCore and MagickWand API's])],
532 [enable_deprecated=$enableval],
533 [enable_deprecated='no'])
535 if test "$enable_deprecated" = 'yes'; then
536 AC_DEFINE(EXCLUDE_DEPRECATED,1,[exclude deprecated methods in MagickCore API])
538 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-deprecated "
541 # Build a version of ImageMagick which operates uninstalled.
542 # Used to build distributions located via MAGICK_HOME / executable path
543 AC_ARG_ENABLE([installed],
544 [AC_HELP_STRING([--disable-installed],
545 [Formally install ImageMagick under PREFIX])],
546 [enable_installed=$enableval],
547 [enable_installed='yes'])
549 if test "$enable_installed" = 'yes'; then
550 AC_DEFINE(INSTALLED_SUPPORT,1,[ImageMagick is formally installed under prefix])
552 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-installed "
555 # Permit enciphering and deciphering image pixels.
556 AC_ARG_ENABLE([cipher],
557 [AC_HELP_STRING([--disable-cipher],
558 [disable enciphering and deciphering image pixels])],
559 [enable_cipher=$enableval],
560 [enable_cipher='yes'])
562 if test "$enable_cipher" = 'yes'; then
563 AC_DEFINE(CIPHER_SUPPORT,1,[permit enciphering and deciphering image pixels])
566 # Build an embeddable version of ImageMagick.
567 AC_ARG_ENABLE([embeddable],
568 [AC_HELP_STRING([--enable-embeddable],
569 [enable self-contained, embeddable, zero-configuration ImageMagick])],
570 [enable_embeddable=$enableval],
571 [enable_embeddable='no'])
573 if test "$enable_embeddable" = 'yes'; then
574 AC_DEFINE(EMBEDDABLE_SUPPORT,1,[Build self-contained, embeddable, zero-configuration ImageMagick])
577 # Build a high dynamic range version of ImageMagick.
578 AC_ARG_ENABLE([hdri],
579 [AC_HELP_STRING([--enable-hdri],
580 [accurately represent the wide range of intensity levels found in real scenes])],
581 [enable_hdri=$enableval],
585 if test "$enable_hdri" = 'yes'; then
587 AC_DEFINE(HDRI_SUPPORT,1,[accurately represent the wide range of intensity levels in real scenes])
588 MAGICK_FEATURES="HDRI $MAGICK_FEATURES"
590 AC_SUBST(MAGICK_HDRI)dnl
592 # Build a version of ImageMagick with assert statements.
593 AC_ARG_ENABLE([assert],
594 [AC_HELP_STRING([--disable-assert],
595 [disable assert() statements in build])],
596 [enable_assert=$enableval],
597 [enable_assert='yes'])
599 if test "$enable_assert" = 'no'; then
600 AC_DEFINE(NDEBUG,1,[Turn off assert statements])
603 # Add configure option --enable-maintainer-mode which enables dependency
604 # checking and generation useful to package maintainers. This is made an
605 # option to avoid confusing end users.
609 # Enable ccmalloc memory debugging support
610 AC_ARG_ENABLE([ccmalloc],
611 [AC_HELP_STRING([--enable-ccmalloc],
612 [enable 'ccmalloc' memory debug support])],
613 [enable_ccmalloc=$enableval],
614 [enable_ccmalloc='no'])
616 # Enable Electric Fence memory debugging support
617 AC_ARG_ENABLE([efence],
618 [AC_HELP_STRING([--enable-efence],
619 [enable 'efence' memory debug support])],
620 [enable_efence=$enableval],
621 [enable_efence='no'])
623 # Enable prof-based profiling support
624 AC_ARG_ENABLE([prof],
625 [AC_HELP_STRING([--enable-prof],
626 [enable 'prof' profiling support])],
627 [enable_prof=$enableval],
630 # Enable gprof-based profiling support
631 AC_ARG_ENABLE([gprof],
632 [AC_HELP_STRING([--enable-gprof],
633 [enable 'gprof' profiling support])],
634 [enable_gprof=$enableval],
637 # Enable gcov-based profiling support
638 AC_ARG_ENABLE([gcov],
639 [AC_HELP_STRING([--enable-gcov],
640 [enable 'gcov' profiling support])],
641 [enable_gcov=$enableval],
644 enable_profiling='no'
645 if test "$enable_prof" = 'yes' || test "$enable_gprof" = 'yes' || test "$enable_gcov" = 'yes'; then
646 enable_profiling='yes'
647 if test "$libtool_build_shared_libs" = 'yes'; then
648 echo "Warning: Can not profile code using shared libraries"
652 # Magick API method prefix
653 AC_ARG_WITH([method-prefix],
654 [AC_HELP_STRING([--with-method-prefix=PREFIX],
655 [prefix MagickCore API methods])],
656 [with_method_prefix=$enableval],
657 [with_method_prefix=''])
659 if test "$with_method_prefix" != ''; then
660 AC_DEFINE_UNQUOTED(NAMESPACE_PREFIX,$with_method_prefix,[Magick API method prefix])
663 # Number of bits in a Quantum
664 AC_ARG_WITH([quantum-depth],
665 [AC_HELP_STRING([--with-quantum-depth=DEPTH],
666 [number of bits in a pixel quantum (default 16)])],
667 [with_quantum_depth=$withval],
668 [with_quantum_depth=16])
670 if test "$with_quantum_depth" != '8'; then
671 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-quantum-depth=$with_quantum_depth "
674 case "${with_quantum_depth}" in
679 * ) AC_MSG_ERROR("Pixel quantum depth must have value of 8, 16, 32, or 64") ;;
681 if test "$enable_hdri" = 'yes'; then
682 with_quantum_depth=16
684 QUANTUM_DEPTH="$with_quantum_depth"
685 AC_DEFINE_UNQUOTED(QUANTUM_DEPTH,$QUANTUM_DEPTH,[Number of bits in a pixel Quantum (8/16/32/64)])
686 AC_SUBST(QUANTUM_DEPTH)dnl
688 # Set pixel cache threshold
690 [AC_HELP_STRING([--with-cache=THRESHOLD],
691 [set pixel cache threshhold in MB (default available memory)])],
692 [with_cache=$withval],
695 if test "$with_cache" != ''; then
696 AC_DEFINE_UNQUOTED(PixelCacheThreshold,$with_cache,[Pixel cache threshold in MB (defaults to available memory)])
697 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-cache=$with_cache "
700 # Disable/Enable support for full delegate paths
701 AC_ARG_WITH([frozenpaths],
702 [AC_HELP_STRING([--with-frozenpaths],
703 [freeze delegate paths])],
704 [with_frozenpaths=$withval],
705 [with_frozenpaths='no'])
707 # Enable build/install of Magick++
708 AC_ARG_WITH([magick-plus-plus],
709 [AC_HELP_STRING([--without-magick-plus-plus],
710 [disable build/install of Magick++])],
711 [with_magick_plus_plus=$withval],
712 [with_magick_plus_plus='yes'])
714 # Disable build/install of PerlMagick.
716 [AC_HELP_STRING([--with-perl],
717 [enable build/install of PerlMagick])],
718 [with_perl=$withval],
721 # Options to pass when configuring PerlMagick
722 AC_ARG_WITH([perl-options],
723 [AC_HELP_STRING([--with-perl-options=OPTIONS],
724 [options to pass on command-line when generating PerlMagick's build file])],
725 PERL_MAKE_OPTIONS=$withval)
726 AC_SUBST(PERL_MAKE_OPTIONS)
728 # Enable umem, object-caching memory allocation library.
730 [ --with-umem enable umem memory allocation library support],
731 [with_umem=$withval],
733 if test "$with_umem" != 'yes' ; then
734 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-umem=$with_umem "
738 # Specify path to shared libstdc++ if not in normal location
740 AC_ARG_WITH([libstdc],
741 [AC_HELP_STRING([--with-libstdc=DIR],
742 [ use libstdc++ in DIR (for GNU C++)])],
743 [with_libstdc=$withval],
746 if test "$with_libstdc" != ''; then
747 if test -d "$with_libstdc"; then
748 LIBSTDCLDFLAGS="-L$with_libstdc"
751 AC_SUBST(LIBSTDCLDFLAGS)
753 # Does gcc required -traditional?
754 AC_PROG_GCC_TRADITIONAL
758 # Set defines required to build DLLs and modules using MinGW
761 # These options are set for multi-thread DLL module build
762 # libMagickCore: _DLL _MAGICKMOD_ _MAGICKLIB_
764 # executable/Magick++: _DLL _MAGICKMOD_
765 MODULE_EXTRA_CPPFLAGS=''
766 LIBRARY_EXTRA_CPPFLAGS=''
767 if test "${native_win32_build}" = 'yes'; then
768 if test "${libtool_build_shared_libs}" = 'yes'; then
769 CPPFLAGS="$CPPFLAGS -D_DLL"
770 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_DLL"
771 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_DLL"
772 LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKLIB_"
773 if test "$with_modules" = 'yes'; then
774 LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKMOD_"
776 MODULE_EXTRA_CPPFLAGS="$MODULE_EXTRA_CPPFLAGS -D_MAGICKLIB_"
779 CPPFLAGS="$CPPFLAGS -D_LIB"
780 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_LIB"
781 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_LIB"
783 if test "$with_threads" = 'yes'; then
784 CPPFLAGS="$CPPFLAGS -D_MT"
785 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_MT"
786 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_MT"
789 AC_SUBST(MODULE_EXTRA_CPPFLAGS)
790 AC_SUBST(LIBRARY_EXTRA_CPPFLAGS)
792 # Check standard headers
794 if ! test x"$ac_cv_header_stdc" = x"yes"; then
795 AC_MSG_WARN([configure has detected that you do not have the ANSI standard C
796 header files. Compilation cannot proceed. Please install the ANSI C
797 headers and rerun this script.]);
802 # Check additional headers
803 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)
807 # Checks for typedefs, structures, and compiler characteristics.
820 # If the C compiler supports the keyword inline, do nothing. Otherwise
821 # define inline to __inline__ or __inline if it accepts one of those,
822 # otherwise define inline to be empty.
825 # If the C compiler supports the keyword restrict, do nothing. Otherwise
826 # define restrict to __restrict__ or __restrict if it accepts one of those,
827 # otherwise define restrict to be empty.
830 # If words are stored with the most significant byte first (like
831 # Motorola and SPARC CPUs), define `WORDS_BIGENDIAN'.
834 # Define mode_t to a suitable type, if standard headers do not define it.
837 # Define off_t to a suitable type, if standard headers do not define it.
840 # Define pid_t to a suitable type, if standard headers do not define it.
843 # Define size_t to a suitable type, if standard headers do not define it.
846 # Define ssize_t to a suitable type, if standard headers do not define it.
849 # If the C compiler supports a working long double type with more range
850 # or precision than the double type, define HAVE_LONG_DOUBLE.
851 AC_TYPE_LONG_DOUBLE_WIDER
853 # If the C type char is unsigned, define __CHAR_UNSIGNED__, unless the
854 # C compiler predefines it.
857 # Obtain size of an 'signed short' and define as SIZEOF_SIGNED_SHORT
858 AC_CHECK_SIZEOF(signed short)
860 # Obtain size of an 'unsigned short' and define as SIZEOF_UNSIGNED_SHORT
861 AC_CHECK_SIZEOF(unsigned short)
863 # Obtain size of an 'signed int' and define as SIZEOF_SIGNED_INT
864 AC_CHECK_SIZEOF(signed int)
866 # Obtain size of an 'unsigned int' and define as SIZEOF_UNSIGNED_INT
867 AC_CHECK_SIZEOF(unsigned int)
869 # Obtain size of a 'signed long' and define as SIZEOF_SIGNED_LONG
870 AC_CHECK_SIZEOF(signed long)
872 # Obtain size of a 'unsigned long' and define as SIZEOF_UNSIGNED_LONG
873 AC_CHECK_SIZEOF(unsigned long)
875 # Obtain size of a 'long long' and define as SIZEOF_SIGNED_LONG_LONG. If
876 # 'signed long long' is not supported then the value defined is zero.
877 AC_CHECK_SIZEOF(signed long long)
879 # Obtain size of a 'unsigned long long' and define as
880 # SIZEOF_UNSIGNED_LONG_LONG. If 'unsigned long long' is not
881 # supported then the value defined is zero.
882 AC_CHECK_SIZEOF(unsigned long long)
884 # Obtain size of off_t and define as SIZEOF_OFF_T
885 AC_CHECK_SIZEOF(off_t)
887 # Obtain size of size_t and define as SIZEOF_SIZE_T
888 AC_CHECK_SIZEOF(size_t)
890 # Obtain size of ssize_t and define as SIZEOF_SSIZE_T
891 AC_CHECK_SIZEOF(ssize_t)
893 # Obtain size of an unsigned int pointer and define as SIZEOF_UNSIGNED_INTP
894 AC_CHECK_SIZEOF(unsigned int*)
897 # Compute sized types for current CPU and compiler options.
900 AC_MSG_CHECKING(for signed 8-bit type)
902 AC_MSG_RESULT($INT8_T)
905 AC_MSG_CHECKING(for unsigned 8-bit type)
906 UINT8_T='unsigned char'
907 AC_MSG_RESULT($UINT8_T)
910 AC_MSG_CHECKING(for signed 16-bit type)
911 INT16_T='signed short'
912 AC_MSG_RESULT($INT16_T)
915 AC_MSG_CHECKING(for unsigned 16-bit type)
916 UINT16_T='unsigned short'
917 AC_MSG_RESULT($UINT16_T)
920 AC_MSG_CHECKING(for signed 32-bit type)
922 if test $ac_cv_sizeof_signed_int -eq 4; then
924 elif test $ac_cv_sizeof_signed_long -eq 4; then
925 INT32_T='signed long'
927 AC_MSG_RESULT($INT32_T)
930 AC_MSG_CHECKING(for unsigned 32-bit type)
932 if test $ac_cv_sizeof_unsigned_int -eq 4; then
933 UINT32_T='unsigned int'
934 elif test $ac_cv_sizeof_unsigned_long -eq 4; then
935 UINT32_T='unsigned long'
937 AC_MSG_RESULT($UINT32_T)
940 AC_MSG_CHECKING(for signed 64-bit type)
942 if test $ac_cv_sizeof_signed_long -eq 8; then
943 INT64_T='signed long'
944 elif test $ac_cv_sizeof_signed_long_long -eq 8; then
945 INT64_T='signed long long'
947 AC_MSG_RESULT($INT64_T)
950 AC_MSG_CHECKING(for unsigned 64-bit type)
952 if test $ac_cv_sizeof_unsigned_long -eq 8; then
953 UINT64_T='unsigned long'
954 elif test $ac_cv_sizeof_unsigned_long_long -eq 8; then
955 UINT64_T='unsigned long long'
957 AC_MSG_RESULT($UINT64_T)
960 AC_MSG_CHECKING(for unsigned maximum type)
962 if test "$UINT64_T" != 'none'; then
964 elif test "$UINT32_T" != 'none'; then
967 AC_MSG_RESULT($UINTMAX_T)
970 AC_MSG_CHECKING(for pointer difference type)
972 if test $ac_cv_sizeof_unsigned_long -eq $ac_cv_sizeof_unsigned_intp; then
973 UINTPTR_T='unsigned long'
974 elif test $ac_cv_sizeof_unsigned_long_long -eq $ac_cv_sizeof_unsigned_intp; then
975 UINTPTR_T='unsigned long long'
977 AC_MSG_RESULT($UINTPTR_T)
980 AC_MSG_CHECKING([whether our compiler supports __func__])
982 [{ const char *func = __func__; return(func != 0 ? 0 : 1); }],
983 AC_MSG_RESULT([yes]),
985 AC_MSG_CHECKING([whether our compiler supports __FUNCTION__])
987 [{ const char *func = __FUNCTION__; return(func != 0 ? 0 : 1); }],
989 AC_DEFINE(__func__, __FUNCTION__,
990 [Define to appropriate substitue if compiler does not have __func__]),
992 AC_DEFINE(__func__, __FILE__,
993 [Define to appropriate substitue if compiler does not have __func__])))
997 # Check for functions
1000 MAGICK_FUNC_MMAP_FILEIO
1001 AC_FUNC_CLOSEDIR_VOID
1005 AC_FUNC_SELECT_ARGTYPES
1006 AC_FUNC_SETVBUF_REVERSED
1015 AC_CHECK_LIB(m,sqrt,MATH_LIBS="-lm",,)
1016 LIBS="$MATH_LIBS $LIBS"
1019 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])
1022 # Check for clock_gettime().
1024 AC_SEARCH_LIBS(clock_gettime, rt,
1026 AC_DEFINE([HAVE_CLOCK_GETTIME],[1],[Define to 1 if you have clock_gettime.])
1027 AC_MSG_CHECKING([whether clock_gettime supports CLOCK_REALTIME])
1030 [[#include <time.h>]],
1031 [[clockid_t clockType = CLOCK_REALTIME;]])],
1034 AC_DEFINE([HAVE_CLOCK_REALTIME],[1],
1035 [Define to 1 if clock_gettime supports CLOCK_REALTIME.])
1041 AC_CHECK_FUNCS([gettimeofday ftime], [break])
1047 # Check for function prototypes
1051 AC_CHECK_DECLS([pread, pwrite],[],[],[
1052 #include <unistd.h>])
1054 AC_CHECK_DECLS([strlcpy],[],[],[
1055 #include <strings.h>])
1057 AC_CHECK_DECLS([vsnprintf],[],[],[
1059 #include <stdarg.h>])
1063 # C++ Support Tests (For Magick++)
1066 have_magick_plus_plus='no'
1067 if test "$with_magick_plus_plus" = 'yes'; then
1072 # Full set of headers used...
1073 # algorithm cctype cerrno cmath cstdio cstdlib cstring ctime exception
1074 # functional iomanip iosfwd iostream iterator list string strstream utility
1079 AX_CXX_NAMESPACE_STD
1080 AC_CXX_HAVE_STD_LIBS
1084 AC_MSG_CHECKING([whether C++ compiler is sufficient for Magick++])
1086 test $ax_cv_cxx_bool = 'yes' && \
1087 test $ax_cv_cxx_namespaces = 'yes' && \
1088 test $ac_cv_cxx_have_std_libs = 'yes' && \
1089 test $ax_cv_cxx_have_std_namespace = 'yes'; then
1090 have_magick_plus_plus='yes'
1092 have_magick_plus_plus='no (failed tests)'
1094 AC_MSG_RESULT([$have_magick_plus_plus])
1097 AM_CONDITIONAL(WITH_MAGICK_PLUS_PLUS, test "$have_magick_plus_plus" = 'yes')
1099 # Only check for delegate libraries in subdirectories if requested.
1100 if test "$enable_delegate_build" != 'no'; then
1101 # Check for delegate sub-directories and add -I & -L options as required.
1102 # This presumes that delegates are installed as detailed in the ImageMagick
1103 # README. If delegates are installed in a standard location where the
1104 # compiler will automatically find them then these options should not be
1108 # Most delegates have includes in the same directory as the library, but not all...
1111 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
1112 if test -d "$builddir/$dir"; then
1113 CPPFLAGS="$CPPFLAGS -I$builddir/$dir"
1115 if test -d "$srcdirfull/$dir"; then
1116 CPPFLAGS="$CPPFLAGS -I$srcdirfull/$dir"
1122 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
1123 if test -d "$builddir/$dir/.libs"; then
1124 LDFLAGS="$LDFLAGS -L$builddir/$dir/.libs"
1126 if test -d "$srcdirfull/$dir/.libs"; then
1127 LDFLAGS="$LDFLAGS -L$srcdirfull/$dir/.libs"
1130 if test -d "$builddir/$dir"; then
1131 LDFLAGS="$LDFLAGS -L$builddir/$dir"
1133 if test -d "$srcdirfull/$dir"; then
1134 LDFLAGS="$LDFLAGS -L$srcdirfull/$dir"
1140 # Assume that delegate headers reside under same directory as ImageMagick
1141 # installation prefix.
1142 MAGICK_CPPFLAGS="-I$INCLUDE_DIR/ImageMagick $MAGICK_CPPFLAGS"
1145 # Find the X11 RGB database
1147 AC_CACHE_CHECK(for X11 configure files,im_cv_x_configure,
1148 [# Look for the header file in a standard set of common directories.
1149 # Check X11 before X11Rn because it is often a symlink to the current release.
1158 /usr/XFree86/lib/X11 \
1166 /usr/local/X11/lib \
1167 /usr/local/X11R4/lib \
1168 /usr/local/X11R5/lib \
1169 /usr/local/X11R6/lib \
1171 /usr/local/lib/X11 \
1172 /usr/local/lib/X11R4 \
1173 /usr/local/lib/X11R5 \
1174 /usr/local/lib/X11R6 \
1175 /usr/local/lib/X11R7 \
1176 /usr/local/x11r5/lib \
1177 /usr/lpp/Xamples/lib \
1179 /usr/openwin/share/lib \
1180 /usr/unsupported/lib \
1183 if test -f "$ac_dir/X11/rgb.txt"; then
1184 im_cv_x_configure="$ac_dir/X11/"
1186 elif test -f "$ac_dir/rgb.txt"; then
1187 im_cv_x_configure="$ac_dir/"
1192 X11_CONFIGURE_PATH="$im_cv_x_configure"
1193 case "${build_os}" in
1195 X11ConfigurePath=`$WinPathScript "$X11ConfigurePath=" 1`
1198 AC_DEFINE_UNQUOTED(X11_CONFIGURE_PATH,"$X11ConfigurePath",Location of X11 configure files)
1201 # Find OpenMP library
1204 if test "$enable_openmp" != 'no'; then
1205 if test "${GCC}" = "yes"; then
1206 AC_CHECK_LIB(gomp,GOMP_parallel_start,GOMP_LIBS="-lgomp",,) # gcc
1208 AC_CHECK_LIB(mtsk,sunw_mp_register_warn,GOMP_LIBS="-lmtsk",,) # solaris cc
1209 AC_CHECK_LIB(xlsmp,_xlsmpFlush,GOMP_LIBS="-lxlsmp",,) # AIX xlc
1210 AC_CHECK_LIB(mp,mp_destroy,GOMP_LIBS="-lmp",,) # SGI IRIX 6.5 MIPSpro C/C++
1212 LIBS="$GOMP_LIBS $LIBS"
1217 # Find Posix threads library
1220 if test "$with_threads" != 'no' && test "$have_threads" = 'yes'; then
1222 if test "x$PTHREAD_LIBS" = "x"; then
1223 case "${host_cpu}-${host_os}" in
1225 MAGICK_CHECK_PTHREAD_LIB(c_r,PTHREAD_LIBS=-lc_r) ;;
1229 for lib in pthread pthreads; do
1230 if test "x$PTHREAD_LIBS" = "x"; then
1231 MAGICK_CHECK_PTHREAD_LIB([$lib],[PTHREAD_LIBS=-l$lib])
1235 THREAD_LIBS="$PTHREAD_LIBS"
1236 LIBS="$LIBS $THREAD_LIBS"
1238 AC_SUBST(THREAD_LIBS)
1245 if test "$with_umem" != 'no'; then
1246 AC_MSG_CHECKING(for UMEM support )
1250 AC_CHECK_HEADER(umem.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1251 AC_CHECK_LIB(umem,umem_alloc,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1252 AC_CHECK_LIB(umem,umem_free,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1253 AC_MSG_CHECKING(if umem memory allocation library is complete)
1254 if test $passed -gt 0; then
1255 if test $failed -gt 0; then
1256 AC_MSG_RESULT(no -- some components failed test)
1257 have_umem='no (failed tests)'
1260 LIBS="$UMEM_LIBS $LIBS"
1261 AC_DEFINE(HasUMEM,1,Define if you have umem memory allocation library)
1269 AM_CONDITIONAL(HasUMEM, test "$have_umem" = 'yes')
1273 # Add support for ccmalloc memory debugging library if requested
1277 if test "$enable_ccmalloc" = 'yes'; then
1278 AC_PATH_PROG(CCMALLOCDelegate,ccmalloc,)
1279 if test -n "$CCMALLOCDelegate"; then
1280 eval `grep PREFIX= $CCMALLOCDelegate | sed -e 's/PREFIX/CCMALLOC_PREFIX/'`
1282 # Assume that gcc is used with ccmalloc.
1283 LIBS="$LIBS $CCMALLOC_PREFIX/lib/ccmalloc-gcc.o"
1284 AC_CHECK_LIB(ccmalloc,ccmalloc_malloc,CCMALLOC_LIBS="$CCMALLOC_PREFIX/lib/ccmalloc-gcc.o -lccmalloc -ldl",,-ldl)
1285 if test -n "$CCMALLOC_LIBS"; then
1287 LIBS="$LIBS $CCMALLOC_LIBS"
1296 # Add support for efence memory debugging library if requested
1298 if test "$enable_efence" = 'yes'; then
1299 EFENCE_LIBS='-lefence'
1300 LIBS="$EFENCE_LIBS $LIBS"
1303 dnl ===========================================================================
1309 AC_ARG_WITH([bzlib],
1310 [AC_HELP_STRING([--without-bzlib],
1311 [disable BZLIB support])],
1312 [with_bzlib=$withval],
1315 if test "$with_bzlib" != 'yes'; then
1316 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-bzlib=$with_bzlib "
1320 if test "$with_bzlib" != 'no'; then
1322 AC_MSG_RESULT([-------------------------------------------------------------])
1323 AC_MSG_CHECKING([for BZLIB])
1328 AC_CHECK_HEADER(bzlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1329 AC_CHECK_LIB(bz2,BZ2_bzDecompress,found_libbz=`expr $found_libbz + 1`,,)
1330 if test "$native_win32_build" = 'yes'; then
1331 AC_CHECK_LIB(bz2,_imp__BZ2_decompress,found_libbz=`expr $found_libbz + 1`,,)
1333 if test $found_libbz -gt 0; then
1334 passed=`expr $passed + 1`
1336 failed=`expr $failed + 1`
1338 AC_MSG_CHECKING(if BZLIB package is complete)
1339 if test $passed -gt 0; then
1340 if test $failed -gt 0; then
1341 AC_MSG_RESULT(no -- some components failed test)
1342 have_bzlib='no (failed tests)'
1345 LIBS="$BZLIB_LIBS $LIBS"
1346 AC_DEFINE(BZLIB_DELEGATE,1,Define if you have the bzip2 library)
1354 AM_CONDITIONAL(BZLIB_DELEGATE, test "$have_bzlib" = 'yes')
1355 AC_SUBST(BZLIB_LIBS)
1358 # Find the X11 include and library directories.
1365 if test "$no_x" != 'yes'; then
1366 AC_MSG_RESULT([-------------------------------------------------------------])
1367 AC_MSG_CHECKING([for X11])
1369 LDFLAGS="$LDFLAGS $X_LIBS"
1370 X11_LIBS="$X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
1371 LIBS="$X11_LIBS $LIBS"
1372 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1374 AC_DEFINE(X11_DELEGATE,1,Define if you have X11 library)dnl
1377 # Check for X11 shared memory extension
1379 # shmctl is required to support the shared memory extension
1380 AC_CHECK_FUNC([shmctl],[have_shmctl='yes'],[])
1381 if test "$have_shmctl" != 'yes'; then
1383 LIBS="$LIBS -lcygipc"
1384 AC_TRY_LINK_FUNC([shmctl],[have_shmctl='yes'; IPC_LIBS='-lcygipc'],[])
1388 if test "$have_shmctl" = 'yes'; then
1389 AC_CHECK_LIB([Xext],[XShmAttach],[XEXT_LIBS='-lXext' ; AC_DEFINE(HAVE_SHARED_MEMORY,1,X11 server supports shared memory extension)],[],[])
1393 # Check for X11 shape extension
1395 AC_CHECK_LIB([Xext],[XShapeCombineMask],[XEXT_LIBS='-lXext' ; AC_DEFINE(HAVE_SHAPE,1,X11 server supports shape extension)],[],[])
1396 AC_CHECK_LIB(Xt,XtSetEventDispatcher,XT_LIBS='-lXt',,)
1397 LIBS="$XEXT_LIBS $XT_LIBS $LIBS"
1399 if test "$no_x" != 'yes'; then
1404 AM_CONDITIONAL(X11_DELEGATE, test "$have_x" = 'yes')
1408 dnl ===========================================================================
1414 [AC_HELP_STRING([--without-zlib],
1415 [disable ZLIB support])],
1416 [with_zlib=$withval],
1419 if test "$with_zlib" != 'yes'; then
1420 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-zlib=$with_zlib "
1425 dnl PNG requires zlib so enable zlib check if PNG is requested
1426 if test "$with_zlib" != 'no' || test "$with_png" != 'no'; then
1427 AC_MSG_RESULT([-------------------------------------------------------------])
1428 AC_MSG_CHECKING([for ZLIB])
1433 AC_CHECK_HEADER(zconf.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1434 AC_CHECK_HEADER(zlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1435 AC_CHECK_LIB(z,compress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1436 AC_CHECK_LIB(z,uncompress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1437 AC_CHECK_LIB(z,deflate,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1438 AC_CHECK_LIB(z,inflate,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1439 AC_CHECK_LIB(z,gzseek,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1440 AC_CHECK_LIB(z,gztell,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1441 AC_MSG_CHECKING([if ZLIB package is complete])
1442 if test $passed -gt 0; then
1443 if test $failed -gt 0; then
1444 AC_MSG_RESULT([no -- some components failed test])
1445 have_zlib='no (failed tests)'
1448 LIBS="$ZLIB_LIBS $LIBS"
1449 AC_DEFINE(ZLIB_DELEGATE,1,Define if you have zlib compression library)
1450 AC_MSG_RESULT([yes])
1457 AM_CONDITIONAL(ZLIB_DELEGATE, test "$have_zlib" = 'yes')
1461 # If profiling, then check for -ldl and dlopen (required for Solaris & gcc)
1464 if test "$enable_profiling" = 'yes'; then
1465 AC_CHECK_LIB(dl,dlopen,LIB_DL='-ldl',,)
1466 LIBS="$LIB_DL $LIBS"
1470 dnl ===========================================================================
1473 # Check for Autotrace delegate library.
1475 AC_ARG_WITH([autotrace],
1476 [AC_HELP_STRING([--with-autotrace],
1477 [enable autotrace support])],
1478 [with_autotrace=$withval],
1479 [with_autotrace='no'])
1481 if test "$with_autotrace" != 'yes'; then
1482 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-autotrace=$with_autotrace "
1489 if test "x$with_autotrace" = "xyes"; then
1490 AC_MSG_RESULT([-------------------------------------------------------------])
1491 PKG_CHECK_MODULES(AUTOTRACE,[autotrace >= 0.31.1], have_autotrace=yes, have_autotrace=no)
1495 if test "$have_autotrace" = 'yes'; then
1497 AC_DEFINE(AUTOTRACE_DELEGATE,1,Define if you have AUTOTRACE library)
1498 if test "$with_modules" = 'no'; then
1499 CPPFLAGS="$AUTOTRACE_CFLAGS $CPPFLAGS"
1503 AM_CONDITIONAL(AUTOTRACE_DELEGATE,test "$have_autotrace" = 'yes')
1504 AC_SUBST(AUTOTRACE_CFLAGS)
1505 AC_SUBST(AUTOTRACE_LIBS)
1507 dnl ===========================================================================
1510 # Check for Display Postscript delegate library.
1513 [AC_HELP_STRING([--without-dps],
1514 [disable Display Postscript support])],
1515 [with_dps=$withval],
1518 if test "$with_dps" != 'yes'; then
1519 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-dps=$with_dps "
1524 if test "$with_dps" != 'no' && test "$with_x" != 'no'; then
1525 AC_MSG_RESULT([-------------------------------------------------------------])
1526 AC_MSG_CHECKING([for DPS])
1530 PERSIST_CPPFLAGS="$CPPFLAGS"
1531 CPPFLAGS="$CPPFLAGS -I${ac_x_includes}/X11"
1532 AC_CHECK_HEADER(DPS/dpsXclient.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1534 # XFree86-4.x needs -lXt to provide XtMalloc for -ldps.
1535 # Cygwin doesn't deliver -lXt as a DLL, which prevents a DLL build.
1536 # Adobe DPS (as delivered on Solaris) doesn't require -lXt.
1537 # ImageMagick itself doesn't use -lXt.
1540 AC_CHECK_LIB(dps,DPSInitialize,have_libdps='yes',have_libdps='no',)
1541 if test "$have_libdps" != 'yes'; then
1542 # Unset cache variable so we can try again.
1543 unset ac_cv_lib_dps_DPSInitialize
1544 AC_CHECK_LIB(dps,DPSInitialize,have_libdps='yes',have_libdps='no',-lXt)
1545 if test "$have_libdps" = 'yes'; then
1549 if test "$have_libdps" = 'yes'; then
1550 passed=`expr $passed + 1`
1552 failed=`expr $failed + 1`
1554 AC_CHECK_LIB(dpstk,XDPSPixelsPerPoint,passed=`expr $passed + 1`,failed=`expr $failed + 1`,-ldps $LIBDPS_XT)
1555 AC_MSG_CHECKING([if DPS package is complete])
1556 if test $passed -gt 0; then
1557 if test $failed -gt 0; then
1558 AC_MSG_RESULT([no -- some components failed test])
1559 have_dps='no (failed tests)'
1560 CPPFLAGS="$PERSIST_CPPFLAGS"
1562 DPS_LIBS="-ldpstk -ldps ${LIBDPS_XT}"
1563 LIBS="$DPS_LIBS $LIBS"
1564 AC_DEFINE(DPS_DELEGATE,1,Define if you have Display Postscript)
1565 AC_MSG_RESULT([yes])
1570 CPPFLAGS=$PERSIST_CPPFLAGS
1573 AM_CONDITIONAL(DPS_DELEGATE, test "$have_dps" = 'yes')
1576 dnl ===========================================================================
1579 # Check for DJVU delegate library.
1582 [AC_HELP_STRING([--without-djvu],
1583 [disable DjVu support])],
1584 [with_djvu=$withval],
1587 if test "$with_djvu" != 'yes'; then
1588 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-djvu=$with_djvu "
1593 if test "$with_djvu" != 'no'; then
1594 AC_MSG_RESULT([-------------------------------------------------------------])
1595 AC_MSG_CHECKING([for DJVU])
1599 AC_CHECK_HEADER(libdjvu/ddjvuapi.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1600 AC_CHECK_LIB(djvulibre,ddjvu_context_create,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1601 AC_MSG_CHECKING([if DJVU package is complete])
1602 if test $passed -gt 0; then
1603 if test $failed -gt 0; then
1604 AC_MSG_RESULT([no -- some components failed test])
1605 have_djvu='no (failed tests)'
1607 DJVU_LIBS='-ldjvulibre'
1608 LIBS="$DJVU_LIBS $LIBS"
1609 AC_DEFINE(DJVU_DELEGATE,1,Define if you have DJVU library)
1610 AC_MSG_RESULT([yes])
1617 AM_CONDITIONAL(DJVU_DELEGATE, test "$have_djvu" = 'yes')
1620 dnl ===========================================================================
1623 # Set DejaVu font directory.
1625 AC_ARG_WITH([dejavu-font-dir],
1626 [AC_HELP_STRING([--with-dejavu-font-dir=DIR],
1627 [DejaVu font directory])],
1628 [with_dejavu_font_dir=$withval],
1629 [with_dejavu_font_dir='default'])
1631 if test "$with_dejavu_font_dir" != 'default'; then
1632 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-dejavu-font-dir=$with_dejavu_font_dir "
1635 dnl ===========================================================================
1638 # Check for FFTW delegate library.
1641 [AC_HELP_STRING([--without-fftw],
1642 [disable FFTW support])],
1643 [with_fftw=$withval],
1646 if test "$with_fftw" != 'yes'; then
1647 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fftw=$with_fftw "
1652 if test "$with_fftw" != 'no'; then
1653 AC_MSG_RESULT([-------------------------------------------------------------])
1654 AC_MSG_CHECKING([for FFTW])
1658 AC_CHECK_HEADER(fftw3.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1659 AC_CHECK_LIB(fftw3,fftw_execute,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1660 AC_MSG_CHECKING([if FFTW package is complete])
1661 if test $passed -gt 0; then
1662 if test $failed -gt 0; then
1663 AC_MSG_RESULT([no -- some components failed test])
1664 have_fftw='no (failed tests)'
1667 LIBS="$FFTW_LIBS $LIBS"
1668 AC_DEFINE(FFTW_DELEGATE,1,Define if you have FFTW library)
1669 AC_MSG_RESULT([yes])
1676 AM_CONDITIONAL(FFTW_DELEGATE, test "$have_fftw" = 'yes')
1679 dnl ===========================================================================
1682 # Check for FlashPIX delegate library.
1685 [AC_HELP_STRING([--without-fpx],
1686 [disable FlashPIX support])],
1687 [with_fpx=$withval],
1690 if test "$with_fpx" != 'yes'; then
1691 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fpx=$with_fpx "
1696 if test "$with_fpx" != 'no'; then
1697 AC_MSG_RESULT([-------------------------------------------------------------])
1698 AC_MSG_CHECKING([for FlashPIX])
1703 AC_CHECK_HEADER(fpxlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1704 AC_CHECK_LIB(fpx,FPX_OpenImageByFilename,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1706 AC_MSG_CHECKING([if FlashPIX package is complete])
1707 if test $passed -gt 0; then
1708 if test $failed -gt 0; then
1709 AC_MSG_RESULT([no -- some components failed test])
1710 have_fpx='no (failed tests)'
1713 AC_DEFINE(FPX_DELEGATE,1,Define if you have FlashPIX library)
1714 AC_MSG_RESULT([yes])
1722 AM_CONDITIONAL(FPX_DELEGATE, test "$have_fpx" = 'yes')
1725 dnl ===========================================================================
1728 # Check for fontconfig delegate library.
1730 AC_ARG_WITH([fontconfig],
1731 [AC_HELP_STRING([--without-fontconfig],
1732 [disable fontconfig support])],
1733 [with_fontconfig=$withval],
1734 [with_fontconfig=$have_x])
1736 if test "$with_fontconfig" != 'yes'; then
1737 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontconfig=$with_fontconfig "
1740 have_fontconfig='no'
1741 FONTCONFIG_CFLAGS=""
1744 if test "x$with_fontconfig" = "xyes"; then
1745 AC_MSG_RESULT([-------------------------------------------------------------])
1746 PKG_CHECK_MODULES(FONTCONFIG,[fontconfig >= 2.1.0], have_fontconfig=yes, have_fontconfig=no)
1750 if test "$have_fontconfig" = 'yes'; then
1751 AC_DEFINE(FONTCONFIG_DELEGATE,1,Define if you have FONTCONFIG library)
1752 if test "$with_modules" = 'no'; then
1753 CPPFLAGS="$FONTCONFIG_CFLAGS $CPPFLAGS"
1757 AM_CONDITIONAL(FONTCONFIG_DELEGATE,test "$have_fontconfig" = 'yes')
1758 AC_SUBST(FONTCONFIG_CFLAGS)
1759 AC_SUBST(FONTCONFIG_LIBS)
1761 dnl ===========================================================================
1764 # Check for freetype delegate library.
1766 AC_ARG_WITH([freetype],
1767 [AC_HELP_STRING([--without-freetype],
1768 [disable Freetype support])],
1769 [with_freetype=$withval],
1770 [with_freetype='yes'])
1773 if test "$with_freetype" != 'yes'; then
1774 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-freetype=$with_freetype "
1779 if test "$with_freetype" != 'no'; then
1780 AC_MSG_RESULT([-------------------------------------------------------------])
1781 AC_MSG_CHECKING([for FreeType 2.0])
1785 PERSIST_LIBS="$LIBS"
1786 PERSIST_CPPFLAGS="$CPPFLAGS"
1787 if test "$enable_delegate_build" != 'no' && test -d "$builddir/freetype/include"; then
1791 AC_CHECK_PROGS(freetype_config,freetype-config,)dnl
1792 if test -n "$freetype_config"; then
1793 freetype_cflags=`$freetype_config --cflags`
1794 freetype_libs=`$freetype_config --libs`
1795 LIBS="$LIBS $freetype_libs"
1796 CPPFLAGS="$freetype_cflags $CPPFLAGS"
1800 dnl First see if there is a library
1801 if test "$FREETYPE_LIBS" = ''; then
1802 AC_CHECK_LIB(freetype,FT_Init_FreeType,FREETYPE_LIBS='-lfreetype',,)
1803 if test "$FREETYPE_LIBS" != ''; then
1804 passed=`expr $passed + 1`
1806 failed=`expr $failed + 1`
1807 LIBS="$PERSIST_LIBS"
1811 dnl Now test for the headers
1812 AC_CHECK_HEADER([ft2build.h],[FT2BUILD_H='#include <ft2build.h>'],[ft2build=''],[])
1813 AC_CHECK_HEADER(freetype/freetype.h,[have_freetype_h='yes'],[have_freetype_h='no'],[$FT2BUILD_H])
1814 if test "$ac_cv_header_ft2build_h" = 'yes' || test "$have_freetype_h" = 'yes'; then
1815 passed=`expr $passed + 1`
1817 failed=`expr $failed + 1`
1818 CPPFLAGS="$PERSIST_CPPFLAGS"
1821 AC_MSG_CHECKING([if FreeType package is complete])
1822 if test $passed -gt 0; then
1823 if test $failed -gt 0; then
1825 AC_MSG_RESULT([no -- some components failed test])
1826 have_freetype='no (failed tests)'
1828 LIBS="$FREETYPE_LIBS $LIBS"
1829 AC_DEFINE(FREETYPE_DELEGATE,1,Define if you have FreeType (TrueType font) library)
1830 if test "$ac_cv_header_ft2build_h" = 'yes'; then
1831 AC_DEFINE([HAVE_FT2BUILD_H],[1],[Define to 1 if you have the <ft2build.h> header file.])
1833 AC_MSG_RESULT([yes])
1840 AM_CONDITIONAL(FREETYPE_DELEGATE,test "$have_freetype" = 'yes')
1841 AC_SUBST(FREETYPE_LIBS)
1843 dnl ===========================================================================
1845 dnl ===========================================================================
1848 # Check for Ghostscript library or framework.
1850 # Test for iapi.h & test for gsapi_new_instance in -lgs
1851 # or -framework Ghostscript
1853 AC_ARG_WITH([gslib],
1854 [AC_HELP_STRING([--without-gslib],
1855 [enable Ghostscript library support])],
1856 [with_gslib=$withval],
1859 gslib_framework='no'
1860 if test "$with_gslib" != 'yes'; then
1861 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gslib=$with_gslib "
1866 if test "$with_gslib" != 'no'; then
1867 AC_MSG_RESULT([-------------------------------------------------------------])
1868 AC_MSG_CHECKING([for Ghostscript])
1873 AC_CHECK_HEADER(ghostscript/iapi.h,passed=`expr $passed + 1`,
1874 failed=`expr $failed + 1`,)
1875 AC_CHECK_HEADER(ghostscript/ierrors.h,passed=`expr $passed + 1`,
1876 failed=`expr $failed + 1`,)
1877 AC_CHECK_FRAMEWORK(Ghostscript,gsapi_new_instance,framework=`expr $framework + 1`,
1878 AC_CHECK_LIB(gs,gsapi_new_instance,passed=`expr $passed + 1`,failed=`expr $failed + 1`,),)
1879 AC_MSG_CHECKING([if Ghostscript package is complete])
1880 if test $passed -gt 0; then
1881 if test $failed -gt 0; then
1882 AC_MSG_RESULT([no -- some components failed test])
1883 have_gslib='no (failed tests)'
1885 if test $framework -gt 0; then
1886 GS_LIBS='-framework Ghostscript'
1887 gslib_framework='yes'
1888 AC_MSG_RESULT([yes, using framework.])
1890 AC_MSG_RESULT([yes, using library.])
1893 LIBS="$GS_LIBS $LIBS"
1894 AC_DEFINE(GS_DELEGATE,1,Define if you have Ghostscript library or framework)
1901 AM_CONDITIONAL(GS_DELEGATE, test "$have_gslib" = 'yes')
1904 # Set default font search path
1905 AC_ARG_WITH([fontpath],
1906 [AC_HELP_STRING([--with-fontpath=DIR],
1907 [prepend to default font search path])],
1908 [with_fontpath=$withval],
1911 if test "$with_fontpath" != "yes" && test -z "$with_fontpath"; then
1914 AC_DEFINE_UNQUOTED(MAGICK_FONT_PATH,"$with_fontpath",Define to prepend to default font search path.)
1916 if test "$with_fontpath=" != ''; then
1917 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontpath=$with_fontpath "
1920 # Set Ghostscript font directory
1921 AC_ARG_WITH([gs-font-dir],
1922 [AC_HELP_STRING([--with-gs-font-dir=DIR],
1923 [Ghostscript font directory])],
1924 [with_gs_font_dir=$withval],
1925 [with_gs_font_dir='default'])
1927 if test "$with_gs_font_dir" != 'default'; then
1928 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gs-font-dir=$with_gs_font_dir "
1931 dnl ===========================================================================
1934 # Check for GVC delegate library.
1937 [AC_HELP_STRING([--without-gvc],
1938 [disable GVC support])],
1939 [with_gvc=$withval],
1942 if test "$with_gvc" != 'yes'; then
1943 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gvc=$with_gvc "
1947 if test "x$with_gvc" = "xyes"; then
1948 AC_MSG_RESULT([-------------------------------------------------------------])
1949 PKG_CHECK_MODULES(GVC,[libgvc >= 2.9.0], have_gvc=yes, have_gvc=no)
1953 if test "$have_gvc" = 'yes'; then
1954 AC_DEFINE(GVC_DELEGATE,1,Define if you have GVC library)
1955 if test "$with_modules" = 'no'; then
1956 CPPFLAGS="$GVC_CFLAGS $CPPFLAGS"
1960 AM_CONDITIONAL(GVC_DELEGATE, test "$have_gvc" = 'yes')
1961 AC_SUBST(GVC_CFLAGS)
1964 dnl ===========================================================================
1967 # Check for JBIG delegate library.
1971 [AC_HELP_STRING([--without-jbig],
1972 [disable JBIG support])],
1973 [with_jbig=$withval],
1978 if test "$with_jbig" != 'no'; then
1979 AC_MSG_RESULT([-------------------------------------------------------------])
1980 AC_MSG_CHECKING([for JBIG])
1984 AC_CHECK_HEADER(jbig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1985 AC_CHECK_LIB(jbig,jbg_dec_init,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1986 AC_MSG_CHECKING([if JBIG package is complete])
1987 if test $passed -gt 0; then
1988 if test $failed -gt 0; then
1989 AC_MSG_RESULT([no -- some components failed test])
1990 have_jbig='no (failed tests)'
1993 LIBS="$JBIG_LIBS $LIBS"
1994 AC_DEFINE(JBIG_DELEGATE,1,Define if you have JBIG library)
1995 AC_MSG_RESULT([yes])
2002 AM_CONDITIONAL(JBIG_DELEGATE, test "$have_jbig" = 'yes')
2005 dnl ===========================================================================
2008 # Check for JPEG delegate library.
2011 [AC_HELP_STRING([--without-jpeg],
2012 [disable JPEG support])],
2013 [with_jpeg=$withval],
2016 if test "$with_jpeg" != 'yes'; then
2017 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jpeg=$with_jpeg "
2022 if test "$with_jpeg" != 'no'; then
2023 AC_MSG_RESULT([-------------------------------------------------------------])
2024 AC_MSG_CHECKING([for JPEG])
2028 AC_CHECK_HEADER(jconfig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2029 AC_CHECK_HEADER(jerror.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2030 AC_CHECK_HEADER(jmorecfg.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2031 AC_CHECK_HEADER(jpeglib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2032 AC_CHECK_LIB(jpeg,jpeg_read_header,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2034 # Test for compatible JPEG library
2035 if test "$ac_cv_jpeg_version_ok" != 'yes'; then
2036 AC_CACHE_CHECK(for JPEG library is version 6b or later, ac_cv_jpeg_version_ok,
2040 #include <jpeglib.h>
2042 changequote(<<, >>)dnl
2044 #if JPEG_LIB_VERSION < 62
2045 #error IJG JPEG library must be version 6b or newer!
2049 changequote([, ])dnl
2050 ac_cv_jpeg_version_ok='yes'; passed=`expr $passed + 1`,
2051 ac_cv_jpeg_version_ok='no'; failed=`expr $failed + 1`)])
2053 AC_MSG_CHECKING([if JPEG package is complete])
2054 if test $passed -gt 0; then
2055 if test $failed -gt 0; then
2056 AC_MSG_RESULT([no -- some components failed test])
2057 have_jpeg='no (failed tests)'
2060 LIBS="$JPEG_LIBS $LIBS"
2061 AC_DEFINE(JPEG_DELEGATE,1,Define if you have JPEG library)
2062 AC_MSG_RESULT([yes])
2069 AM_CONDITIONAL(JPEG_DELEGATE, test "$have_jpeg" = 'yes')
2072 dnl ===========================================================================
2075 # Check for JPEG Version 2 delegate library.
2078 [AC_HELP_STRING([--without-jp2],
2079 [disable JPEG-2000 support])],
2080 [with_jp2=$withval],
2083 if test "$with_jp2" != 'yes'; then
2084 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jp2=$with_jp2 "
2089 if test "$with_jp2" != 'no'; then
2090 AC_MSG_RESULT([-------------------------------------------------------------])
2091 AC_MSG_CHECKING([for JPEG Version 2])
2095 AC_CHECK_HEADER(jasper/jasper.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2096 AC_CHECK_LIB(jasper,jas_stream_fopen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2097 AC_MSG_CHECKING([if JPEG version 2 support package is complete])
2098 if test $passed -gt 0; then
2099 if test $failed -gt 0; then
2100 AC_MSG_RESULT([no -- some components failed test])
2101 have_jp2='no (failed tests)'
2104 LIBS="$JP2_LIBS $LIBS"
2105 AC_DEFINE(JP2_DELEGATE,1,Define if you have JPEG version 2 "Jasper" library)
2106 AC_MSG_RESULT([yes])
2113 AM_CONDITIONAL(JP2_DELEGATE, test "$have_jp2" = 'yes')
2116 dnl ===========================================================================
2119 # Check for LCMS delegate library.
2123 [ --without-lcms disable lcms (v1.1X) support],
2124 [with_lcms=$withval],
2126 if test "$with_lcms" != 'yes' ; then
2127 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lcms=$with_lcms "
2132 [ --without-lcms2 disable lcms (v2.X) support],
2133 [with_lcms2=$withval],
2135 if test "$with_lcms2" != 'yes' ; then
2136 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lcms2=$with_lcms2 "
2141 if test "$with_lcms2" != 'no'; then
2142 AC_MSG_RESULT([-------------------------------------------------------------])
2143 AC_MSG_CHECKING([for LCMS v2])
2147 have_lcms_header='no'
2149 # Check for <lcms2.h>
2150 AC_CHECK_HEADER(lcms2.h,have_lcms_header='yes',,)
2151 if test "$have_lcms_header" = 'yes'; then
2152 AC_DEFINE(HAVE_LCMS2_H,1,Define if you have the <lcms2.h> header file.)
2153 passed=`expr $passed + 1`
2156 # Check for <lcms2/lcms2.h)
2157 if test "$have_lcms_header" != 'yes'; then
2158 AC_CHECK_HEADER(lcms2/lcms2.h,have_lcms_header='yes',,)
2159 if test "$have_lcms_header" = 'yes'; then
2160 passed=`expr $passed + 1`
2161 AC_DEFINE(HAVE_LCMS2_LCMS2_H,1,Define if you have the <lcms2/lcms2.h> header file.)
2165 # Failed to find lcms header?
2166 if test "$have_lcms_header" != 'yes'; then
2167 failed=`expr $failed + 1`
2170 AC_CHECK_LIB(lcms2,cmsSetLogErrorHandler,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2171 AC_MSG_CHECKING(if LCMS v2 package is complete)
2172 if test $passed -gt 0; then
2173 if test $failed -gt 0; then
2174 AC_MSG_RESULT(no -- some components failed test)
2175 have_lcms2='no (failed tests)'
2178 LIBS="$LCMS_LIBS $LIBS"
2188 # Check for LCMS v1 (1.11 or later)
2190 if test $have_lcms2 = 'yes'; then
2195 if test "$with_lcms" != 'no'; then
2196 AC_MSG_RESULT([-------------------------------------------------------------])
2197 AC_MSG_CHECKING([for LCMS v1.1X])
2201 have_lcms_header='no'
2203 # Check for <lcms.h>
2204 if test "$have_lcms_header" != 'yes'; then
2205 AC_CHECK_HEADER(lcms.h,have_lcms_header='yes',,)
2206 if test "$have_lcms_header" = 'yes'; then
2207 passed=`expr $passed + 1`
2208 AC_DEFINE(HAVE_LCMS_H,1,Define if you have the <lcms.h> header file.)
2212 # Check for <lcms/lcms.h>
2213 if test "$have_lcms_header" != 'yes'; then
2214 AC_CHECK_HEADER(lcms/lcms.h,have_lcms_header='yes',,)
2215 if test "$have_lcms_header" = 'yes'; then
2216 passed=`expr $passed + 1`
2217 AC_DEFINE(HAVE_LCMS_LCMS_H,1,Define if you have the <lcms/lcms.h> header file.)
2221 # Failed to find lcms header?
2222 if test "$have_lcms_header" != 'yes'; then
2223 failed=`expr $failed + 1`
2226 AC_CHECK_LIB(lcms,cmsSetErrorHandler,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2227 AC_MSG_CHECKING(if LCMS package is complete)
2228 if test $passed -gt 0; then
2229 if test $failed -gt 0; then
2230 AC_MSG_RESULT(no -- some components failed test)
2231 have_lcms='no (failed tests)'
2234 LIBS="$LCMS_LIBS $LIBS"
2243 AM_CONDITIONAL(LCMS_DELEGATE, test "$have_lcms2" = 'yes' -o "$have_lcms" = 'yes')
2244 if test "$have_lcms2" = 'yes' -o "$have_lcms" = 'yes'; then
2245 AC_DEFINE(LCMS_DELEGATE,1,[Define if you have LCMS (v1.11 or later) library])
2250 dnl ===========================================================================
2253 # Check for the LQR (Liquid Rescale) delegate library.
2256 [AC_HELP_STRING([--without-lqr],
2257 [disable Liquid Rescale support])],
2258 [with_lqr=$withval],
2261 if test "$with_lqr" != 'yes'; then
2262 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lqr=$with_lqr "
2269 if test "x$with_lqr" = "xyes"; then
2270 AC_MSG_RESULT([-------------------------------------------------------------])
2271 PKG_CHECK_MODULES(LQR,[lqr-1 >= 0.1.0], have_lqr=yes, have_lqr=no)
2275 if test "$have_lqr" = 'yes'; then
2276 AC_DEFINE(LQR_DELEGATE,1,Define if you have LQR library)
2277 CFLAGS="$LQR_CFLAGS $CFLAGS"
2280 AM_CONDITIONAL(LQR_DELEGATE, test "$have_lqr" = 'yes')
2281 AC_SUBST(LQR_CFLAGS)
2284 dnl ===========================================================================
2286 # Disable LZMA (lzma library)
2288 [ --without-lzma disable LZMA support],
2289 [with_lzma=$withval],
2291 if test "$with_lzma" != 'yes' ; then
2292 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lzma=$with_lzma "
2300 if test "$with_lzma" != 'no' || test "$with_tiff" != 'no'; then
2301 AC_MSG_RESULT([-------------------------------------------------------------])
2302 AC_MSG_CHECKING(for LZMA)
2306 AC_CHECK_HEADER(lzma.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2307 AC_CHECK_LIB(lzma,lzma_code,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2308 AC_MSG_CHECKING(if LZMA package is complete)
2309 if test $passed -gt 0; then
2310 if test $failed -gt 0; then
2311 AC_MSG_RESULT(no -- some components failed test)
2312 have_lzma='no (failed tests)'
2315 LIBS="$LZMA_LIBS $LIBS"
2316 AC_DEFINE(LZMA_DELEGATE,1,Define if you have lzma compression library)
2324 AM_CONDITIONAL(LZMA_DELEGATE, test "$have_lzma" = 'yes')
2327 dnl ===========================================================================
2330 # Check for the OpenEXR delegate library.
2332 AC_ARG_WITH([openexr],
2333 [AC_HELP_STRING([--without-openexr],
2334 [disable OpenEXR support])],
2335 [with_openexr=$withval],
2336 [with_openexr='yes'])
2338 if test "$with_openexr" != 'yes'; then
2339 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-openexr=$with_openexr "
2346 if test "x$with_openexr" = "xyes"; then
2347 AC_MSG_RESULT([-------------------------------------------------------------])
2348 PKG_CHECK_MODULES(OPENEXR,[OpenEXR >= 1.0.6], have_openexr=yes, have_openexr=no)
2352 if test "$have_openexr" = 'yes'; then
2353 AC_DEFINE(OPENEXR_DELEGATE,1,Define if you have OPENEXR library)
2354 if test "$with_modules" = 'no'; then
2355 CFLAGS="$OPENEXR_CFLAGS $CFLAGS"
2359 AM_CONDITIONAL(OPENEXR_DELEGATE, test "$have_openexr" = 'yes')
2360 AC_SUBST(OPENEXR_CFLAGS)
2361 AC_SUBST(OPENEXR_LIBS)
2363 dnl ===========================================================================
2366 # Check for PNG delegate library.
2369 [AC_HELP_STRING([--without-png],
2370 [disable PNG support])],
2371 [with_png=$withval],
2374 if test "$with_png" != 'yes'; then
2375 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-png=$with_png "
2380 if test "$with_png" != 'no'; then
2381 AC_MSG_RESULT([-------------------------------------------------------------])
2382 AC_MSG_CHECKING([for PNG])
2386 AC_CHECK_HEADER(png.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2387 AC_CHECK_LIB(png,png_get_io_ptr,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2388 AC_MSG_CHECKING([if PNG package is complete])
2389 if test $passed -gt 0; then
2390 if test $failed -gt 0; then
2391 AC_MSG_RESULT([no -- some components failed test])
2392 have_png='no (failed tests)'
2395 LIBS="$PNG_LIBS $LIBS"
2396 AC_DEFINE(PNG_DELEGATE,1,Define if you have PNG library)
2397 AC_MSG_RESULT([yes])
2404 AM_CONDITIONAL(PNG_DELEGATE,test "$have_png" = 'yes')
2407 dnl ===========================================================================
2410 # Check for RSVG delegate library.
2413 [AC_HELP_STRING([--without-rsvg],
2414 [disable RSVG support])],
2415 [with_rsvg=$withval],
2416 [with_rsvg=$have_x])
2418 if test "$with_rsvg" != 'yes'; then
2419 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-rsvg=$with_rsvg "
2427 if test "x$with_rsvg" = "xyes"; then
2428 AC_MSG_RESULT([-------------------------------------------------------------])
2429 PKG_CHECK_MODULES(RSVG,[librsvg-2.0 >= 2.9.0], have_rsvg=yes, have_rsvg=no)
2431 PKG_CHECK_MODULES(CAIRO_SVG, cairo-svg, have_cairo=yes, have_cairo=no)
2435 if test "$have_rsvg" = 'yes'; then
2436 AC_DEFINE(RSVG_DELEGATE,1,Define if you have RSVG library)
2437 if test "$with_modules" = 'no'; then
2438 CPPFLAGS="$RSVG_CFLAGS $CPPFLAGS"
2442 if test "$have_cairo" = 'yes'; then
2443 AC_DEFINE(CAIRO_DELEGATE,1,Define if you have CAIRO library)
2444 if test "$with_modules" = 'no'; then
2445 CPPFLAGS="$CAIRO_SVG_CFLAGS $CPPFLAGS"
2449 AM_CONDITIONAL(RSVG_DELEGATE, test "$have_rsvg" = 'yes')
2450 AM_CONDITIONAL(CAIRO_DELEGATE, test "$have_cairo" = 'yes')
2451 AC_SUBST(RSVG_CFLAGS)
2454 dnl ===========================================================================
2457 # Check for TIFF delegate library.
2460 [AC_HELP_STRING([--without-tiff],
2461 [disable TIFF support])],
2462 [with_tiff=$withval],
2465 if test "$with_tiff" != 'yes'; then
2466 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-tiff=$with_tiff "
2471 if test "$with_tiff" != 'no'; then
2472 AC_MSG_RESULT([-------------------------------------------------------------])
2473 AC_MSG_CHECKING([for TIFF])
2477 AC_CHECK_HEADER(tiff.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2478 AC_CHECK_HEADER(tiffio.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2479 AC_CHECK_LIB(tiff,TIFFOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2480 AC_CHECK_LIB(tiff,TIFFClientOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2481 AC_CHECK_LIB(tiff,TIFFIsBigEndian,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2482 AC_CHECK_LIB(tiff,TIFFIsByteSwapped,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2483 AC_CHECK_LIB(tiff,TIFFReadRGBATile,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2484 AC_CHECK_LIB(tiff,TIFFReadRGBAStrip,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2485 AC_MSG_CHECKING([if TIFF package is complete])
2486 if test $passed -gt 0; then
2487 if test $failed -gt 0; then
2488 AC_MSG_RESULT([no -- some components failed test])
2489 have_tiff='no (failed tests)'
2492 LIBS="$TIFF_LIBS $LIBS"
2493 AC_DEFINE(TIFF_DELEGATE,1,Define if you have TIFF library)
2494 AC_MSG_RESULT([yes])
2496 AC_CHECK_HEADERS(tiffconf.h)
2497 AC_CHECK_FUNCS([TIFFIsCODECConfigured TIFFMergeFieldInfo \
2498 TIFFReadEXIFDirectory TIFFSetErrorHandlerExt TIFFSetTagExtender \
2499 TIFFSetWarningHandlerExt TIFFSwabArrayOfTriples])
2505 AM_CONDITIONAL(TIFF_DELEGATE, test "$have_tiff" = 'yes')
2508 dnl ===========================================================================
2511 # Check for WEBP delegate library.
2514 [AC_HELP_STRING([--without-webp],
2515 [disable WEBP support])],
2516 [with_webp=$withval],
2519 if test "$with_webp" != 'yes'; then
2520 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-webp=$with_webp "
2525 if test "$with_webp" != 'no'; then
2526 AC_MSG_RESULT([-------------------------------------------------------------])
2527 AC_MSG_CHECKING([for WEBP])
2531 AC_CHECK_HEADER(webp/decode.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2532 AC_CHECK_LIB(webp,WebPDecodeRGB,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2533 AC_MSG_CHECKING([if WEBP package is complete])
2534 if test $passed -gt 0; then
2535 if test $failed -gt 0; then
2536 AC_MSG_RESULT([no -- some components failed test])
2537 have_webp='no (failed tests)'
2540 LIBS="$WEBP_LIBS $LIBS"
2541 AC_DEFINE(WEBP_DELEGATE,1,Define if you have WEBP library)
2542 AC_MSG_RESULT([yes])
2549 AM_CONDITIONAL(WEBP_DELEGATE,test "$have_webp" = 'yes')
2552 dnl ===========================================================================
2555 # Set Windows font directory.
2557 AC_ARG_WITH(windows-font-dir,
2558 [AC_HELP_STRING([--with-windows-font-dir=DIR],
2559 [directory containing MS-Windows fonts])],
2560 [with_windows_font_dir=$withval],
2561 [with_windows_font_dir=''])
2562 if test "$with_windows_font_dir" != '' ; then
2563 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-windows-font-dir=$with_windows_font_dir "
2566 dnl ===========================================================================
2569 # Check for WMF delegate library.
2572 [AC_HELP_STRING([--without-wmf],
2573 [disable WMF support])],
2574 [with_wmf=$withval],
2577 if test "$with_wmf" != 'yes'; then
2578 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-wmf=$with_wmf "
2583 if test "$with_wmf" != 'no'; then
2584 AC_MSG_RESULT([-------------------------------------------------------------])
2585 AC_MSG_CHECKING([for WMF])
2589 AC_CHECK_HEADER(libwmf/eps.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2590 AC_CHECK_LIB(wmf,wmf_eps_function,passed=`expr $passed + 1`,failed=`expr $failed + 1`,"-lwmflite")
2591 AC_MSG_CHECKING([if WMF package is complete])
2592 if test $passed -gt 0; then
2593 if test $failed -gt 0; then
2594 AC_MSG_RESULT([no -- some components failed test])
2595 have_wmf='no (failed tests)'
2597 WMF_LIBS='-lwmf -lwmflite'
2598 LIBS="$WMF_LIBS $LIBS"
2599 AC_DEFINE(WMF_DELEGATE,1,Define if you have WMF library)
2600 AC_MSG_RESULT([yes])
2607 AM_CONDITIONAL(WMF_DELEGATE,test "$have_wmf" = 'yes')
2610 dnl ===========================================================================
2613 dnl ===========================================================================
2616 # Check for XML delegate library.
2619 [AC_HELP_STRING([--without-xml],
2620 [disable XML support])],
2621 [with_xml=$withval],
2624 if test "$with_xml" != 'yes' ; then
2625 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-xml=$with_xml "
2630 if test "$with_xml" != 'no'; then
2631 AC_MSG_RESULT([-------------------------------------------------------------])
2632 AC_MSG_CHECKING([for XML])
2634 PERSIST_LDFLAGS=$LDFLAGS
2635 PERSIST_CPPFLAGS=$CPPFLAGS
2637 AC_CHECK_PROGS(xml2_config,xml2-config,)dnl
2638 if test -n "$xml2_config"; then
2639 # Debian installs libxml headers under /usr/include/libxml2/libxml with
2640 # the shared library installed under /usr/lib, whereas the package
2641 # installs itself under $prefix/libxml and $prefix/lib.
2642 xml2_prefix=`xml2-config --prefix`
2643 if test -d "${xml2_prefix}/include/libxml2"; then
2644 CPPFLAGS="$CPPFLAGS -I${xml2_prefix}/include/libxml2"
2646 if test "${xml2_prefix}" != '/usr'; then
2647 LDFLAGS="$LDFLAGS -L${xml2_prefix}/lib"
2652 AC_CHECK_HEADER(libxml/parser.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2653 AC_CHECK_LIB(xml2,xmlParseExternalEntity,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2654 AC_MSG_CHECKING([if XML package is complete])
2655 if test $passed -gt 0; then
2656 if test $failed -gt 0; then
2657 AC_MSG_RESULT([no -- some components failed test])
2658 have_xml='no (failed tests)'
2659 LDFLAGS="$PERSIST_LDFLAGS"
2660 CPPFLAGS="$PERSIST_CPPFLAGS"
2663 LIBS="$XML_LIBS $LIBS"
2664 AC_DEFINE(XML_DELEGATE,1,Define if you have XML library)
2665 AC_MSG_RESULT([yes])
2672 AM_CONDITIONAL(XML_DELEGATE,test "$have_xml" = 'yes')
2675 dnl ===========================================================================
2677 # Substitute compiler name to build/link PerlMagick
2679 AC_SUBST(PERLMAINCC)
2682 # Configure install Paths
2685 # Subdirectory under lib to place ImageMagick lib files
2686 LIBRARY_RELATIVE_PATH="${PACKAGE_NAME}-${PACKAGE_VERSION}"
2687 AC_DEFINE_UNQUOTED(LIBRARY_RELATIVE_PATH,"$LIBRARY_RELATIVE_PATH",Subdirectory of lib where ImageMagick architecture dependent files are installed)
2689 # Path to ImageMagick bin directory
2690 EXECUTABLE_PATH="${BIN_DIR}"
2691 DEFINE_EXECUTABLE_PATH="${BIN_DIR}/"
2692 case "${build_os}" in
2694 DEFINE_EXECUTABLE_PATH=`$WinPathScript "$DEFINE_EXECUTABLE_PATH" 1`
2697 AC_DEFINE_UNQUOTED(EXECUTABLE_PATH,"$DEFINE_EXECUTABLE_PATH",Directory where executables are installed.)
2698 AC_SUBST(EXECUTABLE_PATH)
2700 # Path to ImageMagick lib
2701 LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}"
2702 DEFINE_LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}/"
2703 case "${build_os}" in
2705 DEFINE_LIBRARY_PATH=`$WinPathScript "$DEFINE_LIBRARY_PATH" 1`
2708 AC_DEFINE_UNQUOTED(LIBRARY_PATH,"$DEFINE_LIBRARY_PATH",Directory where architecture-dependent files live.)
2709 AC_SUBST(LIBRARY_PATH)
2712 # Subdirectory under lib to place ImageMagick coder module files
2713 CODER_RELATIVE_PATH="${LIBRARY_RELATIVE_PATH}/modules-Q${QUANTUM_DEPTH}/coders"
2714 AC_DEFINE_UNQUOTED(CODER_RELATIVE_PATH,"$CODER_RELATIVE_PATH",Subdirectory of lib where coder modules are installed)
2715 CODER_PATH="${LIB_DIR}/${CODER_RELATIVE_PATH}"
2716 DEFINE_CODER_PATH="${LIB_DIR}/${CODER_RELATIVE_PATH}/"
2717 case "${build_os}" in
2719 DEFINE_CODER_PATH=`$WinPathScript "$DEFINE_CODER_PATH" 1`
2722 AC_DEFINE_UNQUOTED(CODER_PATH,"$DEFINE_CODER_PATH",Location of coder modules)
2723 AC_SUBST(CODER_PATH)
2726 # Subdirectory under lib to place ImageMagick filter module files
2727 FILTER_RELATIVE_PATH="${LIBRARY_RELATIVE_PATH}/modules-Q${QUANTUM_DEPTH}/filters"
2728 AC_DEFINE_UNQUOTED(FILTER_RELATIVE_PATH,"$FILTER_RELATIVE_PATH",Subdirectory of lib where filter modules are installed)
2729 FILTER_PATH="${LIB_DIR}/${FILTER_RELATIVE_PATH}"
2730 DEFINE_FILTER_PATH="${LIB_DIR}/${FILTER_RELATIVE_PATH}/"
2731 case "${build_os}" in
2733 DEFINE_FILTER_PATH=`$WinPathScript "$DEFINE_FILTER_PATH" 1`
2736 AC_DEFINE_UNQUOTED(FILTER_PATH,"$DEFINE_FILTER_PATH",Location of filter modules)
2737 AC_SUBST(FILTER_PATH)
2740 # Path to ImageMagick documentation files
2741 DOCUMENTATION_RELATIVE_PATH=""
2742 DOCUMENTATION_PATH="${DOC_DIR}/${DOCUMENTATION_RELATIVE_PATH}"
2743 DEFINE_DOCUMENTATION_PATH="${DOC_DIR}/${DOCUMENTATION_RELATIVE_PATH}/"
2744 case "${build_os}" in
2746 DEFINE_DOCUMENTATION_PATH=`$WinPathScript "$DEFINE_DOCUMENTATION_PATH" 1`
2749 AC_DEFINE_UNQUOTED(DOCUMENTATION_PATH,"$DEFINE_DOCUMENTATION_PATH",Directory where ImageMagick documents live.)
2750 AC_SUBST(DOCUMENTATION_PATH)
2753 # Path to ImageMagick share files
2754 SHARE_RELATIVE_PATH="${PACKAGE_NAME}-${PACKAGE_VERSION}"
2755 SHARE_PATH="${DATA_DIR}/${SHARE_RELATIVE_PATH}"
2756 DEFINE_SHARE_PATH="${DATA_DIR}/${SHARE_RELATIVE_PATH}/"
2757 case "${build_os}" in
2759 DEFINE_SHARE_PATH=`$WinPathScript "$DEFINE_SHARE_PATH" 1`
2762 AC_DEFINE_UNQUOTED(SHARE_PATH,"$DEFINE_SHARE_PATH",Directory where architecture-independent files live.)
2763 AC_SUBST(SHARE_PATH)
2765 # Subdirectory to place ImageMagick configuration files
2766 CONFIGURE_RELATIVE_PATH="${LIBRARY_RELATIVE_PATH}"
2767 AC_DEFINE_UNQUOTED(CONFIGURE_RELATIVE_PATH,"$CONFIGURE_RELATIVE_PATH",Subdirectory of lib where architecture-dependent configuration files live.)
2768 CONFIGURE_PATH="${SYSCONF_DIR}/${CONFIGURE_RELATIVE_PATH}/"
2769 DEFINE_CONFIGURE_PATH="${SYSCONF_DIR}/${CONFIGURE_RELATIVE_PATH}/"
2770 case "${build_os}" in
2772 DEFINE_CONFIGURE_PATH=`$WinPathScript "$DEFINE_CONFIGURE_PATH" 1`
2775 AC_DEFINE_UNQUOTED(CONFIGURE_PATH,"$DEFINE_CONFIGURE_PATH",Directory where architecture-dependent configuration files live.)
2776 AC_SUBST(CONFIGURE_PATH)
2778 # Subdirectory to place ImageMagick configuration files
2779 SHARE_CONFIGURE_RELATIVE_PATH="${LIBRARY_RELATIVE_PATH}"
2780 AC_DEFINE_UNQUOTED(SHARE_CONFIGURE_RELATIVE_PATH,"$SHARE_CONFIGURE_RELATIVE_PATH",Subdirectory of lib where architecture-independent configuration files live.)
2781 SHARE_CONFIGURE_PATH="${DATA_DIR}/${SHARE_CONFIGURE_RELATIVE_PATH}"
2782 DEFINE_SHARE_CONFIGURE_PATH="${DATA_DIR}/${SHARE_CONFIGURE_RELATIVE_PATH}/"
2783 case "${build_os}" in
2785 DEFINE_SHARE_CONFIGURE_PATH=`$WinPathScript "$DEFINE_SHARE_CONFIGURE_PATH" 1`
2788 AC_DEFINE_UNQUOTED(SHARE_CONFIGURE_PATH,"$DEFINE_SHARE_CONFIGURE_PATH",Directory where architecture-independent configuration files live.)
2789 AC_SUBST(SHARE_CONFIGURE_PATH)
2792 # program_transform_name is formed for use in a Makefile, so create a
2793 # modified version for use in a shell script.
2794 configure_transform_name=`echo ${program_transform_name} | sed 's,\\$\\$,$,'`
2796 # Default delegate definitions
2797 AC_MSG_RESULT([-------------------------------------------------------------])
2798 AC_MSG_CHECKING([for ImageMagick delegate programs])
2800 AutotraceDecodeDelegateDefault='autotrace'
2801 BlenderDecodeDelegateDefault='blender'
2802 BZIPDelegateDefault='bzip2'
2803 BrowseDelegateDefault='xdg-open'
2804 CGMDecodeDelegateDefault='ralcgm'
2805 CatDelegateDefault='cat'
2806 DNGDecodeDelegateDefault='ufraw-batch'
2807 GVCDecodeDelegateDefault='dot'
2808 DVIDecodeDelegateDefault='dvips'
2809 EchoDelegateDefault='echo'
2810 EditorDelegateDefault='xterm'
2811 FIGDecodeDelegateDefault='fig2dev'
2812 ConvertDelegateDefault=`echo convert | sed ${configure_transform_name}`
2813 DisplayDelegateDefault=`echo display | sed ${configure_transform_name}`
2814 MogrifyDelegateDefault=`echo mogrify | sed ${configure_transform_name}`
2815 GnuplotDecodeDelegateDefault='gnuplot'
2816 HPGLDecodeDelegateDefault='hp2xx'
2817 HTMLDecodeDelegateDefault='html2ps'
2818 ILBMDecodeDelegateDefault='ilbmtoppm'
2819 ILBMEncodeDelegateDefault='ppmtoilbm'
2820 LPDelegateDefault='lp'
2821 LPRDelegateDefault='lpr'
2822 LZWDecodeDelegateDefault='uncompress'
2823 LZWEncodeDelegateDefault='compress'
2824 LaunchDelegateDefault='gimp'
2825 MANDelegateDefault='groff'
2826 MPEGDecodeDelegateDefault='ffmpeg'
2827 MPEGEncodeDelegateDefault='ffmpeg'
2828 MrSIDDecodeDelegateDefault='mrsidgeodecode'
2829 MVDelegateDefault='mv'
2830 PCLDelegateDefault='pcl6'
2831 PGPDecodeDelegateDefault='pgpv'
2832 POVDelegateDefault='povray'
2833 if test "$native_win32_build" = 'yes'; then
2834 PSDelegateDefault='gswin32c'
2835 elif test "$gslib_framework" = 'yes'; then
2836 PSDelegateDefault='gsc'
2838 PSDelegateDefault='gs'
2840 RLEEncodeDelegateDefault='rawtorle'
2841 RMDelegateDefault='rm'
2842 RSVGDecodeDelegateDefault='rsvg'
2843 SCANDecodeDelegateDefault='scanimage'
2844 TXTDelegateDefault='enscript'
2845 UniconvertorDelegateDefault='uniconvertor'
2846 WMFDecodeDelegateDefault='wmf2eps'
2847 WWWDecodeDelegateDefault='curl'
2848 XPSDelegateDefault='gxps'
2849 ZipDelegateDefault='gzip'
2851 # Search for delegates
2852 AC_PATH_PROG(AutotraceDecodeDelegate, "$AutotraceDecodeDelegateDefault", "$AutotraceDecodeDelegateDefault")
2853 AC_PATH_PROG(BlenderDecodeDelegate, "$BlenderDecodeDelegateDefault", "$BlenderDecodeDelegateDefault")
2854 AC_PATH_PROG(BZIPDelegate, "$BZIPDelegateDefault", "$BZIPDelegateDefault")
2855 AC_PATH_PROG(BrowseDelegate, "$BrowseDelegateDefault" mozilla firefox netscape, "$BrowseDelegateDefault")
2856 AC_PATH_PROG(CGMDecodeDelegate, "$CGMDecodeDelegateDefault", "$CGMDecodeDelegateDefault")
2857 AC_PATH_PROG(CatDelegate, "$CatDelegateDefault", "$CatDelegateDefault")
2858 AC_PATH_PROG(DNGDecodeDelegate, "$DNGDecodeDelegateDefault", "$DNGDecodeDelegateDefault")
2859 AC_PATH_PROG(GVCDecodeDelegate, "$GVCDecodeDelegateDefault", "$GVCDecodeDelegateDefault")
2860 AC_PATH_PROG(DVIDecodeDelegate, "$DVIDecodeDelegateDefault", "$DVIDecodeDelegateDefault")
2861 AC_PATH_PROG(EchoDelegate, "$EchoDelegateDefault", "$EchoDelegateDefault")
2862 AC_PATH_PROG(EditorDelegate, "$EditorDelegateDefault", "$EditorDelegateDefault")
2863 AC_PATH_PROG(FIGDecodeDelegate, "$FIGDecodeDelegateDefault", "$FIGDecodeDelegateDefault")
2864 AC_PATH_PROG(ConvertDelegate, "$ConvertDelegateDefault", "$ConvertDelegateDefault")
2865 AC_PATH_PROG(DisplayDelegate, "$DisplayDelegateDefault", "$DisplayDelegateDefault")
2866 AC_PATH_PROG(MogrifyDelegate, "$MogrifyDelegateDefault", "$MogrifyDelegateDefault")
2867 AC_PATH_PROG(GnuplotDecodeDelegate, "$GnuplotDecodeDelegateDefault", "$GnuplotDecodeDelegateDefault")
2868 AC_PATH_PROG(HPGLDecodeDelegate, "$HPGLDecodeDelegateDefault", "$HPGLDecodeDelegateDefault")
2869 AC_PATH_PROG(HTMLDecodeDelegate, "$HTMLDecodeDelegateDefault", "$HTMLDecodeDelegateDefault")
2870 AC_PATH_PROG(ILBMDecodeDelegate, "$ILBMDecodeDelegateDefault", "$ILBMDecodeDelegateDefault")
2871 AC_PATH_PROG(ILBMEncodeDelegate, "$ILBMEncodeDelegateDefault", "$ILBMEncodeDelegateDefault")
2872 AC_PATH_PROG(LPDelegate, "$LPDelegateDefault", no)
2873 AC_PATH_PROG(LPRDelegate, "$LPRDelegateDefault", "$LPRDelegateDefault")
2874 AC_PATH_PROG(LZWDecodeDelegate, "$LZWDecodeDelegateDefault", "$LZWDecodeDelegateDefault")
2875 AC_PATH_PROG(LZWEncodeDelegate, "$LZWEncodeDelegateDefault", "$LZWEncodeDelegateDefault")
2876 AC_PATH_PROG(LaunchDelegate, "$LaunchDelegateDefault", "$LaunchDelegateDefault")
2877 AC_PATH_PROG(MANDelegate, "$MANDelegateDefault", "$MANDelegateDefault")
2878 AC_PATH_PROG(MPEGDecodeDelegate, "$MPEGDecodeDelegateDefault", "$MPEGDecodeDelegateDefault")
2879 AC_PATH_PROG(MPEGEncodeDelegate, "$MPEGEncodeDelegateDefault", "$MPEGEncodeDelegateDefault")
2880 AC_PATH_PROG(MrSIDDecodeDelegate, "$MrSIDDecodeDelegateDefault", "$MrSIDDecodeDelegateDefault")
2881 AC_PATH_PROG(MVDelegate, "$MVDelegateDefault", "$MVDelegateDefault")
2882 AC_PATH_PROG(PCLDelegate, "$PCLDelegateDefault", "$PCLDelegateDefault")
2883 AC_PATH_PROG(PGPDecodeDelegate, "$PGPDecodeDelegateDefault", "$PGPDecodeDelegateDefault")
2884 AC_PATH_PROG(POVDelegate, "$POVDelegateDefault", "$POVDelegateDefault")
2885 AC_PATH_PROGS(PSDelegate, gsx gsc "$PSDelegateDefault", "$PSDelegateDefault")
2886 AC_PATH_PROG(RLEEncodeDelegate, "$RLEEncodeDelegateDefault", "$RLEEncodeDelegateDefault")
2887 AC_PATH_PROG(RMDelegate, "$RMDelegateDefault", "$RMDelegateDefault")
2888 AC_PATH_PROG(RSVGDecodeDelegate, "$RSVGDecodeDelegateDefault", "$RSVGDecodeDelegateDefault")
2889 AC_PATH_PROG(SCANDecodeDelegate, "$SCANDecodeDelegateDefault", "$SCANDecodeDelegateDefault")
2890 AC_PATH_PROG(TXTDelegate, "$TXTDelegateDefault", "$TXTDelegateDefault")
2891 AC_PATH_PROG(UniconvertorDelegate, "$UniconvertorDelegateDefault", "$UniconvertorDelegateDefault")
2892 AC_PATH_PROG(WMFDecodeDelegate, "$WMFDecodeDelegateDefault", "$WMFDecodeDelegateDefault")
2893 AC_PATH_PROG(WWWDecodeDelegate, "$WWWDecodeDelegateDefault", "$WWWDecodeDelegateDefault")
2894 AC_PATH_PROG(XPSDelegate, "$XPSDelegateDefault", "$XPSDelegateDefault")
2895 AC_PATH_PROG(ZipDelegate, "$ZipDelegateDefault", "$ZipDelegateDefault")
2897 # Prefer lpr to lp; lp needs options tacked on.
2898 if test "$LPRDelegate" != no; then
2899 PrintDelegate="$LPRDelegate"
2901 PrintDelegate="$LPDelegate -c -s"
2903 AC_SUBST(PrintDelegate)
2905 # Installed ImageMagick utiltity paths
2906 ConvertDelegate="${BIN_DIR}/${ConvertDelegateDefault}"
2907 DisplayDelegate="${BIN_DIR}/${DisplayDelegateDefault}"
2908 MogrifyDelegate="${BIN_DIR}/${MogrifyDelegateDefault}"
2910 # Set delegate booleans
2911 have_ffmpeg='no'; if test "$MPEGDecodeDelegate" != "$MPEGDecodeDelegateDefault" ; then have_ffmpeg='yes'; fi
2912 have_fig2dev='no' ; if test "$FIGDecodeDelegate" != "$FIGDecodeDelegateDefault" ; then have_fig2dev='yes'; fi
2913 have_gs='no' ; if test "$PSDelegate" != "$PSDelegateDefault"; then have_gs='yes'; fi
2914 have_hp2xx='no' ; if test "$HPGLDecodeDelegate" != "$HPGLDecodeDelegateDefault" ; then have_hp2xx='yes'; fi
2915 have_ilbmtoppm='no' ; if test "$ILBMDecodeDelegate" != "$ILBMDecodeDelegateDefault" ; then have_ilbmtoppm='yes'; fi
2916 have_mrsid='no'; if test "$MrSIDDecodeDelegate" != "$MrSIDDecodeDelegateDefault" ; then have_mrsid='yes'; fi
2917 have_pcl='no' ; if test "$PCLDelegate" != "$PCLDelegateDefault"; then have_pcl='yes'; fi
2918 have_ppmtoilbm='no' ; if test "$ILBMEncodeDelegate" != "$ILBMEncodeDelegateDefault" ; then have_ppmtoilbm='yes'; fi
2919 have_ralcgm='no' ; if test "$CGMDecodeDelegate" != "$CGMDecodeDelegateDefault" ; then have_ralcgm='yes'; fi
2920 have_xps='no' ; if test "$XPSDelegate" != "$XPSDelegateDefault"; then have_xps='yes'; fi
2923 # Test for font directories
2925 type_include_files=''
2928 AC_MSG_CHECKING(for Dejavu fonts directory)
2930 if test "${with_dejavu_font_dir}" != 'default'; then
2931 dejavu_font_dir="${with_dejavu_font_dir}/"
2933 for font_dir in "${prefix}/share/dejavu/fonts/" '/usr/share/fonts/dejavu/'; do
2934 if test -f "${font_dir}DejaVuSerif.ttf"; then
2935 dejavu_font_dir="${font_dir}"
2940 if test "${dejavu_font_dir}x" != 'x'; then
2941 type_include_files="${type_include_files} "'<include file="type-dejavu.xml" />'
2942 AC_MSG_RESULT([$dejavu_font_dir])
2944 AC_MSG_RESULT([not found!]);
2946 AC_SUBST(dejavu_font_dir)
2950 if test "$with_windows_font_dir" != "no" && test -n "$with_windows_font_dir"; then
2951 windows_font_dir="${with_windows_font_dir}/"
2953 if test "${windows_font_dir}x" != 'x'; then
2954 if test -f '/usr/X11R6/lib/X11/fonts/truetype/arial.ttf'; then
2955 windows_font_dir='/usr/X11R6/lib/X11/fonts/truetype/'
2957 if test -f '/usr/X11R7/lib/X11/fonts/truetype/arial.ttf'; then
2958 windows_font_dir='/usr/X11R7/lib/X11/fonts/truetype/'
2960 if test -f '/usr/share/fonts/msttcore/arial.ttf'; then
2961 windows_font_dir='/usr/share/fonts/msttcore/truetype/'
2964 if test "${windows_font_dir}x" != 'x'; then
2965 type_include_files="$type_include_files "'<include file="type-windows.xml" />'
2967 AC_SUBST(windows_font_dir)
2970 AC_MSG_CHECKING(for Ghostscript fonts directory)
2971 ghostscript_font_dir=''
2972 if test "${with_gs_font_dir}" != 'default'; then
2973 ghostscript_font_dir="${with_gs_font_dir}/"
2975 if test "${native_win32_build}" = 'yes'; then
2976 # Native Windows Build
2977 for font_dir in "c:\\Program Files\\gs\\fonts\\" "c:\\Program Files \(x86\)\\gs\\fonts\\" "c:\\gs\\fonts\\"; do
2978 if test -f "${font_dir}a010013l.pfb"; then
2979 ghostscript_font_dir="$font_dir"
2983 if test "${PSDelegate}" != 'gswin32c'; then
2984 ghostscript_font_dir=`echo "${PSDelegate}" | sed -e 's:/gs/.*:/gs:;s:^/::;s/./&:/;s:/:\\\\:g'`"\\fonts\\"
2987 # Linux / Mac OS X / Unix Build
2988 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
2989 if test -f "${font_dir}a010013l.pfb"; then
2990 ghostscript_font_dir="${font_dir}"
2994 if test "${ghostscript_font_dir}x" = 'x'; then
2995 if test "$PSDelegate" != 'gs'; then
2996 ghostscript_font_dir=`echo "$PSDelegate" | sed -e 's:/bin/gs:/share/ghostscript/fonts:'`"/"
3001 if test "${ghostscript_font_dir}x" != 'x'; then
3002 type_include_files="${type_include_files} "'<include file="type-ghostscript.xml" />'
3003 AC_MSG_RESULT([$ghostscript_font_dir])
3005 AC_MSG_RESULT([not found!]);
3007 AC_SUBST(ghostscript_font_dir)
3008 case "${build_os}" in
3010 PSDelegate=`$WinPathScript "$PSDelegate" 1`
3014 AC_SUBST(type_include_files)
3017 # Handle case where user doesn't want frozen paths
3019 if test "$with_frozenpaths" != 'yes'; then
3020 # Re-set delegate definitions to default (no paths)
3021 AutotraceDecodeDelegate="$AutotraceDecodeDelegateDefault"
3022 BlenderDecodeDelegate="$BlenderDecodeDelegateDefault"
3023 BZIPDelegate="$BZIPDelegateDefault"
3024 BrowseDelegate="$BrowseDelegateDefault"
3025 CGMDecodeDelegate="$CGMDecodeDelegateDefault"
3026 CatDelegate="$CatDelegateDefault"
3027 ConvertDelegate="$ConvertDelegateDefault"
3028 GVCDecodeDelegate="$GVCDecodeDelegateDefault"
3029 DVIDecodeDelegate="$DVIDecodeDelegateDefault"
3030 EchoDelegate="$EchoDelegateDefault"
3031 EditorDelegate="$EditorDelegateDefault"
3032 FIGDecodeDelegate="$FIGDecodeDelegateDefault"
3033 GnuplotDecodeDelegate="$GnuplotDecodeDelegateDefault"
3034 HPGLDecodeDelegate="$HPGLDecodeDelegateDefault"
3035 HTMLDecodeDelegate="$HTMLDecodeDelegateDefault"
3036 ILBMDecodeDelegate="$ILBMDecodeDelegateDefault"
3037 ILBMEncodeDelegate="$ILBMEncodeDelegateDefault"
3038 LPDelegate="$LPDelegateDefault"
3039 LZWDecodeDelegate="$LZWDecodeDelegateDefault"
3040 LZWEncodeDelegate="$LZWEncodeDelegateDefault"
3041 LaunchDelegate="$LaunchDelegateDefault"
3042 MANDelegate="$MANDelegateDefault"
3043 MPEGDecodeDelegate="$MPEGDecodeDelegateDefault"
3044 MPEGEncodeDelegate="$MPEGEncodeDelegateDefault"
3045 MogrifyDelegate="$MogrifyDelegateDefault"
3046 MrSIDDecodeDelegate="$MrSIDDecodeDelegateDefault"
3047 MVDelegate="$MVDelegateDefault"
3048 PCLDelegate="$PCLDelegateDefault"
3049 PGPDecodeDelegate="$PGPDecodeDelegateDefault"
3050 POVDelegate="$POVDelegateDefault"
3051 PSDelegate="$PSDelegateDefault"
3052 RLEEncodeDelegate="$RLEEncodeDelegateDefault"
3053 RMDelegate="$RMDelegateDefault"
3054 RSVGDecodeDelegate="$RSVGDecodeDelegateDefault"
3055 SCANDecodeDelegate="$SCANDecodeDelegateDefault"
3056 ShowImageDelegate="$ShowImageDelegateDefault"
3057 TXTDelegate="$TXTDelegateDefault"
3058 UniconvertorDelegate="$UniconvertorDelegateDefault"
3059 WMFDecodeDelegate="$WMFDecodeDelegateDefault"
3060 WWWDecodeDelegate="$WWWDecodeDelegateDefault"
3061 XPSDelegate="$XPSDelegateDefault"
3062 ZipDelegate="$ZipDelegateDefault"
3065 # Delegate substitutions
3066 AC_SUBST(AutotraceDecodeDelegate)
3067 AC_SUBST(BlenderDecodeDelegate)
3068 AC_SUBST(BZIPDelegate)
3069 AC_SUBST(BrowseDelegate)
3070 AC_SUBST(CGMDecodeDelegate)
3071 AC_SUBST(CatDelegate)
3072 AC_SUBST(ConvertDelegate)
3073 AC_SUBST(GVCDecodeDelegate)
3074 AC_SUBST(DVIDecodeDelegate)
3075 AC_SUBST(EchoDelegate)
3076 AC_SUBST(EditorDelegate)
3077 AC_SUBST(FIGDecodeDelegate)
3078 AC_SUBST(GnuplotDecodeDelegate)
3079 AC_SUBST(HPGLDecodeDelegate)
3080 AC_SUBST(HTMLDecodeDelegate)
3081 AC_SUBST(ILBMDecodeDelegate)
3082 AC_SUBST(ILBMEncodeDelegate)
3083 AC_SUBST(LPDelegate)
3084 AC_SUBST(LZWDecodeDelegate)
3085 AC_SUBST(LZWEncodeDelegate)
3086 AC_SUBST(LaunchDelegate)
3087 AC_SUBST(MANDelegate)
3088 AC_SUBST(MPEGDecodeDelegate)
3089 AC_SUBST(MPEGEncodeDelegate)
3090 AC_SUBST(MogrifyDelegate)
3091 AC_SUBST(MrSIDDecodeDelegate)
3092 AC_SUBST(MVDelegate)
3093 AC_SUBST(PCLDelegate)
3094 AC_SUBST(PGPDecodeDelegate)
3095 AC_SUBST(POVDelegate)
3096 AC_SUBST(PSDelegate)
3097 AC_SUBST(RLEEncodeDelegate)
3098 AC_SUBST(RMDelegate)
3099 AC_SUBST(SCANDecodeDelegate)
3100 AC_SUBST(ShowImageDelegate)
3101 AC_SUBST(TXTDelegate)
3102 AC_SUBST(UniconvertorDelegate)
3103 AC_SUBST(WMFDecodeDelegate)
3104 AC_SUBST(WWWDecodeDelegate)
3105 AC_SUBST(XPSDelegate)
3106 AC_SUBST(ZipDelegate)
3112 AC_CHECK_PROGS(TAR,gnutar gtar tar)
3113 AC_CHECK_PROGS(PERL,perl)
3114 AC_CHECK_PROGS(RPM,rpmbuild rpm)
3115 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
3116 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
3117 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
3118 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
3120 AM_CONDITIONAL(RPM_DELEGATE, test "x$RPM" != "x" )
3123 # 7ZIP support (http://p7zip.sourceforge.net/)
3126 AC_CHECK_PROGS(P7ZIP,[7za])
3128 AM_CONDITIONAL(P7ZIP_DELEGATE, test "x$P7ZIP" != "x" )
3131 # ZIP support (http://www.info-zip.org/Zip.html)
3134 AC_CHECK_PROGS(ZIP,[zip])
3136 AM_CONDITIONAL(ZIP_DELEGATE, test "x$ZIP" != "x" )
3139 # GhostPCL related configuration.
3141 PCLColorDevice=ppmraw
3142 PCLCMYKDevice=bmpsep8
3143 PCLMonoDevice=pbmraw
3144 if test -z "$PCLVersion"; then
3145 PCLVersion='unknown'
3147 if test $have_pcl = 'yes'; then
3148 AC_MSG_RESULT([-------------------------------------------------------------])
3149 AC_MSG_CHECKING([for PCL])
3152 AC_MSG_CHECKING([for pcl color device])
3153 if $PCLDelegate -dBATCH -sDEVICE=$PCLColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3156 PCLColorDevice=ppmraw
3158 AC_MSG_RESULT([$PCLColorDevice])
3161 AC_MSG_CHECKING([for pcl CMYK device])
3162 if $PCLDelegate -dBATCH -sDEVICE=$PCLColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3165 PCLCMYKDevice=$PCLColorDevice
3167 AC_MSG_RESULT([$PCLCMYKDevice])
3170 AC_MSG_CHECKING([for pcl mono device])
3171 if $PCLDelegate -dBATCH -sDEVICE=$PCLMonoDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3174 PCLMonoDevice=$PCLColorDevice
3176 AC_MSG_RESULT([$PCLMonoDevice])
3179 AC_SUBST(PCLMonoDevice)
3180 AC_SUBST(PCLColorDevice)
3181 AC_SUBST(PCLCMYKDevice)
3182 AC_SUBST(PCLVersion)
3185 # GhostXPS related configuration.
3187 XPSColorDevice=ppmraw
3188 XPSCMYKDevice=bmpsep8
3189 XPSMonoDevice=pbmraw
3190 if test -z "$XPSVersion"; then
3191 XPSVersion='unknown'
3193 if test $have_xps = 'yes'; then
3194 AC_MSG_RESULT([-------------------------------------------------------------])
3195 AC_MSG_CHECKING([for XPS])
3198 AC_MSG_CHECKING([for xps color device])
3199 if $XPSDelegate -dBATCH -sDEVICE=$XPSColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3202 XPSColorDevice=ppmraw
3204 AC_MSG_RESULT([$XPSColorDevice])
3207 AC_MSG_CHECKING([for xps CMYK device])
3208 if $XPSDelegate -dBATCH -sDEVICE=$XPSColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3211 XPSCMYKDevice=$XPSColorDevice
3213 AC_MSG_RESULT([$XPSCMYKDevice])
3216 AC_MSG_CHECKING([for xps mono device])
3217 if $XPSDelegate -dBATCH -sDEVICE=$XPSMonoDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3220 XPSMonoDevice=$XPSColorDevice
3222 AC_MSG_RESULT([$XPSMonoDevice])
3225 AC_SUBST(XPSMonoDevice)
3226 AC_SUBST(XPSColorDevice)
3227 AC_SUBST(XPSCMYKDevice)
3228 AC_SUBST(XPSVersion)
3231 # Ghostscript related configuration.
3233 GSAlphaDevice=pngalpha
3234 GSColorDevice=pnmraw
3237 GSPDFDevice=pdfwrite
3239 GSEPSDevice=epswrite
3241 if test $have_gs = 'yes'; then
3242 AC_MSG_RESULT([-------------------------------------------------------------])
3243 AC_MSG_CHECKING([for Ghostscript])
3245 AC_MSG_CHECKING([for Ghostscript version])
3246 if GSVersion=`$PSDelegate --version`; then
3249 GSVersion=`$PSDelegate --help | sed -e '1q' | awk '{ print $3 }'`
3251 AC_MSG_RESULT([$GSVersion])
3254 AC_MSG_CHECKING([for gs alpha device])
3255 if $PSDelegate -q -dBATCH -sDEVICE=$GSAlphaDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3258 GSAlphaDevice=pnmraw
3260 AC_MSG_RESULT([$GSAlphaDevice])
3263 AC_MSG_CHECKING([for gs color device])
3264 if $PSDelegate -q -dBATCH -sDEVICE=$GSColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3267 GSColorDevice=pnmraw
3269 AC_MSG_RESULT([$GSColorDevice])
3272 AC_MSG_CHECKING([for gs CMYK device])
3273 if $PSDelegate -q -dBATCH -sDEVICE=$GSCMYKDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3276 GSCMYKDevice=bmpsep8
3278 AC_MSG_RESULT([$GSCMYKDevice])
3281 AC_MSG_CHECKING([for gs mono device])
3282 if $PSDelegate -q -dBATCH -sDEVICE=$GSMonoDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3285 GSMonoDevice=$GSColorDevice
3287 AC_MSG_RESULT([$GSMonoDevice])
3290 AC_MSG_CHECKING([for gs PDF writing device])
3291 if $PSDelegate -q -dBATCH -sDEVICE=$GSPDFDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3294 GSPDFDevice=nodevice
3296 AC_MSG_RESULT([$GSPDFDevice])
3299 AC_MSG_CHECKING([for gs PS writing device])
3300 if $PSDelegate -q -dBATCH -sDEVICE=$GSPSDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3305 AC_MSG_RESULT([$GSPSDevice])
3308 AC_MSG_CHECKING([for gs EPS writing device])
3309 if $PSDelegate -q -dBATCH -sDEVICE=$GSEPSDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3312 GSEPSDevice=nodevice
3314 AC_MSG_RESULT([$GSEPSDevice])
3317 AC_SUBST(GSAlphaDevice)
3318 AC_SUBST(GSCMYKDevice)
3319 AC_SUBST(GSColorDevice)
3320 AC_SUBST(GSEPSDevice)
3321 AC_SUBST(GSMonoDevice)
3322 AC_SUBST(GSPDFDevice)
3323 AC_SUBST(GSPSDevice)
3327 # PerlMagick-related configuration
3330 # Look for PERL if PerlMagick requested
3331 # If name/path of desired PERL interpreter is specified, look for that one first
3333 if test "$with_perl" != 'no'; then
3334 AC_MSG_RESULT([-------------------------------------------------------------])
3335 AC_MSG_CHECKING([for Perl])
3337 if test "$with_perl" != 'yes'; then
3338 AC_CACHE_CHECK(for perl,ac_cv_path_PERL,ac_cv_path_PERL="$with_perl");
3339 PERL=$ac_cv_path_PERL
3341 have_perl="$ac_cv_path_PERL"
3343 AC_PATH_PROGS(PERL,perl perl5,)dnl
3344 if test "$ac_cv_path_PERL"; then
3345 have_perl="$ac_cv_path_PERL"
3350 if test "$with_perl" != 'yes' ; then
3351 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-perl=$with_perl "
3354 PERL_SUPPORTS_DESTDIR='no'
3356 with_perl_static='no'
3357 with_perl_dynamic='no'
3358 if test "$have_perl" != 'no'; then
3359 if test "$with_perl" != 'no' && test "$libtool_build_shared_libs" = 'no'; then
3360 with_perl_static='yes'
3362 if test "$with_perl" != 'no' && test "$libtool_build_shared_libs" = 'yes'; then
3363 with_perl_dynamic='yes'
3365 # Is PERL's MakeMaker new enough to support DESTDIR?
3366 AX_PROG_PERL_VERSION(5.8.1,[PERL_SUPPORTS_DESTDIR='yes'],[PERL_SUPPORTS_DESTDIR='no'])
3368 AM_CONDITIONAL(WITH_PERL, test "$have_perl" != 'no')
3369 AM_CONDITIONAL(WITH_PERL_STATIC, test $with_perl_static = 'yes')
3370 AM_CONDITIONAL(WITH_PERL_DYNAMIC, test $with_perl_dynamic = 'yes')
3371 AC_SUBST(PERL_SUPPORTS_DESTDIR)
3373 # Determine path to pick up MagickCore library from for use with building PerlMagick
3374 MAGICKCORE_PATH="${LIB_DIR}"
3375 if test $with_perl_static = 'yes'; then
3376 # Find out where libtool hides its uninstalled libraries (as libtool_objdir)
3377 libtool_objdir=$objdir
3379 # Linker search path to library, followed by -lMagickCore
3380 MAGICKCORE_PATH="${builddir}/magick/${libtool_objdir}"
3382 AC_SUBST(MAGICKCORE_PATH)
3384 # Create a simple string containing format names for all delegate libraries
3386 if test "$have_autotrace" = 'yes'; then DELEGATES="$DELEGATES autotrace"; fi
3387 if test "$have_bzlib" = 'yes'; then DELEGATES="$DELEGATES bzlib"; fi
3388 if test "$have_djvu" = 'yes'; then DELEGATES="$DELEGATES djvu"; fi
3389 if test "$have_dps" = 'yes'; then DELEGATES="$DELEGATES dps"; fi
3390 if test "$have_fftw" = 'yes'; then DELEGATES="$DELEGATES fftw"; fi
3391 if test "$have_fpx" = 'yes'; then DELEGATES="$DELEGATES fpx"; fi
3392 if test "$have_fontconfig" = 'yes'; then DELEGATES="$DELEGATES fontconfig"; fi
3393 if test "$have_freetype" = 'yes'; then DELEGATES="$DELEGATES freetype"; fi
3394 if test "$have_gslib" = 'yes'; then DELEGATES="$DELEGATES gs"; fi
3395 if test "$have_gvc" = 'yes'; then DELEGATES="$DELEGATES gvc"; fi
3396 if test "$have_jbig" = 'yes'; then DELEGATES="$DELEGATES jbig"; fi
3397 if test "$have_jpeg" = 'yes'; then
3398 DELEGATES="$DELEGATES jpeg";
3399 if test "$have_png" = 'yes'; then DELEGATES="$DELEGATES jng"; fi
3401 if test "$have_jp2" = 'yes'; then DELEGATES="$DELEGATES jp2"; fi
3402 if test "$have_lcms2" = 'yes'; then DELEGATES="$DELEGATES lcms2"; fi
3403 if test "$have_lcms" = 'yes'; then DELEGATES="$DELEGATES lcms"; fi
3404 if test "$have_lqr" = 'yes'; then DELEGATES="$DELEGATES lqr"; fi
3405 if test "$have_lzma" = 'yes'; then DELEGATES="$DELEGATES lzma"; fi
3406 if test "$have_ffmpeg" = 'yes'; then DELEGATES="$DELEGATES mpeg"; fi
3407 if test "$have_openexr" = 'yes'; then DELEGATES="$DELEGATES openexr"; fi
3408 if test "$have_png" = 'yes'; then DELEGATES="$DELEGATES png"; fi
3409 if test "$have_rsvg" = 'yes'; then DELEGATES="$DELEGATES rsvg"; fi
3410 if test "$have_tiff" = 'yes'; then DELEGATES="$DELEGATES tiff"; fi
3411 if test "$have_x" = 'yes'; then DELEGATES="$DELEGATES x11"; fi
3412 if test "$have_xml" = 'yes'; then DELEGATES="$DELEGATES xml"; fi
3413 if test "$have_wmf" = 'yes'; then DELEGATES="$DELEGATES wmf"; fi
3414 if test "$have_zlib" = 'yes'; then DELEGATES="$DELEGATES zlib"; fi
3419 # Handle special compiler flags
3422 # Add '-p' if prof source profiling support enabled
3423 if test "$enable_prof" = 'yes'; then
3425 CXXFLAGS="-p $CXXFLAGS"
3426 LDFLAGS="-p $LDFLAGS"
3429 # Add '-pg' if gprof source profiling support enabled
3430 if test "$enable_gprof" = 'yes'; then
3431 CFLAGS="-pg $CFLAGS"
3432 CXXFLAGS="-pg $CXXFLAGS"
3433 LDFLAGS="-pg $LDFLAGS"
3436 # Add '-ftest-coverage -fprofile-arcs' if gcov source profiling support enabled
3437 # This is a gcc-specific feature
3438 if test "$enable_gcov" = 'yes'; then
3439 AC_CHECK_LIB(gcov,_gcov_init)
3440 AC_CHECK_LIB(gcov,__gcov_init)
3441 case "$target_os" in
3443 OSX_GCOV_LDFLAG="-Wl,-single_module"
3449 AC_SUBST(OSX_GCOV_LDFLAG)
3450 CFLAGS="-ftest-coverage -fprofile-arcs $CFLAGS"
3451 CXXFLAGS="-ftest-coverage -fprofile-arcs $CXXFLAGS"
3452 LDFLAGS="-ftest-coverage -fprofile-arcs $LDFLAGS"
3456 # Build library dependency list for libMagickCore
3459 MAGICK_LIBLTDL='' # Libltdl for build
3460 MAGICK_API_LIBLTDL='' # libltdl for dependent application (API) build
3461 MAGICK_LTDLDEPS='' # extra libltdl dependencies
3462 if test "$with_ltdl" != 'no'
3464 if test \( "$with_included_ltdl" = 'no' -o "$enable_ltdl_convenience" = 'no' \) -o "$enable_ltdl_install" = 'yes'; then
3465 MAGICK_API_LIBLTDL='-lltdl'
3467 MAGICK_LIBLTDL=${LIBLTDL}
3468 MAGICK_LTDLDEPS=${LTDLDEPS}
3470 AC_SUBST(MAGICK_LIBLTDL)
3471 AC_SUBST(MAGICK_LTDLDEPS)
3473 if test "$with_modules" != 'no'; then
3474 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"
3476 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"
3478 AC_SUBST(MAGICK_DEP_LIBS)
3481 # Remove extraneous spaces from output variables (asthetic)
3483 X_CFLAGS=`echo $X_CFLAGS | sed -e 's/ */ /g'`
3484 X_PRE_LIBS=`echo $X_PRE_LIBS | sed -e 's/ */ /g'`
3485 X_LIBS=`echo $X_LIBS | sed -e 's/ */ /g'`
3486 X_EXTRA_LIBS=`echo $X_EXTRA_LIBS | sed -e 's/ */ /g'`
3488 CC=`echo $CC | sed -e 's/ */ /g'`
3489 CFLAGS=`echo $CFLAGS | sed -e 's/ */ /g'`
3490 CPPFLAGS=`echo $CPPFLAGS | sed -e 's/ */ /g'`
3491 CXXFLAGS=`echo $CXXFLAGS | sed -e 's/ */ /g'`
3492 DELEGATES=`echo $DELEGATES | sed -e 's/^ //g'`
3493 DISTCHECK_CONFIG_FLAGS=`echo $DISTCHECK_CONFIG_FLAGS | sed -e 's/ */ /g'`
3494 LDFLAGS=`echo $LDFLAGS | sed -e 's/ */ /g'`
3495 TESTED_LIBS=`echo $LIBS | sed -e 's/ */ /g'`
3496 MAGICK_DEP_LIBS=`echo $MAGICK_DEP_LIBS | sed -e 's/ */ /g'`
3497 #LIBS=`echo $LIBS | sed -e 's/ */ /g'`
3499 # Pass only user-provided LIBS as "global" libraries
3505 #AC_SUBST(X_PRE_LIBS)
3507 #AC_SUBST(X_EXTRA_LIBS)
3509 MAGICK_CFLAGS=$CFLAGS
3510 MAGICK_CXXFLAGS="$CXXFLAGS"
3511 MAGICK_CPPFLAGS=`echo $MAGICK_CPPFLAGS | sed -e 's/ */ /g'`
3512 MAGICK_PCFLAGS=`echo $MAGICK_PCFLAGS | sed -e 's/ */ /g'`
3513 MAGICK_LDFLAGS="-L$LIB_DIR $LDFLAGS"
3514 MAGICK_LIBS="-lMagickCore $MAGICK_DEP_LIBS $MAGICK_API_LIBLTDL"
3516 AC_SUBST(MAGICK_CFLAGS)
3517 AC_SUBST(MAGICK_CXXFLAGS)
3518 AC_SUBST(MAGICK_CPPFLAGS)
3519 AC_SUBST(MAGICK_PCFLAGS)
3520 AC_SUBST(MAGICK_LDFLAGS)
3521 AC_SUBST(MAGICK_LIBS)
3522 AC_SUBST(MAGICK_FEATURES)
3524 # Set configured scripts to executable.
3525 AC_CONFIG_COMMANDS([default],[],[])
3526 AC_CONFIG_COMMANDS([MagickCore-config.in],[chmod +x magick/MagickCore-config])
3527 AC_CONFIG_COMMANDS([Magick-config.in],[chmod +x magick/Magick-config])
3528 AC_CONFIG_COMMANDS([MagickWand-config.in],[chmod +x wand/MagickWand-config])
3529 AC_CONFIG_COMMANDS([Wand-config.in],[chmod +x wand/Wand-config])
3530 AC_CONFIG_COMMANDS([Magick++-config.in],[chmod +x Magick++/bin/Magick++-config])
3531 AC_CONFIG_COMMANDS([PerlMagick/check.sh.in],[chmod +x PerlMagick/check.sh])
3533 AC_MSG_RESULT([-------------------------------------------------------------])
3534 AC_MSG_RESULT([Update ImageMagick configuration])
3537 rm -f magick-version
3539 result_dejavu_font_dir='none'
3540 if test "${dejavu_font_dir}x" != 'x'; then
3541 result_dejavu_font_dir=$dejavu_font_dir
3544 result_ghostscript_font_dir='none'
3545 if test "${ghostscript_font_dir}x" != 'x'; then
3546 result_ghostscript_font_dir=$ghostscript_font_dir
3549 result_windows_font_dir='none'
3550 if test "${windows_font_dir}x" != 'x'; then
3551 result_windows_font_dir=${windows_font_dir}
3555 ImageMagick is configured as follows. Please verify that this configuration
3556 matches your expectations.
3558 Host system type: $host
3559 Build system type: $build
3562 -------------------------------------------------------------------------------
3563 Shared libraries --enable-shared=$enable_shared $libtool_build_shared_libs
3564 Static libraries --enable-static=$enable_static $libtool_build_static_libs
3565 Module support --with-modules=$with_modules $with_modules
3566 GNU ld --with-gnu-ld=$with_gnu_ld $lt_cv_prog_gnu_ld
3567 Quantum depth --with-quantum-depth=$with_quantum_depth $with_quantum_depth
3568 High Dynamic Range Imagery
3569 --enable-hdri=$enable_hdri $enable_hdri
3571 Delegate Configuration:
3572 BZLIB --with-bzlib=$with_bzlib $have_bzlib
3573 Autotrace --with-autotrace=$with_autotrace $have_autotrace
3574 Dejavu fonts --with-dejavu-font-dir=$with_dejavu_font_dir $result_dejavu_font_dir
3575 DJVU --with-djvu=$with_djvu $have_djvu
3576 DPS --with-dps=$with_dps $have_dps
3577 FFTW --with-fftw=$with_fftw $have_fftw
3578 FlashPIX --with-fpx=$with_fpx $have_fpx
3579 FontConfig --with-fontconfig=$with_fontconfig $have_fontconfig
3580 FreeType --with-freetype=$with_freetype $have_freetype
3581 GhostPCL None $PCLDelegate ($PCLVersion)
3582 GhostXPS None $XPSDelegate ($XPSVersion)
3583 Ghostscript None $PSDelegate ($GSVersion)
3584 Ghostscript fonts --with-gs-font-dir=$with_gs_font_dir $result_ghostscript_font_dir
3585 Ghostscript lib --with-gslib=$with_gslib $have_gslib
3586 Graphviz --with-gvc=$with_gvc $have_gvc
3587 JBIG --with-jbig=$with_jbig $have_jbig
3588 JPEG v1 --with-jpeg=$with_jpeg $have_jpeg
3589 JPEG-2000 --with-jp2=$with_jp2 $have_jp2
3590 LCMS v1 --with-lcms=$with_lcms $have_lcms
3591 LCMS v2 --with-lcms2=$with_lcms2 $have_lcms2
3592 LQR --with-lqr=$with_lqr $have_lqr
3593 LZMA --with-lzma=$with_lzma $have_lzma
3594 Magick++ --with-magick-plus-plus=$with_magick_plus_plus $have_magick_plus_plus
3595 OpenEXR --with-openexr=$with_openexr $have_openexr
3596 PERL --with-perl=$with_perl $have_perl
3597 PNG --with-png=$with_png $have_png
3598 RSVG --with-rsvg=$with_rsvg $have_rsvg
3599 TIFF --with-tiff=$with_tiff $have_tiff
3600 WEBP --with-webp=$with_webp $have_webp
3601 Windows fonts --with-windows-font-dir=$with_windows_font_dir $result_windows_font_dir
3602 WMF --with-wmf=$with_wmf $have_wmf
3603 X11 --with-x=$with_x $have_x
3604 XML --with-xml=$with_xml $have_xml
3605 ZLIB --with-zlib=$with_zlib $have_zlib
3608 X_CFLAGS = $X_CFLAGS
3609 X_PRE_LIBS = $X_PRE_LIBS
3611 X_EXTRA_LIBS = $X_EXTRA_LIBS
3613 Options used to compile and link:
3614 PREFIX = $PREFIX_DIR
3615 EXEC-PREFIX = $EXEC_PREFIX_DIR
3616 VERSION = $PACKAGE_VERSION
3619 CPPFLAGS = $MAGICK_CPPFLAGS
3620 PCFLAGS = $MAGICK_PCFLAGS
3623 MAGICK_LDFLAGS = $MAGICK_LDFLAGS
3626 CXXFLAGS = $CXXFLAGS
3627 FEATURES = $MAGICK_FEATURES