blob: a0ca120214e9f6ad9b4c00cf21a5e199bc537254 [file] [log] [blame]
cristy16af1cb2009-12-11 21:38:29 +00001# Copyright 1999-2010 ImageMagick Studio LLC, a non-profit organization
cristy3ed852e2009-09-05 21:47:34 +00002# dedicated to making software imaging solutions freely available.
3#
4# You may not use this file except in compliance with the License. You may
5# obtain a copy of the License at
6#
7# http://www.imagemagick.org/script/license.php
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14#
15# Copyright (C) 2003 - 2008 GraphicsMagick Group
16
17AC_PREREQ(2.63)
cristydc12aa12010-02-22 01:03:18 +000018AC_INIT([ImageMagick],[6.6.0],[http://www.imagemagick.org],[ImageMagick])
cristy3ed852e2009-09-05 21:47:34 +000019AC_CONFIG_SRCDIR([magick/MagickCore.h])
20AC_CONFIG_AUX_DIR([config])
21AC_CONFIG_MACRO_DIR([m4])
22AC_CONFIG_LIBOBJ_DIR([ltdl])
23AC_CONFIG_HEADERS([config/config.h])
24AX_PREFIX_CONFIG_H([magick/magick-config.h],[MagickCore])
25AC_CONFIG_FILES([\
26 config/configure.xml \
27 config/delegates.xml \
28 config/ImageMagick.rdf \
29 config/MagickCore.dox \
30 config/MagickWand.dox \
cristy430a7312010-01-21 20:44:04 +000031 config/type-dejavu.xml \
cristy3ed852e2009-09-05 21:47:34 +000032 config/type-ghostscript.xml \
33 config/type-windows.xml \
34 config/type.xml \
35 ImageMagick.spec \
36 Magick++/bin/Magick++-config \
37 magick/ImageMagick.pc \
38 Magick++/lib/ImageMagick++.pc \
39 Magick++/lib/Magick++.pc \
40 magick/Magick-config \
41 magick/MagickCore-config \
42 magick/MagickCore.pc \
43 magick/version.h \
44 Makefile \
45 magick.sh \
46 PerlMagick/Magick.pm \
47 PerlMagick/Makefile.PL \
48 PerlMagick/check.sh \
49 utilities/animate.1 \
50 utilities/compare.1 \
51 utilities/composite.1 \
52 utilities/conjure.1 \
53 utilities/convert.1 \
54 utilities/display.1 \
55 utilities/identify.1 \
56 utilities/ImageMagick.1 \
57 utilities/import.1 \
58 utilities/mogrify.1 \
59 utilities/montage.1 \
60 utilities/stream.1 \
61 wand/MagickWand-config \
62 wand/MagickWand.pc \
63 wand/Wand-config \
64 wand/Wand.pc ])
65
66#
67# Save initial user-tunable values
68#
69USER_LIBS=$LIBS
70for var in CC CFLAGS CPPFLAGS CXX CXXCPP LDFLAGS LIBS ; do
71 eval isset=\${$var+set}
72 if test "$isset" = 'set'; then
73 eval val=$`echo $var`
74 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS}'${var}=${val}' "
75 fi
76done
77AC_SUBST(DISTCHECK_CONFIG_FLAGS)
78
79CONFIGURE_ARGS="$0 ${ac_configure_args}"
80AC_SUBST(CONFIGURE_ARGS)
81
82# Source file containing package/library versioning information.
83. ${srcdir}/version.sh
84
cristy15a88782010-01-31 23:24:49 +000085echo "configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}${PACKAGE_VERSION_ADDENDUM}"
cristy837d6dc2010-02-27 01:16:57 +000086AC_CANONICAL_SYSTEM
cristy95646052009-11-28 23:05:30 +000087AC_CANONICAL_BUILD
88AC_CANONICAL_HOST
cristy3ed852e2009-09-05 21:47:34 +000089AC_CANONICAL_TARGET([])
90
91# Substitute library versioning
92AC_SUBST(MAGICK_LIBRARY_CURRENT)dnl
93AC_SUBST(MAGICK_LIBRARY_REVISION)dnl
94AC_SUBST(MAGICK_LIBRARY_AGE)dnl
cristybab87c32010-02-09 20:54:22 +000095AC_SUBST([MAGICK_LIBRARY_CURRENT_MIN],
96 [`expr $MAGICK_LIBRARY_CURRENT - $MAGICK_LIBRARY_AGE`])
97AC_SUBST([MAGICK_LIBRARY_VERSION_INFO],
98 [$MAGICK_LIBRARY_CURRENT:$MAGICK_LIBRARY_REVISION:$MAGICK_LIBRARY_AGE])
cristy3ed852e2009-09-05 21:47:34 +000099
100AC_SUBST(PACKAGE_NAME)dnl
101AC_SUBST(PACKAGE_VERSION)dnl
102AC_SUBST(PACKAGE_RELEASE)dnl
103AC_SUBST(PACKAGE_CHANGE_DATE)dnl
104AC_SUBST(PACKAGE_LIB_VERSION)dnl
105AC_SUBST(PACKAGE_LIB_VERSION_NUMBER)dnl
106AC_SUBST(PACKAGE_RELEASE_DATE)dnl
cristy15a88782010-01-31 23:24:49 +0000107AC_SUBST(PACKAGE_VERSION_ADDENDUM)dnl
cristy3ed852e2009-09-05 21:47:34 +0000108
109# Ensure that make can run correctly
110AM_SANITY_CHECK
111
cristy15a88782010-01-31 23:24:49 +0000112AM_INIT_AUTOMAKE($PACKAGE_NAME,"${PACKAGE_VERSION}${PACKAGE_VERSION_ADDENDUM}", ' ')
cristy3ed852e2009-09-05 21:47:34 +0000113
114# Enable support for silent build rules
115AM_SILENT_RULES([yes])
116
117MAGICK_LIB_VERSION="0x"
118if test ${MAGICK_LIBRARY_CURRENT} -lt 10 ; then
119 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
120fi
121MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_CURRENT}
122if test ${MAGICK_LIBRARY_AGE} -lt 10 ; then
123 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
124fi
125MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_AGE}
126if test ${MAGICK_LIBRARY_REVISION} -lt 10 ; then
127 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
128fi
129MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_REVISION}
130AC_SUBST(MAGICK_LIB_VERSION)
131
132# Definition used to define MagickLibVersionText in version.h
133MAGICK_LIB_VERSION_TEXT="${PACKAGE_VERSION}"
134AC_SUBST(MAGICK_LIB_VERSION_TEXT)
135
136# Definition used to define MagickLibVersionNumber in version.h
137MAGICK_LIB_VERSION_NUMBER="${MAGICK_LIBRARY_CURRENT},${MAGICK_LIBRARY_AGE},${MAGICK_LIBRARY_REVISION}"
138AC_SUBST(MAGICK_LIB_VERSION_NUMBER)
139
140# Regenerate config.status if ChangeLog or version.sh is updated.
141AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/version.sh'])
142
143PERLMAINCC=$CC
144
145MAGICK_CFLAGS=''
146MAGICK_CPPFLAGS=$CPPFLAGS_USER
147MAGICK_PCFLAGS=$CPPFLAGS_USER
148MAGICK_LDFLAGS=''
149MAGICK_LIBS=''
150
151#
152# Evaluate shell variable equivalents to Makefile directory variables
153#
154if test "x$prefix" = xNONE; then
155 prefix=$ac_default_prefix
156fi
157# Let make expand exec_prefix.
158if test "x$exec_prefix" = xNONE; then
159 exec_prefix='${prefix}'
160fi
161
162#
163eval "eval PREFIX_DIR=${prefix}"
164AC_SUBST(PREFIX_DIR)
165eval "eval EXEC_PREFIX_DIR=${exec_prefix}"
166AC_SUBST(EXEC_PREFIX_DIR)
167eval "eval BIN_DIR=$bindir"
168AC_SUBST(BIN_DIR)
169eval "eval SBIN_DIR=$sbindir"
170AC_SUBST(SBIN_DIR)
171eval "eval LIBEXEC_DIR=$libexecdir"
172AC_SUBST(LIBEXEC_DIR)
173eval "eval DATA_DIR=$datadir"
174AC_SUBST(DATA_DIR)
175eval "eval SYSCONF_DIR=$sysconfdir"
176AC_SUBST(SYSCONF_DIR)
177eval "eval SHAREDSTATE_DIR=$sharedstatedir"
178AC_SUBST(SHAREDSTATE_DIR)
179eval "eval LOCALSTATE_DIR=$localstatedir"
180AC_SUBST(LOCALSTATE_DIR)
181eval "eval LIB_DIR=$libdir"
182AC_SUBST(LIB_DIR)
183eval "eval INCLUDE_DIR=$includedir"
184AC_SUBST(INCLUDE_DIR)
185eval "eval PERSISTINCLUDE_DIR=$oldincludedir"
186AC_SUBST(PERSISTINCLUDE_DIR)
187eval "eval INFO_DIR=$infodir"
188AC_SUBST(INFO_DIR)
189eval "eval MAN_DIR=$mandir"
190AC_SUBST(MAN_DIR)
191
192# Get full paths to source and build directories
193srcdirfull="`cd $srcdir && pwd`"
194builddir="`pwd`"
195
196#
197# Compute variables useful for running uninstalled software.
198#
199MAGICK_CODER_MODULE_PATH="${builddir}/coders"
200MAGICK_CONFIGURE_SRC_PATH="${srcdirfull}/config"
201MAGICK_CONFIGURE_BUILD_PATH="${builddir}/config"
202MAGICK_FILTER_MODULE_PATH="${builddir}/filters"
203DIRSEP=':'
204case "${build_os}" in
205 mingw* )
206 MAGICK_CODER_MODULE_PATH=`$WinPathScript "${MAGICK_CODER_MODULE_PATH}" 0`
207 MAGICK_CONFIGURE_SRC_PATH=`$WinPathScript "${MAGICK_CONFIGURE_SRC_PATH}" 0`
208 MAGICK_CONFIGURE_BUILD_PATH=`$WinPathScript "${MAGICK_CONFIGURE_BUILD_PATH}" 0`
209 MAGICK_FILTER_MODULE_PATH=`$WinPathScript "${MAGICK_FILTER_MODULE_PATH}" 0`
210 DIRSEP=';'
211 ;;
212esac
213case "${host_os}" in
214 mingw* )
215 DIRSEP=';'
216 ;;
217esac
218AC_SUBST(MAGICK_CODER_MODULE_PATH)
219AC_SUBST(MAGICK_CONFIGURE_SRC_PATH)
220AC_SUBST(MAGICK_CONFIGURE_BUILD_PATH)
221AC_SUBST(MAGICK_FILTER_MODULE_PATH)
222AC_SUBST(DIRSEP)
223
cristya0b81c32010-01-22 02:54:33 +0000224
225#
226# Enable OS features.
227#
228AC_USE_SYSTEM_EXTENSIONS
229
cristy3ed852e2009-09-05 21:47:34 +0000230# Check for programs
231AC_PROG_CC
cristy95646052009-11-28 23:05:30 +0000232AC_PROG_CXX
cristy3ed852e2009-09-05 21:47:34 +0000233AC_PROG_CC_STDC
234AC_PROG_CPP
235AC_PROG_LD
cristy3ed852e2009-09-05 21:47:34 +0000236AC_SUBST(LD)
cristy837d6dc2010-02-27 01:16:57 +0000237AC_PROG_CC_C99
cristy3ed852e2009-09-05 21:47:34 +0000238AM_PROG_CC_C_O
cristya0b81c32010-01-22 02:54:33 +0000239AC_COMPILE_WARNINGS
240AC_INCLUDES_DEFAULT
cristy3ed852e2009-09-05 21:47:34 +0000241AC_PROG_INSTALL
242AC_PROG_MAKE_SET
cristy3ed852e2009-09-05 21:47:34 +0000243AC_PROG_LN_S
244AM_WITH_DMALLOC
245PKG_PROG_PKG_CONFIG
246
247#
cristy3ed852e2009-09-05 21:47:34 +0000248# Enable run-time checking.
249#
250AC_ARG_ENABLE([bounds-checking],
251 [AC_HELP_STRING([--bounds-checking],
252 [enable run-time bounds-checking])],
253 [enable_bounds_checking=$enableval],
254 [enable_bounds_checking='no'])
255
256if test "$enable_bounds_checking" = yes; then
257 AC_DEFINE([_FORTIFY_SOURCE], [2],
258 [enable run-time bounds-checking])
259fi
260
261#
262# Tests for Windows
263#
264AC_EXEEXT
265AC_OBJEXT
266
267GDI32_LIBS=''
cristy3ed852e2009-09-05 21:47:34 +0000268native_win32_build='no'
269cygwin_build='no'
270case "${host_os}" in
271 cygwin* )
cristy3ed852e2009-09-05 21:47:34 +0000272 cygwin_build='yes'
273 GDI32_LIBS='-lgdi32'
274 ;;
275 mingw* )
cristy3ed852e2009-09-05 21:47:34 +0000276 native_win32_build='yes'
277 GDI32_LIBS='-lgdi32'
278 ;;
279esac
280if test "${GDI32_LIBS}x" != 'x'; then
281 AC_DEFINE(WINGDI32_DELEGATE,1,Define to use the Windows GDI32 library)
282fi
283AC_SUBST(GDI32_LIBS)
284AM_CONDITIONAL(WINGDI32_DELEGATE, test "${GDI32_LIBS}x" != 'x' )
285AM_CONDITIONAL(WIN32_NATIVE_BUILD, test "${native_win32_build}" = 'yes' )
286AM_CONDITIONAL(CYGWIN_BUILD, test "${cygwin_build}" = 'yes' )
287AM_CONDITIONAL(USING_CL, test "x${CC}" = 'xcl.exe' )
288
289WinPathScript="${srcdirfull}/winpath.sh"
290AC_SUBST(WinPathScript)
291
292#
293# Compiler flags tweaks
294#
295if test "${GCC}" != "yes"; then
296 case "${host}" in
297 *-*-hpux* )
298 # aCC: HP ANSI C++ B3910B A.03.34
299 CFLAGS="${CFLAGS} -Wp,-H30000"
300 if test -n "${CXXFLAGS}"; then
301 CXXFLAGS='-AA'
302 else
303 CXXFLAGS="${CXXFLAGS} -AA"
304 fi
305 ;;
306 *-dec-osf5.* )
307 # Compaq alphaev68-dec-osf5.1 compiler
308 if test -n "${CXXFLAGS}"; then
309 CXXFLAGS='-std strict_ansi -noimplicit_include'
310 else
311 CXXFLAGS="${CXXFLAGS} -std strict_ansi -noimplicit_include"
312 fi
313 esac
314fi
315
316# Check for lazy-loading.
317AC_CACHE_CHECK([for linker lazyload option],[im_cv_ld_lazyload],
318[
319im_cv_ld_lazyload='none'
320case "${host}" in
321 *-*-solaris2.8 | *-*-solaris2.9 | *-*-solaris2.1? )
322 if test "$lt_cv_prog_gnu_ld" != 'yes' ; then
323 im_cv_ld_lazyload='-Wl,-zlazyload'
324 fi
325 ;;
326esac
327])
328if test "${im_cv_ld_lazyload}" != 'none' ; then
329 if test -z "${LDFLAGS}" ; then
330 LDFLAGS="${im_cv_ld_lazyload}"
331 else
332 LDFLAGS="${im_cv_ld_lazyload} ${LDFLAGS}"
333 fi
334fi
335
336dnl Platform-specific stuff
337case "$host" in
338*darwin* | *-macos10*)
339 if test -d /opt/local ; then
340 CPPFLAGS="$CPPFLAGS -I/opt/local/include"
341 LDFLAGS="$LDFLAGS -L/opt/local/lib"
342 elif test -d /sw ; then
343 CPPFLAGS="$CPPFLAGS -I/sw/include"
344 LDFLAGS="$LDFLAGS -L/sw/lib"
345 fi
346 dnl OS X universal binary support, requires --disable-dependency-tracking
cristy43596fe2010-01-21 16:46:08 +0000347 AC_ARG_ENABLE([osx-universal-binary],
cristy3ed852e2009-09-05 21:47:34 +0000348 AC_HELP_STRING([--enable-osx-universal-binary],
349 [build universal binary on OS X [[default=no]]]),
350 [build_osxuniversal="${enableval}"], [build_osxuniversal=no])
351
352 if test "${build_osxuniversal}" != no ; then
353 if test "$enable_dependency_tracking" != no ; then
354 AC_MSG_ERROR([--enable-osx-universal-binary requires --disable-dependency-tracking.
355Please re-run configure with these options:
356 --disable-dependency-tracking --enable-osx-universal-binary
357 ])
358 fi
359 CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
360 CXXFLAGS="$CXXFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
361 LDFLAGS="$LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
362 fi
363 ;;
364esac
365
366# Enable support for threads
367AC_ARG_WITH([threads],
368 [AC_HELP_STRING([--without-threads],
369 [disable threads support])],
370 [with_threads=$withval],
371 [with_threads='yes'])
372
373have_threads=no
374if test "$with_threads" != 'no'; then
375 ACX_PTHREAD()
376 if test "$acx_pthread_ok" = yes; then
377 have_threads=yes
378 DEF_THREAD="$PTHREAD_CFLAGS"
379 CFLAGS="$CFLAGS $DEF_THREAD"
380 CXXFLAGS="$CXXFLAGS $DEF_THREAD"
381 if test "$CC" != "$PTHREAD_CC"; then
382 AC_MSG_WARN([Replacing compiler $CC with compiler $PTHREAD_CC to support pthreads.])
383 CC="$PTHREAD_CC"
384 fi
385 fi
386fi
387
388# Enable support for OpenMP
389if test "$have_threads" != 'yes'; then
390 ac_cv_prog_c_openmp=unsupported
391fi
392AC_OPENMP([C])
393CFLAGS="$OPENMP_CFLAGS $CFLAGS"
394MAGICK_PCFLAGS="$MAGICK_PCFLAGS $OPENMP_CFLAGS"
395AC_SUBST(OPENMP_CFLAGS)
396
cristy736173a2009-09-20 21:18:22 +0000397# Enable support for OpenCL
cristy7141bca2010-01-21 16:51:24 +0000398AX_OPENCL([C])
cristyc7083c12009-10-14 03:16:55 +0000399CFLAGS="$CL_CFLAGS $CFLAGS"
400LIBS="$CL_LIBS $LIBS"
cristy18d9cfe2009-12-31 03:55:21 +0000401AC_SUBST(CL_CFLAGS)
cristy736173a2009-09-20 21:18:22 +0000402
cristy3ed852e2009-09-05 21:47:34 +0000403########
404#
405# Check for large file support
406#
407########
408AC_SYS_LARGEFILE
409AC_FUNC_FSEEKO
410LFS_CPPFLAGS=''
411if test "$enable_largefile" != no; then
412 if test "$ac_cv_sys_file_offset_bits" != 'no'; then
413 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
414 else
415 AC_MSG_CHECKING([for native large file support])
416 AC_RUN_IFELSE([#include <unistd.h>
417 main () {
418 exit(!(sizeof(off_t) == 8));
419 }],
420 [ac_cv_sys_file_offset_bits=64; AC_DEFINE(_FILE_OFFSET_BITS,64)
421 AC_MSG_RESULT([yes])],
422 [AC_MSG_RESULT([no])])
423 fi
424 if test "$ac_cv_sys_large_files" != 'no'; then
425 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGE_FILES=1"
426 fi
427 if test "$ac_cv_sys_largefile_source" != 'no'; then
428 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGEFILE_SOURCE=1"
429 fi
430fi
431AC_SUBST(LFS_CPPFLAGS)
432
433#
434# Configure libtool & libltdl
435#
436# Configure libtool
437AC_LIBTOOL_DLOPEN
438LT_INIT([win32-dll])
439LT_LANG([C++])
440AC_SUBST(LIBTOOL_DEPS)
441
442# Configure libltdl
443LT_CONFIG_LTDL_DIR([ltdl])
444LTDL_INIT([convenience nonrecursive])
445
446# Check to see if building shared libraries
447libtool_build_shared_libs='no'
448if test "$enable_shared" = 'yes'; then
449 libtool_build_shared_libs='yes'
450fi
451
452# Check to see if building static libraries
453libtool_build_static_libs='no'
454if test "$enable_static" = 'yes'; then
455 libtool_build_static_libs='yes'
456fi
457
cristyfa112112010-01-04 17:48:07 +0000458AM_CONDITIONAL(WITH_SHARED_LIBS, test "${libtool_build_shared_libs}" = 'yes')
cristy3ed852e2009-09-05 21:47:34 +0000459#
460# Enable support for building loadable modules
461#
462AC_ARG_WITH([modules],
463 [AC_HELP_STRING([--with-modules],
464 [enable building dynamically loadable modules])],
465 [with_modules=$withval],
cristy5a1cefd2010-01-06 20:42:35 +0000466 [with_modules='no'])
cristy3ed852e2009-09-05 21:47:34 +0000467
468# Only allow building loadable modules if we are building shared libraries
469if test "$with_modules" != 'no' ; then
470 if test "$libtool_build_shared_libs" = 'no'; then
471 AC_MSG_WARN([Modules may only be built if building shared libraries is enabled.])
472 with_modules='no'
473 fi
474fi
475if test "$with_modules" != 'no'; then
476 AC_DEFINE(BUILD_MODULES,1,Define if coders and filters are to be built as modules.)
477fi
478AM_CONDITIONAL(WITH_MODULES, test "$with_modules" != 'no')
479
480# Enable building/use of libltdl if we are building shared libraries regardless
481# of whether modules are built or not.
482with_ltdl='no'
483if test "$libtool_build_shared_libs" != 'no'; then
484 with_ltdl='yes'
485fi
486
487AM_CONDITIONAL(WITH_LTDL, test "$with_ltdl" != 'no')
488if test "$with_ltdl" != 'no'; then
489 AC_DEFINE(LTDL_DELEGATE,1,Define if using libltdl to support dynamically loadable modules)
490
491 # Set DLLDFLAGS
492 if test X"$enable_shared" = Xyes; then
493 DLLDFLAGS=-export-dynamic
494 AC_SUBST(DLLDFLAGS)
495 fi
496fi
497
498# Enable build using delegate libraries built in subdirectories rather than installed
cristy5850e4b2010-01-08 14:28:24 +0000499# delegate libraries (bzlib fftw fpx gslib jp2 jbig jpeg lcms png tiff ttf wmf xml zlib)
cristy3ed852e2009-09-05 21:47:34 +0000500AC_ARG_ENABLE([delegate-build],
501 [AC_HELP_STRING([--enable-delegate-build],
502 [look for delegate libraries in build directory])],
503 [enable_delegate_build=$enableval],
504 [enable_delegate_build='no'])
505
506AC_ARG_ENABLE([deprecated],
507 [AC_HELP_STRING([--disable-deprecated],
508 [exclude deprecated methods in MagickCore and MagickWand API's])],
509 [enable_deprecated=$enableval],
510 [enable_deprecated='no'])
511
512if test "$enable_deprecated" = 'yes'; then
513 AC_DEFINE(EXCLUDE_DEPRECATED,1,[exclude deprecated methods in MagickCore API])
514else
515 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-deprecated "
516fi
517
518# Build a version of ImageMagick which operates uninstalled.
519# Used to build distributions located via MAGICK_HOME / executable path
520AC_ARG_ENABLE([installed],
521 [AC_HELP_STRING([--disable-installed],
522 [Formally install ImageMagick under PREFIX])],
523 [enable_installed=$enableval],
524 [enable_installed='yes'])
525
526if test "$enable_installed" = 'yes'; then
527 AC_DEFINE(INSTALLED_SUPPORT,1,[ImageMagick is formally installed under prefix])
528else
529 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-installed "
530fi
531
532# Permit enciphering and deciphering image pixels.
533AC_ARG_ENABLE([cipher],
534 [AC_HELP_STRING([--disable-cipher],
535 [disable enciphering and deciphering image pixels])],
536 [enable_cipher=$enableval],
537 [enable_cipher='yes'])
538
539if test "$enable_cipher" = 'yes'; then
540 AC_DEFINE(CIPHER_SUPPORT,1,[permit enciphering and deciphering image pixels])
541fi
542
543# Build an embeddable version of ImageMagick.
544AC_ARG_ENABLE([embeddable],
545 [AC_HELP_STRING([--enable-embeddable],
546 [enable self-contained, embeddable, zero-configuration ImageMagick])],
547 [enable_embeddable=$enableval],
548 [enable_embeddable='no'])
549
550if test "$enable_embeddable" = 'yes'; then
cristyec501352010-03-13 18:43:34 +0000551 AC_DEFINE(EMBEDDABLE_SUPPORT,1,[Build self-contained, embeddable, zero-configuration ImageMagick])
cristy3ed852e2009-09-05 21:47:34 +0000552fi
553
554# Build a high dynamic range version of ImageMagick.
555AC_ARG_ENABLE([hdri],
556 [AC_HELP_STRING([--enable-hdri],
557 [accurately represent the wide range of intensity levels found in real scenes])],
558 [enable_hdri=$enableval],
559 [enable_hdri='no'])
560
561MAGICK_HDRI=""
562if test "$enable_hdri" = 'yes'; then
563 MAGICK_HDRI="HDRI"
cristyfa112112010-01-04 17:48:07 +0000564 AC_DEFINE(HDRI_SUPPORT,1,[accurately represent the wide range of intensity levels in real scenes])
cristy3ed852e2009-09-05 21:47:34 +0000565fi
566AC_SUBST(MAGICK_HDRI)dnl
567
cristy3ed852e2009-09-05 21:47:34 +0000568# Build a version of ImageMagick with assert statements.
569AC_ARG_ENABLE([assert],
570 [AC_HELP_STRING([--disable-assert],
571 [disable assert() statements in build])],
572 [enable_assert=$enableval],
573 [enable_assert='yes'])
574
575if test "$enable_assert" = 'no'; then
576 AC_DEFINE(NDEBUG,1,[Turn off assert statements])
577fi
578
579# Add configure option --enable-maintainer-mode which enables dependency
580# checking and generation useful to package maintainers. This is made an
581# option to avoid confusing end users.
582AM_MAINTAINER_MODE
583
584
585# Enable ccmalloc memory debugging support
586AC_ARG_ENABLE([ccmalloc],
587 [AC_HELP_STRING([--enable-ccmalloc],
588 [enable 'ccmalloc' memory debug support])],
589 [enable_ccmalloc=$enableval],
590 [enable_ccmalloc='no'])
591
592# Enable Electric Fence memory debugging support
593AC_ARG_ENABLE([efence],
594 [AC_HELP_STRING([--enable-efence],
595 [enable 'efence' memory debug support])],
596 [enable_efence=$enableval],
597 [enable_efence='no'])
598
599# Enable prof-based profiling support
600AC_ARG_ENABLE([prof],
601 [AC_HELP_STRING([--enable-prof],
602 [enable 'prof' profiling support])],
603 [enable_prof=$enableval],
604 [enable_prof='no'])
605
606# Enable gprof-based profiling support
607AC_ARG_ENABLE([gprof],
608 [AC_HELP_STRING([--enable-gprof],
609 [enable 'gprof' profiling support])],
610 [enable_gprof=$enableval],
611 [enable_gprof='no'])
612
613# Enable gcov-based profiling support
614AC_ARG_ENABLE([gcov],
615 [AC_HELP_STRING([--enable-gcov],
616 [enable 'gcov' profiling support])],
617 [enable_gcov=$enableval],
618 [enable_gcov='no'])
619
620enable_profiling='no'
621if test "$enable_prof" = 'yes' || test "$enable_gprof" = 'yes' || test "$enable_gcov" = 'yes'; then
622 enable_profiling='yes'
623 if test "$libtool_build_shared_libs" = 'yes'; then
624 echo "Warning: Can not profile code using shared libraries"
625 fi
626fi
627
628# Magick API method prefix
629AC_ARG_WITH([method-prefix],
630 [AC_HELP_STRING([--with-method-prefix=PREFIX],
631 [prefix MagickCore API methods])],
632 [with_method_prefix=$enableval],
633 [with_method_prefix=''])
634
635if test "$with_method_prefix" != ''; then
636 AC_DEFINE_UNQUOTED(NAMESPACE_PREFIX,$with_method_prefix,[Magick API method prefix])
637fi
638
639# Number of bits in a Quantum
640AC_ARG_WITH([quantum-depth],
641 [AC_HELP_STRING([--with-quantum-depth=DEPTH],
642 [number of bits in a pixel quantum (default 16)])],
643 [with_quantum_depth=$withval],
644 [with_quantum_depth=16])
645
646if test "$with_quantum_depth" != '8'; then
647 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-quantum-depth=$with_quantum_depth "
648fi
649
650case "${with_quantum_depth}" in
651 8 ) ;;
652 16 ) ;;
653 32 ) ;;
654 64 ) ;;
655 * ) AC_MSG_ERROR("Pixel quantum depth must have value of 8, 16, or 32") ;;
656esac
657QUANTUM_DEPTH="$with_quantum_depth"
658AC_DEFINE_UNQUOTED(QUANTUM_DEPTH,$QUANTUM_DEPTH,[Number of bits in a pixel Quantum (8/16/32/64)])
659AC_SUBST(QUANTUM_DEPTH)dnl
660
661# Set pixel cache threshold
662AC_ARG_WITH([cache],
663 [AC_HELP_STRING([--with-cache=THRESHOLD],
664 [set pixel cache threshhold in MB (default available memory)])],
665 [with_cache=$withval],
666 [with_cache=''])
667
668if test "$with_cache" != ''; then
669 AC_DEFINE_UNQUOTED(PixelCacheThreshold,$with_cache,[Pixel cache threshold in MB (defaults to available memory)])
670 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-cache=$with_cache "
671fi
672
673# Disable/Enable support for full delegate paths
674AC_ARG_WITH([frozenpaths],
675 [AC_HELP_STRING([--with-frozenpaths],
676 [freeze delegate paths])],
677 [with_frozenpaths=$withval],
678 [with_frozenpaths='no'])
679
680# Enable build/install of Magick++
681AC_ARG_WITH([magick-plus-plus],
682 [AC_HELP_STRING([--without-magick-plus-plus],
683 [disable build/install of Magick++])],
684 [with_magick_plus_plus=$withval],
685 [with_magick_plus_plus='yes'])
686
687# Disable build/install of PerlMagick.
688AC_ARG_WITH([perl],
689 [AC_HELP_STRING([--with-perl],
690 [enable build/install of PerlMagick])],
691 [with_perl=$withval],
692 [with_perl=$libtool_build_shared_libs])
693
694# Options to pass when configuring PerlMagick
695AC_ARG_WITH([perl-options],
696 [AC_HELP_STRING([--with-perl-options=OPTIONS],
cristy949301e2010-01-06 01:38:40 +0000697 [options to pass on command-line when generating PerlMagick's build file])],
698PERL_MAKE_OPTIONS=$withval)
cristy3ed852e2009-09-05 21:47:34 +0000699AC_SUBST(PERL_MAKE_OPTIONS)
700
cristy3ed852e2009-09-05 21:47:34 +0000701# Enable umem, object-caching memory allocation library.
702AC_ARG_WITH(umem,
703 [ --with-umem enable umem memory allocation library support],
704 [with_umem=$withval],
705 [with_umem='no'])
706if test "$with_umem" != 'yes' ; then
707 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-umem=$with_umem "
708fi
709
710#
711# Specify path to shared libstdc++ if not in normal location
712#
713AC_ARG_WITH([libstdc],
714 [AC_HELP_STRING([--with-libstdc=DIR],
715 [ use libstdc++ in DIR (for GNU C++)])],
716 [with_libstdc=$withval],
717 [with_libstdc=''])
718
719if test "$with_libstdc" != ''; then
720 if test -d "$with_libstdc"; then
721 LIBSTDCLDFLAGS="-L$with_libstdc"
722 fi
723fi
724AC_SUBST(LIBSTDCLDFLAGS)
725
726# Does gcc required -traditional?
727AC_PROG_GCC_TRADITIONAL
728
729########
730#
731# Set defines required to build DLLs and modules using MinGW
732#
733########
734# These options are set for multi-thread DLL module build
735# libMagickCore: _DLL _MAGICKMOD_ _MAGICKLIB_
736# module: _DLL
737# executable/Magick++: _DLL _MAGICKMOD_
738MODULE_EXTRA_CPPFLAGS=''
739LIBRARY_EXTRA_CPPFLAGS=''
740if test "${native_win32_build}" = 'yes'; then
741 if test "${libtool_build_shared_libs}" = 'yes'; then
742 CPPFLAGS="$CPPFLAGS -D_DLL"
743 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_DLL"
744 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_DLL"
745 LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKLIB_"
746 if test "$with_modules" = 'yes'; then
747 LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKMOD_"
748 else
749 MODULE_EXTRA_CPPFLAGS="$MODULE_EXTRA_CPPFLAGS -D_MAGICKLIB_"
750 fi
751 else
752 CPPFLAGS="$CPPFLAGS -D_LIB"
753 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_LIB"
754 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_LIB"
755 fi
756 if test "$with_threads" = 'yes'; then
757 CPPFLAGS="$CPPFLAGS -D_MT"
758 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_MT"
759 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_MT"
760 fi
761fi
762AC_SUBST(MODULE_EXTRA_CPPFLAGS)
763AC_SUBST(LIBRARY_EXTRA_CPPFLAGS)
764
765# Check standard headers
766AC_HEADER_STDC
767if ! test x"$ac_cv_header_stdc" = x"yes"; then
768 AC_MSG_WARN([configure has detected that you do not have the ANSI standard C
769 header files. Compilation cannot proceed. Please install the ANSI C
770 headers and rerun this script.]);
771fi
cristya0b81c32010-01-22 02:54:33 +0000772AC_HEADER_ASSERT
cristy3ed852e2009-09-05 21:47:34 +0000773AC_HEADER_DIRENT
774
775# Check additional headers
cristya0b81c32010-01-22 02:54:33 +0000776AC_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)
cristy3ed852e2009-09-05 21:47:34 +0000777
778########
779#
780# Checks for typedefs, structures, and compiler characteristics.
781#
782########
783
784AC_HEADER_STDBOOL
785AC_C_VOLATILE
786AC_C_STRINGIZE
787AC_HEADER_STAT
788AC_HEADER_TIME
789AC_STRUCT_TM
790AC_SYS_INTERPRETER
791
cristy3ed852e2009-09-05 21:47:34 +0000792# If the C compiler supports the keyword inline, do nothing. Otherwise
793# define inline to __inline__ or __inline if it accepts one of those,
794# otherwise define inline to be empty.
795AC_C_INLINE
796
797# If the C compiler supports the keyword restrict, do nothing. Otherwise
798# define restrict to __restrict__ or __restrict if it accepts one of those,
799# otherwise define restrict to be empty.
800AC_C_RESTRICT
801
802# If words are stored with the most significant byte first (like
803# Motorola and SPARC CPUs), define `WORDS_BIGENDIAN'.
804AC_C_BIGENDIAN
805
806# Define mode_t to a suitable type, if standard headers do not define it.
807AC_TYPE_MODE_T
808
809# Define off_t to a suitable type, if standard headers do not define it.
810AC_TYPE_OFF_T
811
812# Define pid_t to a suitable type, if standard headers do not define it.
813AC_TYPE_PID_T
814
815# Define size_t to a suitable type, if standard headers do not define it.
816AC_TYPE_SIZE_T
817
818# Define ssize_t to a suitable type, if standard headers do not define it.
819AC_TYPE_SSIZE_T
820
821# If the C compiler supports a working long double type with more range
822# or precision than the double type, define HAVE_LONG_DOUBLE.
823AC_TYPE_LONG_DOUBLE_WIDER
824
825# If the C type char is unsigned, define __CHAR_UNSIGNED__, unless the
826# C compiler predefines it.
827AC_C_CHAR_UNSIGNED
828
829# Obtain size of an 'signed short' and define as SIZEOF_SIGNED_SHORT
830AC_CHECK_SIZEOF(signed short)
831
832# Obtain size of an 'unsigned short' and define as SIZEOF_UNSIGNED_SHORT
833AC_CHECK_SIZEOF(unsigned short)
834
835# Obtain size of an 'signed int' and define as SIZEOF_SIGNED_INT
836AC_CHECK_SIZEOF(signed int)
837
838# Obtain size of an 'unsigned int' and define as SIZEOF_UNSIGNED_INT
839AC_CHECK_SIZEOF(unsigned int)
840
841# Obtain size of a 'signed long' and define as SIZEOF_SIGNED_LONG
842AC_CHECK_SIZEOF(signed long)
843
844# Obtain size of a 'unsigned long' and define as SIZEOF_UNSIGNED_LONG
845AC_CHECK_SIZEOF(unsigned long)
846
847# Obtain size of a 'long long' and define as SIZEOF_SIGNED_LONG_LONG. If
848# 'signed long long' is not supported then the value defined is zero.
849AC_CHECK_SIZEOF(signed long long)
850
851# Obtain size of a 'unsigned long long' and define as
852# SIZEOF_UNSIGNED_LONG_LONG. If 'unsigned long long' is not
853# supported then the value defined is zero.
854AC_CHECK_SIZEOF(unsigned long long)
855
856# Obtain size of off_t and define as SIZEOF_OFF_T
857AC_CHECK_SIZEOF(off_t)
858
859# Obtain size of size_t and define as SIZEOF_SIZE_T
860AC_CHECK_SIZEOF(size_t)
861
862# Obtain size of an unsigned int pointer and define as SIZEOF_UNSIGNED_INTP
863AC_CHECK_SIZEOF(unsigned int*)
864
865#
866# Compute sized types for current CPU and compiler options.
867#
868
869AC_MSG_CHECKING(for signed 8-bit type)
870INT8_T='signed char'
871AC_MSG_RESULT($INT8_T)
872AC_SUBST(INT8_T)
873
874AC_MSG_CHECKING(for unsigned 8-bit type)
875UINT8_T='unsigned char'
876AC_MSG_RESULT($UINT8_T)
877AC_SUBST(UINT8_T)
878
879AC_MSG_CHECKING(for signed 16-bit type)
880INT16_T='signed short'
881AC_MSG_RESULT($INT16_T)
882AC_SUBST(INT16_T)
883
884AC_MSG_CHECKING(for unsigned 16-bit type)
885UINT16_T='unsigned short'
886AC_MSG_RESULT($UINT16_T)
887AC_SUBST(UINT16_T)
888
889AC_MSG_CHECKING(for signed 32-bit type)
890INT32_T='none'
891if test $ac_cv_sizeof_signed_int -eq 4; then
892 INT32_T='signed int'
893elif test $ac_cv_sizeof_signed_long -eq 4; then
894 INT32_T='signed long'
895fi
896AC_MSG_RESULT($INT32_T)
897AC_SUBST(INT32_T)
898
899AC_MSG_CHECKING(for unsigned 32-bit type)
900UINT32_T='none'
901if test $ac_cv_sizeof_unsigned_int -eq 4; then
902 UINT32_T='unsigned int'
903elif test $ac_cv_sizeof_unsigned_long -eq 4; then
904 UINT32_T='unsigned long'
905fi
906AC_MSG_RESULT($UINT32_T)
907AC_SUBST(UINT32_T)
908
909AC_MSG_CHECKING(for signed 64-bit type)
910INT64_T='none'
911if test $ac_cv_sizeof_signed_long -eq 8; then
912 INT64_T='signed long'
913elif test $ac_cv_sizeof_signed_long_long -eq 8; then
914 INT64_T='signed long long'
915fi
916AC_MSG_RESULT($INT64_T)
917AC_SUBST(INT64_T)
918
919AC_MSG_CHECKING(for unsigned 64-bit type)
920UINT64_T='none'
921if test $ac_cv_sizeof_unsigned_long -eq 8; then
922 UINT64_T='unsigned long'
923elif test $ac_cv_sizeof_unsigned_long_long -eq 8; then
924 UINT64_T='unsigned long long'
925fi
926AC_MSG_RESULT($UINT64_T)
927AC_SUBST(UINT64_T)
928
929AC_MSG_CHECKING(for unsigned maximum type)
930UINTMAX_T='none'
931if test "$UINT64_T" != 'none'; then
932 UINTMAX_T=$UINT64_T
933elif test "$UINT32_T" != 'none'; then
934 UINTMAX_T=$UINT32_T
935fi
936AC_MSG_RESULT($UINTMAX_T)
937AC_SUBST(UINTMAX_T)
938
939AC_MSG_CHECKING(for pointer difference type)
940UINTPTR_T='none'
941if test $ac_cv_sizeof_unsigned_long -eq $ac_cv_sizeof_unsigned_intp; then
942 UINTPTR_T='unsigned long'
943elif test $ac_cv_sizeof_unsigned_long_long -eq $ac_cv_sizeof_unsigned_intp; then
944 UINTPTR_T='unsigned long long'
945fi
946AC_MSG_RESULT($UINTPTR_T)
947AC_SUBST(UINTPTR_T)
948
949AC_MSG_CHECKING([whether our compiler supports __func__])
950AC_TRY_COMPILE([],
951 [{ const char *func = __func__; return(func != 0 ? 0 : 1); }],
952 AC_MSG_RESULT([yes]),
953 AC_MSG_RESULT([no])
954 AC_MSG_CHECKING([whether our compiler supports __FUNCTION__])
955 AC_TRY_COMPILE([],
956 [{ const char *func = __FUNCTION__; return(func != 0 ? 0 : 1); }],
957 AC_MSG_RESULT([yes])
958 AC_DEFINE(__func__, __FUNCTION__,
959 [Define to appropriate substitue if compiler does not have __func__]),
960 AC_MSG_RESULT([no])
961 AC_DEFINE(__func__, __FILE__,
962 [Define to appropriate substitue if compiler does not have __func__])))
963
964########
965#
966# Check for functions
967#
968########
969MAGICK_FUNC_MMAP_FILEIO
970AC_FUNC_CLOSEDIR_VOID
971AC_FUNC_MMAP
972AC_FUNC_FORK
973AC_FUNC_MEMCMP
974AC_FUNC_SELECT_ARGTYPES
975AC_FUNC_SETVBUF_REVERSED
976AC_TYPE_SIGNAL
977AC_FUNC_STRTOD
978AC_FUNC_VPRINTF
979
cristy161b9262010-03-20 19:34:32 +0000980#
981# Find math library
982#
983MATH_LIBS=''
984AC_CHECK_LIB(m,sqrt,MATH_LIBS="-lm",,)
985LIBS="$MATH_LIBS $LIBS"
986AC_SUBST(MATH_LIBS)
987
cristy56ed31c2010-03-22 00:46:21 +0000988AC_CHECK_FUNCS([_exit atexit cimag clock directio execvp fchmod floor fork ftime ftruncate getcwd getpid getexecname getdtablesize getpagesize getrlimit getrusage gettimeofday gmtime_r j0 j1 localtime_r lstat memmove memset mkstemp munmap _NSGetExecutablePath pclose _pclose poll popen _popen posix_fadvise posix_fallocate posix_madvise posix_memalign pow pread pwrite 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 usleep utime vsprintf vsnprintf waitpid _wfopen _wstat])
cristye43a45e2009-09-28 14:49:00 +0000989
990#
991# Check for clock_gettime().
992#
993AC_SEARCH_LIBS(clock_gettime, rt,
994[
995 AC_DEFINE([HAVE_CLOCK_GETTIME],[1],[Define to 1 if you have clock_gettime.])
996 AC_MSG_CHECKING([whether clock_gettime supports CLOCK_REALTIME])
997 AC_COMPILE_IFELSE(
998 AC_LANG_PROGRAM(
999 [[#include <time.h>]],
1000 [[clockid_t clockType = CLOCK_REALTIME;]]),
1001 [
1002 AC_MSG_RESULT(yes)
1003 AC_DEFINE([HAVE_CLOCK_REALTIME],[1],
1004 [Define to 1 if clock_gettime supports CLOCK_REALTIME.])
1005 ],
1006 AC_MSG_RESULT(no)
1007 )
1008 ],
1009 [
1010 AC_CHECK_FUNCS([gettimeofday ftime], [break])
1011 ]
1012)
cristy3ed852e2009-09-05 21:47:34 +00001013
1014########
1015#
1016# Check for function prototypes
1017#
1018########
1019
1020AC_CHECK_DECLS([pread, pwrite],[],[],[
1021#include <unistd.h>])
1022
1023AC_CHECK_DECLS([strlcpy],[],[],[
1024#include <strings.h>])
1025
1026AC_CHECK_DECLS([vsnprintf],[],[],[
1027#include <stdio.h>
1028#include <stdarg.h>])
1029
1030########
1031#
1032# C++ Support Tests (For Magick++)
1033#
1034########
1035have_magick_plus_plus='no'
1036if test "$with_magick_plus_plus" = 'yes'; then
1037 OLIBS="$LIBS"
1038 LIBS=''
1039 AC_LANG_PUSH(C++)
1040
1041 # Full set of headers used...
1042 # algorithm cctype cerrno cmath cstdio cstdlib cstring ctime exception
1043 # functional iomanip iosfwd iostream iterator list string strstream utility
1044 AC_LANG([C++])
1045 AC_PROG_CXX
1046 AC_CXX_HAVE_BOOL
1047 AC_CXX_HAVE_NAMESPACES
1048 AC_CXX_HAVE_STD_NAMESPACE
1049 AC_CXX_HAVE_STD_LIBS
1050 AC_CXX_HAVE_LSTRING
1051 AC_OPENMP([C++])
1052 AC_LANG_POP
1053
1054 AC_MSG_CHECKING([whether C++ compiler is sufficient for Magick++])
1055 if \
1056 test $ac_cv_cxx_have_bool = 'yes' && \
1057 test $ac_cv_cxx_have_lstring = 'yes' && \
1058 test $ac_cv_cxx_have_namespaces = 'yes' && \
1059 test $ac_cv_cxx_have_std_libs = 'yes' && \
1060 test $ac_cv_cxx_have_std_namespace = 'yes'; then
1061 have_magick_plus_plus='yes'
1062 else
1063 have_magick_plus_plus='no (failed tests)'
1064 fi
1065 AC_MSG_RESULT([$have_magick_plus_plus])
1066 LIBS="$OLIBS"
1067fi
1068AM_CONDITIONAL(WITH_MAGICK_PLUS_PLUS, test "$have_magick_plus_plus" = 'yes')
1069
1070# Only check for delegate libraries in subdirectories if requested.
1071if test "$enable_delegate_build" != 'no'; then
1072 # Check for delegate sub-directories and add -I & -L options as required.
1073 # This presumes that delegates are installed as detailed in the ImageMagick
1074 # README. If delegates are installed in a standard location where the
1075 # compiler will automatically find them then these options should not be
1076 # required.
1077
1078 #
1079 # Most delegates have includes in the same directory as the library, but not all...
1080 #
1081 # Includes
cristy5850e4b2010-01-08 14:28:24 +00001082 for dir in bzlib fftw fpx gslib/src jp2 jp2/src/libjasper/include jbig/libjbig jpeg lcms/include magick png tiff/libtiff ttf/include wand wmf/include xml/include zlib; do
cristy3ed852e2009-09-05 21:47:34 +00001083 if test -d "$builddir/$dir"; then
1084 CPPFLAGS="$CPPFLAGS -I$builddir/$dir"
1085 else
1086 if test -d "$srcdirfull/$dir"; then
1087 CPPFLAGS="$CPPFLAGS -I$srcdirfull/$dir"
1088 fi
1089 fi
1090 done
1091
1092 # Libraries
cristy5850e4b2010-01-08 14:28:24 +00001093 for dir in bzlib fftw fpx gslib/src jp2 jp2/src/libjasper jbig/libjbig jpeg lcms/src magick png tiff/libtiff ttf/objs wand wmf/src xml zlib; do
cristy3ed852e2009-09-05 21:47:34 +00001094 if test -d "$builddir/$dir/.libs"; then
1095 LDFLAGS="$LDFLAGS -L$builddir/$dir/.libs"
1096 else
1097 if test -d "$srcdirfull/$dir/.libs"; then
1098 LDFLAGS="$LDFLAGS -L$srcdirfull/$dir/.libs"
1099 fi
1100 fi
1101 if test -d "$builddir/$dir"; then
1102 LDFLAGS="$LDFLAGS -L$builddir/$dir"
1103 else
1104 if test -d "$srcdirfull/$dir"; then
1105 LDFLAGS="$LDFLAGS -L$srcdirfull/$dir"
1106 fi
1107 fi
1108 done
1109fi
1110
1111# Assume that delegate headers reside under same directory as ImageMagick
1112# installation prefix.
1113MAGICK_CPPFLAGS="-I$INCLUDE_DIR/ImageMagick $MAGICK_CPPFLAGS"
1114
1115#
1116# Find the X11 RGB database
1117#
1118AC_CACHE_CHECK(for X11 configure files,im_cv_x_configure,
1119[# Look for the header file in a standard set of common directories.
1120# Check X11 before X11Rn because it is often a symlink to the current release.
1121 for ac_dir in \
1122 /lib/usr/lib/X11 \
1123 /usr/X11/lib \
1124 /usr/X11R4/lib \
1125 /usr/X11R5/lib \
1126 /usr/X11R6/lib \
1127 /usr/X11R7/lib \
1128 /usr/X386/lib \
1129 /usr/XFree86/lib/X11 \
1130 /usr/athena/lib \
1131 /usr/lib \
1132 /usr/lib/X11 \
1133 /usr/lib/X11R4 \
1134 /usr/lib/X11R5 \
1135 /usr/lib/X11R6 \
1136 /usr/lib/X11R7 \
1137 /usr/local/X11/lib \
1138 /usr/local/X11R4/lib \
1139 /usr/local/X11R5/lib \
1140 /usr/local/X11R6/lib \
1141 /usr/local/lib \
1142 /usr/local/lib/X11 \
1143 /usr/local/lib/X11R4 \
1144 /usr/local/lib/X11R5 \
1145 /usr/local/lib/X11R6 \
1146 /usr/local/lib/X11R7 \
1147 /usr/local/x11r5/lib \
1148 /usr/lpp/Xamples/lib \
1149 /usr/openwin/lib \
1150 /usr/openwin/share/lib \
1151 /usr/unsupported/lib \
1152 /usr/x386/lib \
1153 ; do
1154 if test -f "$ac_dir/X11/rgb.txt"; then
1155 im_cv_x_configure="$ac_dir/X11/"
1156 break
1157 elif test -f "$ac_dir/rgb.txt"; then
1158 im_cv_x_configure="$ac_dir/"
1159 break
1160 fi
1161
1162 done])
1163X11_CONFIGURE_PATH="$im_cv_x_configure"
1164case "${build_os}" in
1165 mingw* )
1166 X11ConfigurePath=`$WinPathScript "$X11ConfigurePath=" 1`
1167 ;;
1168esac
1169AC_DEFINE_UNQUOTED(X11_CONFIGURE_PATH,"$X11ConfigurePath",Location of X11 configure files)
1170
1171#
1172# Find OpenMP library
1173#
1174GOMP_LIBS=''
1175if test "$enable_openmp" != 'no'; then
1176 if test "${GCC}" = "yes"; then
1177 AC_CHECK_LIB(gomp,GOMP_parallel_start,GOMP_LIBS="-lgomp",,) # gcc
1178 else
1179 AC_CHECK_LIB(mtsk,sunw_mp_register_warn,GOMP_LIBS="-lmtsk",,) # solaris cc
1180 AC_CHECK_LIB(xlsmp,_xlsmpFlush,GOMP_LIBS="-lxlsmp",,) # AIX xlc
1181 AC_CHECK_LIB(mp,mp_destroy,GOMP_LIBS="-lmp",,) # SGI IRIX 6.5 MIPSpro C/C++
1182 fi
1183 LIBS="$GOMP_LIBS $LIBS"
1184fi
1185AC_SUBST(GOMP_LIBS)
1186
1187#
1188# Find Posix threads library
1189#
1190THREAD_LIBS=''
1191if test "$with_threads" != 'no' && test "$have_threads" = 'yes'; then
1192
1193 if test "x$PTHREAD_LIBS" = "x"; then
1194 case "${host_cpu}-${host_os}" in
1195 *-freebsd*)
1196 MAGICK_CHECK_PTHREAD_LIB(c_r,PTHREAD_LIBS=-lc_r) ;;
1197 esac
1198 fi
1199
1200 for lib in pthread pthreads; do
1201 if test "x$PTHREAD_LIBS" = "x"; then
1202 MAGICK_CHECK_PTHREAD_LIB([$lib],[PTHREAD_LIBS=-l$lib])
1203 fi
1204 done
1205
1206 THREAD_LIBS="$PTHREAD_LIBS"
1207 LIBS="$LIBS $THREAD_LIBS"
1208fi
1209AC_SUBST(THREAD_LIBS)
1210
1211#
1212# Check for umem.
1213#
1214have_umem='no'
1215UMEM_LIBS=''
1216if test "$with_umem" != 'no'; then
1217 AC_MSG_CHECKING(for UMEM support )
1218 AC_MSG_RESULT()
1219 failed=0
1220 passed=0
1221 AC_CHECK_HEADER(umem.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1222 AC_CHECK_LIB(umem,umem_alloc,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1223 AC_CHECK_LIB(umem,umem_free,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1224 AC_MSG_CHECKING(if umem memory allocation library is complete)
1225 if test $passed -gt 0; then
1226 if test $failed -gt 0; then
1227 AC_MSG_RESULT(no -- some components failed test)
1228 have_umem='no (failed tests)'
1229 else
1230 UMEM_LIBS='-lumem'
1231 LIBS="$UMEM_LIBS $LIBS"
1232 AC_DEFINE(HasUMEM,1,Define if you have umem memory allocation library)
1233 AC_MSG_RESULT(yes)
1234 have_umem='yes'
1235 fi
1236 else
1237 AC_MSG_RESULT(no)
1238 fi
1239fi
1240AM_CONDITIONAL(HasUMEM, test "$have_umem" = 'yes')
1241AC_SUBST(UMEM_LIBS)
1242
1243#
1244# Add support for ccmalloc memory debugging library if requested
1245#
1246have_ccmalloc='no'
1247CCMALLOC_LIBS=''
1248if test "$enable_ccmalloc" = 'yes'; then
1249 AC_PATH_PROG(CCMALLOCDelegate,ccmalloc,)
1250 if test -n "$CCMALLOCDelegate"; then
1251 eval `grep PREFIX= $CCMALLOCDelegate | sed -e 's/PREFIX/CCMALLOC_PREFIX/'`
1252 OLIBS="$LIBS"
1253 # Assume that gcc is used with ccmalloc.
1254 LIBS="$LIBS $CCMALLOC_PREFIX/lib/ccmalloc-gcc.o"
1255 AC_CHECK_LIB(ccmalloc,ccmalloc_malloc,CCMALLOC_LIBS="$CCMALLOC_PREFIX/lib/ccmalloc-gcc.o -lccmalloc -ldl",,-ldl)
1256 if test -n "$CCMALLOC_LIBS"; then
1257 LIBS="$OLIBS"
1258 LIBS="$LIBS $CCMALLOC_LIBS"
1259 have_ccmalloc='yes'
1260 else
1261 LIBS="$OLIBS"
1262 fi
1263 fi
1264fi
1265
1266#
1267# Add support for efence memory debugging library if requested
1268#
1269if test "$enable_efence" = 'yes'; then
1270 EFENCE_LIBS='-lefence'
1271 LIBS="$EFENCE_LIBS $LIBS"
1272fi
1273
cristy3ed852e2009-09-05 21:47:34 +00001274dnl ===========================================================================
1275
1276#
1277# Check for BZLIB
1278#
1279
1280AC_ARG_WITH([bzlib],
1281 [AC_HELP_STRING([--without-bzlib],
1282 [disable BZLIB support])],
1283 [with_bzlib=$withval],
1284 [with_bzlib='yes'])
1285
1286if test "$with_bzlib" != 'yes'; then
1287 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-bzlib=$with_bzlib "
1288fi
1289
1290have_bzlib='no'
1291if test "$with_bzlib" != 'no'; then
1292 BZLIB_LIBS=''
1293 AC_MSG_RESULT([-------------------------------------------------------------])
1294 AC_MSG_CHECKING([for BZLIB])
1295 AC_MSG_RESULT([])
1296 failed=0
1297 passed=0
1298 found_libbz=0
1299 AC_CHECK_HEADER(bzlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1300 AC_CHECK_LIB(bz2,BZ2_bzDecompress,found_libbz=`expr $found_libbz + 1`,,)
1301 if test "$native_win32_build" = 'yes'; then
1302 AC_CHECK_LIB(bz2,_imp__BZ2_decompress,found_libbz=`expr $found_libbz + 1`,,)
1303 fi
1304 if test $found_libbz -gt 0; then
1305 passed=`expr $passed + 1`
1306 else
1307 failed=`expr $failed + 1`
1308 fi
1309 AC_MSG_CHECKING(if BZLIB package is complete)
1310 if test $passed -gt 0; then
1311 if test $failed -gt 0; then
1312 AC_MSG_RESULT(no -- some components failed test)
1313 have_bzlib='no (failed tests)'
1314 else
1315 BZLIB_LIBS='-lbz2'
1316 LIBS="$BZLIB_LIBS $LIBS"
1317 AC_DEFINE(BZLIB_DELEGATE,1,Define if you have the bzip2 library)
1318 AC_MSG_RESULT(yes)
1319 have_bzlib='yes'
1320 fi
1321 else
1322 AC_MSG_RESULT(no)
1323 fi
1324fi
1325AM_CONDITIONAL(BZLIB_DELEGATE, test "$have_bzlib" = 'yes')
1326AC_SUBST(BZLIB_LIBS)
1327
1328#
1329# Find the X11 include and library directories.
1330#
1331IPC_LIBS=''
1332X11_LIBS=''
1333XEXT_LIBS=''
1334XT_LIBS=''
1335AC_PATH_XTRA
1336if test "$no_x" != 'yes'; then
1337 AC_MSG_RESULT([-------------------------------------------------------------])
1338 AC_MSG_CHECKING([for X11])
1339 AC_MSG_RESULT([])
1340 LDFLAGS="$LDFLAGS $X_LIBS"
1341 X11_LIBS="$X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
1342 LIBS="$X11_LIBS $LIBS"
1343 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1344
1345 AC_DEFINE(X11_DELEGATE,1,Define if you have X11 library)dnl
1346
1347 #
1348 # Check for X11 shared memory extension
1349 #
1350 # shmctl is required to support the shared memory extension
1351 AC_CHECK_FUNC([shmctl],[have_shmctl='yes'],[])
1352 if test "$have_shmctl" != 'yes'; then
1353 PERSIST_LIBS=$LIBS
1354 LIBS="$LIBS -lcygipc"
1355 AC_TRY_LINK_FUNC([shmctl],[have_shmctl='yes'; IPC_LIBS='-lcygipc'],[])
1356 LIBS=$PERSIST_LIBS
1357 fi
1358
1359 if test "$have_shmctl" = 'yes'; then
1360 AC_CHECK_LIB([Xext],[XShmAttach],[XEXT_LIBS='-lXext' ; AC_DEFINE(HAVE_SHARED_MEMORY,1,X11 server supports shared memory extension)],[],[])
1361 fi
1362
1363 #
1364 # Check for X11 shape extension
1365 #
1366 AC_CHECK_LIB([Xext],[XShapeCombineMask],[XEXT_LIBS='-lXext' ; AC_DEFINE(HAVE_SHAPE,1,X11 server supports shape extension)],[],[])
1367 AC_CHECK_LIB(Xt,XtSetEventDispatcher,XT_LIBS='-lXt',,)
1368 LIBS="$XEXT_LIBS $XT_LIBS $LIBS"
1369fi
1370if test "$no_x" != 'yes'; then
1371 have_x='yes'
1372else
1373 have_x='no'
1374fi
1375AM_CONDITIONAL(X11_DELEGATE, test "$have_x" = 'yes')
1376AC_SUBST(X11_LIBS)
1377AC_SUBST(XEXT_LIBS)
1378
1379dnl ===========================================================================
1380
1381#
1382# Check for ZLIB
1383#
1384AC_ARG_WITH([zlib],
1385 [AC_HELP_STRING([--without-zlib],
1386 [disable ZLIB support])],
1387 [with_zlib=$withval],
1388 [with_zlib='yes'])
1389
1390if test "$with_zlib" != 'yes'; then
1391 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-zlib=$with_zlib "
1392fi
1393
1394have_zlib='no'
1395ZLIB_LIBS=''
1396dnl PNG requires zlib so enable zlib check if PNG is requested
1397if test "$with_zlib" != 'no' || test "$with_png" != 'no'; then
1398 AC_MSG_RESULT([-------------------------------------------------------------])
1399 AC_MSG_CHECKING([for ZLIB])
1400 AC_MSG_RESULT([])
1401 ZLIB_LIBS=''
1402 failed=0
1403 passed=0
1404 AC_CHECK_HEADER(zconf.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1405 AC_CHECK_HEADER(zlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1406 AC_CHECK_LIB(z,compress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1407 AC_CHECK_LIB(z,uncompress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1408 AC_CHECK_LIB(z,deflate,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1409 AC_CHECK_LIB(z,inflate,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1410 AC_CHECK_LIB(z,gzseek,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1411 AC_CHECK_LIB(z,gztell,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1412 AC_MSG_CHECKING([if ZLIB package is complete])
1413 if test $passed -gt 0; then
1414 if test $failed -gt 0; then
1415 AC_MSG_RESULT([no -- some components failed test])
1416 have_zlib='no (failed tests)'
1417 else
1418 ZLIB_LIBS='-lz'
1419 LIBS="$ZLIB_LIBS $LIBS"
1420 AC_DEFINE(ZLIB_DELEGATE,1,Define if you have zlib compression library)
1421 AC_MSG_RESULT([yes])
1422 have_zlib='yes'
1423 fi
1424 else
1425 AC_MSG_RESULT([no])
1426 fi
1427fi
1428AM_CONDITIONAL(ZLIB_DELEGATE, test "$have_zlib" = 'yes')
1429AC_SUBST(ZLIB_LIBS)
1430
1431#
1432# If profiling, then check for -ldl and dlopen (required for Solaris & gcc)
1433#
1434LIB_DL=''
1435if test "$enable_profiling" = 'yes'; then
1436 AC_CHECK_LIB(dl,dlopen,LIB_DL='-ldl',,)
1437 LIBS="$LIB_DL $LIBS"
1438fi
1439AC_SUBST(LIB_DL)
1440
1441dnl ===========================================================================
1442
1443#
1444# Check for Autotrace delegate library.
1445#
1446AC_ARG_WITH([autotrace],
1447 [AC_HELP_STRING([--with-autotrace],
1448 [enable autotrace support])],
1449 [with_autotrace=$withval],
1450 [with_autotrace='no'])
1451
1452if test "$with_autotrace" != 'yes'; then
1453 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-autotrace=$with_autotrace "
1454fi
1455
1456have_autotrace='no'
1457AUTOTRACE_CFLAGS=""
1458AUTOTRACE_LIBS=""
1459AUTOTRACE_PKG=""
1460if test "x$with_autotrace" = "xyes"; then
1461 AC_MSG_RESULT([-------------------------------------------------------------])
1462 PKG_CHECK_MODULES(AUTOTRACE,[autotrace >= 0.31.1], have_autotrace=yes, have_autotrace=no)
1463 AC_MSG_RESULT([])
1464fi
1465
1466if test "$have_autotrace" = 'yes'; then
1467 failed=0
1468 AC_DEFINE(AUTOTRACE_DELEGATE,1,Define if you have AUTOTRACE library)
1469 if test "$with_modules" = 'no'; then
1470 CPPFLAGS="$AUTOTRACE_CFLAGS $CPPFLAGS"
1471 fi
1472fi
1473
1474AM_CONDITIONAL(AUTOTRACE_DELEGATE,test "$have_autotrace" = 'yes')
1475AC_SUBST(AUTOTRACE_CFLAGS)
1476AC_SUBST(AUTOTRACE_LIBS)
1477
1478dnl ===========================================================================
1479
1480#
1481# Check for Display Postscript delegate library.
1482#
1483AC_ARG_WITH([dps],
1484 [AC_HELP_STRING([--without-dps],
1485 [disable Display Postscript support])],
1486 [with_dps=$withval],
1487 [with_dps='yes'])
1488
1489if test "$with_dps" != 'yes'; then
1490 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-dps=$with_dps "
1491fi
1492
1493have_dps='no'
1494DPS_LIBS=''
1495if test "$with_dps" != 'no' && test "$with_x" != 'no'; then
1496 AC_MSG_RESULT([-------------------------------------------------------------])
1497 AC_MSG_CHECKING([for DPS])
1498 AC_MSG_RESULT([])
1499 failed=0
1500 passed=0
1501 PERSIST_CPPFLAGS="$CPPFLAGS"
1502 CPPFLAGS="$CPPFLAGS -I${ac_x_includes}/X11"
1503 AC_CHECK_HEADER(DPS/dpsXclient.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1504 # DPS issues:
1505 # XFree86-4.x needs -lXt to provide XtMalloc for -ldps.
1506 # Cygwin doesn't deliver -lXt as a DLL, which prevents a DLL build.
1507 # Adobe DPS (as delivered on Solaris) doesn't require -lXt.
1508 # ImageMagick itself doesn't use -lXt.
1509 have_libdps='no'
1510 LIBDPS_XT=''
1511 AC_CHECK_LIB(dps,DPSInitialize,have_libdps='yes',have_libdps='no',)
1512 if test "$have_libdps" != 'yes'; then
1513 # Unset cache variable so we can try again.
1514 unset ac_cv_lib_dps_DPSInitialize
1515 AC_CHECK_LIB(dps,DPSInitialize,have_libdps='yes',have_libdps='no',-lXt)
1516 if test "$have_libdps" = 'yes'; then
1517 LIBDPS_XT='-lXt'
1518 fi
1519 fi
1520 if test "$have_libdps" = 'yes'; then
1521 passed=`expr $passed + 1`
1522 else
1523 failed=`expr $failed + 1`
1524 fi
1525 AC_CHECK_LIB(dpstk,XDPSPixelsPerPoint,passed=`expr $passed + 1`,failed=`expr $failed + 1`,-ldps $LIBDPS_XT)
1526 AC_MSG_CHECKING([if DPS package is complete])
1527 if test $passed -gt 0; then
1528 if test $failed -gt 0; then
1529 AC_MSG_RESULT([no -- some components failed test])
1530 have_dps='no (failed tests)'
1531 CPPFLAGS="$PERSIST_CPPFLAGS"
1532 else
1533 DPS_LIBS="-ldpstk -ldps ${LIBDPS_XT}"
1534 LIBS="$DPS_LIBS $LIBS"
1535 AC_DEFINE(DPS_DELEGATE,1,Define if you have Display Postscript)
1536 AC_MSG_RESULT([yes])
1537 have_dps='yes'
1538 fi
1539 else
1540 AC_MSG_RESULT([no])
1541 CPPFLAGS=$PERSIST_CPPFLAGS
1542 fi
1543fi
1544AM_CONDITIONAL(DPS_DELEGATE, test "$have_dps" = 'yes')
1545AC_SUBST(DPS_LIBS)
1546
1547dnl ===========================================================================
1548
1549#
1550# Check for DJVU delegate library.
1551#
1552AC_ARG_WITH([djvu],
1553 [AC_HELP_STRING([--without-djvu],
1554 [disable DjVu support])],
1555 [with_djvu=$withval],
1556 [with_djvu='yes'])
1557
1558if test "$with_djvu" != 'yes'; then
1559 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-djvu=$with_djvu "
1560fi
1561
1562have_djvu='no'
1563DJVU_LIBS=''
1564if test "$with_djvu" != 'no'; then
1565 AC_MSG_RESULT([-------------------------------------------------------------])
1566 AC_MSG_CHECKING([for DJVU])
1567 AC_MSG_RESULT([])
1568 failed=0
1569 passed=0
1570 AC_CHECK_HEADER(libdjvu/ddjvuapi.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1571 AC_CHECK_LIB(djvulibre,ddjvu_context_create,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1572 AC_MSG_CHECKING([if DJVU package is complete])
1573 if test $passed -gt 0; then
1574 if test $failed -gt 0; then
1575 AC_MSG_RESULT([no -- some components failed test])
1576 have_djvu='no (failed tests)'
1577 else
1578 DJVU_LIBS='-ldjvulibre'
1579 LIBS="$DJVU_LIBS $LIBS"
1580 AC_DEFINE(DJVU_DELEGATE,1,Define if you have DJVU library)
1581 AC_MSG_RESULT([yes])
1582 have_djvu='yes'
1583 fi
1584 else
1585 AC_MSG_RESULT([no])
1586 fi
1587fi
1588AM_CONDITIONAL(DJVU_DELEGATE, test "$have_djvu" = 'yes')
1589AC_SUBST(DJVU_LIBS)
1590
1591dnl ===========================================================================
1592
1593#
cristy430a7312010-01-21 20:44:04 +00001594# Set DejaVu font directory.
1595#
1596AC_ARG_WITH([dejavu-font-dir],
1597 [AC_HELP_STRING([--with-dejavu-font-dir=DIR],
1598 [DejaVu font directory])],
1599 [with_dejavu_font_dir=$withval],
1600 [with_dejavu_font_dir='default'])
1601
1602if test "$with_dejavu_font_dir" != 'default'; then
1603 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-dejavu-font-dir=$with_dejavu_font_dir "
1604fi
1605
1606dnl ===========================================================================
1607
1608#
cristy3ed852e2009-09-05 21:47:34 +00001609# Check for FFTW delegate library.
1610#
1611AC_ARG_WITH([fftw],
1612 [AC_HELP_STRING([--without-fftw],
1613 [disable FFTW support])],
1614 [with_fftw=$withval],
1615 [with_fftw='yes'])
1616
1617if test "$with_fftw" != 'yes'; then
1618 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fftw=$with_fftw "
1619fi
1620
1621have_fftw='no'
1622FFTW_LIBS=''
1623if test "$with_fftw" != 'no'; then
1624 AC_MSG_RESULT([-------------------------------------------------------------])
1625 AC_MSG_CHECKING([for FFTW])
1626 AC_MSG_RESULT([])
1627 failed=0
1628 passed=0
1629 AC_CHECK_HEADER(fftw3.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1630 AC_CHECK_LIB(fftw3,fftw_execute,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1631 AC_MSG_CHECKING([if FFTW package is complete])
1632 if test $passed -gt 0; then
1633 if test $failed -gt 0; then
1634 AC_MSG_RESULT([no -- some components failed test])
1635 have_fftw='no (failed tests)'
1636 else
1637 FFTW_LIBS='-lfftw3'
1638 LIBS="$FFTW_LIBS $LIBS"
1639 AC_DEFINE(FFTW_DELEGATE,1,Define if you have FFTW library)
1640 AC_MSG_RESULT([yes])
1641 have_fftw='yes'
1642 fi
1643 else
1644 AC_MSG_RESULT([no])
1645 fi
1646fi
1647AM_CONDITIONAL(FFTW_DELEGATE, test "$have_fftw" = 'yes')
1648AC_SUBST(FFTW_LIBS)
1649
1650dnl ===========================================================================
1651
1652#
1653# Check for FlashPIX delegate library.
1654#
1655AC_ARG_WITH([fpx],
1656 [AC_HELP_STRING([--without-fpx],
1657 [disable FlashPIX support])],
1658 [with_fpx=$withval],
1659 [with_fpx='yes'])
1660
1661if test "$with_fpx" != 'yes'; then
1662 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fpx=$with_fpx "
1663fi
1664
1665have_fpx='no'
1666FPX_LIBS=''
1667if test "$with_fpx" != 'no'; then
1668 AC_MSG_RESULT([-------------------------------------------------------------])
1669 AC_MSG_CHECKING([for FlashPIX])
1670 AC_MSG_RESULT([])
1671 failed=0
1672 passed=0
1673 AC_LANG_PUSH(C++)
1674 AC_CHECK_HEADER(fpxlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1675 AC_CHECK_LIB(fpx,FPX_OpenImageByFilename,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1676 AC_LANG_POP
1677 AC_MSG_CHECKING([if FlashPIX package is complete])
1678 if test $passed -gt 0; then
1679 if test $failed -gt 0; then
1680 AC_MSG_RESULT([no -- some components failed test])
1681 have_fpx='no (failed tests)'
1682 else
1683 FPX_LIBS='-lfpx'
1684 AC_DEFINE(FPX_DELEGATE,1,Define if you have FlashPIX library)
1685 AC_MSG_RESULT([yes])
1686 have_fpx='yes'
1687 PERLMAINCC="$CXX"
1688 fi
1689 else
1690 AC_MSG_RESULT([no])
1691 fi
1692fi
1693AM_CONDITIONAL(FPX_DELEGATE, test "$have_fpx" = 'yes')
1694AC_SUBST(FPX_LIBS)
1695
1696dnl ===========================================================================
1697
1698#
1699# Check for fontconfig delegate library.
1700#
1701AC_ARG_WITH([fontconfig],
1702 [AC_HELP_STRING([--without-fontconfig],
1703 [disable fontconfig support])],
1704 [with_fontconfig=$withval],
1705 [with_fontconfig=$have_x])
1706
1707if test "$with_fontconfig" != 'yes'; then
1708 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontconfig=$with_fontconfig "
1709fi
1710
1711have_fontconfig='no'
1712FONTCONFIG_CFLAGS=""
1713FONTCONFIG_LIBS=""
1714FONTCONFIG_PKG=""
1715if test "x$with_fontconfig" = "xyes"; then
1716 AC_MSG_RESULT([-------------------------------------------------------------])
1717 PKG_CHECK_MODULES(FONTCONFIG,[fontconfig >= 2.1.0], have_fontconfig=yes, have_fontconfig=no)
1718 AC_MSG_RESULT([])
1719fi
1720
1721if test "$have_fontconfig" = 'yes'; then
1722 AC_DEFINE(FONTCONFIG_DELEGATE,1,Define if you have FONTCONFIG library)
1723 if test "$with_modules" = 'no'; then
1724 CPPFLAGS="$FONTCONFIG_CFLAGS $CPPFLAGS"
1725 fi
1726fi
1727
1728AM_CONDITIONAL(FONTCONFIG_DELEGATE,test "$have_fontconfig" = 'yes')
1729AC_SUBST(FONTCONFIG_CFLAGS)
1730AC_SUBST(FONTCONFIG_LIBS)
1731
1732dnl ===========================================================================
1733
1734#
1735# Check for freetype delegate library.
1736#
1737AC_ARG_WITH([freetype],
1738 [AC_HELP_STRING([--without-freetype],
1739 [disable Freetype support])],
1740 [with_freetype=$withval],
1741 [with_freetype='yes'])
1742
1743
1744if test "$with_freetype" != 'yes'; then
1745 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-freetype=$with_freetype "
1746fi
1747
1748have_freetype='no'
1749FREETYPE_LIBS=''
1750if test "$with_freetype" != 'no'; then
1751 AC_MSG_RESULT([-------------------------------------------------------------])
1752 AC_MSG_CHECKING([for FreeType 2.0])
1753 AC_MSG_RESULT([])
1754 failed=0
1755 passed=0
cristy66291112009-10-03 22:44:36 +00001756 PERSIST_LIBS="$LIBS"
cristy3ed852e2009-09-05 21:47:34 +00001757 PERSIST_CPPFLAGS="$CPPFLAGS"
1758 if test "$enable_delegate_build" != 'no' && test -d "$builddir/freetype/include"; then
1759 :
1760 else
1761 freetype_config=''
1762 AC_CHECK_PROGS(freetype_config,freetype-config,)dnl
1763 if test -n "$freetype_config"; then
1764 freetype_cflags=`$freetype_config --cflags`
1765 freetype_libs=`$freetype_config --libs`
cristy66291112009-10-03 22:44:36 +00001766 LIBS="$LIBS $freetype_libs"
cristy3ed852e2009-09-05 21:47:34 +00001767 CPPFLAGS="$freetype_cflags $CPPFLAGS"
1768 fi
1769 fi
1770
1771dnl First see if there is a library
1772 if test "$FREETYPE_LIBS" = ''; then
1773 AC_CHECK_LIB(freetype,FT_Init_FreeType,FREETYPE_LIBS='-lfreetype',,)
1774 if test "$FREETYPE_LIBS" != ''; then
1775 passed=`expr $passed + 1`
1776 else
1777 failed=`expr $failed + 1`
cristy66291112009-10-03 22:44:36 +00001778 LIBS="$PERSIST_LIBS"
cristy3ed852e2009-09-05 21:47:34 +00001779 fi
1780 fi
1781
1782dnl Now test for the headers
1783 AC_CHECK_HEADER([ft2build.h],[FT2BUILD_H='#include <ft2build.h>'],[ft2build=''],[])
1784 AC_CHECK_HEADER(freetype/freetype.h,[have_freetype_h='yes'],[have_freetype_h='no'],[$FT2BUILD_H])
1785 if test "$ac_cv_header_ft2build_h" = 'yes' || test "$have_freetype_h" = 'yes'; then
1786 passed=`expr $passed + 1`
1787 else
1788 failed=`expr $failed + 1`
1789 CPPFLAGS="$PERSIST_CPPFLAGS"
1790 fi
1791
1792 AC_MSG_CHECKING([if FreeType package is complete])
1793 if test $passed -gt 0; then
1794 if test $failed -gt 0; then
1795 FREETYPE_LIBS=''
1796 AC_MSG_RESULT([no -- some components failed test])
1797 have_freetype='no (failed tests)'
1798 else
1799 LIBS="$FREETYPE_LIBS $LIBS"
1800 AC_DEFINE(FREETYPE_DELEGATE,1,Define if you have FreeType (TrueType font) library)
1801 if test "$ac_cv_header_ft2build_h" = 'yes'; then
1802 AC_DEFINE([HAVE_FT2BUILD_H],[1],[Define to 1 if you have the <ft2build.h> header file.])
1803 fi
1804 AC_MSG_RESULT([yes])
1805 have_freetype='yes'
1806 fi
1807 else
1808 AC_MSG_RESULT([no])
1809 fi
1810fi
1811AM_CONDITIONAL(FREETYPE_DELEGATE,test "$have_freetype" = 'yes')
1812AC_SUBST(FREETYPE_LIBS)
1813
1814dnl ===========================================================================
1815
1816dnl ===========================================================================
1817
1818#
1819# Check for Ghostscript library or framework.
1820#
1821# Test for iapi.h & test for gsapi_new_instance in -lgs
1822# or -framework Ghostscript
1823
1824AC_ARG_WITH([gslib],
1825 [AC_HELP_STRING([--without-gslib],
1826 [enable Ghostscript library support])],
1827 [with_gslib=$withval],
1828 [with_gslib='no'])
1829
cristyb7931f12009-09-25 10:22:21 +00001830gslib_framework='no'
cristy3ed852e2009-09-05 21:47:34 +00001831if test "$with_gslib" != 'yes'; then
1832 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gslib=$with_gslib "
1833fi
1834
1835have_gslib='no'
1836GS_LIBS=''
1837if test "$with_gslib" != 'no'; then
1838 AC_MSG_RESULT([-------------------------------------------------------------])
1839 AC_MSG_CHECKING([for Ghostscript])
1840 AC_MSG_RESULT([])
cristyb7931f12009-09-25 10:22:21 +00001841 framework=0
cristy3ed852e2009-09-05 21:47:34 +00001842 failed=0
1843 passed=0
1844 AC_CHECK_HEADER(ghostscript/iapi.h,passed=`expr $passed + 1`,
1845 failed=`expr $failed + 1`,)
1846 AC_CHECK_HEADER(ghostscript/ierrors.h,passed=`expr $passed + 1`,
1847 failed=`expr $failed + 1`,)
1848 AC_CHECK_FRAMEWORK(Ghostscript,gsapi_new_instance,framework=`expr $framework + 1`,
1849 AC_CHECK_LIB(gs,gsapi_new_instance,passed=`expr $passed + 1`,failed=`expr $failed + 1`,),)
1850 AC_MSG_CHECKING([if Ghostscript package is complete])
1851 if test $passed -gt 0; then
1852 if test $failed -gt 0; then
1853 AC_MSG_RESULT([no -- some components failed test])
1854 have_gslib='no (failed tests)'
1855 else
1856 if test $framework -gt 0; then
1857 GS_LIBS='-framework Ghostscript'
cristyb7931f12009-09-25 10:22:21 +00001858 gslib_framework='yes'
cristy3ed852e2009-09-05 21:47:34 +00001859 AC_MSG_RESULT([yes, using framework.])
1860 else
1861 AC_MSG_RESULT([yes, using library.])
1862 GS_LIBS='-lgs'
1863 fi
1864 LIBS="$GS_LIBS $LIBS"
1865 AC_DEFINE(GS_DELEGATE,1,Define if you have Ghostscript library or framework)
1866 have_gslib='yes'
1867 fi
1868 else
1869 AC_MSG_RESULT([no])
1870 fi
1871fi
1872AM_CONDITIONAL(GS_DELEGATE, test "$have_gslib" = 'yes')
1873AC_SUBST(GS_LIBS)
1874
1875# Set default font search path
1876AC_ARG_WITH([fontpath],
1877 [AC_HELP_STRING([--with-fontpath=DIR],
1878 [prepend to default font search path])],
1879 [with_fontpath=$withval],
1880 [with_fontpath=''])
1881
1882if test "$with_fontpath" != "yes" && test -z "$with_fontpath"; then
1883 with_fontpath=''
1884else
1885 AC_DEFINE_UNQUOTED(MAGICK_FONT_PATH,"$with_fontpath",Define to prepend to default font search path.)
1886fi
1887if test "$with_fontpath=" != ''; then
1888 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontpath=$with_fontpath "
1889fi
1890
1891# Set Ghostscript font directory
1892AC_ARG_WITH([gs-font-dir],
1893 [AC_HELP_STRING([--with-gs-font-dir=DIR],
1894 [Ghostscript font directory])],
1895 [with_gs_font_dir=$withval],
1896 [with_gs_font_dir='default'])
1897
1898if test "$with_gs_font_dir" != 'default'; then
1899 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gs-font-dir=$with_gs_font_dir "
1900fi
1901
1902dnl ===========================================================================
1903
1904#
1905# Check for GVC delegate library.
1906#
1907AC_ARG_WITH(gvc,
1908 [AC_HELP_STRING([--without-gvc],
1909 [disable GVC support])],
1910 [with_gvc=$withval],
1911 [with_gvc='yes'])
1912
1913if test "$with_gvc" != 'yes'; then
1914 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gvc=$with_gvc "
1915fi
1916
1917GVC_PKG=""
1918if test "x$with_gvc" = "xyes"; then
1919 AC_MSG_RESULT([-------------------------------------------------------------])
1920 PKG_CHECK_MODULES(GVC,[libgvc >= 2.9.0], have_gvc=yes, have_gvc=no)
1921 AC_MSG_RESULT([])
1922fi
1923
1924if test "$have_gvc" = 'yes'; then
1925 AC_DEFINE(GVC_DELEGATE,1,Define if you have GVC library)
1926 if test "$with_modules" = 'no'; then
1927 CPPFLAGS="$GVC_CFLAGS $CPPFLAGS"
1928 fi
1929fi
1930
1931AM_CONDITIONAL(GVC_DELEGATE, test "$have_gvc" = 'yes')
1932AC_SUBST(GVC_CFLAGS)
1933AC_SUBST(GVC_LIBS)
1934
1935dnl ===========================================================================
1936
1937#
1938# Check for JBIG delegate library.
1939#
1940
1941AC_ARG_WITH([jbig],
1942 [AC_HELP_STRING([--without-jbig],
1943 [disable JBIG support])],
1944 [with_jbig=$withval],
1945 [with_jbig='yes'])
1946
1947have_jbig='no'
1948JBIG_LIBS=''
1949if test "$with_jbig" != 'no'; then
1950 AC_MSG_RESULT([-------------------------------------------------------------])
1951 AC_MSG_CHECKING([for JBIG])
1952 AC_MSG_RESULT([])
1953 failed=0
1954 passed=0
1955 AC_CHECK_HEADER(jbig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1956 AC_CHECK_LIB(jbig,jbg_dec_init,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1957 AC_MSG_CHECKING([if JBIG package is complete])
1958 if test $passed -gt 0; then
1959 if test $failed -gt 0; then
1960 AC_MSG_RESULT([no -- some components failed test])
1961 have_jbig='no (failed tests)'
1962 else
1963 JBIG_LIBS='-ljbig'
1964 LIBS="$JBIG_LIBS $LIBS"
1965 AC_DEFINE(JBIG_DELEGATE,1,Define if you have JBIG library)
1966 AC_MSG_RESULT([yes])
1967 have_jbig='yes'
1968 fi
1969 else
1970 AC_MSG_RESULT([no])
1971 fi
1972fi
1973AM_CONDITIONAL(JBIG_DELEGATE, test "$have_jbig" = 'yes')
1974AC_SUBST(JBIG_LIBS)
1975
1976dnl ===========================================================================
1977
1978#
1979# Check for JPEG delegate library.
1980#
1981AC_ARG_WITH([jpeg],
1982 [AC_HELP_STRING([--without-jpeg],
1983 [disable JPEG support])],
1984 [with_jpeg=$withval],
1985 [with_jpeg='yes'])
1986
1987if test "$with_jpeg" != 'yes'; then
1988 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jpeg=$with_jpeg "
1989fi
1990
1991have_jpeg='no'
1992JPEG_LIBS=''
1993if test "$with_jpeg" != 'no'; then
1994 AC_MSG_RESULT([-------------------------------------------------------------])
1995 AC_MSG_CHECKING([for JPEG])
1996 AC_MSG_RESULT([])
1997 failed=0
1998 passed=0
1999 AC_CHECK_HEADER(jconfig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2000 AC_CHECK_HEADER(jerror.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2001 AC_CHECK_HEADER(jmorecfg.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2002 AC_CHECK_HEADER(jpeglib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2003 AC_CHECK_LIB(jpeg,jpeg_read_header,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2004
2005# Test for compatible JPEG library
2006if test "$ac_cv_jpeg_version_ok" != 'yes'; then
2007AC_CACHE_CHECK(for JPEG library is version 6b or later, ac_cv_jpeg_version_ok,
2008[AC_TRY_COMPILE(
2009#include <stdio.h>
2010#include <stdlib.h>
2011#include <jpeglib.h>
2012,
2013changequote(<<, >>)dnl
2014<<
2015#if JPEG_LIB_VERSION < 62
2016#error IJG JPEG library must be version 6b or newer!
2017#endif
2018return 0;
2019>>,
2020changequote([, ])dnl
2021ac_cv_jpeg_version_ok='yes'; passed=`expr $passed + 1`,
2022ac_cv_jpeg_version_ok='no'; failed=`expr $failed + 1`)])
2023fi
2024 AC_MSG_CHECKING([if JPEG package is complete])
2025 if test $passed -gt 0; then
2026 if test $failed -gt 0; then
2027 AC_MSG_RESULT([no -- some components failed test])
2028 have_jpeg='no (failed tests)'
2029 else
2030 JPEG_LIBS='-ljpeg'
2031 LIBS="$JPEG_LIBS $LIBS"
2032 AC_DEFINE(JPEG_DELEGATE,1,Define if you have JPEG library)
2033 AC_MSG_RESULT([yes])
2034 have_jpeg='yes'
2035 fi
2036 else
2037 AC_MSG_RESULT([no])
2038 fi
2039fi
2040AM_CONDITIONAL(JPEG_DELEGATE, test "$have_jpeg" = 'yes')
2041AC_SUBST(JPEG_LIBS)
2042
2043dnl ===========================================================================
2044
2045#
2046# Check for JPEG Version 2 delegate library.
2047#
2048AC_ARG_WITH([jp2],
2049 [AC_HELP_STRING([--without-jp2],
2050 [disable JPEG-2000 support])],
2051 [with_jp2=$withval],
2052 [with_jp2='yes'])
2053
2054if test "$with_jp2" != 'yes'; then
2055 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jp2=$with_jp2 "
2056fi
2057
2058have_jp2='no'
2059JP2_LIBS=''
2060if test "$with_jp2" != 'no'; then
2061 AC_MSG_RESULT([-------------------------------------------------------------])
2062 AC_MSG_CHECKING([for JPEG Version 2])
2063 AC_MSG_RESULT([])
2064 failed=0
2065 passed=0
2066 AC_CHECK_HEADER(jasper/jasper.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2067 AC_CHECK_LIB(jasper,jas_stream_fopen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2068 AC_MSG_CHECKING([if JPEG version 2 support package is complete])
2069 if test $passed -gt 0; then
2070 if test $failed -gt 0; then
2071 AC_MSG_RESULT([no -- some components failed test])
2072 have_jp2='no (failed tests)'
2073 else
2074 JP2_LIBS='-ljasper'
2075 LIBS="$JP2_LIBS $LIBS"
2076 AC_DEFINE(JP2_DELEGATE,1,Define if you have JPEG version 2 "Jasper" library)
2077 AC_MSG_RESULT([yes])
2078 have_jp2='yes'
2079 fi
2080 else
2081 AC_MSG_RESULT([no])
2082 fi
2083fi
2084AM_CONDITIONAL(JP2_DELEGATE, test "$have_jp2" = 'yes')
2085AC_SUBST(JP2_LIBS)
2086
2087dnl ===========================================================================
2088
2089#
2090# Check for LCMS delegate library.
2091#
2092AC_ARG_WITH(lcms,
2093 [AC_HELP_STRING([--without-lcms],
2094 [disable LCMS support])],
2095 [with_lcms=$withval],
2096 [with_lcms='yes'])
2097
2098if test "$with_lcms" != 'yes'; then
2099 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lcms=$with_lcms "
2100fi
2101
2102have_lcms='no'
2103LCMS_LIBS=''
2104if test "$with_lcms" != 'no'; then
2105 AC_MSG_RESULT([-------------------------------------------------------------])
2106 AC_MSG_CHECKING([for LCMS])
2107 AC_MSG_RESULT([])
2108 failed=0
2109 passed=0
2110 have_lcms_header='no'
2111 AC_CHECK_HEADER(lcms.h,have_lcms_header='yes',,)
2112 if test "$have_lcms_header" = 'yes'; then
2113 passed=`expr $passed + 1`
2114 AC_DEFINE(HAVE_LCMS_H,1,Define if you have the <lcms.h> header file.)
2115 else
2116 AC_CHECK_HEADER(lcms/lcms.h,have_lcms_header='yes',,)
2117 if test "$have_lcms_header" = 'yes'; then
2118 passed=`expr $passed + 1`
2119 AC_DEFINE(HAVE_LCMS_LCMS_H,1,Define if you have the <lcms/lcms.h> header file.)
2120 else
2121 failed=`expr $failed + 1`
2122 fi
2123 fi
2124 AC_CHECK_LIB(lcms,cmsOpenProfileFromMem,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2125 AC_MSG_CHECKING([if LCMS package is complete])
2126 if test $passed -gt 0; then
2127 if test $failed -gt 0; then
2128 AC_MSG_RESULT([no -- some components failed test])
2129 have_lcms='no (failed tests)'
2130 else
2131 LCMS_LIBS='-llcms'
2132 LIBS="$LCMS_LIBS $LIBS"
2133 AC_DEFINE(LCMS_DELEGATE,1,Define if you have LCMS library)
2134 AC_MSG_RESULT([yes])
2135 have_lcms='yes'
2136 fi
2137 else
2138 AC_MSG_RESULT([no])
2139 fi
2140fi
2141AM_CONDITIONAL(LCMS_DELEGATE, test "$have_lcms" = 'yes')
2142AC_SUBST(LCMS_LIBS)
2143
2144dnl ===========================================================================
2145
2146#
2147# Check for the LQR (Liquid Rescale) delegate library.
2148#
2149AC_ARG_WITH([lqr],
2150 [AC_HELP_STRING([--without-lqr],
cristyec501352010-03-13 18:43:34 +00002151 [disable Liquid Rescale support])],
cristy3ed852e2009-09-05 21:47:34 +00002152 [with_lqr=$withval],
2153 [with_lqr='yes'])
2154
2155if test "$with_lqr" != 'yes'; then
2156 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lqr=$with_lqr "
2157fi
2158
2159have_lqr='no'
2160LQR_CFLAGS=""
2161LQR_LIBS=""
2162LQR_PKG=""
2163if test "x$with_lqr" = "xyes"; then
2164 AC_MSG_RESULT([-------------------------------------------------------------])
2165 PKG_CHECK_MODULES(LQR,[lqr-1 >= 0.1.0], have_lqr=yes, have_lqr=no)
2166 AC_MSG_RESULT([])
2167fi
2168
2169if test "$have_lqr" = 'yes'; then
2170 AC_DEFINE(LQR_DELEGATE,1,Define if you have LQR library)
2171 CFLAGS="$LQR_CFLAGS $CFLAGS"
2172fi
2173
2174AM_CONDITIONAL(LQR_DELEGATE, test "$have_lqr" = 'yes')
2175AC_SUBST(LQR_CFLAGS)
2176AC_SUBST(LQR_LIBS)
2177
2178dnl ===========================================================================
2179
2180#
2181# Check for the OpenEXR delegate library.
2182#
2183AC_ARG_WITH([openexr],
2184 [AC_HELP_STRING([--without-openexr],
2185 [disable OpenEXR support])],
2186 [with_openexr=$withval],
2187 [with_openexr='yes'])
2188
2189if test "$with_openexr" != 'yes'; then
2190 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-openexr=$with_openexr "
2191fi
2192
2193have_openexr='no'
2194OPENEXR_CFLAGS=""
2195OPENEXR_LIBS=""
2196OPENEXR_PKG=""
2197if test "x$with_openexr" = "xyes"; then
2198 AC_MSG_RESULT([-------------------------------------------------------------])
2199 PKG_CHECK_MODULES(OPENEXR,[OpenEXR >= 1.0.6], have_openexr=yes, have_openexr=no)
2200 AC_MSG_RESULT([])
2201fi
2202
2203if test "$have_openexr" = 'yes'; then
2204 AC_DEFINE(OPENEXR_DELEGATE,1,Define if you have OPENEXR library)
2205 if test "$with_modules" = 'no'; then
2206 CFLAGS="$OPENEXR_CFLAGS $CFLAGS"
2207 fi
2208fi
2209
2210AM_CONDITIONAL(OPENEXR_DELEGATE, test "$have_openexr" = 'yes')
2211AC_SUBST(OPENEXR_CFLAGS)
2212AC_SUBST(OPENEXR_LIBS)
2213
2214dnl ===========================================================================
2215
2216#
2217# Check for PNG delegate library.
2218#
2219AC_ARG_WITH(png,
2220 [AC_HELP_STRING([--without-png],
2221 [disable PNG support])],
2222 [with_png=$withval],
2223 [with_png='yes'])
2224
2225if test "$with_png" != 'yes'; then
2226 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-png=$with_png "
2227fi
2228
2229have_png='no'
2230PNG_LIBS=''
2231if test "$with_png" != 'no'; then
2232 AC_MSG_RESULT([-------------------------------------------------------------])
2233 AC_MSG_CHECKING([for PNG])
2234 AC_MSG_RESULT([])
2235 failed=0
2236 passed=0
2237 AC_CHECK_HEADER(png.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2238 AC_CHECK_LIB(png,png_get_io_ptr,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2239 AC_MSG_CHECKING([if PNG package is complete])
2240 if test $passed -gt 0; then
2241 if test $failed -gt 0; then
2242 AC_MSG_RESULT([no -- some components failed test])
2243 have_png='no (failed tests)'
2244 else
2245 PNG_LIBS='-lpng'
2246 LIBS="$PNG_LIBS $LIBS"
2247 AC_DEFINE(PNG_DELEGATE,1,Define if you have PNG library)
2248 AC_MSG_RESULT([yes])
2249 have_png='yes'
2250 fi
2251 else
2252 AC_MSG_RESULT([no])
2253 fi
2254fi
2255AM_CONDITIONAL(PNG_DELEGATE,test "$have_png" = 'yes')
2256AC_SUBST(PNG_LIBS)
2257
2258dnl ===========================================================================
2259
2260#
2261# Check for RSVG delegate library.
2262#
2263AC_ARG_WITH([rsvg],
2264 [AC_HELP_STRING([--without-rsvg],
2265 [disable RSVG support])],
2266 [with_rsvg=$withval],
2267 [with_rsvg=$have_x])
2268
2269if test "$with_rsvg" != 'yes'; then
2270 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-rsvg=$with_rsvg "
2271fi
2272
2273have_rsvg='no'
2274have_cairo='no'
2275RSVG_CFLAGS=""
2276RSVG_LIBS=""
2277RSVG_PKG=""
2278if test "x$with_rsvg" = "xyes"; then
2279 AC_MSG_RESULT([-------------------------------------------------------------])
2280 PKG_CHECK_MODULES(RSVG,[librsvg-2.0 >= 2.9.0], have_rsvg=yes, have_rsvg=no)
2281 AC_MSG_RESULT([])
2282 PKG_CHECK_MODULES(CAIRO_SVG, cairo-svg, have_cairo=yes, have_cairo=no)
2283 AC_MSG_RESULT([])
2284fi
2285
2286if test "$have_rsvg" = 'yes'; then
2287 AC_DEFINE(RSVG_DELEGATE,1,Define if you have RSVG library)
2288 if test "$with_modules" = 'no'; then
2289 CPPFLAGS="$RSVG_CFLAGS $CPPFLAGS"
2290 fi
2291fi
2292
2293if test "$have_cairo" = 'yes'; then
2294 AC_DEFINE(CAIRO_DELEGATE,1,Define if you have CAIRO library)
2295 if test "$with_modules" = 'no'; then
2296 CPPFLAGS="$CAIRO_SVG_CFLAGS $CPPFLAGS"
2297 fi
2298fi
2299
2300AM_CONDITIONAL(RSVG_DELEGATE, test "$have_rsvg" = 'yes')
2301AM_CONDITIONAL(CAIRO_DELEGATE, test "$have_cairo" = 'yes')
2302AC_SUBST(RSVG_CFLAGS)
2303AC_SUBST(RSVG_LIBS)
2304
2305dnl ===========================================================================
2306
2307#
2308# Check for TIFF delegate library.
2309#
2310AC_ARG_WITH([tiff],
2311 [AC_HELP_STRING([--without-tiff],
2312 [disable TIFF support])],
2313 [with_tiff=$withval],
2314 [with_tiff='yes'])
2315
2316if test "$with_tiff" != 'yes'; then
2317 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-tiff=$with_tiff "
2318fi
2319
2320have_tiff='no'
2321TIFF_LIBS=''
2322if test "$with_tiff" != 'no'; then
2323 AC_MSG_RESULT([-------------------------------------------------------------])
2324 AC_MSG_CHECKING([for TIFF])
2325 AC_MSG_RESULT([])
2326 failed=0
2327 passed=0
2328 AC_CHECK_HEADER(tiff.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2329 AC_CHECK_HEADER(tiffio.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2330 AC_CHECK_LIB(tiff,TIFFOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2331 AC_CHECK_LIB(tiff,TIFFClientOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2332 AC_CHECK_LIB(tiff,TIFFIsByteSwapped,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2333 AC_CHECK_LIB(tiff,TIFFReadRGBATile,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2334 AC_CHECK_LIB(tiff,TIFFReadRGBAStrip,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2335 AC_MSG_CHECKING([if TIFF package is complete])
2336 if test $passed -gt 0; then
2337 if test $failed -gt 0; then
2338 AC_MSG_RESULT([no -- some components failed test])
2339 have_tiff='no (failed tests)'
2340 else
2341 TIFF_LIBS='-ltiff'
2342 LIBS="$TIFF_LIBS $LIBS"
2343 AC_DEFINE(TIFF_DELEGATE,1,Define if you have TIFF library)
2344 AC_MSG_RESULT([yes])
2345 have_tiff='yes'
2346 AC_CHECK_HEADERS(tiffconf.h)
2347 AC_CHECK_FUNCS([TIFFIsCODECConfigured TIFFMergeFieldInfo \
2348 TIFFReadEXIFDirectory TIFFSetErrorHandlerExt TIFFSetTagExtender \
2349 TIFFSetWarningHandlerExt TIFFSwabArrayOfTriples])
2350 fi
2351 else
2352 AC_MSG_RESULT([no])
2353 fi
2354fi
2355AM_CONDITIONAL(TIFF_DELEGATE, test "$have_tiff" = 'yes')
2356AC_SUBST(TIFF_LIBS)
2357
2358dnl ===========================================================================
2359
2360#
2361# Set Windows font directory.
2362#
2363AC_ARG_WITH(windows-font-dir,
2364 [AC_HELP_STRING([--with-windows-font-dir=DIR],
2365 [directory containing MS-Windows fonts])],
2366 [with_windows_font_dir=$withval],
2367 [with_windows_font_dir=''])
2368if test "$with_windows_font_dir" != '' ; then
2369 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-windows-font-dir=$with_windows_font_dir "
2370fi
2371
2372dnl ===========================================================================
2373
2374#
2375# Check for WMF delegate library.
2376#
2377AC_ARG_WITH([wmf],
2378 [AC_HELP_STRING([--without-wmf],
2379 [disable WMF support])],
2380 [with_wmf=$withval],
cristy8d63d1d2010-01-06 20:38:37 +00002381 [with_wmf='yes'])
cristy3ed852e2009-09-05 21:47:34 +00002382
2383if test "$with_wmf" != 'yes'; then
2384 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-wmf=$with_wmf "
2385fi
2386
2387have_wmf='no'
2388WMF_LIBS=''
2389WMF_LIBS_DEPS=''
2390OLIBS="$LIBS"
2391if test "$with_wmf" != 'no'; then
2392 AC_MSG_RESULT([-------------------------------------------------------------])
2393 AC_MSG_CHECKING([for WMF])
2394 AC_MSG_RESULT([])
2395 have_libwmf='no'
2396 have_libwmflite='no'
2397 have_libwmf_ipa_h='no'
2398
2399 AC_CHECK_HEADER([libwmf/ipa.h],[have_libwmf_ipa_h='yes'],,[$FT2BUILD_H])
2400 if test "$have_libwmf_ipa_h" = 'yes'; then
2401 AC_CHECK_LIB(wmflite,wmf_lite_create,have_libwmflite='yes',,)
2402 if test "$have_libwmflite" = 'yes'; then
2403 AC_DEFINE(WMFLITE_DELEGATE,1,Define if you have wmflite library)
2404 WMF_LIBS='-lwmflite'
2405 LIBS="$WMF_LIBS $LIBS"
2406 have_wmf='yes'
2407 else
2408 WMF_LIBS_DEPS=''
2409 WMF_CONFIG_LIBS=`libwmf-config --libs`
2410 for lib in xml2 expat freetype jpeg png z; do
2411 testlib="-l${lib}"
2412 echo "$WMF_CONFIG_LIBS" | grep -- "$testlib" > /dev/null && WMF_LIBS_DEPS="$WMF_LIBS_DEPS $testlib"
2413 done
2414 AC_CHECK_LIB(wmf,wmf_api_create,have_libwmf='yes',,$WMF_LIBS_DEPS)
2415 if test "$have_libwmf" = 'yes'; then
2416 AC_DEFINE(WMF_DELEGATE,1,Define if you have wmf library)
2417 WMF_LIBS='-lwmf'
2418 LIBS="$WMF_LIBS $LIBS"
2419 have_wmf='yes'
2420 else
2421 AC_MSG_RESULT([no -- some components failed test])
2422 have_wmf='no (failed tests)'
2423 have_wmflite='no (failed tests)'
2424 LIBS="$OLIBS"
2425 WMF_LIBS=''
2426 fi
2427 fi
2428 fi
2429 AC_MSG_CHECKING([if WMF package is complete])
2430 if test "$have_wmf" = 'yes'; then
2431 AC_MSG_RESULT([yes])
2432 else
2433 AC_MSG_RESULT([no])
2434 fi
2435fi
2436AM_CONDITIONAL(WMF_DELEGATE, test "$have_wmf" = 'yes')
2437AC_SUBST(WMF_LIBS)
2438AC_SUBST(WMF_LIBS_DEPS)
2439
2440dnl ===========================================================================
2441
2442#
2443# Check for XML delegate library.
2444#
2445AC_ARG_WITH([xml],
2446 [AC_HELP_STRING([--without-xml],
2447 [disable XML support])],
2448 [with_xml=$withval],
2449 [with_xml=$have_x])
2450
2451if test "$with_xml" != 'yes' ; then
2452 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-xml=$with_xml "
2453fi
2454
2455have_xml='no'
2456XML_LIBS=''
2457if test "$with_xml" != 'no'; then
2458 AC_MSG_RESULT([-------------------------------------------------------------])
2459 AC_MSG_CHECKING([for XML])
2460 AC_MSG_RESULT([])
2461 PERSIST_LDFLAGS=$LDFLAGS
2462 PERSIST_CPPFLAGS=$CPPFLAGS
2463 xml2_config=''
2464 AC_CHECK_PROGS(xml2_config,xml2-config,)dnl
2465 if test -n "$xml2_config"; then
2466 # Debian installs libxml headers under /usr/include/libxml2/libxml with
2467 # the shared library installed under /usr/lib, whereas the package
2468 # installs itself under $prefix/libxml and $prefix/lib.
2469 xml2_prefix=`xml2-config --prefix`
2470 if test -d "${xml2_prefix}/include/libxml2"; then
2471 CPPFLAGS="$CPPFLAGS -I${xml2_prefix}/include/libxml2"
2472 fi
2473 if test "${xml2_prefix}" != '/usr'; then
2474 LDFLAGS="$LDFLAGS -L${xml2_prefix}/lib"
2475 fi
2476 fi
2477 failed=0
2478 passed=0
2479 AC_CHECK_HEADER(libxml/parser.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2480 AC_CHECK_LIB(xml2,xmlParseExternalEntity,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2481 AC_MSG_CHECKING([if XML package is complete])
2482 if test $passed -gt 0; then
2483 if test $failed -gt 0; then
2484 AC_MSG_RESULT([no -- some components failed test])
2485 have_xml='no (failed tests)'
2486 LDFLAGS="$PERSIST_LDFLAGS"
2487 CPPFLAGS="$PERSIST_CPPFLAGS"
2488 else
2489 XML_LIBS='-lxml2'
2490 LIBS="$XML_LIBS $LIBS"
2491 AC_DEFINE(XML_DELEGATE,1,Define if you have XML library)
2492 AC_MSG_RESULT([yes])
2493 have_xml='yes'
2494 fi
2495 else
2496 AC_MSG_RESULT([no])
2497 fi
2498fi
2499AM_CONDITIONAL(XML_DELEGATE,test "$have_xml" = 'yes')
2500AC_SUBST(XML_LIBS)
2501
2502dnl ===========================================================================
2503
2504# Substitute compiler name to build/link PerlMagick
2505#
2506AC_SUBST(PERLMAINCC)
2507
2508#
2509# Configure install Paths
2510#
2511
2512# Subdirectory under lib to place ImageMagick lib files
2513LIBRARY_RELATIVE_PATH="${PACKAGE_NAME}-${PACKAGE_VERSION}"
2514AC_DEFINE_UNQUOTED(LIBRARY_RELATIVE_PATH,"$LIBRARY_RELATIVE_PATH",Subdirectory of lib where ImageMagick architecture dependent files are installed)
2515
2516# Path to ImageMagick bin directory
2517EXECUTABLE_PATH="${BIN_DIR}"
2518DEFINE_EXECUTABLE_PATH="${BIN_DIR}/"
2519case "${build_os}" in
2520 mingw* )
2521 DEFINE_EXECUTABLE_PATH=`$WinPathScript "$DEFINE_EXECUTABLE_PATH" 1`
2522 ;;
2523esac
2524AC_DEFINE_UNQUOTED(EXECUTABLE_PATH,"$DEFINE_EXECUTABLE_PATH",Directory where executables are installed.)
2525AC_SUBST(EXECUTABLE_PATH)
2526
2527# Path to ImageMagick lib
2528LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}"
2529DEFINE_LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}/"
2530case "${build_os}" in
2531 mingw* )
2532 DEFINE_LIBRARY_PATH=`$WinPathScript "$DEFINE_LIBRARY_PATH" 1`
2533 ;;
2534esac
2535AC_DEFINE_UNQUOTED(LIBRARY_PATH,"$DEFINE_LIBRARY_PATH",Directory where architecture-dependent files live.)
2536AC_SUBST(LIBRARY_PATH)
2537
2538# Subdirectory under lib to place ImageMagick configuration files
2539CONFIGURE_RELATIVE_PATH="${LIBRARY_RELATIVE_PATH}/config"
2540AC_DEFINE_UNQUOTED(CONFIGURE_RELATIVE_PATH,"$CONFIGURE_RELATIVE_PATH",Subdirectory of lib where architecture-dependent configuration files live.)
2541CONFIGURE_PATH="${LIB_DIR}/${CONFIGURE_RELATIVE_PATH}/"
2542DEFINE_CONFIGURE_PATH="${LIB_DIR}/${CONFIGURE_RELATIVE_PATH}/"
2543case "${build_os}" in
2544 mingw* )
2545 DEFINE_CONFIGURE_PATH=`$WinPathScript "$DEFINE_CONFIGURE_PATH" 1`
2546 ;;
2547esac
2548AC_DEFINE_UNQUOTED(CONFIGURE_PATH,"$DEFINE_CONFIGURE_PATH",Directory where architecture-dependent configuration files live.)
2549AC_SUBST(CONFIGURE_PATH)
2550
2551#
2552# Subdirectory under lib to place ImageMagick coder module files
2553CODER_RELATIVE_PATH="${LIBRARY_RELATIVE_PATH}/modules-Q${QUANTUM_DEPTH}/coders"
2554AC_DEFINE_UNQUOTED(CODER_RELATIVE_PATH,"$CODER_RELATIVE_PATH",Subdirectory of lib where coder modules are installed)
2555CODER_PATH="${LIB_DIR}/${CODER_RELATIVE_PATH}"
2556DEFINE_CODER_PATH="${LIB_DIR}/${CODER_RELATIVE_PATH}/"
2557case "${build_os}" in
2558 mingw* )
2559 DEFINE_CODER_PATH=`$WinPathScript "$DEFINE_CODER_PATH" 1`
2560 ;;
2561esac
2562AC_DEFINE_UNQUOTED(CODER_PATH,"$DEFINE_CODER_PATH",Location of coder modules)
2563AC_SUBST(CODER_PATH)
2564
2565#
2566# Subdirectory under lib to place ImageMagick filter module files
2567FILTER_RELATIVE_PATH="${LIBRARY_RELATIVE_PATH}/modules-Q${QUANTUM_DEPTH}/filters"
2568AC_DEFINE_UNQUOTED(FILTER_RELATIVE_PATH,"$FILTER_RELATIVE_PATH",Subdirectory of lib where filter modules are installed)
2569FILTER_PATH="${LIB_DIR}/${FILTER_RELATIVE_PATH}"
2570DEFINE_FILTER_PATH="${LIB_DIR}/${FILTER_RELATIVE_PATH}/"
2571case "${build_os}" in
2572 mingw* )
2573 DEFINE_FILTER_PATH=`$WinPathScript "$DEFINE_FILTER_PATH" 1`
2574 ;;
2575esac
2576AC_DEFINE_UNQUOTED(FILTER_PATH,"$DEFINE_FILTER_PATH",Location of filter modules)
2577AC_SUBST(FILTER_PATH)
2578
2579#
2580# Path to ImageMagick documentation files
2581DOCUMENTATION_RELATIVE_PATH="${PACKAGE_NAME}-${PACKAGE_VERSION}"
2582DOCUMENTATION_PATH="${DATA_DIR}/doc/${DOCUMENTATION_RELATIVE_PATH}"
2583DEFINE_DOCUMENTATION_PATH="${DATA_DIR}/doc/${DOCUMENTATION_RELATIVE_PATH}/"
2584case "${build_os}" in
2585 mingw* )
2586 DEFINE_DOCUMENTATION_PATH=`$WinPathScript "$DEFINE_DOCUMENTATION_PATH" 1`
2587 ;;
2588esac
2589AC_DEFINE_UNQUOTED(DOCUMENTATION_PATH,"$DEFINE_DOCUMENTATION_PATH",Directory where ImageMagick documents live.)
2590AC_SUBST(DOCUMENTATION_PATH)
2591
2592#
2593# Path to ImageMagick share files
2594SHARE_RELATIVE_PATH="${PACKAGE_NAME}-${PACKAGE_VERSION}"
2595SHARE_PATH="${DATA_DIR}/${SHARE_RELATIVE_PATH}"
2596DEFINE_SHARE_PATH="${DATA_DIR}/${SHARE_RELATIVE_PATH}/"
2597case "${build_os}" in
2598 mingw* )
2599 DEFINE_SHARE_PATH=`$WinPathScript "$DEFINE_SHARE_PATH" 1`
2600 ;;
2601esac
2602AC_DEFINE_UNQUOTED(SHARE_PATH,"$DEFINE_SHARE_PATH",Directory where architecture-independent files live.)
2603AC_SUBST(SHARE_PATH)
2604
2605# Subdirectory under share to place ImageMagick configuration files
2606SHARE_CONFIGURE_RELATIVE_PATH="${LIBRARY_RELATIVE_PATH}/config"
2607AC_DEFINE_UNQUOTED(SHARE_CONFIGURE_RELATIVE_PATH,"$SHARE_CONFIGURE_RELATIVE_PATH",Subdirectory of lib where architecture-independent configuration files live.)
2608SHARE_CONFIGURE_PATH="${DATA_DIR}/${SHARE_CONFIGURE_RELATIVE_PATH}"
2609DEFINE_SHARE_CONFIGURE_PATH="${DATA_DIR}/${SHARE_CONFIGURE_RELATIVE_PATH}/"
2610case "${build_os}" in
2611 mingw* )
2612 DEFINE_SHARE_CONFIGURE_PATH=`$WinPathScript "$DEFINE_SHARE_CONFIGURE_PATH" 1`
2613 ;;
2614esac
2615AC_DEFINE_UNQUOTED(SHARE_CONFIGURE_PATH,"$DEFINE_SHARE_CONFIGURE_PATH",Directory where architecture-independent configuration files live.)
2616AC_SUBST(SHARE_CONFIGURE_PATH)
2617
2618#
2619# program_transform_name is formed for use in a Makefile, so create a
2620# modified version for use in a shell script.
2621configure_transform_name=`echo ${program_transform_name} | sed 's,\\$\\$,$,'`
2622
2623# Default delegate definitions
2624AC_MSG_RESULT([-------------------------------------------------------------])
2625AC_MSG_CHECKING([for ImageMagick delegate programs])
2626AC_MSG_RESULT([])
2627AutotraceDecodeDelegateDefault='autotrace'
2628AVIDecodeDelegateDefault='mplayer'
cristy3d7f8062009-09-24 20:45:35 +00002629BlenderDecodeDelegateDefault='blender'
cristy3ed852e2009-09-05 21:47:34 +00002630BZIPDelegateDefault='bzip2'
2631BrowseDelegateDefault='xdg-open'
2632CGMDecodeDelegateDefault='ralcgm'
2633CatDelegateDefault='cat'
2634DNGDecodeDelegateDefault='ufraw-batch'
2635GVCDecodeDelegateDefault='dot'
2636DVIDecodeDelegateDefault='dvips'
2637EchoDelegateDefault='echo'
2638EditorDelegateDefault='xterm'
2639FIGDecodeDelegateDefault='fig2dev'
2640ConvertDelegateDefault=`echo convert | sed ${configure_transform_name}`
2641DisplayDelegateDefault=`echo display | sed ${configure_transform_name}`
2642MogrifyDelegateDefault=`echo mogrify | sed ${configure_transform_name}`
2643GnuplotDecodeDelegateDefault='gnuplot'
2644HDRDecodeDelegateDefault='ra_pfm'
2645HPGLDecodeDelegateDefault='hp2xx'
2646HTMLDecodeDelegateDefault='html2ps'
2647ILBMDecodeDelegateDefault='ilbmtoppm'
2648ILBMEncodeDelegateDefault='ppmtoilbm'
2649LPDelegateDefault='lp'
2650LPRDelegateDefault='lpr'
2651LZWDecodeDelegateDefault='uncompress'
2652LZWEncodeDelegateDefault='compress'
2653LaunchDelegateDefault='gimp'
2654MANDelegateDefault='groff'
2655MPEGDecodeDelegateDefault='ffmpeg'
2656MPEGEncodeDelegateDefault='ffmpeg'
2657MVDelegateDefault='mv'
2658PCLDelegateDefault='pcl6'
2659PGPDecodeDelegateDefault='pgpv'
2660POVDelegateDefault='povray'
2661if test "$native_win32_build" = 'yes'; then
2662 PSDelegateDefault='gswin32c'
cristyb7931f12009-09-25 10:22:21 +00002663elif test "$gslib_framework" = 'yes'; then
cristy3ed852e2009-09-05 21:47:34 +00002664 PSDelegateDefault='gsc'
2665else
2666 PSDelegateDefault='gs'
2667fi
2668RLEEncodeDelegateDefault='rawtorle'
2669RMDelegateDefault='rm'
cristy4689cf02010-02-17 21:15:45 +00002670RSVGDecodeDelegateDefault='rsvg'
cristy3ed852e2009-09-05 21:47:34 +00002671SCANDecodeDelegateDefault='scanimage'
2672TXTDelegateDefault='enscript'
2673WMFDecodeDelegateDefault='wmf2eps'
2674WWWDecodeDelegateDefault='curl'
2675XPSDelegateDefault='gxps'
2676ZipDelegateDefault='gzip'
2677
2678# Search for delegates
2679AC_PATH_PROG(AutotraceDecodeDelegate, "$AutotraceDecodeDelegateDefault", "$AutotraceDecodeDelegateDefault")
2680AC_PATH_PROG(AVIDecodeDelegate, "$AVIDecodeDelegateDefault", "$AVIDecodeDelegateDefault")
2681AC_PATH_PROG(BlenderDecodeDelegate, "$BlenderDecodeDelegateDefault", "$BlenderDecodeDelegateDefault")
2682AC_PATH_PROG(BZIPDelegate, "$BZIPDelegateDefault", "$BZIPDelegateDefault")
2683AC_PATH_PROG(BrowseDelegate, "$BrowseDelegateDefault" mozilla firefox netscape, "$BrowseDelegateDefault")
2684AC_PATH_PROG(CGMDecodeDelegate, "$CGMDecodeDelegateDefault", "$CGMDecodeDelegateDefault")
2685AC_PATH_PROG(CatDelegate, "$CatDelegateDefault", "$CatDelegateDefault")
2686AC_PATH_PROG(DNGDecodeDelegate, "$DNGDecodeDelegateDefault", "$DNGDecodeDelegateDefault")
2687AC_PATH_PROG(GVCDecodeDelegate, "$GVCDecodeDelegateDefault", "$GVCDecodeDelegateDefault")
2688AC_PATH_PROG(DVIDecodeDelegate, "$DVIDecodeDelegateDefault", "$DVIDecodeDelegateDefault")
2689AC_PATH_PROG(EchoDelegate, "$EchoDelegateDefault", "$EchoDelegateDefault")
2690AC_PATH_PROG(EditorDelegate, "$EditorDelegateDefault", "$EditorDelegateDefault")
2691AC_PATH_PROG(FIGDecodeDelegate, "$FIGDecodeDelegateDefault", "$FIGDecodeDelegateDefault")
2692AC_PATH_PROG(ConvertDelegate, "$ConvertDelegateDefault", "$ConvertDelegateDefault")
2693AC_PATH_PROG(DisplayDelegate, "$DisplayDelegateDefault", "$DisplayDelegateDefault")
2694AC_PATH_PROG(MogrifyDelegate, "$MogrifyDelegateDefault", "$MogrifyDelegateDefault")
2695AC_PATH_PROG(GnuplotDecodeDelegate, "$GnuplotDecodeDelegateDefault", "$GnuplotDecodeDelegateDefault")
2696AC_PATH_PROG(HDRDecodeDelegate, "$HDRDecodeDelegateDefault", "$HDRDecodeDelegateDefault")
2697AC_PATH_PROG(HPGLDecodeDelegate, "$HPGLDecodeDelegateDefault", "$HPGLDecodeDelegateDefault")
2698AC_PATH_PROG(HTMLDecodeDelegate, "$HTMLDecodeDelegateDefault", "$HTMLDecodeDelegateDefault")
2699AC_PATH_PROG(ILBMDecodeDelegate, "$ILBMDecodeDelegateDefault", "$ILBMDecodeDelegateDefault")
2700AC_PATH_PROG(ILBMEncodeDelegate, "$ILBMEncodeDelegateDefault", "$ILBMEncodeDelegateDefault")
2701AC_PATH_PROG(LPDelegate, "$LPDelegateDefault", no)
2702AC_PATH_PROG(LPRDelegate, "$LPRDelegateDefault", "$LPRDelegateDefault")
2703AC_PATH_PROG(LZWDecodeDelegate, "$LZWDecodeDelegateDefault", "$LZWDecodeDelegateDefault")
2704AC_PATH_PROG(LZWEncodeDelegate, "$LZWEncodeDelegateDefault", "$LZWEncodeDelegateDefault")
2705AC_PATH_PROG(LaunchDelegate, "$LaunchDelegateDefault", "$LaunchDelegateDefault")
2706AC_PATH_PROG(MANDelegate, "$MANDelegateDefault", "$MANDelegateDefault")
2707AC_PATH_PROG(MPEGDecodeDelegate, "$MPEGDecodeDelegateDefault", "$MPEGDecodeDelegateDefault")
2708AC_PATH_PROG(MPEGEncodeDelegate, "$MPEGEncodeDelegateDefault", "$MPEGEncodeDelegateDefault")
2709AC_PATH_PROG(MVDelegate, "$MVDelegateDefault", "$MVDelegateDefault")
2710AC_PATH_PROG(PCLDelegate, "$PCLDelegateDefault", "$PCLDelegateDefault")
2711AC_PATH_PROG(PGPDecodeDelegate, "$PGPDecodeDelegateDefault", "$PGPDecodeDelegateDefault")
2712AC_PATH_PROG(POVDelegate, "$POVDelegateDefault", "$POVDelegateDefault")
2713AC_PATH_PROGS(PSDelegate, gsx gsc "$PSDelegateDefault", "$PSDelegateDefault")
2714AC_PATH_PROG(RLEEncodeDelegate, "$RLEEncodeDelegateDefault", "$RLEEncodeDelegateDefault")
2715AC_PATH_PROG(RMDelegate, "$RMDelegateDefault", "$RMDelegateDefault")
cristy4689cf02010-02-17 21:15:45 +00002716AC_PATH_PROG(RSVGDecodeDelegate, "$RSVGDecodeDelegateDefault", "$RSVGDecodeDelegateDefault")
cristy3ed852e2009-09-05 21:47:34 +00002717AC_PATH_PROG(SCANDecodeDelegate, "$SCANDecodeDelegateDefault", "$SCANDecodeDelegateDefault")
2718AC_PATH_PROG(TXTDelegate, "$TXTDelegateDefault", "$TXTDelegateDefault")
2719AC_PATH_PROG(WMFDecodeDelegate, "$WMFDecodeDelegateDefault", "$WMFDecodeDelegateDefault")
2720AC_PATH_PROG(WWWDecodeDelegate, "$WWWDecodeDelegateDefault", "$WWWDecodeDelegateDefault")
2721AC_PATH_PROG(XPSDelegate, "$XPSDelegateDefault", "$XPSDelegateDefault")
2722AC_PATH_PROG(ZipDelegate, "$ZipDelegateDefault", "$ZipDelegateDefault")
2723
2724# Prefer lpr to lp; lp needs options tacked on.
2725if test "$LPRDelegate" != no; then
2726 PrintDelegate="$LPRDelegate"
2727else
2728 PrintDelegate="$LPDelegate -c -s"
2729fi
2730AC_SUBST(PrintDelegate)
2731
2732# Installed ImageMagick utiltity paths
2733ConvertDelegate="${BIN_DIR}/${ConvertDelegateDefault}"
2734DisplayDelegate="${BIN_DIR}/${DisplayDelegateDefault}"
2735MogrifyDelegate="${BIN_DIR}/${MogrifyDelegateDefault}"
2736
2737# Set delegate booleans
2738have_ffmpeg='no'; if test "$MPEGDecodeDelegate" != "$MPEGDecodeDelegateDefault" ; then have_ffmpeg='yes'; fi
2739have_fig2dev='no' ; if test "$FIGDecodeDelegate" != "$FIGDecodeDelegateDefault" ; then have_fig2dev='yes'; fi
2740have_gs='no' ; if test "$PSDelegate" != "$PSDelegateDefault"; then have_gs='yes'; fi
2741have_hp2xx='no' ; if test "$HPGLDecodeDelegate" != "$HPGLDecodeDelegateDefault" ; then have_hp2xx='yes'; fi
2742have_ilbmtoppm='no' ; if test "$ILBMDecodeDelegate" != "$ILBMDecodeDelegateDefault" ; then have_ilbmtoppm='yes'; fi
2743have_mplayer='no'; if test "$AVIDecodeDelegate" != "$AVIDecodeDelegateDefault" ; then have_mplayer='yes'; fi
2744have_pcl='no' ; if test "$PCLDelegate" != "$PCLDelegateDefault"; then have_pcl='yes'; fi
2745have_ppmtoilbm='no' ; if test "$ILBMEncodeDelegate" != "$ILBMEncodeDelegateDefault" ; then have_ppmtoilbm='yes'; fi
2746have_ra_pfm='no' ; if test "$HDRDecodeDelegate" != "$HDRDecodeDelegateDefault" ; then have_ra_pfm='yes'; fi
2747have_ralcgm='no' ; if test "$CGMDecodeDelegate" != "$CGMDecodeDelegateDefault" ; then have_ralcgm='yes'; fi
2748have_xps='no' ; if test "$XPSDelegate" != "$XPSDelegateDefault"; then have_xps='yes'; fi
2749
2750#
2751# Test for font directories
2752#
2753type_include_files=''
2754
cristy430a7312010-01-21 20:44:04 +00002755# Dejavu fonts.
2756AC_MSG_CHECKING(for Dejavu fonts directory)
2757dejavu_font_dir=''
2758if test "${with_dejavu_font_dir}" != 'default'; then
2759 dejavu_font_dir="${with_dejavu_font_dir}/"
2760else
2761 for font_dir in "${prefix}/share/dejavu/fonts/" '/usr/share/fonts/dejavu/'; do
2762 if test -f "${font_dir}DejaVuSerif.ttf"; then
2763 dejavu_font_dir="${font_dir}"
2764 break 1
2765 fi
2766 done
2767fi
2768if test "${dejavu_font_dir}x" != 'x'; then
2769 type_include_files="${type_include_files} "'<include file="type-dejavu.xml" />'
2770 AC_MSG_RESULT([$dejavu_font_dir])
2771else
2772 AC_MSG_RESULT([not found!]);
2773fi
2774AC_SUBST(dejavu_font_dir)
2775
cristy3ed852e2009-09-05 21:47:34 +00002776# Windows
2777windows_font_dir=''
2778if test "$with_windows_font_dir" != "no" && test -n "$with_windows_font_dir"; then
2779 windows_font_dir="${with_windows_font_dir}/"
2780fi
cristy430a7312010-01-21 20:44:04 +00002781if test "${windows_font_dir}x" != 'x'; then
cristy3ed852e2009-09-05 21:47:34 +00002782 if test -f '/usr/X11R6/lib/X11/fonts/truetype/arial.ttf'; then
2783 windows_font_dir='/usr/X11R6/lib/X11/fonts/truetype/'
2784 fi
2785 if test -f '/usr/X11R7/lib/X11/fonts/truetype/arial.ttf'; then
2786 windows_font_dir='/usr/X11R7/lib/X11/fonts/truetype/'
2787 fi
2788 if test -f '/usr/share/fonts/msttcore/arial.ttf'; then
2789 windows_font_dir='/usr/share/fonts/msttcore/truetype/'
2790 fi
2791fi
cristy430a7312010-01-21 20:44:04 +00002792if test "${windows_font_dir}x" != 'x'; then
cristy3ed852e2009-09-05 21:47:34 +00002793 type_include_files="$type_include_files "'<include file="type-windows.xml" />'
2794fi
2795AC_SUBST(windows_font_dir)
2796
2797# Ghostscript
2798AC_MSG_CHECKING(for Ghostscript fonts directory)
2799ghostscript_font_dir=''
2800if test "${with_gs_font_dir}" != 'default'; then
2801 ghostscript_font_dir="${with_gs_font_dir}/"
2802else
2803 if test "${native_win32_build}" = 'yes'; then
2804 # Native Windows Build
2805 for font_dir in "c:\\Program Files\\gs\\fonts\\" "c:\\Program Files \(x86\)\\gs\\fonts\\" "c:\\gs\\fonts\\"; do
2806 if test -f "${font_dir}a010013l.pfb"; then
2807 ghostscript_font_dir="$font_dir"
2808 break 1
2809 fi
2810 done
2811 if test "${PSDelegate}" != 'gswin32c'; then
2812 ghostscript_font_dir=`echo "${PSDelegate}" | sed -e 's:/gs/.*:/gs:;s:^/::;s/./&:/;s:/:\\\\:g'`"\\fonts\\"
2813 fi
2814 else
2815 # Linux / Mac OS X / Unix Build
2816 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
2817 if test -f "${font_dir}a010013l.pfb"; then
2818 ghostscript_font_dir="${font_dir}"
2819 break 1
2820 fi
2821 done
2822 if test "${ghostscript_font_dir}x" = 'x'; then
2823 if test "$PSDelegate" != 'gs'; then
2824 ghostscript_font_dir=`echo "$PSDelegate" | sed -e 's:/bin/gs:/share/ghostscript/fonts:'`"/"
2825 fi
2826 fi
2827 fi
2828fi
2829if test "${ghostscript_font_dir}x" != 'x'; then
2830 type_include_files="${type_include_files} "'<include file="type-ghostscript.xml" />'
2831 AC_MSG_RESULT([$ghostscript_font_dir])
2832else
2833 AC_MSG_RESULT([not found!]);
2834fi
2835AC_SUBST(ghostscript_font_dir)
2836case "${build_os}" in
2837 mingw* )
2838 PSDelegate=`$WinPathScript "$PSDelegate" 1`
2839 ;;
2840esac
2841
2842AC_SUBST(type_include_files)
2843
2844#
2845# Handle case where user doesn't want frozen paths
2846#
2847if test "$with_frozenpaths" != 'yes'; then
2848 # Re-set delegate definitions to default (no paths)
2849 AutotraceDecodeDelegate="$AutotraceDecodeDelegateDefault"
2850 AVIDecodeDelegate="$AVIDecodeDelegateDefault"
2851 BlenderDecodeDelegate="$BlenderDecodeDelegateDefault"
2852 BZIPDelegate="$BZIPDelegateDefault"
2853 BrowseDelegate="$BrowseDelegateDefault"
2854 CGMDecodeDelegate="$CGMDecodeDelegateDefault"
2855 CatDelegate="$CatDelegateDefault"
2856 ConvertDelegate="$ConvertDelegateDefault"
2857 GVCDecodeDelegate="$GVCDecodeDelegateDefault"
2858 DVIDecodeDelegate="$DVIDecodeDelegateDefault"
2859 EchoDelegate="$EchoDelegateDefault"
2860 EditorDelegate="$EditorDelegateDefault"
2861 FIGDecodeDelegate="$FIGDecodeDelegateDefault"
2862 GnuplotDecodeDelegate="$GnuplotDecodeDelegateDefault"
2863 HPGLDecodeDelegate="$HPGLDecodeDelegateDefault"
2864 HTMLDecodeDelegate="$HTMLDecodeDelegateDefault"
2865 ILBMDecodeDelegate="$ILBMDecodeDelegateDefault"
2866 ILBMEncodeDelegate="$ILBMEncodeDelegateDefault"
2867 LPDelegate="$LPDelegateDefault"
2868 LZWDecodeDelegate="$LZWDecodeDelegateDefault"
2869 LZWEncodeDelegate="$LZWEncodeDelegateDefault"
2870 LaunchDelegate="$LaunchDelegateDefault"
2871 MANDelegate="$MANDelegateDefault"
2872 MPEGDecodeDelegate="$MPEGDecodeDelegateDefault"
2873 MPEGEncodeDelegate="$MPEGEncodeDelegateDefault"
2874 MVDelegate="$MVDelegateDefault"
2875 MogrifyDelegate="$MogrifyDelegateDefault"
2876 PCLDelegate="$PCLDelegateDefault"
2877 PGPDecodeDelegate="$PGPDecodeDelegateDefault"
2878 POVDelegate="$POVDelegateDefault"
2879 PSDelegate="$PSDelegateDefault"
2880 HDRDecodeDelegate="$HDRDecodeDelegateDefault"
2881 RLEEncodeDelegate="$RLEEncodeDelegateDefault"
2882 RMDelegate="$RMDelegateDefault"
cristy4689cf02010-02-17 21:15:45 +00002883 RSVGDecodeDelegate="$RSVGDecodeDelegateDefault"
cristy3ed852e2009-09-05 21:47:34 +00002884 SCANDecodeDelegate="$SCANDecodeDelegateDefault"
2885 ShowImageDelegate="$ShowImageDelegateDefault"
2886 TXTDelegate="$TXTDelegateDefault"
2887 WMFDecodeDelegate="$WMFDecodeDelegateDefault"
2888 WWWDecodeDelegate="$WWWDecodeDelegateDefault"
2889 XPSDelegate="$XPSDelegateDefault"
2890 ZipDelegate="$ZipDelegateDefault"
2891fi
2892
2893# Delegate substitutions
2894AC_SUBST(AutotraceDecodeDelegate)
2895AC_SUBST(AVIDecodeDelegate)
2896AC_SUBST(BlenderDecodeDelegate)
2897AC_SUBST(BZIPDelegate)
2898AC_SUBST(BrowseDelegate)
2899AC_SUBST(CGMDecodeDelegate)
2900AC_SUBST(CatDelegate)
2901AC_SUBST(ConvertDelegate)
2902AC_SUBST(GVCDecodeDelegate)
2903AC_SUBST(DVIDecodeDelegate)
2904AC_SUBST(EchoDelegate)
2905AC_SUBST(EditorDelegate)
2906AC_SUBST(FIGDecodeDelegate)
2907AC_SUBST(GnuplotDecodeDelegate)
2908AC_SUBST(HDRDecodeDelegate)
2909AC_SUBST(HPGLDecodeDelegate)
2910AC_SUBST(HTMLDecodeDelegate)
2911AC_SUBST(ILBMDecodeDelegate)
2912AC_SUBST(ILBMEncodeDelegate)
2913AC_SUBST(LPDelegate)
2914AC_SUBST(LZWDecodeDelegate)
2915AC_SUBST(LZWEncodeDelegate)
2916AC_SUBST(LaunchDelegate)
2917AC_SUBST(MANDelegate)
2918AC_SUBST(MPEGDecodeDelegate)
2919AC_SUBST(MPEGEncodeDelegate)
2920AC_SUBST(MVDelegate)
2921AC_SUBST(MogrifyDelegate)
2922AC_SUBST(PCLDelegate)
2923AC_SUBST(PGPDecodeDelegate)
2924AC_SUBST(POVDelegate)
2925AC_SUBST(PSDelegate)
2926AC_SUBST(RLEEncodeDelegate)
2927AC_SUBST(RMDelegate)
2928AC_SUBST(SCANDecodeDelegate)
2929AC_SUBST(ShowImageDelegate)
2930AC_SUBST(TXTDelegate)
2931AC_SUBST(WMFDecodeDelegate)
2932AC_SUBST(WWWDecodeDelegate)
2933AC_SUBST(XPSDelegate)
2934AC_SUBST(ZipDelegate)
2935
2936#
2937# RPM support.
2938#
2939RPM=''
2940AC_CHECK_PROGS(TAR,gnutar gtar tar)
2941AC_CHECK_PROGS(PERL,perl)
2942AC_CHECK_PROGS(RPM,rpmbuild rpm)
2943AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
2944AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
2945AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
2946AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
2947AC_SUBST(RPM)
2948AM_CONDITIONAL(RPM_DELEGATE, test "x$RPM" != "x" )
2949
2950#
2951# 7ZIP support (http://p7zip.sourceforge.net/)
2952#
2953P7ZIP=''
2954AC_CHECK_PROGS(P7ZIP,[7za])
2955AC_SUBST(P7ZIP)
2956AM_CONDITIONAL(P7ZIP_DELEGATE, test "x$P7ZIP" != "x" )
2957
2958#
2959# ZIP support (http://www.info-zip.org/Zip.html)
2960#
2961ZIP=''
2962AC_CHECK_PROGS(ZIP,[zip])
2963AC_SUBST(ZIP)
2964AM_CONDITIONAL(ZIP_DELEGATE, test "x$ZIP" != "x" )
2965
2966#
2967# GhostPCL related configuration.
2968#
2969PCLColorDevice=ppmraw
2970PCLCMYKDevice=bmpsep8
2971PCLMonoDevice=pbmraw
2972if test -z "$PCLVersion"; then
2973 PCLVersion='unknown'
2974fi
2975if test $have_pcl = 'yes'; then
2976 AC_MSG_RESULT([-------------------------------------------------------------])
2977 AC_MSG_CHECKING([for PCL])
2978 AC_MSG_RESULT([])
2979 # PCLColorDevice
2980 AC_MSG_CHECKING([for pcl color device])
2981 if $PCLDelegate -dBATCH -sDEVICE=$PCLColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
2982 :
2983 else
2984 PCLColorDevice=ppmraw
2985 fi
2986 AC_MSG_RESULT([$PCLColorDevice])
2987
2988 # PCLCMYKDevice
2989 AC_MSG_CHECKING([for pcl CMYK device])
2990 if $PCLDelegate -dBATCH -sDEVICE=$PCLColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
2991 :
2992 else
2993 PCLCMYKDevice=$PCLColorDevice
2994 fi
2995 AC_MSG_RESULT([$PCLCMYKDevice])
2996
2997 # PCLMonoDevice
2998 AC_MSG_CHECKING([for pcl mono device])
2999 if $PCLDelegate -dBATCH -sDEVICE=$PCLMonoDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3000 :
3001 else
3002 PCLMonoDevice=$PCLColorDevice
3003 fi
3004 AC_MSG_RESULT([$PCLMonoDevice])
3005fi
3006
3007AC_SUBST(PCLMonoDevice)
3008AC_SUBST(PCLColorDevice)
3009AC_SUBST(PCLCMYKDevice)
3010AC_SUBST(PCLVersion)
3011
3012#
3013# GhostXPS related configuration.
3014#
3015XPSColorDevice=ppmraw
3016XPSCMYKDevice=bmpsep8
3017XPSMonoDevice=pbmraw
3018if test -z "$XPSVersion"; then
3019 XPSVersion='unknown'
3020fi
3021if test $have_xps = 'yes'; then
3022 AC_MSG_RESULT([-------------------------------------------------------------])
3023 AC_MSG_CHECKING([for XPS])
3024 AC_MSG_RESULT([])
3025 # XPSColorDevice
3026 AC_MSG_CHECKING([for xps color device])
3027 if $XPSDelegate -dBATCH -sDEVICE=$XPSColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3028 :
3029 else
3030 XPSColorDevice=ppmraw
3031 fi
3032 AC_MSG_RESULT([$XPSColorDevice])
3033
3034 # XPSCMYKDevice
3035 AC_MSG_CHECKING([for xps CMYK device])
3036 if $XPSDelegate -dBATCH -sDEVICE=$XPSColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3037 :
3038 else
3039 XPSCMYKDevice=$XPSColorDevice
3040 fi
3041 AC_MSG_RESULT([$XPSCMYKDevice])
3042
3043 # XPSMonoDevice
3044 AC_MSG_CHECKING([for xps mono device])
3045 if $XPSDelegate -dBATCH -sDEVICE=$XPSMonoDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3046 :
3047 else
3048 XPSMonoDevice=$XPSColorDevice
3049 fi
3050 AC_MSG_RESULT([$XPSMonoDevice])
3051fi
3052
3053AC_SUBST(XPSMonoDevice)
3054AC_SUBST(XPSColorDevice)
3055AC_SUBST(XPSCMYKDevice)
3056AC_SUBST(XPSVersion)
3057
3058#
3059# Ghostscript related configuration.
3060#
3061if test "$have_png" = 'yes'; then
3062 GSAlphaDevice=pngalpha
3063else
3064 GSAlphaDevice=pnmraw
3065fi
3066GSColorDevice=pnmraw
3067GSCMYKDevice=pam
3068GSMonoDevice=pbmraw
3069GSPDFDevice=pdfwrite
3070GSPSDevice=pswrite
3071GSEPSDevice=epswrite
3072GSVersion='unknown'
3073if test $have_gs = 'yes'; then
3074 AC_MSG_RESULT([-------------------------------------------------------------])
3075 AC_MSG_CHECKING([for Ghostscript])
3076 AC_MSG_RESULT([])
3077 AC_MSG_CHECKING([for Ghostscript version])
3078 if GSVersion=`$PSDelegate --version`; then
3079 :
3080 else
3081 GSVersion=`$PSDelegate --help | sed -e '1q' | awk '{ print $3 }'`
3082 fi
3083 AC_MSG_RESULT([$GSVersion])
3084
3085 # GSAlphaDevice
3086 AC_MSG_CHECKING([for gs alpha device])
3087 if $PSDelegate -q -dBATCH -sDEVICE=$GSAlphaDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3088 :
3089 else
3090 GSAlphaDevice=pnmraw
3091 fi
3092 AC_MSG_RESULT([$GSAlphaDevice])
3093
3094 # GSColorDevice
3095 AC_MSG_CHECKING([for gs color device])
3096 if $PSDelegate -q -dBATCH -sDEVICE=$GSColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3097 :
3098 else
3099 GSColorDevice=pnmraw
3100 fi
3101 AC_MSG_RESULT([$GSColorDevice])
3102
3103 # GSCMYKDevice
3104 AC_MSG_CHECKING([for gs CMYK device])
3105 if $PSDelegate -q -dBATCH -sDEVICE=$GSCMYKDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3106 :
3107 else
3108 GSCMYKDevice=bmpsep8
3109 fi
3110 AC_MSG_RESULT([$GSCMYKDevice])
3111
3112 # GSMonoDevice
3113 AC_MSG_CHECKING([for gs mono device])
3114 if $PSDelegate -q -dBATCH -sDEVICE=$GSMonoDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3115 :
3116 else
3117 GSMonoDevice=$GSColorDevice
3118 fi
3119 AC_MSG_RESULT([$GSMonoDevice])
3120
3121 # GSPDFDevice
3122 AC_MSG_CHECKING([for gs PDF writing device])
3123 if $PSDelegate -q -dBATCH -sDEVICE=$GSPDFDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3124 :
3125 else
3126 GSPDFDevice=nodevice
3127 fi
3128 AC_MSG_RESULT([$GSPDFDevice])
3129
3130 # GSPSDevice
3131 AC_MSG_CHECKING([for gs PS writing device])
3132 if $PSDelegate -q -dBATCH -sDEVICE=$GSPSDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3133 :
3134 else
3135 GSPSDevice=nodevice
3136 fi
3137 AC_MSG_RESULT([$GSPSDevice])
3138
3139 # GSEPSDevice
3140 AC_MSG_CHECKING([for gs EPS writing device])
3141 if $PSDelegate -q -dBATCH -sDEVICE=$GSEPSDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3142 :
3143 else
3144 GSEPSDevice=nodevice
3145 fi
3146 AC_MSG_RESULT([$GSEPSDevice])
3147fi
3148
3149AC_SUBST(GSAlphaDevice)
3150AC_SUBST(GSCMYKDevice)
3151AC_SUBST(GSColorDevice)
3152AC_SUBST(GSEPSDevice)
3153AC_SUBST(GSMonoDevice)
3154AC_SUBST(GSPDFDevice)
3155AC_SUBST(GSPSDevice)
3156AC_SUBST(GSVersion)
3157
3158#
3159# PerlMagick-related configuration
3160#
3161
3162# Look for PERL if PerlMagick requested
3163# If name/path of desired PERL interpreter is specified, look for that one first
3164have_perl='no'
3165if test "$with_perl" != 'no'; then
3166 AC_MSG_RESULT([-------------------------------------------------------------])
3167 AC_MSG_CHECKING([for Perl])
3168 AC_MSG_RESULT([])
3169 if test "$with_perl" != 'yes'; then
3170 AC_CACHE_CHECK(for perl,ac_cv_path_PERL,ac_cv_path_PERL="$with_perl");
3171 PERL=$ac_cv_path_PERL
3172 AC_SUBST(PERL)dnl
3173 have_perl="$ac_cv_path_PERL"
3174 else
3175 AC_PATH_PROGS(PERL,perl perl5,)dnl
3176 if test "$ac_cv_path_PERL"; then
3177 have_perl="$ac_cv_path_PERL"
3178 fi
3179 fi
3180fi
3181
cristy949301e2010-01-06 01:38:40 +00003182if test "$with_perl" != 'yes' ; then
3183 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-perl=$with_perl "
3184fi
3185
3186PERL_SUPPORTS_DESTDIR='no'
3187
cristy3ed852e2009-09-05 21:47:34 +00003188with_perl_static='no'
3189with_perl_dynamic='no'
3190if test "$have_perl" != 'no'; then
3191 if test "$with_perl" != 'no' && test "$libtool_build_shared_libs" = 'no'; then
3192 with_perl_static='yes'
3193 fi
3194 if test "$with_perl" != 'no' && test "$libtool_build_shared_libs" = 'yes'; then
3195 with_perl_dynamic='yes'
3196 fi
3197 # Is PERL's MakeMaker new enough to support DESTDIR?
3198 AC_PROG_PERL_VERSION(5.8.1,[PERL_SUPPORTS_DESTDIR='yes'],[PERL_SUPPORTS_DESTDIR='no'])
3199fi
3200AM_CONDITIONAL(WITH_PERL, test "$have_perl" != 'no')
3201AM_CONDITIONAL(WITH_PERL_STATIC, test $with_perl_static = 'yes')
3202AM_CONDITIONAL(WITH_PERL_DYNAMIC, test $with_perl_dynamic = 'yes')
3203AC_SUBST(PERL_SUPPORTS_DESTDIR)
3204
3205# Determine path to pick up MagickCore library from for use with building PerlMagick
3206MAGICKCORE_PATH="${LIB_DIR}"
3207if test $with_perl_static = 'yes'; then
3208 # Find out where libtool hides its uninstalled libraries (as libtool_objdir)
3209 libtool_objdir=$objdir
3210
3211 # Linker search path to library, followed by -lMagickCore
3212 MAGICKCORE_PATH="${builddir}/magick/${libtool_objdir}"
3213fi
3214AC_SUBST(MAGICKCORE_PATH)
3215
3216# Create a simple string containing format names for all delegate libraries
3217DELEGATES=''
3218if test "$have_autotrace" = 'yes'; then DELEGATES="$DELEGATES autotrace"; fi
3219if test "$have_bzlib" = 'yes'; then DELEGATES="$DELEGATES bzlib"; fi
3220if test "$have_djvu" = 'yes'; then DELEGATES="$DELEGATES djvu"; fi
3221if test "$have_dps" = 'yes'; then DELEGATES="$DELEGATES dps"; fi
3222if test "$have_fftw" = 'yes'; then DELEGATES="$DELEGATES fftw"; fi
3223if test "$have_fpx" = 'yes'; then DELEGATES="$DELEGATES fpx"; fi
3224if test "$have_fontconfig" = 'yes'; then DELEGATES="$DELEGATES fontconfig"; fi
3225if test "$have_freetype" = 'yes'; then DELEGATES="$DELEGATES freetype"; fi
3226if test "$have_gslib" = 'yes'; then DELEGATES="$DELEGATES gs"; fi
3227if test "$have_gvc" = 'yes'; then DELEGATES="$DELEGATES gvc"; fi
3228if test "$have_jbig" = 'yes'; then DELEGATES="$DELEGATES jbig"; fi
3229if test "$have_jpeg" = 'yes'; then
3230 DELEGATES="$DELEGATES jpeg";
3231 if test "$have_png" = 'yes'; then DELEGATES="$DELEGATES jng"; fi
3232fi
3233if test "$have_jp2" = 'yes'; then DELEGATES="$DELEGATES jp2"; fi
3234if test "$have_lcms" = 'yes'; then DELEGATES="$DELEGATES lcms"; fi
3235if test "$have_lqr" = 'yes'; then DELEGATES="$DELEGATES lqr"; fi
3236if test "$have_ffmpeg" = 'yes'; then DELEGATES="$DELEGATES mpeg"; fi
3237if test "$have_openexr" = 'yes'; then DELEGATES="$DELEGATES openexr"; fi
3238if test "$have_png" = 'yes'; then DELEGATES="$DELEGATES png"; fi
3239if test "$have_rsvg" = 'yes'; then DELEGATES="$DELEGATES rsvg"; fi
3240if test "$have_tiff" = 'yes'; then DELEGATES="$DELEGATES tiff"; fi
3241if test "$have_x" = 'yes'; then DELEGATES="$DELEGATES x11"; fi
3242if test "$have_xml" = 'yes'; then DELEGATES="$DELEGATES xml"; fi
3243if test "$have_wmf" = 'yes'; then DELEGATES="$DELEGATES wmf"; fi
3244if test "$have_zlib" = 'yes'; then DELEGATES="$DELEGATES zlib"; fi
3245
3246AC_SUBST(DELEGATES)
3247
3248#
3249# Handle special compiler flags
3250#
3251
3252# Add '-p' if prof source profiling support enabled
3253if test "$enable_prof" = 'yes'; then
3254 CFLAGS="-p $CFLAGS"
3255 CXXFLAGS="-p $CXXFLAGS"
3256 LDFLAGS="-p $LDFLAGS"
3257fi
3258
3259# Add '-pg' if gprof source profiling support enabled
3260if test "$enable_gprof" = 'yes'; then
3261 CFLAGS="-pg $CFLAGS"
3262 CXXFLAGS="-pg $CXXFLAGS"
3263 LDFLAGS="-pg $LDFLAGS"
3264fi
3265
3266# Add '-ftest-coverage -fprofile-arcs' if gcov source profiling support enabled
3267# This is a gcc-specific feature
3268if test "$enable_gcov" = 'yes'; then
3269 AC_CHECK_LIB(gcov,_gcov_init)
3270 AC_CHECK_LIB(gcov,__gcov_init)
3271 case "$target_os" in
3272 darwin*)
3273 OSX_GCOV_LDFLAG="-Wl,-single_module"
3274 ;;
3275 *)
3276 OSX_GCOV_LDFLAG=""
3277 ;;
3278 esac
3279 AC_SUBST(OSX_GCOV_LDFLAG)
3280 CFLAGS="-ftest-coverage -fprofile-arcs $CFLAGS"
3281 CXXFLAGS="-ftest-coverage -fprofile-arcs $CXXFLAGS"
3282 LDFLAGS="-ftest-coverage -fprofile-arcs $LDFLAGS"
3283fi
3284
3285#
3286# Build library dependency list for libMagickCore
3287#
3288
3289MAGICK_LIBLTDL='' # Libltdl for build
3290MAGICK_API_LIBLTDL='' # libltdl for dependent application (API) build
3291MAGICK_LTDLDEPS='' # extra libltdl dependencies
3292if test "$with_ltdl" != 'no'
3293then
3294 if test \( "$with_included_ltdl" = 'no' -o "$enable_ltdl_convenience" = 'no' \) -o "$enable_ltdl_install" = 'yes'; then
3295 MAGICK_API_LIBLTDL='-lltdl'
3296 fi
3297 MAGICK_LIBLTDL=${LIBLTDL}
3298 MAGICK_LTDLDEPS=${LTDLDEPS}
3299fi
3300AC_SUBST(MAGICK_LIBLTDL)
3301AC_SUBST(MAGICK_LTDLDEPS)
3302
3303if test "$with_modules" != 'no'; then
cristy2e8b51d2009-10-17 18:26:15 +00003304 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 $BZLIB_LIBS $ZLIB_LIBS $GDI32_LIBS $MATH_LIBS $CCMALLOC_LIBS $EFENCE_LIBS $UMEM_LIBS $GOMP_LIBS $CL_LIBS $THREAD_LIBS"
cristy3ed852e2009-09-05 21:47:34 +00003305else
cristy2e8b51d2009-10-17 18:26:15 +00003306 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 $WMF_LIBS $DPS_LIBS $XEXT_LIBS $XT_LIBS $IPC_LIBS $X11_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"
cristy3ed852e2009-09-05 21:47:34 +00003307fi
3308AC_SUBST(MAGICK_DEP_LIBS)
3309
3310#
3311# Remove extraneous spaces from output variables (asthetic)
3312#
3313X_CFLAGS=`echo $X_CFLAGS | sed -e 's/ */ /g'`
3314X_PRE_LIBS=`echo $X_PRE_LIBS | sed -e 's/ */ /g'`
3315X_LIBS=`echo $X_LIBS | sed -e 's/ */ /g'`
3316X_EXTRA_LIBS=`echo $X_EXTRA_LIBS | sed -e 's/ */ /g'`
3317
3318CC=`echo $CC | sed -e 's/ */ /g'`
3319CFLAGS=`echo $CFLAGS | sed -e 's/ */ /g'`
3320CPPFLAGS=`echo $CPPFLAGS | sed -e 's/ */ /g'`
3321CXXFLAGS=`echo $CXXFLAGS | sed -e 's/ */ /g'`
3322DELEGATES=`echo $DELEGATES | sed -e 's/^ //g'`
3323DISTCHECK_CONFIG_FLAGS=`echo $DISTCHECK_CONFIG_FLAGS | sed -e 's/ */ /g'`
3324LDFLAGS=`echo $LDFLAGS | sed -e 's/ */ /g'`
3325TESTED_LIBS=`echo $LIBS | sed -e 's/ */ /g'`
3326MAGICK_DEP_LIBS=`echo $MAGICK_DEP_LIBS | sed -e 's/ */ /g'`
3327#LIBS=`echo $LIBS | sed -e 's/ */ /g'`
3328
3329# Pass only user-provided LIBS as "global" libraries
3330LIBS=$USER_LIBS
3331
3332#AC_SUBST(CPPFLAGS)
3333AC_SUBST(X_CFLAGS)
3334#AC_SUBST(LDFLAGS)
3335#AC_SUBST(X_PRE_LIBS)
3336#AC_SUBST(X_LIBS)
3337#AC_SUBST(X_EXTRA_LIBS)
3338
3339MAGICK_CFLAGS=$CFLAGS
3340MAGICK_CXXFLAGS="$CXXFLAGS"
3341MAGICK_CPPFLAGS=`echo $MAGICK_CPPFLAGS | sed -e 's/ */ /g'`
3342MAGICK_PCFLAGS=`echo $MAGICK_PCFLAGS | sed -e 's/ */ /g'`
3343MAGICK_LDFLAGS="-L$LIB_DIR $LDFLAGS"
3344MAGICK_LIBS="-lMagickCore $MAGICK_DEP_LIBS $MAGICK_API_LIBLTDL"
3345
3346AC_SUBST(MAGICK_CFLAGS)
3347AC_SUBST(MAGICK_CXXFLAGS)
3348AC_SUBST(MAGICK_CPPFLAGS)
3349AC_SUBST(MAGICK_PCFLAGS)
3350AC_SUBST(MAGICK_LDFLAGS)
3351AC_SUBST(MAGICK_LIBS)
3352
3353# Set configured scripts to executable.
3354AC_CONFIG_COMMANDS([default],[],[])
3355AC_CONFIG_COMMANDS([MagickCore-config.in],[chmod +x magick/MagickCore-config])
3356AC_CONFIG_COMMANDS([Magick-config.in],[chmod +x magick/Magick-config])
3357AC_CONFIG_COMMANDS([MagickWand-config.in],[chmod +x wand/MagickWand-config])
3358AC_CONFIG_COMMANDS([Wand-config.in],[chmod +x wand/Wand-config])
3359AC_CONFIG_COMMANDS([Magick++-config.in],[chmod +x Magick++/bin/Magick++-config])
3360AC_CONFIG_COMMANDS([PerlMagick/check.sh.in],[chmod +x PerlMagick/check.sh])
3361
3362AC_MSG_RESULT([-------------------------------------------------------------])
3363AC_MSG_RESULT([Update ImageMagick configuration])
3364AC_OUTPUT
3365
3366rm -f magick-version
3367
cristy430a7312010-01-21 20:44:04 +00003368result_dejavu_font_dir='none'
3369if test "${dejavu_font_dir}x" != 'x'; then
3370 result_dejavu_font_dir=$dejavu_font_dir
3371fi
3372
cristy3ed852e2009-09-05 21:47:34 +00003373result_ghostscript_font_dir='none'
3374if test "${ghostscript_font_dir}x" != 'x'; then
3375 result_ghostscript_font_dir=$ghostscript_font_dir
3376fi
3377
3378result_windows_font_dir='none'
3379if test "${windows_font_dir}x" != 'x'; then
3380 result_windows_font_dir=${windows_font_dir}
3381fi
3382
3383AC_MSG_RESULT([
3384ImageMagick is configured as follows. Please verify that this configuration
3385matches your expectations.
3386
3387Host system type: $host
3388Build system type: $build
3389
3390 Option Value
3391-------------------------------------------------------------------------------
3392Shared libraries --enable-shared=$enable_shared $libtool_build_shared_libs
3393Static libraries --enable-static=$enable_static $libtool_build_static_libs
3394Module support --with-modules=$with_modules $with_modules
3395GNU ld --with-gnu-ld=$with_gnu_ld $lt_cv_prog_gnu_ld
3396Quantum depth --with-quantum-depth=$with_quantum_depth $with_quantum_depth
3397High Dynamic Range Imagery
3398 --enable-hdri=$enable_hdri $enable_hdri
3399
3400Delegate Configuration:
3401BZLIB --with-bzlib=$with_bzlib $have_bzlib
3402Autotrace --with-autotrace=$with_autotrace $have_autotrace
cristy430a7312010-01-21 20:44:04 +00003403Dejavu fonts --with-dejavu-font-dir=$with_dejavu_font_dir $result_dejavu_font_dir
cristy3ed852e2009-09-05 21:47:34 +00003404DJVU --with-djvu=$with_djvu $have_djvu
3405DPS --with-dps=$with_dps $have_dps
3406FFTW --with-fftw=$with_fftw $have_fftw
3407FlashPIX --with-fpx=$with_fpx $have_fpx
3408FontConfig --with-fontconfig=$with_fontconfig $have_fontconfig
3409FreeType --with-freetype=$with_freetype $have_freetype
3410GhostPCL None $PCLDelegate ($PCLVersion)
3411GhostXPS None $XPSDelegate ($XPSVersion)
3412Ghostscript None $PSDelegate ($GSVersion)
3413Ghostscript fonts --with-gs-font-dir=$with_gs_font_dir $result_ghostscript_font_dir
3414Ghostscript lib --with-gslib=$with_gslib $have_gslib
3415Graphviz --with-gvc=$with_gvc $have_gvc
3416JBIG --with-jbig=$with_jbig $have_jbig
3417JPEG v1 --with-jpeg=$with_jpeg $have_jpeg
3418JPEG-2000 --with-jp2=$with_jp2 $have_jp2
3419LCMS --with-lcms=$with_lcms $have_lcms
3420LQR --with-lqr=$with_lqr $have_lqr
3421Magick++ --with-magick-plus-plus=$with_magick_plus_plus $have_magick_plus_plus
3422OpenEXR --with-openexr=$with_openexr $have_openexr
3423PERL --with-perl=$with_perl $have_perl
3424PNG --with-png=$with_png $have_png
3425RSVG --with-rsvg=$with_rsvg $have_rsvg
3426TIFF --with-tiff=$with_tiff $have_tiff
3427Windows fonts --with-windows-font-dir=$with_windows_font_dir $result_windows_font_dir
3428WMF --with-wmf=$with_wmf $have_wmf
3429X11 --with-x=$with_x $have_x
3430XML --with-xml=$with_xml $have_xml
3431ZLIB --with-zlib=$with_zlib $have_zlib
3432
3433X11 Configuration:
3434 X_CFLAGS = $X_CFLAGS
3435 X_PRE_LIBS = $X_PRE_LIBS
3436 X_LIBS = $X_LIBS
3437 X_EXTRA_LIBS = $X_EXTRA_LIBS
3438
3439Options used to compile and link:
3440 PREFIX = $PREFIX_DIR
3441 EXEC-PREFIX = $EXEC_PREFIX_DIR
3442 VERSION = $PACKAGE_VERSION
3443 CC = $CC
3444 CFLAGS = $CFLAGS
cristy3ed852e2009-09-05 21:47:34 +00003445 CPPFLAGS = $MAGICK_CPPFLAGS
3446 PCFLAGS = $MAGICK_PCFLAGS
3447 DEFS = $DEFS
3448 LDFLAGS = $LDFLAGS
3449 MAGICK_LDFLAGS = $MAGICK_LDFLAGS
3450 LIBS = $MAGICK_LIBS
3451 CXX = $CXX
3452 CXXFLAGS = $CXXFLAGS
3453])