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