blob: 5eb8058fbfa022c6117b1f339731d03827e11ae6 [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'
cristy6d5e20f2011-04-25 13:48:54 +0000923INT32_F='none'
cristy3ed852e2009-09-05 21:47:34 +0000924if test $ac_cv_sizeof_signed_int -eq 4; then
925 INT32_T='signed int'
cristy6d5e20f2011-04-25 13:48:54 +0000926 INT32_F='""'
cristy3ed852e2009-09-05 21:47:34 +0000927elif test $ac_cv_sizeof_signed_long -eq 4; then
928 INT32_T='signed long'
cristy6d5e20f2011-04-25 13:48:54 +0000929 INT32_F='"l"'
cristy3ed852e2009-09-05 21:47:34 +0000930fi
931AC_MSG_RESULT($INT32_T)
932AC_SUBST(INT32_T)
cristy6d5e20f2011-04-25 13:48:54 +0000933AC_SUBST(INT32_F)
cristy3ed852e2009-09-05 21:47:34 +0000934
935AC_MSG_CHECKING(for unsigned 32-bit type)
936UINT32_T='none'
cristy6d5e20f2011-04-25 13:48:54 +0000937UINT32_F='none'
cristy3ed852e2009-09-05 21:47:34 +0000938if test $ac_cv_sizeof_unsigned_int -eq 4; then
939 UINT32_T='unsigned int'
cristy6d5e20f2011-04-25 13:48:54 +0000940 UINT32_F='""'
cristy3ed852e2009-09-05 21:47:34 +0000941elif test $ac_cv_sizeof_unsigned_long -eq 4; then
942 UINT32_T='unsigned long'
cristy6d5e20f2011-04-25 13:48:54 +0000943 UINT32_F='"l"'
cristy3ed852e2009-09-05 21:47:34 +0000944fi
945AC_MSG_RESULT($UINT32_T)
946AC_SUBST(UINT32_T)
cristy6d5e20f2011-04-25 13:48:54 +0000947AC_SUBST(UINT32_F)
cristy3ed852e2009-09-05 21:47:34 +0000948
949AC_MSG_CHECKING(for signed 64-bit type)
950INT64_T='none'
cristy6d5e20f2011-04-25 13:48:54 +0000951INT64_F='none'
cristy3ed852e2009-09-05 21:47:34 +0000952if test $ac_cv_sizeof_signed_long -eq 8; then
953 INT64_T='signed long'
cristy6d5e20f2011-04-25 13:48:54 +0000954 INT64_F='"l"'
cristy3ed852e2009-09-05 21:47:34 +0000955elif test $ac_cv_sizeof_signed_long_long -eq 8; then
956 INT64_T='signed long long'
cristy6d5e20f2011-04-25 13:48:54 +0000957 INT64_F='"ll"'
cristy3ed852e2009-09-05 21:47:34 +0000958fi
cristy6d5e20f2011-04-25 13:48:54 +0000959case "${build_os}" in
960 mingw* )
961 INT64_F='"I64"'
962 ;;
963esac
cristy3ed852e2009-09-05 21:47:34 +0000964AC_MSG_RESULT($INT64_T)
965AC_SUBST(INT64_T)
cristy6d5e20f2011-04-25 13:48:54 +0000966AC_SUBST(INT64_F)
cristy3ed852e2009-09-05 21:47:34 +0000967
968AC_MSG_CHECKING(for unsigned 64-bit type)
969UINT64_T='none'
cristy6d5e20f2011-04-25 13:48:54 +0000970UINT64_F='none'
cristy3ed852e2009-09-05 21:47:34 +0000971if test $ac_cv_sizeof_unsigned_long -eq 8; then
972 UINT64_T='unsigned long'
cristy6d5e20f2011-04-25 13:48:54 +0000973 UINT64_F='"l"'
cristy3ed852e2009-09-05 21:47:34 +0000974elif test $ac_cv_sizeof_unsigned_long_long -eq 8; then
975 UINT64_T='unsigned long long'
cristy6d5e20f2011-04-25 13:48:54 +0000976 UINT64_F='"ll"'
cristy3ed852e2009-09-05 21:47:34 +0000977fi
cristy6d5e20f2011-04-25 13:48:54 +0000978case "${build_os}" in
979 mingw* )
980 UINT64_F='"I64"'
981 ;;
982esac
cristy3ed852e2009-09-05 21:47:34 +0000983AC_MSG_RESULT($UINT64_T)
984AC_SUBST(UINT64_T)
cristy6d5e20f2011-04-25 13:48:54 +0000985AC_SUBST(UINT64_F)
cristy3ed852e2009-09-05 21:47:34 +0000986
987AC_MSG_CHECKING(for unsigned maximum type)
988UINTMAX_T='none'
cristy6d5e20f2011-04-25 13:48:54 +0000989UINTMAX_F='none'
cristy3ed852e2009-09-05 21:47:34 +0000990if test "$UINT64_T" != 'none'; then
991 UINTMAX_T=$UINT64_T
cristy6d5e20f2011-04-25 13:48:54 +0000992 UINTMAX_F=$UINT64_F
cristy3ed852e2009-09-05 21:47:34 +0000993elif test "$UINT32_T" != 'none'; then
994 UINTMAX_T=$UINT32_T
cristy6d5e20f2011-04-25 13:48:54 +0000995 UINTMAX_F=$UINT32_F
cristy3ed852e2009-09-05 21:47:34 +0000996fi
997AC_MSG_RESULT($UINTMAX_T)
998AC_SUBST(UINTMAX_T)
cristy6d5e20f2011-04-25 13:48:54 +0000999AC_SUBST(UINTMAX_F)
cristy3ed852e2009-09-05 21:47:34 +00001000
1001AC_MSG_CHECKING(for pointer difference type)
1002UINTPTR_T='none'
cristy6d5e20f2011-04-25 13:48:54 +00001003UINTPTR_F='none'
cristy3ed852e2009-09-05 21:47:34 +00001004if test $ac_cv_sizeof_unsigned_long -eq $ac_cv_sizeof_unsigned_intp; then
1005 UINTPTR_T='unsigned long'
cristy6d5e20f2011-04-25 13:48:54 +00001006 UINTPTR_F='"l"'
cristy3ed852e2009-09-05 21:47:34 +00001007elif test $ac_cv_sizeof_unsigned_long_long -eq $ac_cv_sizeof_unsigned_intp; then
1008 UINTPTR_T='unsigned long long'
cristy6d5e20f2011-04-25 13:48:54 +00001009 UINTPTR_F='"ll"'
cristy3ed852e2009-09-05 21:47:34 +00001010fi
1011AC_MSG_RESULT($UINTPTR_T)
1012AC_SUBST(UINTPTR_T)
cristy6d5e20f2011-04-25 13:48:54 +00001013AC_SUBST(UINTPTR_F)
cristy3ed852e2009-09-05 21:47:34 +00001014
1015AC_MSG_CHECKING([whether our compiler supports __func__])
1016AC_TRY_COMPILE([],
1017 [{ const char *func = __func__; return(func != 0 ? 0 : 1); }],
1018 AC_MSG_RESULT([yes]),
1019 AC_MSG_RESULT([no])
1020 AC_MSG_CHECKING([whether our compiler supports __FUNCTION__])
1021 AC_TRY_COMPILE([],
1022 [{ const char *func = __FUNCTION__; return(func != 0 ? 0 : 1); }],
1023 AC_MSG_RESULT([yes])
1024 AC_DEFINE(__func__, __FUNCTION__,
1025 [Define to appropriate substitue if compiler does not have __func__]),
1026 AC_MSG_RESULT([no])
1027 AC_DEFINE(__func__, __FILE__,
1028 [Define to appropriate substitue if compiler does not have __func__])))
1029
1030########
1031#
1032# Check for functions
1033#
1034########
1035MAGICK_FUNC_MMAP_FILEIO
1036AC_FUNC_CLOSEDIR_VOID
1037AC_FUNC_MMAP
1038AC_FUNC_FORK
1039AC_FUNC_MEMCMP
1040AC_FUNC_SELECT_ARGTYPES
1041AC_FUNC_SETVBUF_REVERSED
1042AC_TYPE_SIGNAL
1043AC_FUNC_STRTOD
1044AC_FUNC_VPRINTF
1045
cristy161b9262010-03-20 19:34:32 +00001046#
1047# Find math library
1048#
1049MATH_LIBS=''
1050AC_CHECK_LIB(m,sqrt,MATH_LIBS="-lm",,)
1051LIBS="$MATH_LIBS $LIBS"
1052AC_SUBST(MATH_LIBS)
1053
cristy47b022b2011-01-18 22:29:21 +00001054AC_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 +00001055
1056#
1057# Check for clock_gettime().
1058#
1059AC_SEARCH_LIBS(clock_gettime, rt,
1060[
1061 AC_DEFINE([HAVE_CLOCK_GETTIME],[1],[Define to 1 if you have clock_gettime.])
1062 AC_MSG_CHECKING([whether clock_gettime supports CLOCK_REALTIME])
cristyda16f162011-02-19 23:52:17 +00001063 AC_COMPILE_IFELSE([
cristye43a45e2009-09-28 14:49:00 +00001064 AC_LANG_PROGRAM(
1065 [[#include <time.h>]],
cristyda16f162011-02-19 23:52:17 +00001066 [[clockid_t clockType = CLOCK_REALTIME;]])],
cristye43a45e2009-09-28 14:49:00 +00001067 [
1068 AC_MSG_RESULT(yes)
1069 AC_DEFINE([HAVE_CLOCK_REALTIME],[1],
1070 [Define to 1 if clock_gettime supports CLOCK_REALTIME.])
1071 ],
1072 AC_MSG_RESULT(no)
1073 )
1074 ],
1075 [
1076 AC_CHECK_FUNCS([gettimeofday ftime], [break])
1077 ]
1078)
cristy3ed852e2009-09-05 21:47:34 +00001079
1080########
1081#
1082# Check for function prototypes
1083#
1084########
1085
1086AC_CHECK_DECLS([pread, pwrite],[],[],[
1087#include <unistd.h>])
1088
1089AC_CHECK_DECLS([strlcpy],[],[],[
1090#include <strings.h>])
1091
1092AC_CHECK_DECLS([vsnprintf],[],[],[
1093#include <stdio.h>
1094#include <stdarg.h>])
1095
1096########
1097#
1098# C++ Support Tests (For Magick++)
1099#
1100########
1101have_magick_plus_plus='no'
1102if test "$with_magick_plus_plus" = 'yes'; then
1103 OLIBS="$LIBS"
1104 LIBS=''
1105 AC_LANG_PUSH(C++)
1106
1107 # Full set of headers used...
1108 # algorithm cctype cerrno cmath cstdio cstdlib cstring ctime exception
1109 # functional iomanip iosfwd iostream iterator list string strstream utility
1110 AC_LANG([C++])
1111 AC_PROG_CXX
cristy964cb7f2010-04-25 23:18:00 +00001112 AX_CXX_BOOL
1113 AX_CXX_NAMESPACES
1114 AX_CXX_NAMESPACE_STD
cristy3ed852e2009-09-05 21:47:34 +00001115 AC_CXX_HAVE_STD_LIBS
cristy3ed852e2009-09-05 21:47:34 +00001116 AC_OPENMP([C++])
1117 AC_LANG_POP
1118
1119 AC_MSG_CHECKING([whether C++ compiler is sufficient for Magick++])
1120 if \
cristy964cb7f2010-04-25 23:18:00 +00001121 test $ax_cv_cxx_bool = 'yes' && \
cristy964cb7f2010-04-25 23:18:00 +00001122 test $ax_cv_cxx_namespaces = 'yes' && \
cristy3ed852e2009-09-05 21:47:34 +00001123 test $ac_cv_cxx_have_std_libs = 'yes' && \
cristy964cb7f2010-04-25 23:18:00 +00001124 test $ax_cv_cxx_have_std_namespace = 'yes'; then
cristy3ed852e2009-09-05 21:47:34 +00001125 have_magick_plus_plus='yes'
1126 else
1127 have_magick_plus_plus='no (failed tests)'
1128 fi
1129 AC_MSG_RESULT([$have_magick_plus_plus])
1130 LIBS="$OLIBS"
1131fi
1132AM_CONDITIONAL(WITH_MAGICK_PLUS_PLUS, test "$have_magick_plus_plus" = 'yes')
1133
1134# Only check for delegate libraries in subdirectories if requested.
1135if test "$enable_delegate_build" != 'no'; then
1136 # Check for delegate sub-directories and add -I & -L options as required.
1137 # This presumes that delegates are installed as detailed in the ImageMagick
1138 # README. If delegates are installed in a standard location where the
1139 # compiler will automatically find them then these options should not be
1140 # required.
1141
1142 #
1143 # Most delegates have includes in the same directory as the library, but not all...
1144 #
1145 # Includes
cristyfbb0ef02010-12-19 02:32:11 +00001146 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 +00001147 if test -d "$builddir/$dir"; then
1148 CPPFLAGS="$CPPFLAGS -I$builddir/$dir"
1149 else
1150 if test -d "$srcdirfull/$dir"; then
1151 CPPFLAGS="$CPPFLAGS -I$srcdirfull/$dir"
1152 fi
1153 fi
1154 done
1155
1156 # Libraries
cristyfbb0ef02010-12-19 02:32:11 +00001157 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 +00001158 if test -d "$builddir/$dir/.libs"; then
1159 LDFLAGS="$LDFLAGS -L$builddir/$dir/.libs"
1160 else
1161 if test -d "$srcdirfull/$dir/.libs"; then
1162 LDFLAGS="$LDFLAGS -L$srcdirfull/$dir/.libs"
1163 fi
1164 fi
1165 if test -d "$builddir/$dir"; then
1166 LDFLAGS="$LDFLAGS -L$builddir/$dir"
1167 else
1168 if test -d "$srcdirfull/$dir"; then
1169 LDFLAGS="$LDFLAGS -L$srcdirfull/$dir"
1170 fi
1171 fi
1172 done
1173fi
1174
1175# Assume that delegate headers reside under same directory as ImageMagick
1176# installation prefix.
1177MAGICK_CPPFLAGS="-I$INCLUDE_DIR/ImageMagick $MAGICK_CPPFLAGS"
1178
1179#
1180# Find the X11 RGB database
1181#
1182AC_CACHE_CHECK(for X11 configure files,im_cv_x_configure,
1183[# Look for the header file in a standard set of common directories.
1184# Check X11 before X11Rn because it is often a symlink to the current release.
1185 for ac_dir in \
1186 /lib/usr/lib/X11 \
1187 /usr/X11/lib \
1188 /usr/X11R4/lib \
1189 /usr/X11R5/lib \
1190 /usr/X11R6/lib \
1191 /usr/X11R7/lib \
1192 /usr/X386/lib \
1193 /usr/XFree86/lib/X11 \
1194 /usr/athena/lib \
1195 /usr/lib \
1196 /usr/lib/X11 \
1197 /usr/lib/X11R4 \
1198 /usr/lib/X11R5 \
1199 /usr/lib/X11R6 \
1200 /usr/lib/X11R7 \
1201 /usr/local/X11/lib \
1202 /usr/local/X11R4/lib \
1203 /usr/local/X11R5/lib \
1204 /usr/local/X11R6/lib \
1205 /usr/local/lib \
1206 /usr/local/lib/X11 \
1207 /usr/local/lib/X11R4 \
1208 /usr/local/lib/X11R5 \
1209 /usr/local/lib/X11R6 \
1210 /usr/local/lib/X11R7 \
1211 /usr/local/x11r5/lib \
1212 /usr/lpp/Xamples/lib \
1213 /usr/openwin/lib \
1214 /usr/openwin/share/lib \
1215 /usr/unsupported/lib \
1216 /usr/x386/lib \
1217 ; do
1218 if test -f "$ac_dir/X11/rgb.txt"; then
1219 im_cv_x_configure="$ac_dir/X11/"
1220 break
1221 elif test -f "$ac_dir/rgb.txt"; then
1222 im_cv_x_configure="$ac_dir/"
1223 break
1224 fi
1225
1226 done])
1227X11_CONFIGURE_PATH="$im_cv_x_configure"
1228case "${build_os}" in
1229 mingw* )
1230 X11ConfigurePath=`$WinPathScript "$X11ConfigurePath=" 1`
1231 ;;
1232esac
1233AC_DEFINE_UNQUOTED(X11_CONFIGURE_PATH,"$X11ConfigurePath",Location of X11 configure files)
1234
1235#
1236# Find OpenMP library
1237#
1238GOMP_LIBS=''
1239if test "$enable_openmp" != 'no'; then
1240 if test "${GCC}" = "yes"; then
1241 AC_CHECK_LIB(gomp,GOMP_parallel_start,GOMP_LIBS="-lgomp",,) # gcc
1242 else
1243 AC_CHECK_LIB(mtsk,sunw_mp_register_warn,GOMP_LIBS="-lmtsk",,) # solaris cc
1244 AC_CHECK_LIB(xlsmp,_xlsmpFlush,GOMP_LIBS="-lxlsmp",,) # AIX xlc
1245 AC_CHECK_LIB(mp,mp_destroy,GOMP_LIBS="-lmp",,) # SGI IRIX 6.5 MIPSpro C/C++
1246 fi
1247 LIBS="$GOMP_LIBS $LIBS"
1248fi
1249AC_SUBST(GOMP_LIBS)
1250
1251#
1252# Find Posix threads library
1253#
1254THREAD_LIBS=''
1255if test "$with_threads" != 'no' && test "$have_threads" = 'yes'; then
1256
1257 if test "x$PTHREAD_LIBS" = "x"; then
1258 case "${host_cpu}-${host_os}" in
1259 *-freebsd*)
1260 MAGICK_CHECK_PTHREAD_LIB(c_r,PTHREAD_LIBS=-lc_r) ;;
1261 esac
1262 fi
1263
1264 for lib in pthread pthreads; do
1265 if test "x$PTHREAD_LIBS" = "x"; then
1266 MAGICK_CHECK_PTHREAD_LIB([$lib],[PTHREAD_LIBS=-l$lib])
1267 fi
1268 done
1269
1270 THREAD_LIBS="$PTHREAD_LIBS"
1271 LIBS="$LIBS $THREAD_LIBS"
1272fi
1273AC_SUBST(THREAD_LIBS)
1274
1275#
1276# Check for umem.
1277#
1278have_umem='no'
1279UMEM_LIBS=''
1280if test "$with_umem" != 'no'; then
1281 AC_MSG_CHECKING(for UMEM support )
1282 AC_MSG_RESULT()
1283 failed=0
1284 passed=0
1285 AC_CHECK_HEADER(umem.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1286 AC_CHECK_LIB(umem,umem_alloc,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1287 AC_CHECK_LIB(umem,umem_free,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1288 AC_MSG_CHECKING(if umem memory allocation library is complete)
1289 if test $passed -gt 0; then
1290 if test $failed -gt 0; then
1291 AC_MSG_RESULT(no -- some components failed test)
1292 have_umem='no (failed tests)'
1293 else
1294 UMEM_LIBS='-lumem'
1295 LIBS="$UMEM_LIBS $LIBS"
1296 AC_DEFINE(HasUMEM,1,Define if you have umem memory allocation library)
1297 AC_MSG_RESULT(yes)
1298 have_umem='yes'
1299 fi
1300 else
1301 AC_MSG_RESULT(no)
1302 fi
1303fi
1304AM_CONDITIONAL(HasUMEM, test "$have_umem" = 'yes')
1305AC_SUBST(UMEM_LIBS)
1306
1307#
1308# Add support for ccmalloc memory debugging library if requested
1309#
1310have_ccmalloc='no'
1311CCMALLOC_LIBS=''
1312if test "$enable_ccmalloc" = 'yes'; then
1313 AC_PATH_PROG(CCMALLOCDelegate,ccmalloc,)
1314 if test -n "$CCMALLOCDelegate"; then
1315 eval `grep PREFIX= $CCMALLOCDelegate | sed -e 's/PREFIX/CCMALLOC_PREFIX/'`
1316 OLIBS="$LIBS"
1317 # Assume that gcc is used with ccmalloc.
1318 LIBS="$LIBS $CCMALLOC_PREFIX/lib/ccmalloc-gcc.o"
1319 AC_CHECK_LIB(ccmalloc,ccmalloc_malloc,CCMALLOC_LIBS="$CCMALLOC_PREFIX/lib/ccmalloc-gcc.o -lccmalloc -ldl",,-ldl)
1320 if test -n "$CCMALLOC_LIBS"; then
1321 LIBS="$OLIBS"
1322 LIBS="$LIBS $CCMALLOC_LIBS"
1323 have_ccmalloc='yes'
1324 else
1325 LIBS="$OLIBS"
1326 fi
1327 fi
1328fi
1329
1330#
1331# Add support for efence memory debugging library if requested
1332#
1333if test "$enable_efence" = 'yes'; then
1334 EFENCE_LIBS='-lefence'
1335 LIBS="$EFENCE_LIBS $LIBS"
1336fi
1337
cristy3ed852e2009-09-05 21:47:34 +00001338dnl ===========================================================================
1339
1340#
1341# Check for BZLIB
1342#
1343
1344AC_ARG_WITH([bzlib],
1345 [AC_HELP_STRING([--without-bzlib],
1346 [disable BZLIB support])],
1347 [with_bzlib=$withval],
1348 [with_bzlib='yes'])
1349
1350if test "$with_bzlib" != 'yes'; then
1351 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-bzlib=$with_bzlib "
1352fi
1353
1354have_bzlib='no'
1355if test "$with_bzlib" != 'no'; then
1356 BZLIB_LIBS=''
1357 AC_MSG_RESULT([-------------------------------------------------------------])
1358 AC_MSG_CHECKING([for BZLIB])
1359 AC_MSG_RESULT([])
1360 failed=0
1361 passed=0
1362 found_libbz=0
1363 AC_CHECK_HEADER(bzlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1364 AC_CHECK_LIB(bz2,BZ2_bzDecompress,found_libbz=`expr $found_libbz + 1`,,)
1365 if test "$native_win32_build" = 'yes'; then
1366 AC_CHECK_LIB(bz2,_imp__BZ2_decompress,found_libbz=`expr $found_libbz + 1`,,)
1367 fi
1368 if test $found_libbz -gt 0; then
1369 passed=`expr $passed + 1`
1370 else
1371 failed=`expr $failed + 1`
1372 fi
1373 AC_MSG_CHECKING(if BZLIB package is complete)
1374 if test $passed -gt 0; then
1375 if test $failed -gt 0; then
1376 AC_MSG_RESULT(no -- some components failed test)
1377 have_bzlib='no (failed tests)'
1378 else
1379 BZLIB_LIBS='-lbz2'
1380 LIBS="$BZLIB_LIBS $LIBS"
1381 AC_DEFINE(BZLIB_DELEGATE,1,Define if you have the bzip2 library)
1382 AC_MSG_RESULT(yes)
1383 have_bzlib='yes'
1384 fi
1385 else
1386 AC_MSG_RESULT(no)
1387 fi
1388fi
1389AM_CONDITIONAL(BZLIB_DELEGATE, test "$have_bzlib" = 'yes')
1390AC_SUBST(BZLIB_LIBS)
1391
1392#
1393# Find the X11 include and library directories.
1394#
1395IPC_LIBS=''
1396X11_LIBS=''
1397XEXT_LIBS=''
1398XT_LIBS=''
1399AC_PATH_XTRA
1400if test "$no_x" != 'yes'; then
1401 AC_MSG_RESULT([-------------------------------------------------------------])
1402 AC_MSG_CHECKING([for X11])
1403 AC_MSG_RESULT([])
1404 LDFLAGS="$LDFLAGS $X_LIBS"
1405 X11_LIBS="$X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
1406 LIBS="$X11_LIBS $LIBS"
1407 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1408
1409 AC_DEFINE(X11_DELEGATE,1,Define if you have X11 library)dnl
1410
1411 #
1412 # Check for X11 shared memory extension
1413 #
1414 # shmctl is required to support the shared memory extension
1415 AC_CHECK_FUNC([shmctl],[have_shmctl='yes'],[])
1416 if test "$have_shmctl" != 'yes'; then
1417 PERSIST_LIBS=$LIBS
1418 LIBS="$LIBS -lcygipc"
1419 AC_TRY_LINK_FUNC([shmctl],[have_shmctl='yes'; IPC_LIBS='-lcygipc'],[])
1420 LIBS=$PERSIST_LIBS
1421 fi
1422
1423 if test "$have_shmctl" = 'yes'; then
1424 AC_CHECK_LIB([Xext],[XShmAttach],[XEXT_LIBS='-lXext' ; AC_DEFINE(HAVE_SHARED_MEMORY,1,X11 server supports shared memory extension)],[],[])
1425 fi
1426
1427 #
1428 # Check for X11 shape extension
1429 #
1430 AC_CHECK_LIB([Xext],[XShapeCombineMask],[XEXT_LIBS='-lXext' ; AC_DEFINE(HAVE_SHAPE,1,X11 server supports shape extension)],[],[])
1431 AC_CHECK_LIB(Xt,XtSetEventDispatcher,XT_LIBS='-lXt',,)
1432 LIBS="$XEXT_LIBS $XT_LIBS $LIBS"
1433fi
1434if test "$no_x" != 'yes'; then
1435 have_x='yes'
1436else
1437 have_x='no'
1438fi
1439AM_CONDITIONAL(X11_DELEGATE, test "$have_x" = 'yes')
1440AC_SUBST(X11_LIBS)
1441AC_SUBST(XEXT_LIBS)
1442
1443dnl ===========================================================================
1444
1445#
1446# Check for ZLIB
1447#
1448AC_ARG_WITH([zlib],
1449 [AC_HELP_STRING([--without-zlib],
1450 [disable ZLIB support])],
1451 [with_zlib=$withval],
1452 [with_zlib='yes'])
1453
1454if test "$with_zlib" != 'yes'; then
1455 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-zlib=$with_zlib "
1456fi
1457
1458have_zlib='no'
1459ZLIB_LIBS=''
1460dnl PNG requires zlib so enable zlib check if PNG is requested
1461if test "$with_zlib" != 'no' || test "$with_png" != 'no'; then
1462 AC_MSG_RESULT([-------------------------------------------------------------])
1463 AC_MSG_CHECKING([for ZLIB])
1464 AC_MSG_RESULT([])
1465 ZLIB_LIBS=''
1466 failed=0
1467 passed=0
1468 AC_CHECK_HEADER(zconf.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1469 AC_CHECK_HEADER(zlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1470 AC_CHECK_LIB(z,compress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1471 AC_CHECK_LIB(z,uncompress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1472 AC_CHECK_LIB(z,deflate,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1473 AC_CHECK_LIB(z,inflate,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1474 AC_CHECK_LIB(z,gzseek,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1475 AC_CHECK_LIB(z,gztell,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1476 AC_MSG_CHECKING([if ZLIB package is complete])
1477 if test $passed -gt 0; then
1478 if test $failed -gt 0; then
1479 AC_MSG_RESULT([no -- some components failed test])
1480 have_zlib='no (failed tests)'
1481 else
1482 ZLIB_LIBS='-lz'
1483 LIBS="$ZLIB_LIBS $LIBS"
1484 AC_DEFINE(ZLIB_DELEGATE,1,Define if you have zlib compression library)
1485 AC_MSG_RESULT([yes])
1486 have_zlib='yes'
1487 fi
1488 else
1489 AC_MSG_RESULT([no])
1490 fi
1491fi
1492AM_CONDITIONAL(ZLIB_DELEGATE, test "$have_zlib" = 'yes')
1493AC_SUBST(ZLIB_LIBS)
1494
1495#
1496# If profiling, then check for -ldl and dlopen (required for Solaris & gcc)
1497#
1498LIB_DL=''
1499if test "$enable_profiling" = 'yes'; then
1500 AC_CHECK_LIB(dl,dlopen,LIB_DL='-ldl',,)
1501 LIBS="$LIB_DL $LIBS"
1502fi
1503AC_SUBST(LIB_DL)
1504
1505dnl ===========================================================================
1506
1507#
1508# Check for Autotrace delegate library.
1509#
1510AC_ARG_WITH([autotrace],
1511 [AC_HELP_STRING([--with-autotrace],
1512 [enable autotrace support])],
1513 [with_autotrace=$withval],
1514 [with_autotrace='no'])
1515
1516if test "$with_autotrace" != 'yes'; then
1517 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-autotrace=$with_autotrace "
1518fi
1519
1520have_autotrace='no'
1521AUTOTRACE_CFLAGS=""
1522AUTOTRACE_LIBS=""
1523AUTOTRACE_PKG=""
1524if test "x$with_autotrace" = "xyes"; then
1525 AC_MSG_RESULT([-------------------------------------------------------------])
1526 PKG_CHECK_MODULES(AUTOTRACE,[autotrace >= 0.31.1], have_autotrace=yes, have_autotrace=no)
1527 AC_MSG_RESULT([])
1528fi
1529
1530if test "$have_autotrace" = 'yes'; then
1531 failed=0
1532 AC_DEFINE(AUTOTRACE_DELEGATE,1,Define if you have AUTOTRACE library)
1533 if test "$with_modules" = 'no'; then
1534 CPPFLAGS="$AUTOTRACE_CFLAGS $CPPFLAGS"
1535 fi
1536fi
1537
1538AM_CONDITIONAL(AUTOTRACE_DELEGATE,test "$have_autotrace" = 'yes')
1539AC_SUBST(AUTOTRACE_CFLAGS)
1540AC_SUBST(AUTOTRACE_LIBS)
1541
1542dnl ===========================================================================
1543
1544#
1545# Check for Display Postscript delegate library.
1546#
1547AC_ARG_WITH([dps],
1548 [AC_HELP_STRING([--without-dps],
1549 [disable Display Postscript support])],
1550 [with_dps=$withval],
1551 [with_dps='yes'])
1552
1553if test "$with_dps" != 'yes'; then
1554 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-dps=$with_dps "
1555fi
1556
1557have_dps='no'
1558DPS_LIBS=''
1559if test "$with_dps" != 'no' && test "$with_x" != 'no'; then
1560 AC_MSG_RESULT([-------------------------------------------------------------])
1561 AC_MSG_CHECKING([for DPS])
1562 AC_MSG_RESULT([])
1563 failed=0
1564 passed=0
1565 PERSIST_CPPFLAGS="$CPPFLAGS"
1566 CPPFLAGS="$CPPFLAGS -I${ac_x_includes}/X11"
1567 AC_CHECK_HEADER(DPS/dpsXclient.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1568 # DPS issues:
1569 # XFree86-4.x needs -lXt to provide XtMalloc for -ldps.
1570 # Cygwin doesn't deliver -lXt as a DLL, which prevents a DLL build.
1571 # Adobe DPS (as delivered on Solaris) doesn't require -lXt.
1572 # ImageMagick itself doesn't use -lXt.
1573 have_libdps='no'
1574 LIBDPS_XT=''
1575 AC_CHECK_LIB(dps,DPSInitialize,have_libdps='yes',have_libdps='no',)
1576 if test "$have_libdps" != 'yes'; then
1577 # Unset cache variable so we can try again.
1578 unset ac_cv_lib_dps_DPSInitialize
1579 AC_CHECK_LIB(dps,DPSInitialize,have_libdps='yes',have_libdps='no',-lXt)
1580 if test "$have_libdps" = 'yes'; then
1581 LIBDPS_XT='-lXt'
1582 fi
1583 fi
1584 if test "$have_libdps" = 'yes'; then
1585 passed=`expr $passed + 1`
1586 else
1587 failed=`expr $failed + 1`
1588 fi
1589 AC_CHECK_LIB(dpstk,XDPSPixelsPerPoint,passed=`expr $passed + 1`,failed=`expr $failed + 1`,-ldps $LIBDPS_XT)
1590 AC_MSG_CHECKING([if DPS package is complete])
1591 if test $passed -gt 0; then
1592 if test $failed -gt 0; then
1593 AC_MSG_RESULT([no -- some components failed test])
1594 have_dps='no (failed tests)'
1595 CPPFLAGS="$PERSIST_CPPFLAGS"
1596 else
1597 DPS_LIBS="-ldpstk -ldps ${LIBDPS_XT}"
1598 LIBS="$DPS_LIBS $LIBS"
1599 AC_DEFINE(DPS_DELEGATE,1,Define if you have Display Postscript)
1600 AC_MSG_RESULT([yes])
1601 have_dps='yes'
1602 fi
1603 else
1604 AC_MSG_RESULT([no])
1605 CPPFLAGS=$PERSIST_CPPFLAGS
1606 fi
1607fi
1608AM_CONDITIONAL(DPS_DELEGATE, test "$have_dps" = 'yes')
1609AC_SUBST(DPS_LIBS)
1610
1611dnl ===========================================================================
1612
1613#
1614# Check for DJVU delegate library.
1615#
1616AC_ARG_WITH([djvu],
1617 [AC_HELP_STRING([--without-djvu],
1618 [disable DjVu support])],
1619 [with_djvu=$withval],
1620 [with_djvu='yes'])
1621
1622if test "$with_djvu" != 'yes'; then
1623 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-djvu=$with_djvu "
1624fi
1625
1626have_djvu='no'
1627DJVU_LIBS=''
1628if test "$with_djvu" != 'no'; then
1629 AC_MSG_RESULT([-------------------------------------------------------------])
1630 AC_MSG_CHECKING([for DJVU])
1631 AC_MSG_RESULT([])
1632 failed=0
1633 passed=0
1634 AC_CHECK_HEADER(libdjvu/ddjvuapi.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1635 AC_CHECK_LIB(djvulibre,ddjvu_context_create,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1636 AC_MSG_CHECKING([if DJVU package is complete])
1637 if test $passed -gt 0; then
1638 if test $failed -gt 0; then
1639 AC_MSG_RESULT([no -- some components failed test])
1640 have_djvu='no (failed tests)'
1641 else
1642 DJVU_LIBS='-ldjvulibre'
1643 LIBS="$DJVU_LIBS $LIBS"
1644 AC_DEFINE(DJVU_DELEGATE,1,Define if you have DJVU library)
1645 AC_MSG_RESULT([yes])
1646 have_djvu='yes'
1647 fi
1648 else
1649 AC_MSG_RESULT([no])
1650 fi
1651fi
1652AM_CONDITIONAL(DJVU_DELEGATE, test "$have_djvu" = 'yes')
1653AC_SUBST(DJVU_LIBS)
1654
1655dnl ===========================================================================
1656
1657#
cristy430a7312010-01-21 20:44:04 +00001658# Set DejaVu font directory.
1659#
1660AC_ARG_WITH([dejavu-font-dir],
1661 [AC_HELP_STRING([--with-dejavu-font-dir=DIR],
1662 [DejaVu font directory])],
1663 [with_dejavu_font_dir=$withval],
1664 [with_dejavu_font_dir='default'])
1665
1666if test "$with_dejavu_font_dir" != 'default'; then
1667 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-dejavu-font-dir=$with_dejavu_font_dir "
1668fi
1669
1670dnl ===========================================================================
1671
1672#
cristy3ed852e2009-09-05 21:47:34 +00001673# Check for FFTW delegate library.
1674#
1675AC_ARG_WITH([fftw],
1676 [AC_HELP_STRING([--without-fftw],
1677 [disable FFTW support])],
1678 [with_fftw=$withval],
1679 [with_fftw='yes'])
1680
1681if test "$with_fftw" != 'yes'; then
1682 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fftw=$with_fftw "
1683fi
1684
1685have_fftw='no'
1686FFTW_LIBS=''
1687if test "$with_fftw" != 'no'; then
1688 AC_MSG_RESULT([-------------------------------------------------------------])
1689 AC_MSG_CHECKING([for FFTW])
1690 AC_MSG_RESULT([])
1691 failed=0
1692 passed=0
1693 AC_CHECK_HEADER(fftw3.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1694 AC_CHECK_LIB(fftw3,fftw_execute,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1695 AC_MSG_CHECKING([if FFTW package is complete])
1696 if test $passed -gt 0; then
1697 if test $failed -gt 0; then
1698 AC_MSG_RESULT([no -- some components failed test])
1699 have_fftw='no (failed tests)'
1700 else
1701 FFTW_LIBS='-lfftw3'
1702 LIBS="$FFTW_LIBS $LIBS"
1703 AC_DEFINE(FFTW_DELEGATE,1,Define if you have FFTW library)
1704 AC_MSG_RESULT([yes])
1705 have_fftw='yes'
1706 fi
1707 else
1708 AC_MSG_RESULT([no])
1709 fi
1710fi
1711AM_CONDITIONAL(FFTW_DELEGATE, test "$have_fftw" = 'yes')
1712AC_SUBST(FFTW_LIBS)
1713
1714dnl ===========================================================================
1715
1716#
1717# Check for FlashPIX delegate library.
1718#
1719AC_ARG_WITH([fpx],
1720 [AC_HELP_STRING([--without-fpx],
1721 [disable FlashPIX support])],
1722 [with_fpx=$withval],
1723 [with_fpx='yes'])
1724
1725if test "$with_fpx" != 'yes'; then
1726 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fpx=$with_fpx "
1727fi
1728
1729have_fpx='no'
1730FPX_LIBS=''
1731if test "$with_fpx" != 'no'; then
1732 AC_MSG_RESULT([-------------------------------------------------------------])
1733 AC_MSG_CHECKING([for FlashPIX])
1734 AC_MSG_RESULT([])
1735 failed=0
1736 passed=0
1737 AC_LANG_PUSH(C++)
1738 AC_CHECK_HEADER(fpxlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1739 AC_CHECK_LIB(fpx,FPX_OpenImageByFilename,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1740 AC_LANG_POP
1741 AC_MSG_CHECKING([if FlashPIX package is complete])
1742 if test $passed -gt 0; then
1743 if test $failed -gt 0; then
1744 AC_MSG_RESULT([no -- some components failed test])
1745 have_fpx='no (failed tests)'
1746 else
1747 FPX_LIBS='-lfpx'
1748 AC_DEFINE(FPX_DELEGATE,1,Define if you have FlashPIX library)
1749 AC_MSG_RESULT([yes])
1750 have_fpx='yes'
1751 PERLMAINCC="$CXX"
1752 fi
1753 else
1754 AC_MSG_RESULT([no])
1755 fi
1756fi
1757AM_CONDITIONAL(FPX_DELEGATE, test "$have_fpx" = 'yes')
1758AC_SUBST(FPX_LIBS)
1759
1760dnl ===========================================================================
1761
1762#
1763# Check for fontconfig delegate library.
1764#
1765AC_ARG_WITH([fontconfig],
1766 [AC_HELP_STRING([--without-fontconfig],
1767 [disable fontconfig support])],
1768 [with_fontconfig=$withval],
1769 [with_fontconfig=$have_x])
1770
1771if test "$with_fontconfig" != 'yes'; then
1772 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontconfig=$with_fontconfig "
1773fi
1774
1775have_fontconfig='no'
1776FONTCONFIG_CFLAGS=""
1777FONTCONFIG_LIBS=""
1778FONTCONFIG_PKG=""
1779if test "x$with_fontconfig" = "xyes"; then
1780 AC_MSG_RESULT([-------------------------------------------------------------])
1781 PKG_CHECK_MODULES(FONTCONFIG,[fontconfig >= 2.1.0], have_fontconfig=yes, have_fontconfig=no)
1782 AC_MSG_RESULT([])
1783fi
1784
1785if test "$have_fontconfig" = 'yes'; then
cristyd09bcf92010-03-25 03:04:45 +00001786 AC_DEFINE(FONTCONFIG_DELEGATE,1,Define if you have FONTCONFIG library)
1787 if test "$with_modules" = 'no'; then
cristy3ed852e2009-09-05 21:47:34 +00001788 CPPFLAGS="$FONTCONFIG_CFLAGS $CPPFLAGS"
cristyd09bcf92010-03-25 03:04:45 +00001789 fi
cristy3ed852e2009-09-05 21:47:34 +00001790fi
1791
1792AM_CONDITIONAL(FONTCONFIG_DELEGATE,test "$have_fontconfig" = 'yes')
1793AC_SUBST(FONTCONFIG_CFLAGS)
1794AC_SUBST(FONTCONFIG_LIBS)
1795
1796dnl ===========================================================================
1797
1798#
1799# Check for freetype delegate library.
1800#
1801AC_ARG_WITH([freetype],
1802 [AC_HELP_STRING([--without-freetype],
1803 [disable Freetype support])],
1804 [with_freetype=$withval],
1805 [with_freetype='yes'])
1806
1807
1808if test "$with_freetype" != 'yes'; then
1809 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-freetype=$with_freetype "
1810fi
1811
1812have_freetype='no'
1813FREETYPE_LIBS=''
1814if test "$with_freetype" != 'no'; then
1815 AC_MSG_RESULT([-------------------------------------------------------------])
1816 AC_MSG_CHECKING([for FreeType 2.0])
1817 AC_MSG_RESULT([])
1818 failed=0
1819 passed=0
cristy66291112009-10-03 22:44:36 +00001820 PERSIST_LIBS="$LIBS"
cristy3ed852e2009-09-05 21:47:34 +00001821 PERSIST_CPPFLAGS="$CPPFLAGS"
1822 if test "$enable_delegate_build" != 'no' && test -d "$builddir/freetype/include"; then
1823 :
1824 else
1825 freetype_config=''
1826 AC_CHECK_PROGS(freetype_config,freetype-config,)dnl
1827 if test -n "$freetype_config"; then
1828 freetype_cflags=`$freetype_config --cflags`
1829 freetype_libs=`$freetype_config --libs`
cristy66291112009-10-03 22:44:36 +00001830 LIBS="$LIBS $freetype_libs"
cristy3ed852e2009-09-05 21:47:34 +00001831 CPPFLAGS="$freetype_cflags $CPPFLAGS"
1832 fi
1833 fi
1834
1835dnl First see if there is a library
1836 if test "$FREETYPE_LIBS" = ''; then
1837 AC_CHECK_LIB(freetype,FT_Init_FreeType,FREETYPE_LIBS='-lfreetype',,)
1838 if test "$FREETYPE_LIBS" != ''; then
1839 passed=`expr $passed + 1`
1840 else
1841 failed=`expr $failed + 1`
cristy66291112009-10-03 22:44:36 +00001842 LIBS="$PERSIST_LIBS"
cristy3ed852e2009-09-05 21:47:34 +00001843 fi
1844 fi
1845
1846dnl Now test for the headers
1847 AC_CHECK_HEADER([ft2build.h],[FT2BUILD_H='#include <ft2build.h>'],[ft2build=''],[])
1848 AC_CHECK_HEADER(freetype/freetype.h,[have_freetype_h='yes'],[have_freetype_h='no'],[$FT2BUILD_H])
1849 if test "$ac_cv_header_ft2build_h" = 'yes' || test "$have_freetype_h" = 'yes'; then
1850 passed=`expr $passed + 1`
1851 else
1852 failed=`expr $failed + 1`
1853 CPPFLAGS="$PERSIST_CPPFLAGS"
1854 fi
1855
1856 AC_MSG_CHECKING([if FreeType package is complete])
1857 if test $passed -gt 0; then
1858 if test $failed -gt 0; then
1859 FREETYPE_LIBS=''
1860 AC_MSG_RESULT([no -- some components failed test])
1861 have_freetype='no (failed tests)'
1862 else
1863 LIBS="$FREETYPE_LIBS $LIBS"
1864 AC_DEFINE(FREETYPE_DELEGATE,1,Define if you have FreeType (TrueType font) library)
1865 if test "$ac_cv_header_ft2build_h" = 'yes'; then
1866 AC_DEFINE([HAVE_FT2BUILD_H],[1],[Define to 1 if you have the <ft2build.h> header file.])
1867 fi
1868 AC_MSG_RESULT([yes])
1869 have_freetype='yes'
1870 fi
1871 else
1872 AC_MSG_RESULT([no])
1873 fi
1874fi
1875AM_CONDITIONAL(FREETYPE_DELEGATE,test "$have_freetype" = 'yes')
1876AC_SUBST(FREETYPE_LIBS)
1877
1878dnl ===========================================================================
1879
1880dnl ===========================================================================
1881
1882#
1883# Check for Ghostscript library or framework.
1884#
1885# Test for iapi.h & test for gsapi_new_instance in -lgs
1886# or -framework Ghostscript
1887
1888AC_ARG_WITH([gslib],
1889 [AC_HELP_STRING([--without-gslib],
1890 [enable Ghostscript library support])],
1891 [with_gslib=$withval],
1892 [with_gslib='no'])
1893
cristyb7931f12009-09-25 10:22:21 +00001894gslib_framework='no'
cristy3ed852e2009-09-05 21:47:34 +00001895if test "$with_gslib" != 'yes'; then
1896 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gslib=$with_gslib "
1897fi
1898
1899have_gslib='no'
1900GS_LIBS=''
1901if test "$with_gslib" != 'no'; then
1902 AC_MSG_RESULT([-------------------------------------------------------------])
1903 AC_MSG_CHECKING([for Ghostscript])
1904 AC_MSG_RESULT([])
cristyb7931f12009-09-25 10:22:21 +00001905 framework=0
cristy3ed852e2009-09-05 21:47:34 +00001906 failed=0
1907 passed=0
1908 AC_CHECK_HEADER(ghostscript/iapi.h,passed=`expr $passed + 1`,
1909 failed=`expr $failed + 1`,)
1910 AC_CHECK_HEADER(ghostscript/ierrors.h,passed=`expr $passed + 1`,
1911 failed=`expr $failed + 1`,)
1912 AC_CHECK_FRAMEWORK(Ghostscript,gsapi_new_instance,framework=`expr $framework + 1`,
1913 AC_CHECK_LIB(gs,gsapi_new_instance,passed=`expr $passed + 1`,failed=`expr $failed + 1`,),)
1914 AC_MSG_CHECKING([if Ghostscript package is complete])
1915 if test $passed -gt 0; then
1916 if test $failed -gt 0; then
1917 AC_MSG_RESULT([no -- some components failed test])
1918 have_gslib='no (failed tests)'
1919 else
1920 if test $framework -gt 0; then
1921 GS_LIBS='-framework Ghostscript'
cristyb7931f12009-09-25 10:22:21 +00001922 gslib_framework='yes'
cristy3ed852e2009-09-05 21:47:34 +00001923 AC_MSG_RESULT([yes, using framework.])
1924 else
1925 AC_MSG_RESULT([yes, using library.])
1926 GS_LIBS='-lgs'
1927 fi
1928 LIBS="$GS_LIBS $LIBS"
1929 AC_DEFINE(GS_DELEGATE,1,Define if you have Ghostscript library or framework)
1930 have_gslib='yes'
1931 fi
1932 else
1933 AC_MSG_RESULT([no])
1934 fi
1935fi
1936AM_CONDITIONAL(GS_DELEGATE, test "$have_gslib" = 'yes')
1937AC_SUBST(GS_LIBS)
1938
1939# Set default font search path
1940AC_ARG_WITH([fontpath],
1941 [AC_HELP_STRING([--with-fontpath=DIR],
1942 [prepend to default font search path])],
1943 [with_fontpath=$withval],
1944 [with_fontpath=''])
1945
1946if test "$with_fontpath" != "yes" && test -z "$with_fontpath"; then
1947 with_fontpath=''
1948else
1949 AC_DEFINE_UNQUOTED(MAGICK_FONT_PATH,"$with_fontpath",Define to prepend to default font search path.)
1950fi
1951if test "$with_fontpath=" != ''; then
1952 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontpath=$with_fontpath "
1953fi
1954
1955# Set Ghostscript font directory
1956AC_ARG_WITH([gs-font-dir],
1957 [AC_HELP_STRING([--with-gs-font-dir=DIR],
1958 [Ghostscript font directory])],
1959 [with_gs_font_dir=$withval],
1960 [with_gs_font_dir='default'])
1961
1962if test "$with_gs_font_dir" != 'default'; then
1963 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gs-font-dir=$with_gs_font_dir "
1964fi
1965
1966dnl ===========================================================================
1967
1968#
1969# Check for GVC delegate library.
1970#
1971AC_ARG_WITH(gvc,
1972 [AC_HELP_STRING([--without-gvc],
1973 [disable GVC support])],
1974 [with_gvc=$withval],
1975 [with_gvc='yes'])
1976
1977if test "$with_gvc" != 'yes'; then
1978 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gvc=$with_gvc "
1979fi
1980
1981GVC_PKG=""
1982if test "x$with_gvc" = "xyes"; then
1983 AC_MSG_RESULT([-------------------------------------------------------------])
1984 PKG_CHECK_MODULES(GVC,[libgvc >= 2.9.0], have_gvc=yes, have_gvc=no)
1985 AC_MSG_RESULT([])
1986fi
1987
1988if test "$have_gvc" = 'yes'; then
1989 AC_DEFINE(GVC_DELEGATE,1,Define if you have GVC library)
1990 if test "$with_modules" = 'no'; then
1991 CPPFLAGS="$GVC_CFLAGS $CPPFLAGS"
1992 fi
1993fi
1994
1995AM_CONDITIONAL(GVC_DELEGATE, test "$have_gvc" = 'yes')
1996AC_SUBST(GVC_CFLAGS)
1997AC_SUBST(GVC_LIBS)
1998
1999dnl ===========================================================================
2000
2001#
2002# Check for JBIG delegate library.
2003#
2004
2005AC_ARG_WITH([jbig],
2006 [AC_HELP_STRING([--without-jbig],
2007 [disable JBIG support])],
2008 [with_jbig=$withval],
2009 [with_jbig='yes'])
2010
2011have_jbig='no'
2012JBIG_LIBS=''
2013if test "$with_jbig" != 'no'; then
2014 AC_MSG_RESULT([-------------------------------------------------------------])
2015 AC_MSG_CHECKING([for JBIG])
2016 AC_MSG_RESULT([])
2017 failed=0
2018 passed=0
2019 AC_CHECK_HEADER(jbig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2020 AC_CHECK_LIB(jbig,jbg_dec_init,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2021 AC_MSG_CHECKING([if JBIG package is complete])
2022 if test $passed -gt 0; then
2023 if test $failed -gt 0; then
2024 AC_MSG_RESULT([no -- some components failed test])
2025 have_jbig='no (failed tests)'
2026 else
2027 JBIG_LIBS='-ljbig'
2028 LIBS="$JBIG_LIBS $LIBS"
2029 AC_DEFINE(JBIG_DELEGATE,1,Define if you have JBIG library)
2030 AC_MSG_RESULT([yes])
2031 have_jbig='yes'
2032 fi
2033 else
2034 AC_MSG_RESULT([no])
2035 fi
2036fi
2037AM_CONDITIONAL(JBIG_DELEGATE, test "$have_jbig" = 'yes')
2038AC_SUBST(JBIG_LIBS)
2039
2040dnl ===========================================================================
2041
2042#
2043# Check for JPEG delegate library.
2044#
2045AC_ARG_WITH([jpeg],
2046 [AC_HELP_STRING([--without-jpeg],
2047 [disable JPEG support])],
2048 [with_jpeg=$withval],
2049 [with_jpeg='yes'])
2050
2051if test "$with_jpeg" != 'yes'; then
2052 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jpeg=$with_jpeg "
2053fi
2054
2055have_jpeg='no'
2056JPEG_LIBS=''
2057if test "$with_jpeg" != 'no'; then
2058 AC_MSG_RESULT([-------------------------------------------------------------])
2059 AC_MSG_CHECKING([for JPEG])
2060 AC_MSG_RESULT([])
2061 failed=0
2062 passed=0
2063 AC_CHECK_HEADER(jconfig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2064 AC_CHECK_HEADER(jerror.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2065 AC_CHECK_HEADER(jmorecfg.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2066 AC_CHECK_HEADER(jpeglib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2067 AC_CHECK_LIB(jpeg,jpeg_read_header,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2068
2069# Test for compatible JPEG library
2070if test "$ac_cv_jpeg_version_ok" != 'yes'; then
2071AC_CACHE_CHECK(for JPEG library is version 6b or later, ac_cv_jpeg_version_ok,
2072[AC_TRY_COMPILE(
2073#include <stdio.h>
2074#include <stdlib.h>
2075#include <jpeglib.h>
2076,
2077changequote(<<, >>)dnl
2078<<
2079#if JPEG_LIB_VERSION < 62
2080#error IJG JPEG library must be version 6b or newer!
2081#endif
2082return 0;
2083>>,
2084changequote([, ])dnl
2085ac_cv_jpeg_version_ok='yes'; passed=`expr $passed + 1`,
2086ac_cv_jpeg_version_ok='no'; failed=`expr $failed + 1`)])
2087fi
2088 AC_MSG_CHECKING([if JPEG package is complete])
2089 if test $passed -gt 0; then
2090 if test $failed -gt 0; then
2091 AC_MSG_RESULT([no -- some components failed test])
2092 have_jpeg='no (failed tests)'
2093 else
2094 JPEG_LIBS='-ljpeg'
2095 LIBS="$JPEG_LIBS $LIBS"
2096 AC_DEFINE(JPEG_DELEGATE,1,Define if you have JPEG library)
2097 AC_MSG_RESULT([yes])
2098 have_jpeg='yes'
2099 fi
2100 else
2101 AC_MSG_RESULT([no])
2102 fi
2103fi
2104AM_CONDITIONAL(JPEG_DELEGATE, test "$have_jpeg" = 'yes')
2105AC_SUBST(JPEG_LIBS)
2106
2107dnl ===========================================================================
2108
2109#
2110# Check for JPEG Version 2 delegate library.
2111#
2112AC_ARG_WITH([jp2],
2113 [AC_HELP_STRING([--without-jp2],
2114 [disable JPEG-2000 support])],
2115 [with_jp2=$withval],
2116 [with_jp2='yes'])
2117
2118if test "$with_jp2" != 'yes'; then
2119 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jp2=$with_jp2 "
2120fi
2121
2122have_jp2='no'
2123JP2_LIBS=''
2124if test "$with_jp2" != 'no'; then
2125 AC_MSG_RESULT([-------------------------------------------------------------])
2126 AC_MSG_CHECKING([for JPEG Version 2])
2127 AC_MSG_RESULT([])
2128 failed=0
2129 passed=0
2130 AC_CHECK_HEADER(jasper/jasper.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2131 AC_CHECK_LIB(jasper,jas_stream_fopen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2132 AC_MSG_CHECKING([if JPEG version 2 support package is complete])
2133 if test $passed -gt 0; then
2134 if test $failed -gt 0; then
2135 AC_MSG_RESULT([no -- some components failed test])
2136 have_jp2='no (failed tests)'
2137 else
2138 JP2_LIBS='-ljasper'
2139 LIBS="$JP2_LIBS $LIBS"
2140 AC_DEFINE(JP2_DELEGATE,1,Define if you have JPEG version 2 "Jasper" library)
2141 AC_MSG_RESULT([yes])
2142 have_jp2='yes'
2143 fi
2144 else
2145 AC_MSG_RESULT([no])
2146 fi
2147fi
2148AM_CONDITIONAL(JP2_DELEGATE, test "$have_jp2" = 'yes')
2149AC_SUBST(JP2_LIBS)
2150
2151dnl ===========================================================================
2152
2153#
2154# Check for LCMS delegate library.
2155#
cristy71203402010-06-18 13:12:03 +00002156# Disable LCMS.
cristy3ed852e2009-09-05 21:47:34 +00002157AC_ARG_WITH(lcms,
cristy71203402010-06-18 13:12:03 +00002158 [ --without-lcms disable lcms (v1.1X) support],
2159 [with_lcms=$withval],
2160 [with_lcms='yes'])
2161if test "$with_lcms" != 'yes' ; then
cristy3ed852e2009-09-05 21:47:34 +00002162 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lcms=$with_lcms "
2163fi
2164
cristy71203402010-06-18 13:12:03 +00002165# Disable LCMS2.
2166AC_ARG_WITH(lcms2,
2167 [ --without-lcms2 disable lcms (v2.X) support],
2168 [with_lcms2=$withval],
2169 [with_lcms2='yes'])
2170if test "$with_lcms2" != 'yes' ; then
2171 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lcms2=$with_lcms2 "
2172fi
2173
2174have_lcms2='no'
cristy3ed852e2009-09-05 21:47:34 +00002175LCMS_LIBS=''
cristy71203402010-06-18 13:12:03 +00002176if test "$with_lcms2" != 'no'; then
cristy3ed852e2009-09-05 21:47:34 +00002177 AC_MSG_RESULT([-------------------------------------------------------------])
cristy71203402010-06-18 13:12:03 +00002178 AC_MSG_CHECKING([for LCMS v2])
2179 AC_MSG_RESULT()
cristy3ed852e2009-09-05 21:47:34 +00002180 failed=0
2181 passed=0
2182 have_lcms_header='no'
cristy71203402010-06-18 13:12:03 +00002183
2184 # Check for <lcms2.h>
cristyd09bcf92010-03-25 03:04:45 +00002185 AC_CHECK_HEADER(lcms2.h,have_lcms_header='yes',,)
2186 if test "$have_lcms_header" = 'yes'; then
cristy71203402010-06-18 13:12:03 +00002187 AC_DEFINE(HAVE_LCMS2_H,1,Define if you have the <lcms2.h> header file.)
2188 passed=`expr $passed + 1`
cristyd09bcf92010-03-25 03:04:45 +00002189 fi
cristy71203402010-06-18 13:12:03 +00002190
2191 # Check for <lcms2/lcms2.h)
2192 if test "$have_lcms_header" != 'yes'; then
2193 AC_CHECK_HEADER(lcms2/lcms2.h,have_lcms_header='yes',,)
2194 if test "$have_lcms_header" = 'yes'; then
2195 passed=`expr $passed + 1`
2196 AC_DEFINE(HAVE_LCMS2_LCMS2_H,1,Define if you have the <lcms2/lcms2.h> header file.)
2197 fi
2198 fi
2199
2200 # Failed to find lcms header?
2201 if test "$have_lcms_header" != 'yes'; then
2202 failed=`expr $failed + 1`
2203 fi
2204
2205 AC_CHECK_LIB(lcms2,cmsSetLogErrorHandler,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2206 AC_MSG_CHECKING(if LCMS v2 package is complete)
cristyd09bcf92010-03-25 03:04:45 +00002207 if test $passed -gt 0; then
cristy71203402010-06-18 13:12:03 +00002208 if test $failed -gt 0; then
2209 AC_MSG_RESULT(no -- some components failed test)
2210 have_lcms2='no (failed tests)'
2211 else
2212 LCMS_LIBS='-llcms2'
2213 LIBS="$LCMS_LIBS $LIBS"
2214 AC_MSG_RESULT(yes)
2215 have_lcms2='yes'
2216 fi
cristyd09bcf92010-03-25 03:04:45 +00002217 else
cristy71203402010-06-18 13:12:03 +00002218 AC_MSG_RESULT(no)
cristyd09bcf92010-03-25 03:04:45 +00002219 fi
2220fi
2221
cristy71203402010-06-18 13:12:03 +00002222#
2223# Check for LCMS v1 (1.11 or later)
2224#
2225if test $have_lcms2 = 'yes'; then
2226 with_lcms='no'
2227fi
2228
2229have_lcms='no'
cristyd09bcf92010-03-25 03:04:45 +00002230if test "$with_lcms" != 'no'; then
cristyd09bcf92010-03-25 03:04:45 +00002231 AC_MSG_RESULT([-------------------------------------------------------------])
cristy71203402010-06-18 13:12:03 +00002232 AC_MSG_CHECKING([for LCMS v1.1X])
2233 AC_MSG_RESULT()
cristyd09bcf92010-03-25 03:04:45 +00002234 failed=0
2235 passed=0
2236 have_lcms_header='no'
cristy71203402010-06-18 13:12:03 +00002237
2238 # Check for <lcms.h>
2239 if test "$have_lcms_header" != 'yes'; then
2240 AC_CHECK_HEADER(lcms.h,have_lcms_header='yes',,)
2241 if test "$have_lcms_header" = 'yes'; then
cristy3ed852e2009-09-05 21:47:34 +00002242 passed=`expr $passed + 1`
2243 AC_DEFINE(HAVE_LCMS_H,1,Define if you have the <lcms.h> header file.)
cristy71203402010-06-18 13:12:03 +00002244 fi
cristy3ed852e2009-09-05 21:47:34 +00002245 fi
cristy71203402010-06-18 13:12:03 +00002246
2247 # Check for <lcms/lcms.h>
2248 if test "$have_lcms_header" != 'yes'; then
2249 AC_CHECK_HEADER(lcms/lcms.h,have_lcms_header='yes',,)
2250 if test "$have_lcms_header" = 'yes'; then
2251 passed=`expr $passed + 1`
2252 AC_DEFINE(HAVE_LCMS_LCMS_H,1,Define if you have the <lcms/lcms.h> header file.)
2253 fi
2254 fi
2255
2256 # Failed to find lcms header?
2257 if test "$have_lcms_header" != 'yes'; then
2258 failed=`expr $failed + 1`
2259 fi
2260
2261 AC_CHECK_LIB(lcms,cmsSetErrorHandler,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2262 AC_MSG_CHECKING(if LCMS package is complete)
cristy3ed852e2009-09-05 21:47:34 +00002263 if test $passed -gt 0; then
cristy71203402010-06-18 13:12:03 +00002264 if test $failed -gt 0; then
2265 AC_MSG_RESULT(no -- some components failed test)
2266 have_lcms='no (failed tests)'
2267 else
2268 LCMS_LIBS='-llcms'
2269 LIBS="$LCMS_LIBS $LIBS"
2270 AC_MSG_RESULT(yes)
2271 have_lcms='yes'
2272 fi
cristy3ed852e2009-09-05 21:47:34 +00002273 else
cristy71203402010-06-18 13:12:03 +00002274 AC_MSG_RESULT(no)
cristy3ed852e2009-09-05 21:47:34 +00002275 fi
2276fi
cristy71203402010-06-18 13:12:03 +00002277
2278AM_CONDITIONAL(LCMS_DELEGATE, test "$have_lcms2" = 'yes' -o "$have_lcms" = 'yes')
2279if test "$have_lcms2" = 'yes' -o "$have_lcms" = 'yes'; then
2280 AC_DEFINE(LCMS_DELEGATE,1,[Define if you have LCMS (v1.11 or later) library])
cristyd09bcf92010-03-25 03:04:45 +00002281fi
cristy3ed852e2009-09-05 21:47:34 +00002282AC_SUBST(LCMS_LIBS)
2283
cristy71203402010-06-18 13:12:03 +00002284
cristy3ed852e2009-09-05 21:47:34 +00002285dnl ===========================================================================
2286
2287#
2288# Check for the LQR (Liquid Rescale) delegate library.
2289#
2290AC_ARG_WITH([lqr],
2291 [AC_HELP_STRING([--without-lqr],
cristyec501352010-03-13 18:43:34 +00002292 [disable Liquid Rescale support])],
cristy3ed852e2009-09-05 21:47:34 +00002293 [with_lqr=$withval],
2294 [with_lqr='yes'])
2295
2296if test "$with_lqr" != 'yes'; then
2297 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lqr=$with_lqr "
2298fi
2299
2300have_lqr='no'
2301LQR_CFLAGS=""
2302LQR_LIBS=""
2303LQR_PKG=""
2304if test "x$with_lqr" = "xyes"; then
2305 AC_MSG_RESULT([-------------------------------------------------------------])
2306 PKG_CHECK_MODULES(LQR,[lqr-1 >= 0.1.0], have_lqr=yes, have_lqr=no)
2307 AC_MSG_RESULT([])
2308fi
2309
2310if test "$have_lqr" = 'yes'; then
2311 AC_DEFINE(LQR_DELEGATE,1,Define if you have LQR library)
2312 CFLAGS="$LQR_CFLAGS $CFLAGS"
2313fi
2314
2315AM_CONDITIONAL(LQR_DELEGATE, test "$have_lqr" = 'yes')
2316AC_SUBST(LQR_CFLAGS)
2317AC_SUBST(LQR_LIBS)
2318
2319dnl ===========================================================================
2320
cristyfbb0ef02010-12-19 02:32:11 +00002321# Disable LZMA (lzma library)
2322AC_ARG_WITH(lzma,
2323 [ --without-lzma disable LZMA support],
2324 [with_lzma=$withval],
2325 [with_lzma='yes'])
2326if test "$with_lzma" != 'yes' ; then
2327 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lzma=$with_lzma "
2328fi
2329
2330#
2331# Check for LZMA
2332#
2333have_lzma='no'
2334LZMA_LIBS=''
2335if test "$with_lzma" != 'no' || test "$with_tiff" != 'no'; then
2336 AC_MSG_RESULT([-------------------------------------------------------------])
2337 AC_MSG_CHECKING(for LZMA)
2338 AC_MSG_RESULT()
2339 failed=0
2340 passed=0
2341 AC_CHECK_HEADER(lzma.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2342 AC_CHECK_LIB(lzma,lzma_code,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2343 AC_MSG_CHECKING(if LZMA package is complete)
2344 if test $passed -gt 0; then
2345 if test $failed -gt 0; then
2346 AC_MSG_RESULT(no -- some components failed test)
2347 have_lzma='no (failed tests)'
2348 else
2349 LZMA_LIBS='-llzma'
2350 LIBS="$LZMA_LIBS $LIBS"
2351 AC_DEFINE(LZMA_DELEGATE,1,Define if you have lzma compression library)
2352 AC_MSG_RESULT(yes)
2353 have_lzma='yes'
2354 fi
2355 else
2356 AC_MSG_RESULT(no)
2357 fi
2358fi
2359AM_CONDITIONAL(LZMA_DELEGATE, test "$have_lzma" = 'yes')
2360AC_SUBST(LZMA_LIBS)
2361
2362dnl ===========================================================================
2363
cristy3ed852e2009-09-05 21:47:34 +00002364#
2365# Check for the OpenEXR delegate library.
2366#
2367AC_ARG_WITH([openexr],
2368 [AC_HELP_STRING([--without-openexr],
2369 [disable OpenEXR support])],
2370 [with_openexr=$withval],
2371 [with_openexr='yes'])
2372
2373if test "$with_openexr" != 'yes'; then
2374 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-openexr=$with_openexr "
2375fi
2376
2377have_openexr='no'
2378OPENEXR_CFLAGS=""
2379OPENEXR_LIBS=""
2380OPENEXR_PKG=""
2381if test "x$with_openexr" = "xyes"; then
2382 AC_MSG_RESULT([-------------------------------------------------------------])
2383 PKG_CHECK_MODULES(OPENEXR,[OpenEXR >= 1.0.6], have_openexr=yes, have_openexr=no)
2384 AC_MSG_RESULT([])
2385fi
2386
2387if test "$have_openexr" = 'yes'; then
2388 AC_DEFINE(OPENEXR_DELEGATE,1,Define if you have OPENEXR library)
2389 if test "$with_modules" = 'no'; then
2390 CFLAGS="$OPENEXR_CFLAGS $CFLAGS"
2391 fi
2392fi
2393
2394AM_CONDITIONAL(OPENEXR_DELEGATE, test "$have_openexr" = 'yes')
2395AC_SUBST(OPENEXR_CFLAGS)
2396AC_SUBST(OPENEXR_LIBS)
2397
2398dnl ===========================================================================
2399
2400#
2401# Check for PNG delegate library.
2402#
2403AC_ARG_WITH(png,
2404 [AC_HELP_STRING([--without-png],
2405 [disable PNG support])],
2406 [with_png=$withval],
2407 [with_png='yes'])
2408
2409if test "$with_png" != 'yes'; then
2410 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-png=$with_png "
2411fi
2412
2413have_png='no'
2414PNG_LIBS=''
2415if test "$with_png" != 'no'; then
2416 AC_MSG_RESULT([-------------------------------------------------------------])
2417 AC_MSG_CHECKING([for PNG])
2418 AC_MSG_RESULT([])
2419 failed=0
2420 passed=0
2421 AC_CHECK_HEADER(png.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2422 AC_CHECK_LIB(png,png_get_io_ptr,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2423 AC_MSG_CHECKING([if PNG package is complete])
2424 if test $passed -gt 0; then
2425 if test $failed -gt 0; then
2426 AC_MSG_RESULT([no -- some components failed test])
2427 have_png='no (failed tests)'
2428 else
2429 PNG_LIBS='-lpng'
2430 LIBS="$PNG_LIBS $LIBS"
2431 AC_DEFINE(PNG_DELEGATE,1,Define if you have PNG library)
2432 AC_MSG_RESULT([yes])
2433 have_png='yes'
2434 fi
2435 else
2436 AC_MSG_RESULT([no])
2437 fi
2438fi
2439AM_CONDITIONAL(PNG_DELEGATE,test "$have_png" = 'yes')
2440AC_SUBST(PNG_LIBS)
2441
2442dnl ===========================================================================
2443
2444#
2445# Check for RSVG delegate library.
2446#
2447AC_ARG_WITH([rsvg],
2448 [AC_HELP_STRING([--without-rsvg],
2449 [disable RSVG support])],
2450 [with_rsvg=$withval],
2451 [with_rsvg=$have_x])
2452
2453if test "$with_rsvg" != 'yes'; then
2454 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-rsvg=$with_rsvg "
2455fi
2456
2457have_rsvg='no'
2458have_cairo='no'
2459RSVG_CFLAGS=""
2460RSVG_LIBS=""
2461RSVG_PKG=""
2462if test "x$with_rsvg" = "xyes"; then
2463 AC_MSG_RESULT([-------------------------------------------------------------])
2464 PKG_CHECK_MODULES(RSVG,[librsvg-2.0 >= 2.9.0], have_rsvg=yes, have_rsvg=no)
2465 AC_MSG_RESULT([])
2466 PKG_CHECK_MODULES(CAIRO_SVG, cairo-svg, have_cairo=yes, have_cairo=no)
2467 AC_MSG_RESULT([])
2468fi
2469
2470if test "$have_rsvg" = 'yes'; then
2471 AC_DEFINE(RSVG_DELEGATE,1,Define if you have RSVG library)
2472 if test "$with_modules" = 'no'; then
2473 CPPFLAGS="$RSVG_CFLAGS $CPPFLAGS"
2474 fi
2475fi
2476
2477if test "$have_cairo" = 'yes'; then
2478 AC_DEFINE(CAIRO_DELEGATE,1,Define if you have CAIRO library)
2479 if test "$with_modules" = 'no'; then
2480 CPPFLAGS="$CAIRO_SVG_CFLAGS $CPPFLAGS"
2481 fi
2482fi
2483
2484AM_CONDITIONAL(RSVG_DELEGATE, test "$have_rsvg" = 'yes')
2485AM_CONDITIONAL(CAIRO_DELEGATE, test "$have_cairo" = 'yes')
2486AC_SUBST(RSVG_CFLAGS)
2487AC_SUBST(RSVG_LIBS)
2488
2489dnl ===========================================================================
2490
2491#
2492# Check for TIFF delegate library.
2493#
2494AC_ARG_WITH([tiff],
2495 [AC_HELP_STRING([--without-tiff],
2496 [disable TIFF support])],
2497 [with_tiff=$withval],
2498 [with_tiff='yes'])
2499
2500if test "$with_tiff" != 'yes'; then
2501 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-tiff=$with_tiff "
2502fi
2503
2504have_tiff='no'
2505TIFF_LIBS=''
2506if test "$with_tiff" != 'no'; then
2507 AC_MSG_RESULT([-------------------------------------------------------------])
2508 AC_MSG_CHECKING([for TIFF])
2509 AC_MSG_RESULT([])
2510 failed=0
2511 passed=0
2512 AC_CHECK_HEADER(tiff.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2513 AC_CHECK_HEADER(tiffio.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2514 AC_CHECK_LIB(tiff,TIFFOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2515 AC_CHECK_LIB(tiff,TIFFClientOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
cristyb97f1002010-07-26 14:02:57 +00002516 AC_CHECK_LIB(tiff,TIFFIsBigEndian,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
cristy3ed852e2009-09-05 21:47:34 +00002517 AC_CHECK_LIB(tiff,TIFFIsByteSwapped,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2518 AC_CHECK_LIB(tiff,TIFFReadRGBATile,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2519 AC_CHECK_LIB(tiff,TIFFReadRGBAStrip,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2520 AC_MSG_CHECKING([if TIFF package is complete])
2521 if test $passed -gt 0; then
2522 if test $failed -gt 0; then
2523 AC_MSG_RESULT([no -- some components failed test])
2524 have_tiff='no (failed tests)'
2525 else
2526 TIFF_LIBS='-ltiff'
2527 LIBS="$TIFF_LIBS $LIBS"
2528 AC_DEFINE(TIFF_DELEGATE,1,Define if you have TIFF library)
2529 AC_MSG_RESULT([yes])
2530 have_tiff='yes'
2531 AC_CHECK_HEADERS(tiffconf.h)
2532 AC_CHECK_FUNCS([TIFFIsCODECConfigured TIFFMergeFieldInfo \
2533 TIFFReadEXIFDirectory TIFFSetErrorHandlerExt TIFFSetTagExtender \
2534 TIFFSetWarningHandlerExt TIFFSwabArrayOfTriples])
2535 fi
2536 else
2537 AC_MSG_RESULT([no])
2538 fi
2539fi
2540AM_CONDITIONAL(TIFF_DELEGATE, test "$have_tiff" = 'yes')
2541AC_SUBST(TIFF_LIBS)
2542
2543dnl ===========================================================================
2544
2545#
cristyb1860752011-03-14 00:27:46 +00002546# Check for WEBP delegate library.
2547#
2548AC_ARG_WITH(webp,
2549 [AC_HELP_STRING([--without-webp],
2550 [disable WEBP support])],
2551 [with_webp=$withval],
2552 [with_webp='yes'])
2553
2554if test "$with_webp" != 'yes'; then
2555 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-webp=$with_webp "
2556fi
2557
2558have_webp='no'
2559WEBP_LIBS=''
2560if test "$with_webp" != 'no'; then
2561 AC_MSG_RESULT([-------------------------------------------------------------])
2562 AC_MSG_CHECKING([for WEBP])
2563 AC_MSG_RESULT([])
2564 failed=0
2565 passed=0
2566 AC_CHECK_HEADER(webp/decode.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2567 AC_CHECK_LIB(webp,WebPDecodeRGB,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2568 AC_MSG_CHECKING([if WEBP package is complete])
2569 if test $passed -gt 0; then
2570 if test $failed -gt 0; then
2571 AC_MSG_RESULT([no -- some components failed test])
2572 have_webp='no (failed tests)'
2573 else
2574 WEBP_LIBS='-lwebp'
2575 LIBS="$WEBP_LIBS $LIBS"
2576 AC_DEFINE(WEBP_DELEGATE,1,Define if you have WEBP library)
2577 AC_MSG_RESULT([yes])
2578 have_webp='yes'
2579 fi
2580 else
2581 AC_MSG_RESULT([no])
2582 fi
2583fi
2584AM_CONDITIONAL(WEBP_DELEGATE,test "$have_webp" = 'yes')
2585AC_SUBST(WEBP_LIBS)
2586
2587dnl ===========================================================================
2588
2589#
cristy3ed852e2009-09-05 21:47:34 +00002590# Set Windows font directory.
2591#
2592AC_ARG_WITH(windows-font-dir,
2593 [AC_HELP_STRING([--with-windows-font-dir=DIR],
2594 [directory containing MS-Windows fonts])],
2595 [with_windows_font_dir=$withval],
2596 [with_windows_font_dir=''])
2597if test "$with_windows_font_dir" != '' ; then
2598 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-windows-font-dir=$with_windows_font_dir "
2599fi
2600
2601dnl ===========================================================================
2602
2603#
2604# Check for WMF delegate library.
2605#
2606AC_ARG_WITH([wmf],
2607 [AC_HELP_STRING([--without-wmf],
2608 [disable WMF support])],
2609 [with_wmf=$withval],
cristy8d63d1d2010-01-06 20:38:37 +00002610 [with_wmf='yes'])
cristy3ed852e2009-09-05 21:47:34 +00002611
2612if test "$with_wmf" != 'yes'; then
2613 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-wmf=$with_wmf "
2614fi
2615
2616have_wmf='no'
2617WMF_LIBS=''
cristy3ed852e2009-09-05 21:47:34 +00002618if test "$with_wmf" != 'no'; then
2619 AC_MSG_RESULT([-------------------------------------------------------------])
2620 AC_MSG_CHECKING([for WMF])
2621 AC_MSG_RESULT([])
cristy735e8942010-04-02 20:32:57 +00002622 failed=0
2623 passed=0
2624 AC_CHECK_HEADER(libwmf/eps.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
cristy22652362010-04-02 23:22:31 +00002625 AC_CHECK_LIB(wmf,wmf_eps_function,passed=`expr $passed + 1`,failed=`expr $failed + 1`,"-lwmflite")
cristy3ed852e2009-09-05 21:47:34 +00002626 AC_MSG_CHECKING([if WMF package is complete])
cristy735e8942010-04-02 20:32:57 +00002627 if test $passed -gt 0; then
2628 if test $failed -gt 0; then
2629 AC_MSG_RESULT([no -- some components failed test])
2630 have_wmf='no (failed tests)'
2631 else
2632 WMF_LIBS='-lwmf -lwmflite'
2633 LIBS="$WMF_LIBS $LIBS"
2634 AC_DEFINE(WMF_DELEGATE,1,Define if you have WMF library)
2635 AC_MSG_RESULT([yes])
2636 have_wmf='yes'
2637 fi
cristy3ed852e2009-09-05 21:47:34 +00002638 else
2639 AC_MSG_RESULT([no])
2640 fi
2641fi
cristy735e8942010-04-02 20:32:57 +00002642AM_CONDITIONAL(WMF_DELEGATE,test "$have_wmf" = 'yes')
cristy3ed852e2009-09-05 21:47:34 +00002643AC_SUBST(WMF_LIBS)
cristy735e8942010-04-02 20:32:57 +00002644
2645dnl ===========================================================================
2646
cristy3ed852e2009-09-05 21:47:34 +00002647
2648dnl ===========================================================================
2649
2650#
2651# Check for XML delegate library.
2652#
2653AC_ARG_WITH([xml],
2654 [AC_HELP_STRING([--without-xml],
2655 [disable XML support])],
2656 [with_xml=$withval],
2657 [with_xml=$have_x])
2658
2659if test "$with_xml" != 'yes' ; then
2660 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-xml=$with_xml "
2661fi
2662
2663have_xml='no'
2664XML_LIBS=''
2665if test "$with_xml" != 'no'; then
2666 AC_MSG_RESULT([-------------------------------------------------------------])
2667 AC_MSG_CHECKING([for XML])
2668 AC_MSG_RESULT([])
2669 PERSIST_LDFLAGS=$LDFLAGS
2670 PERSIST_CPPFLAGS=$CPPFLAGS
2671 xml2_config=''
2672 AC_CHECK_PROGS(xml2_config,xml2-config,)dnl
2673 if test -n "$xml2_config"; then
2674 # Debian installs libxml headers under /usr/include/libxml2/libxml with
2675 # the shared library installed under /usr/lib, whereas the package
2676 # installs itself under $prefix/libxml and $prefix/lib.
2677 xml2_prefix=`xml2-config --prefix`
2678 if test -d "${xml2_prefix}/include/libxml2"; then
2679 CPPFLAGS="$CPPFLAGS -I${xml2_prefix}/include/libxml2"
2680 fi
2681 if test "${xml2_prefix}" != '/usr'; then
2682 LDFLAGS="$LDFLAGS -L${xml2_prefix}/lib"
2683 fi
2684 fi
2685 failed=0
2686 passed=0
2687 AC_CHECK_HEADER(libxml/parser.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2688 AC_CHECK_LIB(xml2,xmlParseExternalEntity,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2689 AC_MSG_CHECKING([if XML package is complete])
2690 if test $passed -gt 0; then
2691 if test $failed -gt 0; then
2692 AC_MSG_RESULT([no -- some components failed test])
2693 have_xml='no (failed tests)'
2694 LDFLAGS="$PERSIST_LDFLAGS"
2695 CPPFLAGS="$PERSIST_CPPFLAGS"
2696 else
2697 XML_LIBS='-lxml2'
2698 LIBS="$XML_LIBS $LIBS"
2699 AC_DEFINE(XML_DELEGATE,1,Define if you have XML library)
2700 AC_MSG_RESULT([yes])
2701 have_xml='yes'
2702 fi
2703 else
2704 AC_MSG_RESULT([no])
2705 fi
2706fi
2707AM_CONDITIONAL(XML_DELEGATE,test "$have_xml" = 'yes')
2708AC_SUBST(XML_LIBS)
2709
2710dnl ===========================================================================
2711
2712# Substitute compiler name to build/link PerlMagick
2713#
2714AC_SUBST(PERLMAINCC)
2715
2716#
2717# Configure install Paths
2718#
2719
2720# Subdirectory under lib to place ImageMagick lib files
2721LIBRARY_RELATIVE_PATH="${PACKAGE_NAME}-${PACKAGE_VERSION}"
2722AC_DEFINE_UNQUOTED(LIBRARY_RELATIVE_PATH,"$LIBRARY_RELATIVE_PATH",Subdirectory of lib where ImageMagick architecture dependent files are installed)
2723
2724# Path to ImageMagick bin directory
2725EXECUTABLE_PATH="${BIN_DIR}"
2726DEFINE_EXECUTABLE_PATH="${BIN_DIR}/"
2727case "${build_os}" in
2728 mingw* )
2729 DEFINE_EXECUTABLE_PATH=`$WinPathScript "$DEFINE_EXECUTABLE_PATH" 1`
2730 ;;
2731esac
2732AC_DEFINE_UNQUOTED(EXECUTABLE_PATH,"$DEFINE_EXECUTABLE_PATH",Directory where executables are installed.)
2733AC_SUBST(EXECUTABLE_PATH)
2734
2735# Path to ImageMagick lib
2736LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}"
2737DEFINE_LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}/"
2738case "${build_os}" in
2739 mingw* )
2740 DEFINE_LIBRARY_PATH=`$WinPathScript "$DEFINE_LIBRARY_PATH" 1`
2741 ;;
2742esac
2743AC_DEFINE_UNQUOTED(LIBRARY_PATH,"$DEFINE_LIBRARY_PATH",Directory where architecture-dependent files live.)
2744AC_SUBST(LIBRARY_PATH)
2745
cristy3ed852e2009-09-05 21:47:34 +00002746#
2747# Subdirectory under lib to place ImageMagick coder module files
2748CODER_RELATIVE_PATH="${LIBRARY_RELATIVE_PATH}/modules-Q${QUANTUM_DEPTH}/coders"
2749AC_DEFINE_UNQUOTED(CODER_RELATIVE_PATH,"$CODER_RELATIVE_PATH",Subdirectory of lib where coder modules are installed)
2750CODER_PATH="${LIB_DIR}/${CODER_RELATIVE_PATH}"
2751DEFINE_CODER_PATH="${LIB_DIR}/${CODER_RELATIVE_PATH}/"
2752case "${build_os}" in
2753 mingw* )
2754 DEFINE_CODER_PATH=`$WinPathScript "$DEFINE_CODER_PATH" 1`
2755 ;;
2756esac
2757AC_DEFINE_UNQUOTED(CODER_PATH,"$DEFINE_CODER_PATH",Location of coder modules)
2758AC_SUBST(CODER_PATH)
2759
2760#
2761# Subdirectory under lib to place ImageMagick filter module files
2762FILTER_RELATIVE_PATH="${LIBRARY_RELATIVE_PATH}/modules-Q${QUANTUM_DEPTH}/filters"
2763AC_DEFINE_UNQUOTED(FILTER_RELATIVE_PATH,"$FILTER_RELATIVE_PATH",Subdirectory of lib where filter modules are installed)
2764FILTER_PATH="${LIB_DIR}/${FILTER_RELATIVE_PATH}"
2765DEFINE_FILTER_PATH="${LIB_DIR}/${FILTER_RELATIVE_PATH}/"
2766case "${build_os}" in
2767 mingw* )
2768 DEFINE_FILTER_PATH=`$WinPathScript "$DEFINE_FILTER_PATH" 1`
2769 ;;
2770esac
2771AC_DEFINE_UNQUOTED(FILTER_PATH,"$DEFINE_FILTER_PATH",Location of filter modules)
2772AC_SUBST(FILTER_PATH)
2773
2774#
2775# Path to ImageMagick documentation files
cristyd55889c2011-03-27 00:50:24 +00002776DOCUMENTATION_RELATIVE_PATH=""
2777DOCUMENTATION_PATH="${DOC_DIR}/${DOCUMENTATION_RELATIVE_PATH}"
2778DEFINE_DOCUMENTATION_PATH="${DOC_DIR}/${DOCUMENTATION_RELATIVE_PATH}/"
cristy3ed852e2009-09-05 21:47:34 +00002779case "${build_os}" in
2780 mingw* )
2781 DEFINE_DOCUMENTATION_PATH=`$WinPathScript "$DEFINE_DOCUMENTATION_PATH" 1`
2782 ;;
2783esac
2784AC_DEFINE_UNQUOTED(DOCUMENTATION_PATH,"$DEFINE_DOCUMENTATION_PATH",Directory where ImageMagick documents live.)
2785AC_SUBST(DOCUMENTATION_PATH)
2786
cristy3cf8a722011-03-20 23:32:22 +00002787# Subdirectory to place ImageMagick configuration files
cristyba0f1972011-03-28 12:42:52 +00002788CONFIGURE_RELATIVE_PATH="${PACKAGE_NAME}"
cristy29b1f6f2011-03-27 14:02:38 +00002789AC_DEFINE_UNQUOTED(CONFIGURE_RELATIVE_PATH,"$CONFIGURE_RELATIVE_PATH",Subdirectory of lib where architecture-dependent configuration files live.)
2790CONFIGURE_PATH="${SYSCONF_DIR}/${CONFIGURE_RELATIVE_PATH}/"
2791DEFINE_CONFIGURE_PATH="${SYSCONF_DIR}/${CONFIGURE_RELATIVE_PATH}/"
2792case "${build_os}" in
2793 mingw* )
2794 DEFINE_CONFIGURE_PATH=`$WinPathScript "$DEFINE_CONFIGURE_PATH" 1`
2795 ;;
2796esac
2797AC_DEFINE_UNQUOTED(CONFIGURE_PATH,"$DEFINE_CONFIGURE_PATH",Directory where architecture-dependent configuration files live.)
2798AC_SUBST(CONFIGURE_PATH)
2799
2800# Subdirectory to place ImageMagick configuration files
cristy4f820712011-04-01 12:35:43 +00002801SHARE_RELATIVE_PATH="${LIBRARY_RELATIVE_PATH}"
2802AC_DEFINE_UNQUOTED(SHARE_RELATIVE_PATH,"$SHARE_RELATIVE_PATH",Subdirectory of lib where architecture-independent configuration files live.)
2803SHARE_PATH="${DATA_DIR}/${SHARE_RELATIVE_PATH}"
2804DEFINE_SHARE_PATH="${DATA_DIR}/${SHARE_RELATIVE_PATH}/"
cristy3ed852e2009-09-05 21:47:34 +00002805case "${build_os}" in
2806 mingw* )
cristy4f820712011-04-01 12:35:43 +00002807 DEFINE_SHARE_PATH=`$WinPathScript "$DEFINE_SHARE_PATH" 1`
cristy3ed852e2009-09-05 21:47:34 +00002808 ;;
2809esac
cristy4f820712011-04-01 12:35:43 +00002810AC_DEFINE_UNQUOTED(SHARE_PATH,"$DEFINE_SHARE_PATH",Directory where architecture-independent configuration files live.)
2811AC_SUBST(SHARE_PATH)
cristy3ed852e2009-09-05 21:47:34 +00002812
2813#
2814# program_transform_name is formed for use in a Makefile, so create a
2815# modified version for use in a shell script.
2816configure_transform_name=`echo ${program_transform_name} | sed 's,\\$\\$,$,'`
2817
2818# Default delegate definitions
2819AC_MSG_RESULT([-------------------------------------------------------------])
2820AC_MSG_CHECKING([for ImageMagick delegate programs])
2821AC_MSG_RESULT([])
2822AutotraceDecodeDelegateDefault='autotrace'
cristy3d7f8062009-09-24 20:45:35 +00002823BlenderDecodeDelegateDefault='blender'
cristy3ed852e2009-09-05 21:47:34 +00002824BZIPDelegateDefault='bzip2'
2825BrowseDelegateDefault='xdg-open'
2826CGMDecodeDelegateDefault='ralcgm'
2827CatDelegateDefault='cat'
2828DNGDecodeDelegateDefault='ufraw-batch'
2829GVCDecodeDelegateDefault='dot'
2830DVIDecodeDelegateDefault='dvips'
2831EchoDelegateDefault='echo'
2832EditorDelegateDefault='xterm'
2833FIGDecodeDelegateDefault='fig2dev'
2834ConvertDelegateDefault=`echo convert | sed ${configure_transform_name}`
2835DisplayDelegateDefault=`echo display | sed ${configure_transform_name}`
2836MogrifyDelegateDefault=`echo mogrify | sed ${configure_transform_name}`
2837GnuplotDecodeDelegateDefault='gnuplot'
cristy3ed852e2009-09-05 21:47:34 +00002838HPGLDecodeDelegateDefault='hp2xx'
2839HTMLDecodeDelegateDefault='html2ps'
2840ILBMDecodeDelegateDefault='ilbmtoppm'
2841ILBMEncodeDelegateDefault='ppmtoilbm'
2842LPDelegateDefault='lp'
2843LPRDelegateDefault='lpr'
2844LZWDecodeDelegateDefault='uncompress'
2845LZWEncodeDelegateDefault='compress'
2846LaunchDelegateDefault='gimp'
2847MANDelegateDefault='groff'
2848MPEGDecodeDelegateDefault='ffmpeg'
2849MPEGEncodeDelegateDefault='ffmpeg'
cristy935c86e2010-06-05 23:50:07 +00002850MrSIDDecodeDelegateDefault='mrsidgeodecode'
cristy3ed852e2009-09-05 21:47:34 +00002851MVDelegateDefault='mv'
2852PCLDelegateDefault='pcl6'
2853PGPDecodeDelegateDefault='pgpv'
2854POVDelegateDefault='povray'
2855if test "$native_win32_build" = 'yes'; then
2856 PSDelegateDefault='gswin32c'
cristyb7931f12009-09-25 10:22:21 +00002857elif test "$gslib_framework" = 'yes'; then
cristy3ed852e2009-09-05 21:47:34 +00002858 PSDelegateDefault='gsc'
2859else
2860 PSDelegateDefault='gs'
2861fi
2862RLEEncodeDelegateDefault='rawtorle'
2863RMDelegateDefault='rm'
cristy4689cf02010-02-17 21:15:45 +00002864RSVGDecodeDelegateDefault='rsvg'
cristy3ed852e2009-09-05 21:47:34 +00002865SCANDecodeDelegateDefault='scanimage'
2866TXTDelegateDefault='enscript'
cristy16db5ed2010-07-29 13:32:02 +00002867UniconvertorDelegateDefault='uniconvertor'
cristy3ed852e2009-09-05 21:47:34 +00002868WMFDecodeDelegateDefault='wmf2eps'
2869WWWDecodeDelegateDefault='curl'
2870XPSDelegateDefault='gxps'
2871ZipDelegateDefault='gzip'
2872
2873# Search for delegates
2874AC_PATH_PROG(AutotraceDecodeDelegate, "$AutotraceDecodeDelegateDefault", "$AutotraceDecodeDelegateDefault")
cristy3ed852e2009-09-05 21:47:34 +00002875AC_PATH_PROG(BlenderDecodeDelegate, "$BlenderDecodeDelegateDefault", "$BlenderDecodeDelegateDefault")
2876AC_PATH_PROG(BZIPDelegate, "$BZIPDelegateDefault", "$BZIPDelegateDefault")
2877AC_PATH_PROG(BrowseDelegate, "$BrowseDelegateDefault" mozilla firefox netscape, "$BrowseDelegateDefault")
2878AC_PATH_PROG(CGMDecodeDelegate, "$CGMDecodeDelegateDefault", "$CGMDecodeDelegateDefault")
2879AC_PATH_PROG(CatDelegate, "$CatDelegateDefault", "$CatDelegateDefault")
2880AC_PATH_PROG(DNGDecodeDelegate, "$DNGDecodeDelegateDefault", "$DNGDecodeDelegateDefault")
2881AC_PATH_PROG(GVCDecodeDelegate, "$GVCDecodeDelegateDefault", "$GVCDecodeDelegateDefault")
2882AC_PATH_PROG(DVIDecodeDelegate, "$DVIDecodeDelegateDefault", "$DVIDecodeDelegateDefault")
2883AC_PATH_PROG(EchoDelegate, "$EchoDelegateDefault", "$EchoDelegateDefault")
2884AC_PATH_PROG(EditorDelegate, "$EditorDelegateDefault", "$EditorDelegateDefault")
2885AC_PATH_PROG(FIGDecodeDelegate, "$FIGDecodeDelegateDefault", "$FIGDecodeDelegateDefault")
2886AC_PATH_PROG(ConvertDelegate, "$ConvertDelegateDefault", "$ConvertDelegateDefault")
2887AC_PATH_PROG(DisplayDelegate, "$DisplayDelegateDefault", "$DisplayDelegateDefault")
2888AC_PATH_PROG(MogrifyDelegate, "$MogrifyDelegateDefault", "$MogrifyDelegateDefault")
2889AC_PATH_PROG(GnuplotDecodeDelegate, "$GnuplotDecodeDelegateDefault", "$GnuplotDecodeDelegateDefault")
cristy3ed852e2009-09-05 21:47:34 +00002890AC_PATH_PROG(HPGLDecodeDelegate, "$HPGLDecodeDelegateDefault", "$HPGLDecodeDelegateDefault")
2891AC_PATH_PROG(HTMLDecodeDelegate, "$HTMLDecodeDelegateDefault", "$HTMLDecodeDelegateDefault")
2892AC_PATH_PROG(ILBMDecodeDelegate, "$ILBMDecodeDelegateDefault", "$ILBMDecodeDelegateDefault")
2893AC_PATH_PROG(ILBMEncodeDelegate, "$ILBMEncodeDelegateDefault", "$ILBMEncodeDelegateDefault")
2894AC_PATH_PROG(LPDelegate, "$LPDelegateDefault", no)
2895AC_PATH_PROG(LPRDelegate, "$LPRDelegateDefault", "$LPRDelegateDefault")
2896AC_PATH_PROG(LZWDecodeDelegate, "$LZWDecodeDelegateDefault", "$LZWDecodeDelegateDefault")
2897AC_PATH_PROG(LZWEncodeDelegate, "$LZWEncodeDelegateDefault", "$LZWEncodeDelegateDefault")
2898AC_PATH_PROG(LaunchDelegate, "$LaunchDelegateDefault", "$LaunchDelegateDefault")
2899AC_PATH_PROG(MANDelegate, "$MANDelegateDefault", "$MANDelegateDefault")
2900AC_PATH_PROG(MPEGDecodeDelegate, "$MPEGDecodeDelegateDefault", "$MPEGDecodeDelegateDefault")
2901AC_PATH_PROG(MPEGEncodeDelegate, "$MPEGEncodeDelegateDefault", "$MPEGEncodeDelegateDefault")
cristy935c86e2010-06-05 23:50:07 +00002902AC_PATH_PROG(MrSIDDecodeDelegate, "$MrSIDDecodeDelegateDefault", "$MrSIDDecodeDelegateDefault")
cristy3ed852e2009-09-05 21:47:34 +00002903AC_PATH_PROG(MVDelegate, "$MVDelegateDefault", "$MVDelegateDefault")
2904AC_PATH_PROG(PCLDelegate, "$PCLDelegateDefault", "$PCLDelegateDefault")
2905AC_PATH_PROG(PGPDecodeDelegate, "$PGPDecodeDelegateDefault", "$PGPDecodeDelegateDefault")
2906AC_PATH_PROG(POVDelegate, "$POVDelegateDefault", "$POVDelegateDefault")
2907AC_PATH_PROGS(PSDelegate, gsx gsc "$PSDelegateDefault", "$PSDelegateDefault")
2908AC_PATH_PROG(RLEEncodeDelegate, "$RLEEncodeDelegateDefault", "$RLEEncodeDelegateDefault")
2909AC_PATH_PROG(RMDelegate, "$RMDelegateDefault", "$RMDelegateDefault")
cristy4689cf02010-02-17 21:15:45 +00002910AC_PATH_PROG(RSVGDecodeDelegate, "$RSVGDecodeDelegateDefault", "$RSVGDecodeDelegateDefault")
cristy3ed852e2009-09-05 21:47:34 +00002911AC_PATH_PROG(SCANDecodeDelegate, "$SCANDecodeDelegateDefault", "$SCANDecodeDelegateDefault")
2912AC_PATH_PROG(TXTDelegate, "$TXTDelegateDefault", "$TXTDelegateDefault")
cristy5ac9ac82010-07-29 13:24:24 +00002913AC_PATH_PROG(UniconvertorDelegate, "$UniconvertorDelegateDefault", "$UniconvertorDelegateDefault")
cristy3ed852e2009-09-05 21:47:34 +00002914AC_PATH_PROG(WMFDecodeDelegate, "$WMFDecodeDelegateDefault", "$WMFDecodeDelegateDefault")
2915AC_PATH_PROG(WWWDecodeDelegate, "$WWWDecodeDelegateDefault", "$WWWDecodeDelegateDefault")
2916AC_PATH_PROG(XPSDelegate, "$XPSDelegateDefault", "$XPSDelegateDefault")
2917AC_PATH_PROG(ZipDelegate, "$ZipDelegateDefault", "$ZipDelegateDefault")
2918
2919# Prefer lpr to lp; lp needs options tacked on.
2920if test "$LPRDelegate" != no; then
2921 PrintDelegate="$LPRDelegate"
2922else
2923 PrintDelegate="$LPDelegate -c -s"
2924fi
2925AC_SUBST(PrintDelegate)
2926
2927# Installed ImageMagick utiltity paths
2928ConvertDelegate="${BIN_DIR}/${ConvertDelegateDefault}"
2929DisplayDelegate="${BIN_DIR}/${DisplayDelegateDefault}"
2930MogrifyDelegate="${BIN_DIR}/${MogrifyDelegateDefault}"
2931
2932# Set delegate booleans
2933have_ffmpeg='no'; if test "$MPEGDecodeDelegate" != "$MPEGDecodeDelegateDefault" ; then have_ffmpeg='yes'; fi
2934have_fig2dev='no' ; if test "$FIGDecodeDelegate" != "$FIGDecodeDelegateDefault" ; then have_fig2dev='yes'; fi
2935have_gs='no' ; if test "$PSDelegate" != "$PSDelegateDefault"; then have_gs='yes'; fi
2936have_hp2xx='no' ; if test "$HPGLDecodeDelegate" != "$HPGLDecodeDelegateDefault" ; then have_hp2xx='yes'; fi
2937have_ilbmtoppm='no' ; if test "$ILBMDecodeDelegate" != "$ILBMDecodeDelegateDefault" ; then have_ilbmtoppm='yes'; fi
cristy935c86e2010-06-05 23:50:07 +00002938have_mrsid='no'; if test "$MrSIDDecodeDelegate" != "$MrSIDDecodeDelegateDefault" ; then have_mrsid='yes'; fi
cristy3ed852e2009-09-05 21:47:34 +00002939have_pcl='no' ; if test "$PCLDelegate" != "$PCLDelegateDefault"; then have_pcl='yes'; fi
2940have_ppmtoilbm='no' ; if test "$ILBMEncodeDelegate" != "$ILBMEncodeDelegateDefault" ; then have_ppmtoilbm='yes'; fi
cristy3ed852e2009-09-05 21:47:34 +00002941have_ralcgm='no' ; if test "$CGMDecodeDelegate" != "$CGMDecodeDelegateDefault" ; then have_ralcgm='yes'; fi
2942have_xps='no' ; if test "$XPSDelegate" != "$XPSDelegateDefault"; then have_xps='yes'; fi
2943
2944#
2945# Test for font directories
2946#
2947type_include_files=''
2948
cristy430a7312010-01-21 20:44:04 +00002949# Dejavu fonts.
2950AC_MSG_CHECKING(for Dejavu fonts directory)
2951dejavu_font_dir=''
2952if test "${with_dejavu_font_dir}" != 'default'; then
2953 dejavu_font_dir="${with_dejavu_font_dir}/"
2954else
2955 for font_dir in "${prefix}/share/dejavu/fonts/" '/usr/share/fonts/dejavu/'; do
2956 if test -f "${font_dir}DejaVuSerif.ttf"; then
2957 dejavu_font_dir="${font_dir}"
2958 break 1
2959 fi
2960 done
2961fi
2962if test "${dejavu_font_dir}x" != 'x'; then
2963 type_include_files="${type_include_files} "'<include file="type-dejavu.xml" />'
2964 AC_MSG_RESULT([$dejavu_font_dir])
2965else
2966 AC_MSG_RESULT([not found!]);
2967fi
2968AC_SUBST(dejavu_font_dir)
2969
cristy3ed852e2009-09-05 21:47:34 +00002970# Windows
2971windows_font_dir=''
2972if test "$with_windows_font_dir" != "no" && test -n "$with_windows_font_dir"; then
2973 windows_font_dir="${with_windows_font_dir}/"
2974fi
cristy430a7312010-01-21 20:44:04 +00002975if test "${windows_font_dir}x" != 'x'; then
cristy3ed852e2009-09-05 21:47:34 +00002976 if test -f '/usr/X11R6/lib/X11/fonts/truetype/arial.ttf'; then
2977 windows_font_dir='/usr/X11R6/lib/X11/fonts/truetype/'
2978 fi
2979 if test -f '/usr/X11R7/lib/X11/fonts/truetype/arial.ttf'; then
2980 windows_font_dir='/usr/X11R7/lib/X11/fonts/truetype/'
2981 fi
2982 if test -f '/usr/share/fonts/msttcore/arial.ttf'; then
2983 windows_font_dir='/usr/share/fonts/msttcore/truetype/'
2984 fi
2985fi
cristy430a7312010-01-21 20:44:04 +00002986if test "${windows_font_dir}x" != 'x'; then
cristy3ed852e2009-09-05 21:47:34 +00002987 type_include_files="$type_include_files "'<include file="type-windows.xml" />'
2988fi
2989AC_SUBST(windows_font_dir)
2990
2991# Ghostscript
2992AC_MSG_CHECKING(for Ghostscript fonts directory)
2993ghostscript_font_dir=''
2994if test "${with_gs_font_dir}" != 'default'; then
2995 ghostscript_font_dir="${with_gs_font_dir}/"
2996else
2997 if test "${native_win32_build}" = 'yes'; then
2998 # Native Windows Build
2999 for font_dir in "c:\\Program Files\\gs\\fonts\\" "c:\\Program Files \(x86\)\\gs\\fonts\\" "c:\\gs\\fonts\\"; do
3000 if test -f "${font_dir}a010013l.pfb"; then
3001 ghostscript_font_dir="$font_dir"
3002 break 1
3003 fi
3004 done
3005 if test "${PSDelegate}" != 'gswin32c'; then
3006 ghostscript_font_dir=`echo "${PSDelegate}" | sed -e 's:/gs/.*:/gs:;s:^/::;s/./&:/;s:/:\\\\:g'`"\\fonts\\"
3007 fi
3008 else
3009 # Linux / Mac OS X / Unix Build
3010 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
3011 if test -f "${font_dir}a010013l.pfb"; then
3012 ghostscript_font_dir="${font_dir}"
3013 break 1
3014 fi
3015 done
3016 if test "${ghostscript_font_dir}x" = 'x'; then
3017 if test "$PSDelegate" != 'gs'; then
3018 ghostscript_font_dir=`echo "$PSDelegate" | sed -e 's:/bin/gs:/share/ghostscript/fonts:'`"/"
3019 fi
3020 fi
3021 fi
3022fi
3023if test "${ghostscript_font_dir}x" != 'x'; then
3024 type_include_files="${type_include_files} "'<include file="type-ghostscript.xml" />'
3025 AC_MSG_RESULT([$ghostscript_font_dir])
3026else
3027 AC_MSG_RESULT([not found!]);
3028fi
3029AC_SUBST(ghostscript_font_dir)
3030case "${build_os}" in
3031 mingw* )
3032 PSDelegate=`$WinPathScript "$PSDelegate" 1`
3033 ;;
3034esac
3035
3036AC_SUBST(type_include_files)
3037
3038#
3039# Handle case where user doesn't want frozen paths
3040#
3041if test "$with_frozenpaths" != 'yes'; then
3042 # Re-set delegate definitions to default (no paths)
3043 AutotraceDecodeDelegate="$AutotraceDecodeDelegateDefault"
cristy3ed852e2009-09-05 21:47:34 +00003044 BlenderDecodeDelegate="$BlenderDecodeDelegateDefault"
3045 BZIPDelegate="$BZIPDelegateDefault"
3046 BrowseDelegate="$BrowseDelegateDefault"
3047 CGMDecodeDelegate="$CGMDecodeDelegateDefault"
3048 CatDelegate="$CatDelegateDefault"
3049 ConvertDelegate="$ConvertDelegateDefault"
3050 GVCDecodeDelegate="$GVCDecodeDelegateDefault"
3051 DVIDecodeDelegate="$DVIDecodeDelegateDefault"
3052 EchoDelegate="$EchoDelegateDefault"
3053 EditorDelegate="$EditorDelegateDefault"
3054 FIGDecodeDelegate="$FIGDecodeDelegateDefault"
3055 GnuplotDecodeDelegate="$GnuplotDecodeDelegateDefault"
3056 HPGLDecodeDelegate="$HPGLDecodeDelegateDefault"
3057 HTMLDecodeDelegate="$HTMLDecodeDelegateDefault"
3058 ILBMDecodeDelegate="$ILBMDecodeDelegateDefault"
3059 ILBMEncodeDelegate="$ILBMEncodeDelegateDefault"
3060 LPDelegate="$LPDelegateDefault"
3061 LZWDecodeDelegate="$LZWDecodeDelegateDefault"
3062 LZWEncodeDelegate="$LZWEncodeDelegateDefault"
3063 LaunchDelegate="$LaunchDelegateDefault"
3064 MANDelegate="$MANDelegateDefault"
3065 MPEGDecodeDelegate="$MPEGDecodeDelegateDefault"
3066 MPEGEncodeDelegate="$MPEGEncodeDelegateDefault"
cristy3ed852e2009-09-05 21:47:34 +00003067 MogrifyDelegate="$MogrifyDelegateDefault"
cristy935c86e2010-06-05 23:50:07 +00003068 MrSIDDecodeDelegate="$MrSIDDecodeDelegateDefault"
3069 MVDelegate="$MVDelegateDefault"
cristy3ed852e2009-09-05 21:47:34 +00003070 PCLDelegate="$PCLDelegateDefault"
3071 PGPDecodeDelegate="$PGPDecodeDelegateDefault"
3072 POVDelegate="$POVDelegateDefault"
3073 PSDelegate="$PSDelegateDefault"
cristy3ed852e2009-09-05 21:47:34 +00003074 RLEEncodeDelegate="$RLEEncodeDelegateDefault"
3075 RMDelegate="$RMDelegateDefault"
cristy4689cf02010-02-17 21:15:45 +00003076 RSVGDecodeDelegate="$RSVGDecodeDelegateDefault"
cristy3ed852e2009-09-05 21:47:34 +00003077 SCANDecodeDelegate="$SCANDecodeDelegateDefault"
3078 ShowImageDelegate="$ShowImageDelegateDefault"
3079 TXTDelegate="$TXTDelegateDefault"
cristy5ac9ac82010-07-29 13:24:24 +00003080 UniconvertorDelegate="$UniconvertorDelegateDefault"
cristy3ed852e2009-09-05 21:47:34 +00003081 WMFDecodeDelegate="$WMFDecodeDelegateDefault"
3082 WWWDecodeDelegate="$WWWDecodeDelegateDefault"
3083 XPSDelegate="$XPSDelegateDefault"
3084 ZipDelegate="$ZipDelegateDefault"
3085fi
3086
3087# Delegate substitutions
3088AC_SUBST(AutotraceDecodeDelegate)
cristy3ed852e2009-09-05 21:47:34 +00003089AC_SUBST(BlenderDecodeDelegate)
3090AC_SUBST(BZIPDelegate)
3091AC_SUBST(BrowseDelegate)
3092AC_SUBST(CGMDecodeDelegate)
3093AC_SUBST(CatDelegate)
3094AC_SUBST(ConvertDelegate)
3095AC_SUBST(GVCDecodeDelegate)
3096AC_SUBST(DVIDecodeDelegate)
3097AC_SUBST(EchoDelegate)
3098AC_SUBST(EditorDelegate)
3099AC_SUBST(FIGDecodeDelegate)
3100AC_SUBST(GnuplotDecodeDelegate)
cristy3ed852e2009-09-05 21:47:34 +00003101AC_SUBST(HPGLDecodeDelegate)
3102AC_SUBST(HTMLDecodeDelegate)
3103AC_SUBST(ILBMDecodeDelegate)
3104AC_SUBST(ILBMEncodeDelegate)
3105AC_SUBST(LPDelegate)
3106AC_SUBST(LZWDecodeDelegate)
3107AC_SUBST(LZWEncodeDelegate)
3108AC_SUBST(LaunchDelegate)
3109AC_SUBST(MANDelegate)
3110AC_SUBST(MPEGDecodeDelegate)
3111AC_SUBST(MPEGEncodeDelegate)
cristy3ed852e2009-09-05 21:47:34 +00003112AC_SUBST(MogrifyDelegate)
cristy935c86e2010-06-05 23:50:07 +00003113AC_SUBST(MrSIDDecodeDelegate)
3114AC_SUBST(MVDelegate)
cristy3ed852e2009-09-05 21:47:34 +00003115AC_SUBST(PCLDelegate)
3116AC_SUBST(PGPDecodeDelegate)
3117AC_SUBST(POVDelegate)
3118AC_SUBST(PSDelegate)
3119AC_SUBST(RLEEncodeDelegate)
3120AC_SUBST(RMDelegate)
3121AC_SUBST(SCANDecodeDelegate)
3122AC_SUBST(ShowImageDelegate)
3123AC_SUBST(TXTDelegate)
cristy5ac9ac82010-07-29 13:24:24 +00003124AC_SUBST(UniconvertorDelegate)
cristy3ed852e2009-09-05 21:47:34 +00003125AC_SUBST(WMFDecodeDelegate)
3126AC_SUBST(WWWDecodeDelegate)
3127AC_SUBST(XPSDelegate)
3128AC_SUBST(ZipDelegate)
3129
3130#
3131# RPM support.
3132#
3133RPM=''
3134AC_CHECK_PROGS(TAR,gnutar gtar tar)
3135AC_CHECK_PROGS(PERL,perl)
3136AC_CHECK_PROGS(RPM,rpmbuild rpm)
3137AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
3138AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
3139AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
3140AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
3141AC_SUBST(RPM)
3142AM_CONDITIONAL(RPM_DELEGATE, test "x$RPM" != "x" )
3143
3144#
3145# 7ZIP support (http://p7zip.sourceforge.net/)
3146#
3147P7ZIP=''
3148AC_CHECK_PROGS(P7ZIP,[7za])
3149AC_SUBST(P7ZIP)
3150AM_CONDITIONAL(P7ZIP_DELEGATE, test "x$P7ZIP" != "x" )
3151
3152#
3153# ZIP support (http://www.info-zip.org/Zip.html)
3154#
3155ZIP=''
3156AC_CHECK_PROGS(ZIP,[zip])
3157AC_SUBST(ZIP)
3158AM_CONDITIONAL(ZIP_DELEGATE, test "x$ZIP" != "x" )
3159
3160#
3161# GhostPCL related configuration.
3162#
3163PCLColorDevice=ppmraw
3164PCLCMYKDevice=bmpsep8
3165PCLMonoDevice=pbmraw
3166if test -z "$PCLVersion"; then
3167 PCLVersion='unknown'
3168fi
3169if test $have_pcl = 'yes'; then
3170 AC_MSG_RESULT([-------------------------------------------------------------])
3171 AC_MSG_CHECKING([for PCL])
3172 AC_MSG_RESULT([])
3173 # PCLColorDevice
3174 AC_MSG_CHECKING([for pcl color device])
3175 if $PCLDelegate -dBATCH -sDEVICE=$PCLColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3176 :
3177 else
3178 PCLColorDevice=ppmraw
3179 fi
3180 AC_MSG_RESULT([$PCLColorDevice])
3181
3182 # PCLCMYKDevice
3183 AC_MSG_CHECKING([for pcl CMYK device])
3184 if $PCLDelegate -dBATCH -sDEVICE=$PCLColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3185 :
3186 else
3187 PCLCMYKDevice=$PCLColorDevice
3188 fi
3189 AC_MSG_RESULT([$PCLCMYKDevice])
3190
3191 # PCLMonoDevice
3192 AC_MSG_CHECKING([for pcl mono device])
3193 if $PCLDelegate -dBATCH -sDEVICE=$PCLMonoDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3194 :
3195 else
3196 PCLMonoDevice=$PCLColorDevice
3197 fi
3198 AC_MSG_RESULT([$PCLMonoDevice])
3199fi
3200
3201AC_SUBST(PCLMonoDevice)
3202AC_SUBST(PCLColorDevice)
3203AC_SUBST(PCLCMYKDevice)
3204AC_SUBST(PCLVersion)
3205
3206#
3207# GhostXPS related configuration.
3208#
3209XPSColorDevice=ppmraw
3210XPSCMYKDevice=bmpsep8
3211XPSMonoDevice=pbmraw
3212if test -z "$XPSVersion"; then
3213 XPSVersion='unknown'
3214fi
3215if test $have_xps = 'yes'; then
3216 AC_MSG_RESULT([-------------------------------------------------------------])
3217 AC_MSG_CHECKING([for XPS])
3218 AC_MSG_RESULT([])
3219 # XPSColorDevice
3220 AC_MSG_CHECKING([for xps color device])
3221 if $XPSDelegate -dBATCH -sDEVICE=$XPSColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3222 :
3223 else
3224 XPSColorDevice=ppmraw
3225 fi
3226 AC_MSG_RESULT([$XPSColorDevice])
3227
3228 # XPSCMYKDevice
3229 AC_MSG_CHECKING([for xps CMYK device])
3230 if $XPSDelegate -dBATCH -sDEVICE=$XPSColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3231 :
3232 else
3233 XPSCMYKDevice=$XPSColorDevice
3234 fi
3235 AC_MSG_RESULT([$XPSCMYKDevice])
3236
3237 # XPSMonoDevice
3238 AC_MSG_CHECKING([for xps mono device])
3239 if $XPSDelegate -dBATCH -sDEVICE=$XPSMonoDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3240 :
3241 else
3242 XPSMonoDevice=$XPSColorDevice
3243 fi
3244 AC_MSG_RESULT([$XPSMonoDevice])
3245fi
3246
3247AC_SUBST(XPSMonoDevice)
3248AC_SUBST(XPSColorDevice)
3249AC_SUBST(XPSCMYKDevice)
3250AC_SUBST(XPSVersion)
3251
3252#
3253# Ghostscript related configuration.
3254#
cristya97426c2011-02-04 01:41:27 +00003255GSAlphaDevice=pngalpha
cristy3ed852e2009-09-05 21:47:34 +00003256GSColorDevice=pnmraw
3257GSCMYKDevice=pam
3258GSMonoDevice=pbmraw
3259GSPDFDevice=pdfwrite
3260GSPSDevice=pswrite
3261GSEPSDevice=epswrite
3262GSVersion='unknown'
3263if test $have_gs = 'yes'; then
3264 AC_MSG_RESULT([-------------------------------------------------------------])
3265 AC_MSG_CHECKING([for Ghostscript])
3266 AC_MSG_RESULT([])
3267 AC_MSG_CHECKING([for Ghostscript version])
3268 if GSVersion=`$PSDelegate --version`; then
3269 :
3270 else
3271 GSVersion=`$PSDelegate --help | sed -e '1q' | awk '{ print $3 }'`
3272 fi
3273 AC_MSG_RESULT([$GSVersion])
3274
3275 # GSAlphaDevice
3276 AC_MSG_CHECKING([for gs alpha device])
3277 if $PSDelegate -q -dBATCH -sDEVICE=$GSAlphaDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3278 :
3279 else
3280 GSAlphaDevice=pnmraw
3281 fi
3282 AC_MSG_RESULT([$GSAlphaDevice])
3283
3284 # GSColorDevice
3285 AC_MSG_CHECKING([for gs color device])
3286 if $PSDelegate -q -dBATCH -sDEVICE=$GSColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3287 :
3288 else
3289 GSColorDevice=pnmraw
3290 fi
3291 AC_MSG_RESULT([$GSColorDevice])
3292
3293 # GSCMYKDevice
3294 AC_MSG_CHECKING([for gs CMYK device])
3295 if $PSDelegate -q -dBATCH -sDEVICE=$GSCMYKDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3296 :
3297 else
3298 GSCMYKDevice=bmpsep8
3299 fi
3300 AC_MSG_RESULT([$GSCMYKDevice])
3301
3302 # GSMonoDevice
3303 AC_MSG_CHECKING([for gs mono device])
3304 if $PSDelegate -q -dBATCH -sDEVICE=$GSMonoDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3305 :
3306 else
3307 GSMonoDevice=$GSColorDevice
3308 fi
3309 AC_MSG_RESULT([$GSMonoDevice])
3310
3311 # GSPDFDevice
3312 AC_MSG_CHECKING([for gs PDF writing device])
3313 if $PSDelegate -q -dBATCH -sDEVICE=$GSPDFDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3314 :
3315 else
3316 GSPDFDevice=nodevice
3317 fi
3318 AC_MSG_RESULT([$GSPDFDevice])
3319
3320 # GSPSDevice
3321 AC_MSG_CHECKING([for gs PS writing device])
3322 if $PSDelegate -q -dBATCH -sDEVICE=$GSPSDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3323 :
3324 else
3325 GSPSDevice=nodevice
3326 fi
3327 AC_MSG_RESULT([$GSPSDevice])
3328
3329 # GSEPSDevice
3330 AC_MSG_CHECKING([for gs EPS writing device])
3331 if $PSDelegate -q -dBATCH -sDEVICE=$GSEPSDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3332 :
3333 else
3334 GSEPSDevice=nodevice
3335 fi
3336 AC_MSG_RESULT([$GSEPSDevice])
3337fi
3338
3339AC_SUBST(GSAlphaDevice)
3340AC_SUBST(GSCMYKDevice)
3341AC_SUBST(GSColorDevice)
3342AC_SUBST(GSEPSDevice)
3343AC_SUBST(GSMonoDevice)
3344AC_SUBST(GSPDFDevice)
3345AC_SUBST(GSPSDevice)
3346AC_SUBST(GSVersion)
3347
3348#
3349# PerlMagick-related configuration
3350#
3351
3352# Look for PERL if PerlMagick requested
3353# If name/path of desired PERL interpreter is specified, look for that one first
3354have_perl='no'
3355if test "$with_perl" != 'no'; then
3356 AC_MSG_RESULT([-------------------------------------------------------------])
3357 AC_MSG_CHECKING([for Perl])
3358 AC_MSG_RESULT([])
3359 if test "$with_perl" != 'yes'; then
3360 AC_CACHE_CHECK(for perl,ac_cv_path_PERL,ac_cv_path_PERL="$with_perl");
3361 PERL=$ac_cv_path_PERL
3362 AC_SUBST(PERL)dnl
3363 have_perl="$ac_cv_path_PERL"
3364 else
3365 AC_PATH_PROGS(PERL,perl perl5,)dnl
3366 if test "$ac_cv_path_PERL"; then
3367 have_perl="$ac_cv_path_PERL"
3368 fi
3369 fi
3370fi
3371
cristy949301e2010-01-06 01:38:40 +00003372if test "$with_perl" != 'yes' ; then
3373 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-perl=$with_perl "
3374fi
3375
3376PERL_SUPPORTS_DESTDIR='no'
3377
cristy3ed852e2009-09-05 21:47:34 +00003378with_perl_static='no'
3379with_perl_dynamic='no'
3380if test "$have_perl" != 'no'; then
3381 if test "$with_perl" != 'no' && test "$libtool_build_shared_libs" = 'no'; then
3382 with_perl_static='yes'
3383 fi
3384 if test "$with_perl" != 'no' && test "$libtool_build_shared_libs" = 'yes'; then
3385 with_perl_dynamic='yes'
3386 fi
3387 # Is PERL's MakeMaker new enough to support DESTDIR?
cristy964cb7f2010-04-25 23:18:00 +00003388 AX_PROG_PERL_VERSION(5.8.1,[PERL_SUPPORTS_DESTDIR='yes'],[PERL_SUPPORTS_DESTDIR='no'])
cristy3ed852e2009-09-05 21:47:34 +00003389fi
3390AM_CONDITIONAL(WITH_PERL, test "$have_perl" != 'no')
3391AM_CONDITIONAL(WITH_PERL_STATIC, test $with_perl_static = 'yes')
3392AM_CONDITIONAL(WITH_PERL_DYNAMIC, test $with_perl_dynamic = 'yes')
3393AC_SUBST(PERL_SUPPORTS_DESTDIR)
3394
3395# Determine path to pick up MagickCore library from for use with building PerlMagick
3396MAGICKCORE_PATH="${LIB_DIR}"
3397if test $with_perl_static = 'yes'; then
3398 # Find out where libtool hides its uninstalled libraries (as libtool_objdir)
3399 libtool_objdir=$objdir
3400
3401 # Linker search path to library, followed by -lMagickCore
3402 MAGICKCORE_PATH="${builddir}/magick/${libtool_objdir}"
3403fi
3404AC_SUBST(MAGICKCORE_PATH)
3405
3406# Create a simple string containing format names for all delegate libraries
3407DELEGATES=''
3408if test "$have_autotrace" = 'yes'; then DELEGATES="$DELEGATES autotrace"; fi
3409if test "$have_bzlib" = 'yes'; then DELEGATES="$DELEGATES bzlib"; fi
3410if test "$have_djvu" = 'yes'; then DELEGATES="$DELEGATES djvu"; fi
3411if test "$have_dps" = 'yes'; then DELEGATES="$DELEGATES dps"; fi
3412if test "$have_fftw" = 'yes'; then DELEGATES="$DELEGATES fftw"; fi
3413if test "$have_fpx" = 'yes'; then DELEGATES="$DELEGATES fpx"; fi
3414if test "$have_fontconfig" = 'yes'; then DELEGATES="$DELEGATES fontconfig"; fi
3415if test "$have_freetype" = 'yes'; then DELEGATES="$DELEGATES freetype"; fi
3416if test "$have_gslib" = 'yes'; then DELEGATES="$DELEGATES gs"; fi
3417if test "$have_gvc" = 'yes'; then DELEGATES="$DELEGATES gvc"; fi
3418if test "$have_jbig" = 'yes'; then DELEGATES="$DELEGATES jbig"; fi
3419if test "$have_jpeg" = 'yes'; then
3420 DELEGATES="$DELEGATES jpeg";
3421 if test "$have_png" = 'yes'; then DELEGATES="$DELEGATES jng"; fi
3422fi
3423if test "$have_jp2" = 'yes'; then DELEGATES="$DELEGATES jp2"; fi
cristy71203402010-06-18 13:12:03 +00003424if test "$have_lcms2" = 'yes'; then DELEGATES="$DELEGATES lcms2"; fi
cristy3ed852e2009-09-05 21:47:34 +00003425if test "$have_lcms" = 'yes'; then DELEGATES="$DELEGATES lcms"; fi
3426if test "$have_lqr" = 'yes'; then DELEGATES="$DELEGATES lqr"; fi
cristyfbb0ef02010-12-19 02:32:11 +00003427if test "$have_lzma" = 'yes'; then DELEGATES="$DELEGATES lzma"; fi
cristy3ed852e2009-09-05 21:47:34 +00003428if test "$have_ffmpeg" = 'yes'; then DELEGATES="$DELEGATES mpeg"; fi
3429if test "$have_openexr" = 'yes'; then DELEGATES="$DELEGATES openexr"; fi
3430if test "$have_png" = 'yes'; then DELEGATES="$DELEGATES png"; fi
3431if test "$have_rsvg" = 'yes'; then DELEGATES="$DELEGATES rsvg"; fi
3432if test "$have_tiff" = 'yes'; then DELEGATES="$DELEGATES tiff"; fi
3433if test "$have_x" = 'yes'; then DELEGATES="$DELEGATES x11"; fi
3434if test "$have_xml" = 'yes'; then DELEGATES="$DELEGATES xml"; fi
3435if test "$have_wmf" = 'yes'; then DELEGATES="$DELEGATES wmf"; fi
3436if test "$have_zlib" = 'yes'; then DELEGATES="$DELEGATES zlib"; fi
3437
3438AC_SUBST(DELEGATES)
3439
3440#
3441# Handle special compiler flags
3442#
3443
3444# Add '-p' if prof source profiling support enabled
3445if test "$enable_prof" = 'yes'; then
3446 CFLAGS="-p $CFLAGS"
3447 CXXFLAGS="-p $CXXFLAGS"
3448 LDFLAGS="-p $LDFLAGS"
3449fi
3450
3451# Add '-pg' if gprof source profiling support enabled
3452if test "$enable_gprof" = 'yes'; then
3453 CFLAGS="-pg $CFLAGS"
3454 CXXFLAGS="-pg $CXXFLAGS"
3455 LDFLAGS="-pg $LDFLAGS"
3456fi
3457
3458# Add '-ftest-coverage -fprofile-arcs' if gcov source profiling support enabled
3459# This is a gcc-specific feature
3460if test "$enable_gcov" = 'yes'; then
3461 AC_CHECK_LIB(gcov,_gcov_init)
3462 AC_CHECK_LIB(gcov,__gcov_init)
3463 case "$target_os" in
3464 darwin*)
3465 OSX_GCOV_LDFLAG="-Wl,-single_module"
3466 ;;
3467 *)
3468 OSX_GCOV_LDFLAG=""
3469 ;;
3470 esac
3471 AC_SUBST(OSX_GCOV_LDFLAG)
3472 CFLAGS="-ftest-coverage -fprofile-arcs $CFLAGS"
3473 CXXFLAGS="-ftest-coverage -fprofile-arcs $CXXFLAGS"
3474 LDFLAGS="-ftest-coverage -fprofile-arcs $LDFLAGS"
3475fi
3476
3477#
3478# Build library dependency list for libMagickCore
3479#
3480
3481MAGICK_LIBLTDL='' # Libltdl for build
3482MAGICK_API_LIBLTDL='' # libltdl for dependent application (API) build
3483MAGICK_LTDLDEPS='' # extra libltdl dependencies
3484if test "$with_ltdl" != 'no'
3485then
3486 if test \( "$with_included_ltdl" = 'no' -o "$enable_ltdl_convenience" = 'no' \) -o "$enable_ltdl_install" = 'yes'; then
3487 MAGICK_API_LIBLTDL='-lltdl'
3488 fi
3489 MAGICK_LIBLTDL=${LIBLTDL}
3490 MAGICK_LTDLDEPS=${LTDLDEPS}
3491fi
3492AC_SUBST(MAGICK_LIBLTDL)
3493AC_SUBST(MAGICK_LTDLDEPS)
3494
3495if test "$with_modules" != 'no'; then
cristyfbb0ef02010-12-19 02:32:11 +00003496 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 +00003497else
cristyb1860752011-03-14 00:27:46 +00003498 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 +00003499fi
3500AC_SUBST(MAGICK_DEP_LIBS)
3501
3502#
3503# Remove extraneous spaces from output variables (asthetic)
3504#
3505X_CFLAGS=`echo $X_CFLAGS | sed -e 's/ */ /g'`
3506X_PRE_LIBS=`echo $X_PRE_LIBS | sed -e 's/ */ /g'`
3507X_LIBS=`echo $X_LIBS | sed -e 's/ */ /g'`
3508X_EXTRA_LIBS=`echo $X_EXTRA_LIBS | sed -e 's/ */ /g'`
3509
3510CC=`echo $CC | sed -e 's/ */ /g'`
3511CFLAGS=`echo $CFLAGS | sed -e 's/ */ /g'`
3512CPPFLAGS=`echo $CPPFLAGS | sed -e 's/ */ /g'`
3513CXXFLAGS=`echo $CXXFLAGS | sed -e 's/ */ /g'`
3514DELEGATES=`echo $DELEGATES | sed -e 's/^ //g'`
3515DISTCHECK_CONFIG_FLAGS=`echo $DISTCHECK_CONFIG_FLAGS | sed -e 's/ */ /g'`
3516LDFLAGS=`echo $LDFLAGS | sed -e 's/ */ /g'`
3517TESTED_LIBS=`echo $LIBS | sed -e 's/ */ /g'`
3518MAGICK_DEP_LIBS=`echo $MAGICK_DEP_LIBS | sed -e 's/ */ /g'`
3519#LIBS=`echo $LIBS | sed -e 's/ */ /g'`
3520
3521# Pass only user-provided LIBS as "global" libraries
3522LIBS=$USER_LIBS
3523
3524#AC_SUBST(CPPFLAGS)
3525AC_SUBST(X_CFLAGS)
3526#AC_SUBST(LDFLAGS)
3527#AC_SUBST(X_PRE_LIBS)
3528#AC_SUBST(X_LIBS)
3529#AC_SUBST(X_EXTRA_LIBS)
3530
3531MAGICK_CFLAGS=$CFLAGS
3532MAGICK_CXXFLAGS="$CXXFLAGS"
3533MAGICK_CPPFLAGS=`echo $MAGICK_CPPFLAGS | sed -e 's/ */ /g'`
3534MAGICK_PCFLAGS=`echo $MAGICK_PCFLAGS | sed -e 's/ */ /g'`
3535MAGICK_LDFLAGS="-L$LIB_DIR $LDFLAGS"
3536MAGICK_LIBS="-lMagickCore $MAGICK_DEP_LIBS $MAGICK_API_LIBLTDL"
3537
3538AC_SUBST(MAGICK_CFLAGS)
3539AC_SUBST(MAGICK_CXXFLAGS)
3540AC_SUBST(MAGICK_CPPFLAGS)
3541AC_SUBST(MAGICK_PCFLAGS)
3542AC_SUBST(MAGICK_LDFLAGS)
3543AC_SUBST(MAGICK_LIBS)
cristyfd9dcd42010-08-08 18:07:02 +00003544AC_SUBST(MAGICK_FEATURES)
cristy3ed852e2009-09-05 21:47:34 +00003545
3546# Set configured scripts to executable.
3547AC_CONFIG_COMMANDS([default],[],[])
3548AC_CONFIG_COMMANDS([MagickCore-config.in],[chmod +x magick/MagickCore-config])
3549AC_CONFIG_COMMANDS([Magick-config.in],[chmod +x magick/Magick-config])
3550AC_CONFIG_COMMANDS([MagickWand-config.in],[chmod +x wand/MagickWand-config])
3551AC_CONFIG_COMMANDS([Wand-config.in],[chmod +x wand/Wand-config])
3552AC_CONFIG_COMMANDS([Magick++-config.in],[chmod +x Magick++/bin/Magick++-config])
3553AC_CONFIG_COMMANDS([PerlMagick/check.sh.in],[chmod +x PerlMagick/check.sh])
3554
3555AC_MSG_RESULT([-------------------------------------------------------------])
3556AC_MSG_RESULT([Update ImageMagick configuration])
3557AC_OUTPUT
3558
3559rm -f magick-version
3560
cristy430a7312010-01-21 20:44:04 +00003561result_dejavu_font_dir='none'
3562if test "${dejavu_font_dir}x" != 'x'; then
3563 result_dejavu_font_dir=$dejavu_font_dir
3564fi
3565
cristy3ed852e2009-09-05 21:47:34 +00003566result_ghostscript_font_dir='none'
3567if test "${ghostscript_font_dir}x" != 'x'; then
3568 result_ghostscript_font_dir=$ghostscript_font_dir
3569fi
3570
3571result_windows_font_dir='none'
3572if test "${windows_font_dir}x" != 'x'; then
3573 result_windows_font_dir=${windows_font_dir}
3574fi
3575
3576AC_MSG_RESULT([
3577ImageMagick is configured as follows. Please verify that this configuration
3578matches your expectations.
3579
3580Host system type: $host
3581Build system type: $build
3582
3583 Option Value
3584-------------------------------------------------------------------------------
3585Shared libraries --enable-shared=$enable_shared $libtool_build_shared_libs
3586Static libraries --enable-static=$enable_static $libtool_build_static_libs
3587Module support --with-modules=$with_modules $with_modules
3588GNU ld --with-gnu-ld=$with_gnu_ld $lt_cv_prog_gnu_ld
3589Quantum depth --with-quantum-depth=$with_quantum_depth $with_quantum_depth
3590High Dynamic Range Imagery
3591 --enable-hdri=$enable_hdri $enable_hdri
3592
3593Delegate Configuration:
3594BZLIB --with-bzlib=$with_bzlib $have_bzlib
3595Autotrace --with-autotrace=$with_autotrace $have_autotrace
cristy430a7312010-01-21 20:44:04 +00003596Dejavu fonts --with-dejavu-font-dir=$with_dejavu_font_dir $result_dejavu_font_dir
cristy3ed852e2009-09-05 21:47:34 +00003597DJVU --with-djvu=$with_djvu $have_djvu
3598DPS --with-dps=$with_dps $have_dps
3599FFTW --with-fftw=$with_fftw $have_fftw
3600FlashPIX --with-fpx=$with_fpx $have_fpx
3601FontConfig --with-fontconfig=$with_fontconfig $have_fontconfig
3602FreeType --with-freetype=$with_freetype $have_freetype
3603GhostPCL None $PCLDelegate ($PCLVersion)
3604GhostXPS None $XPSDelegate ($XPSVersion)
3605Ghostscript None $PSDelegate ($GSVersion)
3606Ghostscript fonts --with-gs-font-dir=$with_gs_font_dir $result_ghostscript_font_dir
3607Ghostscript lib --with-gslib=$with_gslib $have_gslib
3608Graphviz --with-gvc=$with_gvc $have_gvc
3609JBIG --with-jbig=$with_jbig $have_jbig
3610JPEG v1 --with-jpeg=$with_jpeg $have_jpeg
3611JPEG-2000 --with-jp2=$with_jp2 $have_jp2
cristy71203402010-06-18 13:12:03 +00003612LCMS v1 --with-lcms=$with_lcms $have_lcms
3613LCMS v2 --with-lcms2=$with_lcms2 $have_lcms2
cristy3ed852e2009-09-05 21:47:34 +00003614LQR --with-lqr=$with_lqr $have_lqr
cristyfbb0ef02010-12-19 02:32:11 +00003615LZMA --with-lzma=$with_lzma $have_lzma
cristy3ed852e2009-09-05 21:47:34 +00003616Magick++ --with-magick-plus-plus=$with_magick_plus_plus $have_magick_plus_plus
3617OpenEXR --with-openexr=$with_openexr $have_openexr
3618PERL --with-perl=$with_perl $have_perl
3619PNG --with-png=$with_png $have_png
3620RSVG --with-rsvg=$with_rsvg $have_rsvg
3621TIFF --with-tiff=$with_tiff $have_tiff
cristyb1860752011-03-14 00:27:46 +00003622WEBP --with-webp=$with_webp $have_webp
cristy3ed852e2009-09-05 21:47:34 +00003623Windows fonts --with-windows-font-dir=$with_windows_font_dir $result_windows_font_dir
3624WMF --with-wmf=$with_wmf $have_wmf
3625X11 --with-x=$with_x $have_x
3626XML --with-xml=$with_xml $have_xml
3627ZLIB --with-zlib=$with_zlib $have_zlib
3628
3629X11 Configuration:
3630 X_CFLAGS = $X_CFLAGS
3631 X_PRE_LIBS = $X_PRE_LIBS
3632 X_LIBS = $X_LIBS
3633 X_EXTRA_LIBS = $X_EXTRA_LIBS
3634
3635Options used to compile and link:
3636 PREFIX = $PREFIX_DIR
3637 EXEC-PREFIX = $EXEC_PREFIX_DIR
3638 VERSION = $PACKAGE_VERSION
3639 CC = $CC
3640 CFLAGS = $CFLAGS
cristy3ed852e2009-09-05 21:47:34 +00003641 CPPFLAGS = $MAGICK_CPPFLAGS
3642 PCFLAGS = $MAGICK_PCFLAGS
3643 DEFS = $DEFS
3644 LDFLAGS = $LDFLAGS
3645 MAGICK_LDFLAGS = $MAGICK_LDFLAGS
3646 LIBS = $MAGICK_LIBS
3647 CXX = $CXX
3648 CXXFLAGS = $CXXFLAGS
cristyfd9dcd42010-08-08 18:07:02 +00003649 FEATURES = $MAGICK_FEATURES
cristy3ed852e2009-09-05 21:47:34 +00003650])