blob: 76ea66a114d4399c9a5e3bed196a575231bf5769 [file] [log] [blame]
cristy1454be72011-12-19 01:52:48 +00001# Copyright 1999-2012 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
cristya448bd22011-10-14 12:38:13 +000017AC_PREREQ(2.67)
cristyfddf7752011-02-26 19:25:10 +000018
cristy4c08aed2011-07-01 19:47:50 +000019m4_define([magick_major_version], [7])
20m4_define([magick_minor_version], [0])
21m4_define([magick_micro_version], [0])
cristyd92eea22011-10-16 00:28:23 +000022m4_define([magick_patchlevel_version], [0])
cristyfddf7752011-02-26 19:25:10 +000023m4_define([magick_version],
cristy29eb34e2011-10-16 00:46:08 +000024 [magick_major_version.magick_minor_version.magick_micro_version-magick_patchlevel_version])
cristyd694ca32011-03-27 21:42:54 +000025m4_define([magick_svn_revision], esyscmd([sh -c "svnversion | sed -r 's/([0-9]+).*/\1/'"]))
cristyfddf7752011-02-26 19:25:10 +000026
cristy09b53e12011-10-14 12:47:22 +000027AC_INIT([ImageMagick],[magick_version],[http://www.imagemagick.org],[ImageMagick])
cristy4c08aed2011-07-01 19:47:50 +000028AC_CONFIG_SRCDIR([MagickCore/MagickCore.h])
cristy3ed852e2009-09-05 21:47:34 +000029AC_CONFIG_AUX_DIR([config])
30AC_CONFIG_MACRO_DIR([m4])
31AC_CONFIG_LIBOBJ_DIR([ltdl])
32AC_CONFIG_HEADERS([config/config.h])
cristy4c08aed2011-07-01 19:47:50 +000033AX_PREFIX_CONFIG_H([MagickCore/magick-config.h],[MagickCore])
cristy3ed852e2009-09-05 21:47:34 +000034AC_CONFIG_FILES([\
35 config/configure.xml \
36 config/delegates.xml \
37 config/ImageMagick.rdf \
38 config/MagickCore.dox \
39 config/MagickWand.dox \
cristy430a7312010-01-21 20:44:04 +000040 config/type-dejavu.xml \
cristy3ed852e2009-09-05 21:47:34 +000041 config/type-ghostscript.xml \
42 config/type-windows.xml \
43 config/type.xml \
44 ImageMagick.spec \
45 Magick++/bin/Magick++-config \
cristy4c08aed2011-07-01 19:47:50 +000046 MagickCore/ImageMagick.pc \
cristy3ed852e2009-09-05 21:47:34 +000047 Magick++/lib/ImageMagick++.pc \
48 Magick++/lib/Magick++.pc \
cristy4c08aed2011-07-01 19:47:50 +000049 MagickCore/MagickCore-config \
50 MagickCore/MagickCore.pc \
51 MagickCore/version.h \
cristy3ed852e2009-09-05 21:47:34 +000052 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 \
cristy4c08aed2011-07-01 19:47:50 +000069 MagickWand/MagickWand-config \
70 MagickWand/MagickWand.pc ])
cristy3ed852e2009-09-05 21:47:34 +000071
72#
73# Save initial user-tunable values
74#
75USER_LIBS=$LIBS
76for var in CC CFLAGS CPPFLAGS CXX CXXCPP LDFLAGS LIBS ; do
77 eval isset=\${$var+set}
78 if test "$isset" = 'set'; then
79 eval val=$`echo $var`
80 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS}'${var}=${val}' "
81 fi
82done
83AC_SUBST(DISTCHECK_CONFIG_FLAGS)
84
85CONFIGURE_ARGS="$0 ${ac_configure_args}"
86AC_SUBST(CONFIGURE_ARGS)
87
88# Source file containing package/library versioning information.
89. ${srcdir}/version.sh
90
cristy15a88782010-01-31 23:24:49 +000091echo "configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}${PACKAGE_VERSION_ADDENDUM}"
cristy837d6dc2010-02-27 01:16:57 +000092AC_CANONICAL_SYSTEM
cristy95646052009-11-28 23:05:30 +000093AC_CANONICAL_BUILD
94AC_CANONICAL_HOST
cristy3ed852e2009-09-05 21:47:34 +000095
cristy19615b82011-04-13 20:02:01 +000096MAGICK_TARGET_CPU=$host_cpu
cristy3225a072010-04-17 01:47:28 +000097AC_SUBST(MAGICK_TARGET_CPU)
98
cristy19615b82011-04-13 20:02:01 +000099MAGICK_TARGET_VENDOR=$host_vendor
cristy3225a072010-04-17 01:47:28 +0000100AC_SUBST(MAGICK_TARGET_VENDOR)
101
cristy19615b82011-04-13 20:02:01 +0000102MAGICK_TARGET_OS=$host_os
cristy3225a072010-04-17 01:47:28 +0000103AC_SUBST(MAGICK_TARGET_OS)
104
cristy3ed852e2009-09-05 21:47:34 +0000105# Substitute library versioning
106AC_SUBST(MAGICK_LIBRARY_CURRENT)dnl
107AC_SUBST(MAGICK_LIBRARY_REVISION)dnl
108AC_SUBST(MAGICK_LIBRARY_AGE)dnl
cristybab87c32010-02-09 20:54:22 +0000109AC_SUBST([MAGICK_LIBRARY_CURRENT_MIN],
110 [`expr $MAGICK_LIBRARY_CURRENT - $MAGICK_LIBRARY_AGE`])
111AC_SUBST([MAGICK_LIBRARY_VERSION_INFO],
112 [$MAGICK_LIBRARY_CURRENT:$MAGICK_LIBRARY_REVISION:$MAGICK_LIBRARY_AGE])
cristyd694ca32011-03-27 21:42:54 +0000113AC_SUBST([MAGICK_SVN_REVISION],[magick_svn_revision])
cristy3ed852e2009-09-05 21:47:34 +0000114
115AC_SUBST(PACKAGE_NAME)dnl
116AC_SUBST(PACKAGE_VERSION)dnl
cristy878c2f12011-08-19 00:25:19 +0000117AC_SUBST(PACKAGE_PERL_VERSION)dnl
cristy3ed852e2009-09-05 21:47:34 +0000118AC_SUBST(PACKAGE_RELEASE)dnl
119AC_SUBST(PACKAGE_CHANGE_DATE)dnl
120AC_SUBST(PACKAGE_LIB_VERSION)dnl
121AC_SUBST(PACKAGE_LIB_VERSION_NUMBER)dnl
122AC_SUBST(PACKAGE_RELEASE_DATE)dnl
cristy15a88782010-01-31 23:24:49 +0000123AC_SUBST(PACKAGE_VERSION_ADDENDUM)dnl
cristy3ed852e2009-09-05 21:47:34 +0000124
125# Ensure that make can run correctly
126AM_SANITY_CHECK
127
cristya448bd22011-10-14 12:38:13 +0000128AM_INIT_AUTOMAKE([1.11 color-tests foreign parallel-tests silent-rules subdir-objects dist-zip dist-bzip2 dist-xz])
cristy3ed852e2009-09-05 21:47:34 +0000129
130# Enable support for silent build rules
cristyfddf7752011-02-26 19:25:10 +0000131m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
cristy3ed852e2009-09-05 21:47:34 +0000132
133MAGICK_LIB_VERSION="0x"
134if test ${MAGICK_LIBRARY_CURRENT} -lt 10 ; then
135 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
136fi
137MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_CURRENT}
138if test ${MAGICK_LIBRARY_AGE} -lt 10 ; then
139 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
140fi
141MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_AGE}
142if test ${MAGICK_LIBRARY_REVISION} -lt 10 ; then
143 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
144fi
145MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_REVISION}
146AC_SUBST(MAGICK_LIB_VERSION)
147
148# Definition used to define MagickLibVersionText in version.h
149MAGICK_LIB_VERSION_TEXT="${PACKAGE_VERSION}"
150AC_SUBST(MAGICK_LIB_VERSION_TEXT)
151
152# Definition used to define MagickLibVersionNumber in version.h
153MAGICK_LIB_VERSION_NUMBER="${MAGICK_LIBRARY_CURRENT},${MAGICK_LIBRARY_AGE},${MAGICK_LIBRARY_REVISION}"
154AC_SUBST(MAGICK_LIB_VERSION_NUMBER)
155
156# Regenerate config.status if ChangeLog or version.sh is updated.
157AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/version.sh'])
158
159PERLMAINCC=$CC
160
161MAGICK_CFLAGS=''
162MAGICK_CPPFLAGS=$CPPFLAGS_USER
163MAGICK_PCFLAGS=$CPPFLAGS_USER
164MAGICK_LDFLAGS=''
165MAGICK_LIBS=''
cristyfd9dcd42010-08-08 18:07:02 +0000166MAGICK_FEATURES=''
cristy3ed852e2009-09-05 21:47:34 +0000167
168#
169# Evaluate shell variable equivalents to Makefile directory variables
170#
171if test "x$prefix" = xNONE; then
172 prefix=$ac_default_prefix
173fi
174# Let make expand exec_prefix.
175if test "x$exec_prefix" = xNONE; then
176 exec_prefix='${prefix}'
177fi
178
179#
180eval "eval PREFIX_DIR=${prefix}"
181AC_SUBST(PREFIX_DIR)
182eval "eval EXEC_PREFIX_DIR=${exec_prefix}"
183AC_SUBST(EXEC_PREFIX_DIR)
184eval "eval BIN_DIR=$bindir"
185AC_SUBST(BIN_DIR)
186eval "eval SBIN_DIR=$sbindir"
187AC_SUBST(SBIN_DIR)
188eval "eval LIBEXEC_DIR=$libexecdir"
189AC_SUBST(LIBEXEC_DIR)
190eval "eval DATA_DIR=$datadir"
191AC_SUBST(DATA_DIR)
cristyd55889c2011-03-27 00:50:24 +0000192eval "eval DOC_DIR=$docdir"
193AC_SUBST(DOC_DIR)
cristy3ed852e2009-09-05 21:47:34 +0000194eval "eval SYSCONF_DIR=$sysconfdir"
195AC_SUBST(SYSCONF_DIR)
196eval "eval SHAREDSTATE_DIR=$sharedstatedir"
197AC_SUBST(SHAREDSTATE_DIR)
198eval "eval LOCALSTATE_DIR=$localstatedir"
199AC_SUBST(LOCALSTATE_DIR)
200eval "eval LIB_DIR=$libdir"
201AC_SUBST(LIB_DIR)
202eval "eval INCLUDE_DIR=$includedir"
203AC_SUBST(INCLUDE_DIR)
204eval "eval PERSISTINCLUDE_DIR=$oldincludedir"
205AC_SUBST(PERSISTINCLUDE_DIR)
206eval "eval INFO_DIR=$infodir"
207AC_SUBST(INFO_DIR)
208eval "eval MAN_DIR=$mandir"
209AC_SUBST(MAN_DIR)
210
211# Get full paths to source and build directories
212srcdirfull="`cd $srcdir && pwd`"
213builddir="`pwd`"
214
215#
216# Compute variables useful for running uninstalled software.
217#
218MAGICK_CODER_MODULE_PATH="${builddir}/coders"
219MAGICK_CONFIGURE_SRC_PATH="${srcdirfull}/config"
220MAGICK_CONFIGURE_BUILD_PATH="${builddir}/config"
221MAGICK_FILTER_MODULE_PATH="${builddir}/filters"
222DIRSEP=':'
223case "${build_os}" in
224 mingw* )
225 MAGICK_CODER_MODULE_PATH=`$WinPathScript "${MAGICK_CODER_MODULE_PATH}" 0`
226 MAGICK_CONFIGURE_SRC_PATH=`$WinPathScript "${MAGICK_CONFIGURE_SRC_PATH}" 0`
227 MAGICK_CONFIGURE_BUILD_PATH=`$WinPathScript "${MAGICK_CONFIGURE_BUILD_PATH}" 0`
228 MAGICK_FILTER_MODULE_PATH=`$WinPathScript "${MAGICK_FILTER_MODULE_PATH}" 0`
229 DIRSEP=';'
230 ;;
231esac
232case "${host_os}" in
233 mingw* )
234 DIRSEP=';'
235 ;;
236esac
237AC_SUBST(MAGICK_CODER_MODULE_PATH)
238AC_SUBST(MAGICK_CONFIGURE_SRC_PATH)
239AC_SUBST(MAGICK_CONFIGURE_BUILD_PATH)
240AC_SUBST(MAGICK_FILTER_MODULE_PATH)
241AC_SUBST(DIRSEP)
242
cristya0b81c32010-01-22 02:54:33 +0000243
244#
245# Enable OS features.
246#
247AC_USE_SYSTEM_EXTENSIONS
248
cristy3ed852e2009-09-05 21:47:34 +0000249# Check for programs
250AC_PROG_CC
cristy95646052009-11-28 23:05:30 +0000251AC_PROG_CXX
cristy3ed852e2009-09-05 21:47:34 +0000252AC_PROG_CC_STDC
253AC_PROG_CPP
254AC_PROG_LD
cristy3ed852e2009-09-05 21:47:34 +0000255AC_SUBST(LD)
cristy837d6dc2010-02-27 01:16:57 +0000256AC_PROG_CC_C99
cristy3ed852e2009-09-05 21:47:34 +0000257AM_PROG_CC_C_O
cristy92703d82010-04-26 00:18:18 +0000258AX_CFLAGS_WARN_ALL
cristy3ed852e2009-09-05 21:47:34 +0000259AC_PROG_INSTALL
260AC_PROG_MAKE_SET
cristy3ed852e2009-09-05 21:47:34 +0000261AC_PROG_LN_S
262AM_WITH_DMALLOC
cristy92703d82010-04-26 00:18:18 +0000263AX_C___ATTRIBUTE__
cristy0d3a6382010-04-26 00:45:55 +0000264PKG_PROG_PKG_CONFIG
cristy3ed852e2009-09-05 21:47:34 +0000265
266#
cristy3ed852e2009-09-05 21:47:34 +0000267# Enable run-time checking.
268#
269AC_ARG_ENABLE([bounds-checking],
270 [AC_HELP_STRING([--bounds-checking],
271 [enable run-time bounds-checking])],
272 [enable_bounds_checking=$enableval],
273 [enable_bounds_checking='no'])
274
275if test "$enable_bounds_checking" = yes; then
276 AC_DEFINE([_FORTIFY_SOURCE], [2],
277 [enable run-time bounds-checking])
278fi
279
280#
281# Tests for Windows
282#
283AC_EXEEXT
284AC_OBJEXT
cristy0d3a6382010-04-26 00:45:55 +0000285AX_LANG_COMPILER_MS
cristy3ed852e2009-09-05 21:47:34 +0000286
287GDI32_LIBS=''
cristy3ed852e2009-09-05 21:47:34 +0000288native_win32_build='no'
289cygwin_build='no'
290case "${host_os}" in
291 cygwin* )
cristy3ed852e2009-09-05 21:47:34 +0000292 cygwin_build='yes'
293 GDI32_LIBS='-lgdi32'
294 ;;
295 mingw* )
cristy3ed852e2009-09-05 21:47:34 +0000296 native_win32_build='yes'
297 GDI32_LIBS='-lgdi32'
298 ;;
299esac
300if test "${GDI32_LIBS}x" != 'x'; then
301 AC_DEFINE(WINGDI32_DELEGATE,1,Define to use the Windows GDI32 library)
302fi
303AC_SUBST(GDI32_LIBS)
304AM_CONDITIONAL(WINGDI32_DELEGATE, test "${GDI32_LIBS}x" != 'x' )
305AM_CONDITIONAL(WIN32_NATIVE_BUILD, test "${native_win32_build}" = 'yes' )
306AM_CONDITIONAL(CYGWIN_BUILD, test "${cygwin_build}" = 'yes' )
307AM_CONDITIONAL(USING_CL, test "x${CC}" = 'xcl.exe' )
308
309WinPathScript="${srcdirfull}/winpath.sh"
310AC_SUBST(WinPathScript)
311
312#
313# Compiler flags tweaks
314#
315if test "${GCC}" != "yes"; then
316 case "${host}" in
317 *-*-hpux* )
318 # aCC: HP ANSI C++ B3910B A.03.34
319 CFLAGS="${CFLAGS} -Wp,-H30000"
320 if test -n "${CXXFLAGS}"; then
321 CXXFLAGS='-AA'
322 else
323 CXXFLAGS="${CXXFLAGS} -AA"
324 fi
325 ;;
326 *-dec-osf5.* )
327 # Compaq alphaev68-dec-osf5.1 compiler
328 if test -n "${CXXFLAGS}"; then
329 CXXFLAGS='-std strict_ansi -noimplicit_include'
330 else
331 CXXFLAGS="${CXXFLAGS} -std strict_ansi -noimplicit_include"
332 fi
333 esac
334fi
335
336# Check for lazy-loading.
337AC_CACHE_CHECK([for linker lazyload option],[im_cv_ld_lazyload],
338[
339im_cv_ld_lazyload='none'
340case "${host}" in
341 *-*-solaris2.8 | *-*-solaris2.9 | *-*-solaris2.1? )
342 if test "$lt_cv_prog_gnu_ld" != 'yes' ; then
343 im_cv_ld_lazyload='-Wl,-zlazyload'
344 fi
345 ;;
346esac
347])
348if test "${im_cv_ld_lazyload}" != 'none' ; then
349 if test -z "${LDFLAGS}" ; then
350 LDFLAGS="${im_cv_ld_lazyload}"
351 else
352 LDFLAGS="${im_cv_ld_lazyload} ${LDFLAGS}"
353 fi
354fi
355
356dnl Platform-specific stuff
357case "$host" in
358*darwin* | *-macos10*)
cristy3ed852e2009-09-05 21:47:34 +0000359 dnl OS X universal binary support, requires --disable-dependency-tracking
cristy43596fe2010-01-21 16:46:08 +0000360 AC_ARG_ENABLE([osx-universal-binary],
cristy3ed852e2009-09-05 21:47:34 +0000361 AC_HELP_STRING([--enable-osx-universal-binary],
362 [build universal binary on OS X [[default=no]]]),
363 [build_osxuniversal="${enableval}"], [build_osxuniversal=no])
364
365 if test "${build_osxuniversal}" != no ; then
366 if test "$enable_dependency_tracking" != no ; then
367 AC_MSG_ERROR([--enable-osx-universal-binary requires --disable-dependency-tracking.
368Please re-run configure with these options:
369 --disable-dependency-tracking --enable-osx-universal-binary
370 ])
371 fi
372 CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
373 CXXFLAGS="$CXXFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
374 LDFLAGS="$LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
375 fi
376 ;;
377esac
378
cristy0151ae12011-10-28 16:32:29 +0000379#
380# ARCH specific include directory
381#
cristy670aa3c2011-11-03 00:54:00 +0000382AC_ARG_WITH([includearch-dir],
383 [AC_HELP_STRING([--includearch-dir=DIR],
cristy0151ae12011-10-28 16:32:29 +0000384 [ARCH specific include directory])],
cristy670aa3c2011-11-03 00:54:00 +0000385 [includearch_dir=$withval],
386 [includearch_dir=$INCLUDE_DIR])
cristy0151ae12011-10-28 16:32:29 +0000387
cristy670aa3c2011-11-03 00:54:00 +0000388eval "eval INCLUDEARCH_DIR=$includearch_dir"
389AC_SUBST(INCLUDEARCH_DIR)
cristy0151ae12011-10-28 16:32:29 +0000390
391#
392# ARCH specific configuration directory
393#
cristy670aa3c2011-11-03 00:54:00 +0000394AC_ARG_WITH([sharearch-dir],
395 [AC_HELP_STRING([--sharearch-dir=DIR],
cristy0151ae12011-10-28 16:32:29 +0000396 [ARCH specific config directory])],
cristy670aa3c2011-11-03 00:54:00 +0000397 [sharearch_dir=$withval],
cristy408ebcd2011-11-14 01:36:57 +0000398 [sharearch_dir="${LIB_DIR}"])
cristy0151ae12011-10-28 16:32:29 +0000399
cristy670aa3c2011-11-03 00:54:00 +0000400eval "eval SHAREARCH_DIR=$sharearch_dir"
401SHAREARCH_DIR="$sharearch_dir"
402AC_SUBST(SHAREARCH_DIR)
cristy0151ae12011-10-28 16:32:29 +0000403
404#
cristy3ed852e2009-09-05 21:47:34 +0000405# Enable support for threads
406AC_ARG_WITH([threads],
cristy55bf91c2010-09-24 00:29:41 +0000407 [AC_HELP_STRING([--without-threads], [disable threads support])],
cristy3ed852e2009-09-05 21:47:34 +0000408 [with_threads=$withval],
409 [with_threads='yes'])
410
411have_threads=no
412if test "$with_threads" != 'no'; then
cristyf6fcb5d2010-09-24 01:19:13 +0000413 AX_PTHREAD()
cristy7acf8fb2010-09-23 19:58:53 +0000414 if test "$ax_pthread_ok" = yes; then
cristy3ed852e2009-09-05 21:47:34 +0000415 have_threads=yes
416 DEF_THREAD="$PTHREAD_CFLAGS"
417 CFLAGS="$CFLAGS $DEF_THREAD"
418 CXXFLAGS="$CXXFLAGS $DEF_THREAD"
419 if test "$CC" != "$PTHREAD_CC"; then
420 AC_MSG_WARN([Replacing compiler $CC with compiler $PTHREAD_CC to support pthreads.])
421 CC="$PTHREAD_CC"
422 fi
cristy55bf91c2010-09-24 00:29:41 +0000423 AC_DEFINE(THREAD_SUPPORT,1,[Define if you have POSIX threads libraries and header files.])
cristy3ed852e2009-09-05 21:47:34 +0000424 fi
425fi
426
427# Enable support for OpenMP
428if test "$have_threads" != 'yes'; then
429 ac_cv_prog_c_openmp=unsupported
430fi
431AC_OPENMP([C])
432CFLAGS="$OPENMP_CFLAGS $CFLAGS"
433MAGICK_PCFLAGS="$MAGICK_PCFLAGS $OPENMP_CFLAGS"
434AC_SUBST(OPENMP_CFLAGS)
cristy391f1ce2010-09-09 17:23:28 +0000435if test "$enable_openmp" != no; then
436 if test "$ac_cv_prog_c_openmp" != 'unsupported'; then
437 MAGICK_FEATURES="OpenMP $MAGICK_FEATURES"
438 fi
439fi
cristy3ed852e2009-09-05 21:47:34 +0000440
cristy736173a2009-09-20 21:18:22 +0000441# Enable support for OpenCL
cristy7141bca2010-01-21 16:51:24 +0000442AX_OPENCL([C])
cristyc7083c12009-10-14 03:16:55 +0000443CFLAGS="$CL_CFLAGS $CFLAGS"
444LIBS="$CL_LIBS $LIBS"
cristy18d9cfe2009-12-31 03:55:21 +0000445AC_SUBST(CL_CFLAGS)
cristy391f1ce2010-09-09 17:23:28 +0000446if test "$enable_opencl" != no; then
cristyf864d422011-09-12 17:57:53 +0000447 if test "X$ax_cv_check_cl_libcl" != Xno; then :
cristy391f1ce2010-09-09 17:23:28 +0000448 MAGICK_FEATURES="OpenCL $MAGICK_FEATURES"
449 fi
cristyfd9dcd42010-08-08 18:07:02 +0000450fi
cristy736173a2009-09-20 21:18:22 +0000451
cristy3ed852e2009-09-05 21:47:34 +0000452########
453#
454# Check for large file support
455#
456########
457AC_SYS_LARGEFILE
458AC_FUNC_FSEEKO
459LFS_CPPFLAGS=''
460if test "$enable_largefile" != no; then
cristyc1e0cc12011-09-21 16:41:16 +0000461 case $ac_cv_sys_file_offset_bits in
462 no)
463 # nothing to do here as the host supports LFS fine
464 ;;
465 unknown)
cristy3ed852e2009-09-05 21:47:34 +0000466 AC_MSG_CHECKING([for native large file support])
cristyda16f162011-02-19 23:52:17 +0000467 AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>
cristy3ed852e2009-09-05 21:47:34 +0000468 main () {
469 exit(!(sizeof(off_t) == 8));
cristyda16f162011-02-19 23:52:17 +0000470 }])],
cristy3ed852e2009-09-05 21:47:34 +0000471 [ac_cv_sys_file_offset_bits=64; AC_DEFINE(_FILE_OFFSET_BITS,64)
cristya448bd22011-10-14 12:38:13 +0000472 AC_MSG_NOTICE([yes])],
473 [AC_MSG_NOTICE([no])])
cristyc1e0cc12011-09-21 16:41:16 +0000474 ;;
475 *)
476 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
477 ;;
478 esac
cristy3ed852e2009-09-05 21:47:34 +0000479 if test "$ac_cv_sys_large_files" != 'no'; then
480 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGE_FILES=1"
481 fi
482 if test "$ac_cv_sys_largefile_source" != 'no'; then
483 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGEFILE_SOURCE=1"
484 fi
485fi
486AC_SUBST(LFS_CPPFLAGS)
487
cristy3ed852e2009-09-05 21:47:34 +0000488# Configure libtool
489AC_LIBTOOL_DLOPEN
490LT_INIT([win32-dll])
491LT_LANG([C++])
492AC_SUBST(LIBTOOL_DEPS)
493
494# Configure libltdl
495LT_CONFIG_LTDL_DIR([ltdl])
496LTDL_INIT([convenience nonrecursive])
497
498# Check to see if building shared libraries
499libtool_build_shared_libs='no'
500if test "$enable_shared" = 'yes'; then
501 libtool_build_shared_libs='yes'
502fi
503
504# Check to see if building static libraries
505libtool_build_static_libs='no'
506if test "$enable_static" = 'yes'; then
507 libtool_build_static_libs='yes'
508fi
509
cristyfa112112010-01-04 17:48:07 +0000510AM_CONDITIONAL(WITH_SHARED_LIBS, test "${libtool_build_shared_libs}" = 'yes')
cristy3ed852e2009-09-05 21:47:34 +0000511#
512# Enable support for building loadable modules
513#
514AC_ARG_WITH([modules],
515 [AC_HELP_STRING([--with-modules],
516 [enable building dynamically loadable modules])],
517 [with_modules=$withval],
cristy5a1cefd2010-01-06 20:42:35 +0000518 [with_modules='no'])
cristy3ed852e2009-09-05 21:47:34 +0000519
520# Only allow building loadable modules if we are building shared libraries
521if test "$with_modules" != 'no' ; then
522 if test "$libtool_build_shared_libs" = 'no'; then
523 AC_MSG_WARN([Modules may only be built if building shared libraries is enabled.])
524 with_modules='no'
525 fi
526fi
527if test "$with_modules" != 'no'; then
528 AC_DEFINE(BUILD_MODULES,1,Define if coders and filters are to be built as modules.)
529fi
530AM_CONDITIONAL(WITH_MODULES, test "$with_modules" != 'no')
531
532# Enable building/use of libltdl if we are building shared libraries regardless
533# of whether modules are built or not.
534with_ltdl='no'
535if test "$libtool_build_shared_libs" != 'no'; then
536 with_ltdl='yes'
537fi
538
539AM_CONDITIONAL(WITH_LTDL, test "$with_ltdl" != 'no')
540if test "$with_ltdl" != 'no'; then
541 AC_DEFINE(LTDL_DELEGATE,1,Define if using libltdl to support dynamically loadable modules)
542
543 # Set DLLDFLAGS
544 if test X"$enable_shared" = Xyes; then
545 DLLDFLAGS=-export-dynamic
546 AC_SUBST(DLLDFLAGS)
547 fi
548fi
549
550# Enable build using delegate libraries built in subdirectories rather than installed
cristyfbb0ef02010-12-19 02:32:11 +0000551# delegate libraries (bzlib fftw fpx gslib jp2 jbig jpeg lcms lzma png tiff ttf wmf xml zlib)
cristy3ed852e2009-09-05 21:47:34 +0000552AC_ARG_ENABLE([delegate-build],
553 [AC_HELP_STRING([--enable-delegate-build],
554 [look for delegate libraries in build directory])],
555 [enable_delegate_build=$enableval],
556 [enable_delegate_build='no'])
557
558AC_ARG_ENABLE([deprecated],
559 [AC_HELP_STRING([--disable-deprecated],
560 [exclude deprecated methods in MagickCore and MagickWand API's])],
561 [enable_deprecated=$enableval],
562 [enable_deprecated='no'])
563
564if test "$enable_deprecated" = 'yes'; then
565 AC_DEFINE(EXCLUDE_DEPRECATED,1,[exclude deprecated methods in MagickCore API])
566else
567 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-deprecated "
568fi
569
570# Build a version of ImageMagick which operates uninstalled.
571# Used to build distributions located via MAGICK_HOME / executable path
572AC_ARG_ENABLE([installed],
573 [AC_HELP_STRING([--disable-installed],
574 [Formally install ImageMagick under PREFIX])],
575 [enable_installed=$enableval],
576 [enable_installed='yes'])
577
578if test "$enable_installed" = 'yes'; then
579 AC_DEFINE(INSTALLED_SUPPORT,1,[ImageMagick is formally installed under prefix])
580else
581 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-installed "
582fi
583
584# Permit enciphering and deciphering image pixels.
585AC_ARG_ENABLE([cipher],
586 [AC_HELP_STRING([--disable-cipher],
587 [disable enciphering and deciphering image pixels])],
588 [enable_cipher=$enableval],
589 [enable_cipher='yes'])
590
591if test "$enable_cipher" = 'yes'; then
592 AC_DEFINE(CIPHER_SUPPORT,1,[permit enciphering and deciphering image pixels])
593fi
594
cristy6e3607c2011-09-13 13:59:17 +0000595# Build a zero-configuration version of ImageMagick.
596AC_ARG_ENABLE([zero-configuration],
597 [AC_HELP_STRING([--enable-zero-configuration],
cristy3ed852e2009-09-05 21:47:34 +0000598 [enable self-contained, embeddable, zero-configuration ImageMagick])],
cristy6e3607c2011-09-13 13:59:17 +0000599 [enable_zero_configuration=$enableval],
600 [enable_zero_configuration='no'])
cristy3ed852e2009-09-05 21:47:34 +0000601
cristy6e3607c2011-09-13 13:59:17 +0000602if test "$enable_zero_configuration" = 'yes'; then
603 AC_DEFINE(ZERO_CONFIGURATION_SUPPORT,1,[Build self-contained, embeddable, zero-configuration ImageMagick])
cristy81af5702011-09-13 14:20:58 +0000604 MAGICK_FEATURES="Zero-Configuration $MAGICK_FEATURES"
cristy3ed852e2009-09-05 21:47:34 +0000605fi
606
607# Build a high dynamic range version of ImageMagick.
608AC_ARG_ENABLE([hdri],
609 [AC_HELP_STRING([--enable-hdri],
610 [accurately represent the wide range of intensity levels found in real scenes])],
611 [enable_hdri=$enableval],
612 [enable_hdri='no'])
613
614MAGICK_HDRI=""
615if test "$enable_hdri" = 'yes'; then
616 MAGICK_HDRI="HDRI"
cristyfa112112010-01-04 17:48:07 +0000617 AC_DEFINE(HDRI_SUPPORT,1,[accurately represent the wide range of intensity levels in real scenes])
cristyfd9dcd42010-08-08 18:07:02 +0000618 MAGICK_FEATURES="HDRI $MAGICK_FEATURES"
cristy3ed852e2009-09-05 21:47:34 +0000619fi
620AC_SUBST(MAGICK_HDRI)dnl
621
cristy3ed852e2009-09-05 21:47:34 +0000622# Build a version of ImageMagick with assert statements.
623AC_ARG_ENABLE([assert],
624 [AC_HELP_STRING([--disable-assert],
625 [disable assert() statements in build])],
626 [enable_assert=$enableval],
627 [enable_assert='yes'])
628
629if test "$enable_assert" = 'no'; then
630 AC_DEFINE(NDEBUG,1,[Turn off assert statements])
631fi
632
cristya448bd22011-10-14 12:38:13 +0000633# Don't emit "rebuild rules" for configure, Makefile.ins, etc.
cristy3ed852e2009-09-05 21:47:34 +0000634AM_MAINTAINER_MODE
635
cristy3ed852e2009-09-05 21:47:34 +0000636# Enable ccmalloc memory debugging support
637AC_ARG_ENABLE([ccmalloc],
638 [AC_HELP_STRING([--enable-ccmalloc],
639 [enable 'ccmalloc' memory debug support])],
640 [enable_ccmalloc=$enableval],
641 [enable_ccmalloc='no'])
642
643# Enable Electric Fence memory debugging support
644AC_ARG_ENABLE([efence],
645 [AC_HELP_STRING([--enable-efence],
646 [enable 'efence' memory debug support])],
647 [enable_efence=$enableval],
648 [enable_efence='no'])
649
650# Enable prof-based profiling support
651AC_ARG_ENABLE([prof],
652 [AC_HELP_STRING([--enable-prof],
653 [enable 'prof' profiling support])],
654 [enable_prof=$enableval],
655 [enable_prof='no'])
656
657# Enable gprof-based profiling support
658AC_ARG_ENABLE([gprof],
659 [AC_HELP_STRING([--enable-gprof],
660 [enable 'gprof' profiling support])],
661 [enable_gprof=$enableval],
662 [enable_gprof='no'])
663
664# Enable gcov-based profiling support
665AC_ARG_ENABLE([gcov],
666 [AC_HELP_STRING([--enable-gcov],
667 [enable 'gcov' profiling support])],
668 [enable_gcov=$enableval],
669 [enable_gcov='no'])
670
671enable_profiling='no'
672if test "$enable_prof" = 'yes' || test "$enable_gprof" = 'yes' || test "$enable_gcov" = 'yes'; then
673 enable_profiling='yes'
674 if test "$libtool_build_shared_libs" = 'yes'; then
675 echo "Warning: Can not profile code using shared libraries"
676 fi
677fi
678
679# Magick API method prefix
680AC_ARG_WITH([method-prefix],
681 [AC_HELP_STRING([--with-method-prefix=PREFIX],
682 [prefix MagickCore API methods])],
683 [with_method_prefix=$enableval],
684 [with_method_prefix=''])
685
686if test "$with_method_prefix" != ''; then
687 AC_DEFINE_UNQUOTED(NAMESPACE_PREFIX,$with_method_prefix,[Magick API method prefix])
688fi
689
690# Number of bits in a Quantum
691AC_ARG_WITH([quantum-depth],
692 [AC_HELP_STRING([--with-quantum-depth=DEPTH],
693 [number of bits in a pixel quantum (default 16)])],
694 [with_quantum_depth=$withval],
695 [with_quantum_depth=16])
696
697if test "$with_quantum_depth" != '8'; then
698 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-quantum-depth=$with_quantum_depth "
699fi
700
701case "${with_quantum_depth}" in
702 8 ) ;;
703 16 ) ;;
704 32 ) ;;
705 64 ) ;;
cristycdae12a2010-09-19 02:24:31 +0000706 * ) AC_MSG_ERROR("Pixel quantum depth must have value of 8, 16, 32, or 64") ;;
cristy3ed852e2009-09-05 21:47:34 +0000707esac
708QUANTUM_DEPTH="$with_quantum_depth"
709AC_DEFINE_UNQUOTED(QUANTUM_DEPTH,$QUANTUM_DEPTH,[Number of bits in a pixel Quantum (8/16/32/64)])
710AC_SUBST(QUANTUM_DEPTH)dnl
711
712# Set pixel cache threshold
713AC_ARG_WITH([cache],
714 [AC_HELP_STRING([--with-cache=THRESHOLD],
715 [set pixel cache threshhold in MB (default available memory)])],
716 [with_cache=$withval],
717 [with_cache=''])
718
719if test "$with_cache" != ''; then
720 AC_DEFINE_UNQUOTED(PixelCacheThreshold,$with_cache,[Pixel cache threshold in MB (defaults to available memory)])
721 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-cache=$with_cache "
722fi
723
724# Disable/Enable support for full delegate paths
725AC_ARG_WITH([frozenpaths],
726 [AC_HELP_STRING([--with-frozenpaths],
727 [freeze delegate paths])],
728 [with_frozenpaths=$withval],
729 [with_frozenpaths='no'])
730
731# Enable build/install of Magick++
732AC_ARG_WITH([magick-plus-plus],
733 [AC_HELP_STRING([--without-magick-plus-plus],
734 [disable build/install of Magick++])],
735 [with_magick_plus_plus=$withval],
736 [with_magick_plus_plus='yes'])
737
738# Disable build/install of PerlMagick.
739AC_ARG_WITH([perl],
740 [AC_HELP_STRING([--with-perl],
741 [enable build/install of PerlMagick])],
742 [with_perl=$withval],
cristyb5f4e2f2010-04-25 00:49:11 +0000743 [with_perl='no'])
cristy3ed852e2009-09-05 21:47:34 +0000744
745# Options to pass when configuring PerlMagick
746AC_ARG_WITH([perl-options],
747 [AC_HELP_STRING([--with-perl-options=OPTIONS],
cristy949301e2010-01-06 01:38:40 +0000748 [options to pass on command-line when generating PerlMagick's build file])],
749PERL_MAKE_OPTIONS=$withval)
cristy3ed852e2009-09-05 21:47:34 +0000750AC_SUBST(PERL_MAKE_OPTIONS)
751
cristy3ed852e2009-09-05 21:47:34 +0000752# Enable umem, object-caching memory allocation library.
753AC_ARG_WITH(umem,
754 [ --with-umem enable umem memory allocation library support],
755 [with_umem=$withval],
756 [with_umem='no'])
757if test "$with_umem" != 'yes' ; then
758 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-umem=$with_umem "
759fi
760
761#
762# Specify path to shared libstdc++ if not in normal location
763#
764AC_ARG_WITH([libstdc],
765 [AC_HELP_STRING([--with-libstdc=DIR],
766 [ use libstdc++ in DIR (for GNU C++)])],
767 [with_libstdc=$withval],
768 [with_libstdc=''])
769
770if test "$with_libstdc" != ''; then
771 if test -d "$with_libstdc"; then
772 LIBSTDCLDFLAGS="-L$with_libstdc"
773 fi
774fi
775AC_SUBST(LIBSTDCLDFLAGS)
776
777# Does gcc required -traditional?
778AC_PROG_GCC_TRADITIONAL
779
780########
781#
782# Set defines required to build DLLs and modules using MinGW
783#
784########
785# These options are set for multi-thread DLL module build
786# libMagickCore: _DLL _MAGICKMOD_ _MAGICKLIB_
787# module: _DLL
788# executable/Magick++: _DLL _MAGICKMOD_
789MODULE_EXTRA_CPPFLAGS=''
790LIBRARY_EXTRA_CPPFLAGS=''
791if test "${native_win32_build}" = 'yes'; then
792 if test "${libtool_build_shared_libs}" = 'yes'; then
793 CPPFLAGS="$CPPFLAGS -D_DLL"
794 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_DLL"
795 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_DLL"
796 LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKLIB_"
797 if test "$with_modules" = 'yes'; then
798 LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKMOD_"
799 else
800 MODULE_EXTRA_CPPFLAGS="$MODULE_EXTRA_CPPFLAGS -D_MAGICKLIB_"
801 fi
802 else
803 CPPFLAGS="$CPPFLAGS -D_LIB"
804 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_LIB"
805 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_LIB"
806 fi
807 if test "$with_threads" = 'yes'; then
808 CPPFLAGS="$CPPFLAGS -D_MT"
809 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_MT"
810 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_MT"
811 fi
812fi
813AC_SUBST(MODULE_EXTRA_CPPFLAGS)
814AC_SUBST(LIBRARY_EXTRA_CPPFLAGS)
815
816# Check standard headers
817AC_HEADER_STDC
818if ! test x"$ac_cv_header_stdc" = x"yes"; then
819 AC_MSG_WARN([configure has detected that you do not have the ANSI standard C
820 header files. Compilation cannot proceed. Please install the ANSI C
821 headers and rerun this script.]);
822fi
cristya0b81c32010-01-22 02:54:33 +0000823AC_HEADER_ASSERT
cristy3ed852e2009-09-05 21:47:34 +0000824AC_HEADER_DIRENT
825
826# Check additional headers
cristya8549b12011-05-18 19:05:08 +0000827AC_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 xlocale.h)
cristy3ed852e2009-09-05 21:47:34 +0000828
829########
830#
831# Checks for typedefs, structures, and compiler characteristics.
832#
833########
834
835AC_HEADER_STDBOOL
836AC_C_VOLATILE
837AC_C_STRINGIZE
838AC_HEADER_STAT
839AC_HEADER_TIME
840AC_STRUCT_TM
cristy92703d82010-04-26 00:18:18 +0000841AC_STRUCT_TIMEZONE
cristy3ed852e2009-09-05 21:47:34 +0000842AC_SYS_INTERPRETER
843
cristy3ed852e2009-09-05 21:47:34 +0000844# If the C compiler supports the keyword inline, do nothing. Otherwise
845# define inline to __inline__ or __inline if it accepts one of those,
846# otherwise define inline to be empty.
847AC_C_INLINE
848
849# If the C compiler supports the keyword restrict, do nothing. Otherwise
850# define restrict to __restrict__ or __restrict if it accepts one of those,
851# otherwise define restrict to be empty.
852AC_C_RESTRICT
853
854# If words are stored with the most significant byte first (like
855# Motorola and SPARC CPUs), define `WORDS_BIGENDIAN'.
856AC_C_BIGENDIAN
857
cristy501c8042011-05-26 17:46:28 +0000858# Define to a suitable type, if standard headers do not define it.
859AC_TYPE_INT8_T
860AC_TYPE_INT16_T
861AC_TYPE_INT32_T
862AC_TYPE_INT64_T
863AC_TYPE_INTMAX_T
864AC_TYPE_INTPTR_T
865AC_TYPE_LONG_DOUBLE
cristy3ed852e2009-09-05 21:47:34 +0000866AC_TYPE_LONG_DOUBLE_WIDER
cristy501c8042011-05-26 17:46:28 +0000867AC_TYPE_LONG_LONG_INT
868AC_TYPE_MBSTATE_T
869AC_TYPE_MODE_T
870AC_TYPE_OFF_T
871AC_TYPE_PID_T
872AC_TYPE_SIZE_T
873AC_TYPE_SSIZE_T
874AC_TYPE_UID_T
875AC_TYPE_UINT8_T
876AC_TYPE_UINT16_T
877AC_TYPE_UINT32_T
878AC_TYPE_UINT64_T
879AC_TYPE_UINTMAX_T
880AC_TYPE_UINTPTR_T
881AC_TYPE_UNSIGNED_LONG_LONG_INT
cristy3ed852e2009-09-05 21:47:34 +0000882
883# If the C type char is unsigned, define __CHAR_UNSIGNED__, unless the
884# C compiler predefines it.
885AC_C_CHAR_UNSIGNED
886
887# Obtain size of an 'signed short' and define as SIZEOF_SIGNED_SHORT
888AC_CHECK_SIZEOF(signed short)
889
890# Obtain size of an 'unsigned short' and define as SIZEOF_UNSIGNED_SHORT
891AC_CHECK_SIZEOF(unsigned short)
892
893# Obtain size of an 'signed int' and define as SIZEOF_SIGNED_INT
894AC_CHECK_SIZEOF(signed int)
895
896# Obtain size of an 'unsigned int' and define as SIZEOF_UNSIGNED_INT
897AC_CHECK_SIZEOF(unsigned int)
898
899# Obtain size of a 'signed long' and define as SIZEOF_SIGNED_LONG
900AC_CHECK_SIZEOF(signed long)
901
902# Obtain size of a 'unsigned long' and define as SIZEOF_UNSIGNED_LONG
903AC_CHECK_SIZEOF(unsigned long)
904
905# Obtain size of a 'long long' and define as SIZEOF_SIGNED_LONG_LONG. If
906# 'signed long long' is not supported then the value defined is zero.
907AC_CHECK_SIZEOF(signed long long)
908
909# Obtain size of a 'unsigned long long' and define as
910# SIZEOF_UNSIGNED_LONG_LONG. If 'unsigned long long' is not
911# supported then the value defined is zero.
912AC_CHECK_SIZEOF(unsigned long long)
913
914# Obtain size of off_t and define as SIZEOF_OFF_T
915AC_CHECK_SIZEOF(off_t)
916
917# Obtain size of size_t and define as SIZEOF_SIZE_T
918AC_CHECK_SIZEOF(size_t)
919
cristy330e9352010-06-01 18:42:49 +0000920# Obtain size of ssize_t and define as SIZEOF_SSIZE_T
921AC_CHECK_SIZEOF(ssize_t)
922
cristy3ed852e2009-09-05 21:47:34 +0000923# Obtain size of an unsigned int pointer and define as SIZEOF_UNSIGNED_INTP
924AC_CHECK_SIZEOF(unsigned int*)
925
926#
927# Compute sized types for current CPU and compiler options.
928#
929
930AC_MSG_CHECKING(for signed 8-bit type)
931INT8_T='signed char'
cristya448bd22011-10-14 12:38:13 +0000932AC_MSG_NOTICE($INT8_T)
cristy3ed852e2009-09-05 21:47:34 +0000933AC_SUBST(INT8_T)
934
935AC_MSG_CHECKING(for unsigned 8-bit type)
936UINT8_T='unsigned char'
cristya448bd22011-10-14 12:38:13 +0000937AC_MSG_NOTICE($UINT8_T)
cristy3ed852e2009-09-05 21:47:34 +0000938AC_SUBST(UINT8_T)
939
940AC_MSG_CHECKING(for signed 16-bit type)
941INT16_T='signed short'
cristya448bd22011-10-14 12:38:13 +0000942AC_MSG_NOTICE($INT16_T)
cristy3ed852e2009-09-05 21:47:34 +0000943AC_SUBST(INT16_T)
944
945AC_MSG_CHECKING(for unsigned 16-bit type)
946UINT16_T='unsigned short'
cristya448bd22011-10-14 12:38:13 +0000947AC_MSG_NOTICE($UINT16_T)
cristy3ed852e2009-09-05 21:47:34 +0000948AC_SUBST(UINT16_T)
949
950AC_MSG_CHECKING(for signed 32-bit type)
951INT32_T='none'
cristy6d5e20f2011-04-25 13:48:54 +0000952INT32_F='none'
cristy3ed852e2009-09-05 21:47:34 +0000953if test $ac_cv_sizeof_signed_int -eq 4; then
954 INT32_T='signed int'
cristy6d5e20f2011-04-25 13:48:54 +0000955 INT32_F='""'
cristy3ed852e2009-09-05 21:47:34 +0000956elif test $ac_cv_sizeof_signed_long -eq 4; then
957 INT32_T='signed long'
cristy6d5e20f2011-04-25 13:48:54 +0000958 INT32_F='"l"'
cristy3ed852e2009-09-05 21:47:34 +0000959fi
cristya448bd22011-10-14 12:38:13 +0000960AC_MSG_NOTICE($INT32_T)
cristy3ed852e2009-09-05 21:47:34 +0000961AC_SUBST(INT32_T)
cristy6d5e20f2011-04-25 13:48:54 +0000962AC_SUBST(INT32_F)
cristy3ed852e2009-09-05 21:47:34 +0000963
964AC_MSG_CHECKING(for unsigned 32-bit type)
965UINT32_T='none'
cristy6d5e20f2011-04-25 13:48:54 +0000966UINT32_F='none'
cristy3ed852e2009-09-05 21:47:34 +0000967if test $ac_cv_sizeof_unsigned_int -eq 4; then
968 UINT32_T='unsigned int'
cristy6d5e20f2011-04-25 13:48:54 +0000969 UINT32_F='""'
cristy3ed852e2009-09-05 21:47:34 +0000970elif test $ac_cv_sizeof_unsigned_long -eq 4; then
971 UINT32_T='unsigned long'
cristy6d5e20f2011-04-25 13:48:54 +0000972 UINT32_F='"l"'
cristy3ed852e2009-09-05 21:47:34 +0000973fi
cristya448bd22011-10-14 12:38:13 +0000974AC_MSG_NOTICE($UINT32_T)
cristy3ed852e2009-09-05 21:47:34 +0000975AC_SUBST(UINT32_T)
cristy6d5e20f2011-04-25 13:48:54 +0000976AC_SUBST(UINT32_F)
cristy3ed852e2009-09-05 21:47:34 +0000977
978AC_MSG_CHECKING(for signed 64-bit type)
979INT64_T='none'
cristy6d5e20f2011-04-25 13:48:54 +0000980INT64_F='none'
cristy3ed852e2009-09-05 21:47:34 +0000981if test $ac_cv_sizeof_signed_long -eq 8; then
982 INT64_T='signed long'
cristy6d5e20f2011-04-25 13:48:54 +0000983 INT64_F='"l"'
cristy3ed852e2009-09-05 21:47:34 +0000984elif test $ac_cv_sizeof_signed_long_long -eq 8; then
985 INT64_T='signed long long'
cristy6d5e20f2011-04-25 13:48:54 +0000986 INT64_F='"ll"'
cristy3ed852e2009-09-05 21:47:34 +0000987fi
cristy3a99dcf2011-12-17 01:29:40 +0000988case "${host_os}" in
cristy6d5e20f2011-04-25 13:48:54 +0000989 mingw* )
990 INT64_F='"I64"'
991 ;;
992esac
cristya448bd22011-10-14 12:38:13 +0000993AC_MSG_NOTICE($INT64_T)
cristy3ed852e2009-09-05 21:47:34 +0000994AC_SUBST(INT64_T)
cristy6d5e20f2011-04-25 13:48:54 +0000995AC_SUBST(INT64_F)
cristy3ed852e2009-09-05 21:47:34 +0000996
997AC_MSG_CHECKING(for unsigned 64-bit type)
998UINT64_T='none'
cristy6d5e20f2011-04-25 13:48:54 +0000999UINT64_F='none'
cristy3ed852e2009-09-05 21:47:34 +00001000if test $ac_cv_sizeof_unsigned_long -eq 8; then
1001 UINT64_T='unsigned long'
cristy6d5e20f2011-04-25 13:48:54 +00001002 UINT64_F='"l"'
cristy3ed852e2009-09-05 21:47:34 +00001003elif test $ac_cv_sizeof_unsigned_long_long -eq 8; then
1004 UINT64_T='unsigned long long'
cristy6d5e20f2011-04-25 13:48:54 +00001005 UINT64_F='"ll"'
cristy3ed852e2009-09-05 21:47:34 +00001006fi
cristy3a99dcf2011-12-17 01:29:40 +00001007case "${host_os}" in
cristy6d5e20f2011-04-25 13:48:54 +00001008 mingw* )
1009 UINT64_F='"I64"'
1010 ;;
1011esac
cristya448bd22011-10-14 12:38:13 +00001012AC_MSG_NOTICE($UINT64_T)
cristy3ed852e2009-09-05 21:47:34 +00001013AC_SUBST(UINT64_T)
cristy6d5e20f2011-04-25 13:48:54 +00001014AC_SUBST(UINT64_F)
cristy3ed852e2009-09-05 21:47:34 +00001015
1016AC_MSG_CHECKING(for unsigned maximum type)
1017UINTMAX_T='none'
cristy6d5e20f2011-04-25 13:48:54 +00001018UINTMAX_F='none'
cristy3ed852e2009-09-05 21:47:34 +00001019if test "$UINT64_T" != 'none'; then
1020 UINTMAX_T=$UINT64_T
cristy6d5e20f2011-04-25 13:48:54 +00001021 UINTMAX_F=$UINT64_F
cristy3ed852e2009-09-05 21:47:34 +00001022elif test "$UINT32_T" != 'none'; then
1023 UINTMAX_T=$UINT32_T
cristy6d5e20f2011-04-25 13:48:54 +00001024 UINTMAX_F=$UINT32_F
cristy3ed852e2009-09-05 21:47:34 +00001025fi
cristya448bd22011-10-14 12:38:13 +00001026AC_MSG_NOTICE($UINTMAX_T)
cristy3ed852e2009-09-05 21:47:34 +00001027AC_SUBST(UINTMAX_T)
cristy6d5e20f2011-04-25 13:48:54 +00001028AC_SUBST(UINTMAX_F)
cristy3ed852e2009-09-05 21:47:34 +00001029
1030AC_MSG_CHECKING(for pointer difference type)
1031UINTPTR_T='none'
cristy6d5e20f2011-04-25 13:48:54 +00001032UINTPTR_F='none'
cristy3ed852e2009-09-05 21:47:34 +00001033if test $ac_cv_sizeof_unsigned_long -eq $ac_cv_sizeof_unsigned_intp; then
1034 UINTPTR_T='unsigned long'
cristy6d5e20f2011-04-25 13:48:54 +00001035 UINTPTR_F='"l"'
cristy3ed852e2009-09-05 21:47:34 +00001036elif test $ac_cv_sizeof_unsigned_long_long -eq $ac_cv_sizeof_unsigned_intp; then
1037 UINTPTR_T='unsigned long long'
cristy6d5e20f2011-04-25 13:48:54 +00001038 UINTPTR_F='"ll"'
cristy3ed852e2009-09-05 21:47:34 +00001039fi
cristya448bd22011-10-14 12:38:13 +00001040AC_MSG_NOTICE($UINTPTR_T)
cristy3ed852e2009-09-05 21:47:34 +00001041AC_SUBST(UINTPTR_T)
cristy6d5e20f2011-04-25 13:48:54 +00001042AC_SUBST(UINTPTR_F)
cristy3ed852e2009-09-05 21:47:34 +00001043
1044AC_MSG_CHECKING([whether our compiler supports __func__])
1045AC_TRY_COMPILE([],
1046 [{ const char *func = __func__; return(func != 0 ? 0 : 1); }],
cristya448bd22011-10-14 12:38:13 +00001047 AC_MSG_NOTICE([yes]),
1048 AC_MSG_NOTICE([no])
cristy3ed852e2009-09-05 21:47:34 +00001049 AC_MSG_CHECKING([whether our compiler supports __FUNCTION__])
1050 AC_TRY_COMPILE([],
1051 [{ const char *func = __FUNCTION__; return(func != 0 ? 0 : 1); }],
cristya448bd22011-10-14 12:38:13 +00001052 AC_MSG_NOTICE([yes])
cristy3ed852e2009-09-05 21:47:34 +00001053 AC_DEFINE(__func__, __FUNCTION__,
1054 [Define to appropriate substitue if compiler does not have __func__]),
cristya448bd22011-10-14 12:38:13 +00001055 AC_MSG_NOTICE([no])
cristy3ed852e2009-09-05 21:47:34 +00001056 AC_DEFINE(__func__, __FILE__,
1057 [Define to appropriate substitue if compiler does not have __func__])))
1058
1059########
1060#
1061# Check for functions
1062#
1063########
1064MAGICK_FUNC_MMAP_FILEIO
1065AC_FUNC_CLOSEDIR_VOID
1066AC_FUNC_MMAP
1067AC_FUNC_FORK
1068AC_FUNC_MEMCMP
1069AC_FUNC_SELECT_ARGTYPES
1070AC_FUNC_SETVBUF_REVERSED
1071AC_TYPE_SIGNAL
1072AC_FUNC_STRTOD
cristy7d4a1d62011-10-13 15:54:12 +00001073AC_FUNC_STRERROR_R
cristy3ed852e2009-09-05 21:47:34 +00001074AC_FUNC_VPRINTF
1075
cristy161b9262010-03-20 19:34:32 +00001076#
1077# Find math library
1078#
1079MATH_LIBS=''
1080AC_CHECK_LIB(m,sqrt,MATH_LIBS="-lm",,)
1081LIBS="$MATH_LIBS $LIBS"
1082AC_SUBST(MATH_LIBS)
1083
cristy82b20722011-11-05 21:52:36 +00001084AC_CHECK_FUNCS([acosh asinh atanh 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 isnan j0 j1 lltostr localtime_r lstat memmove memset mkstemp munmap nanosleep newlocale _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 strrchr strcspn strdup strpbrk strspn strstr strtod strtod_l strtol strtoul symlink sysconf sigemptyset sigaction spawnvp strerror strlcat strlcpy strcasecmp strncasecmp telldir tempnam times ulltostr uselocale usleep utime vfprintf vfprintf_l vsprintf vsnprintf vsnprintf_l waitpid _wfopen _wstat])
cristye43a45e2009-09-28 14:49:00 +00001085
1086#
1087# Check for clock_gettime().
1088#
1089AC_SEARCH_LIBS(clock_gettime, rt,
1090[
1091 AC_DEFINE([HAVE_CLOCK_GETTIME],[1],[Define to 1 if you have clock_gettime.])
1092 AC_MSG_CHECKING([whether clock_gettime supports CLOCK_REALTIME])
cristyda16f162011-02-19 23:52:17 +00001093 AC_COMPILE_IFELSE([
cristye43a45e2009-09-28 14:49:00 +00001094 AC_LANG_PROGRAM(
1095 [[#include <time.h>]],
cristyda16f162011-02-19 23:52:17 +00001096 [[clockid_t clockType = CLOCK_REALTIME;]])],
cristye43a45e2009-09-28 14:49:00 +00001097 [
cristya448bd22011-10-14 12:38:13 +00001098 AC_MSG_NOTICE(yes)
cristye43a45e2009-09-28 14:49:00 +00001099 AC_DEFINE([HAVE_CLOCK_REALTIME],[1],
1100 [Define to 1 if clock_gettime supports CLOCK_REALTIME.])
1101 ],
cristya448bd22011-10-14 12:38:13 +00001102 AC_MSG_NOTICE(no)
cristye43a45e2009-09-28 14:49:00 +00001103 )
1104 ],
1105 [
1106 AC_CHECK_FUNCS([gettimeofday ftime], [break])
1107 ]
1108)
cristy3ed852e2009-09-05 21:47:34 +00001109
1110########
1111#
1112# Check for function prototypes
1113#
1114########
1115
1116AC_CHECK_DECLS([pread, pwrite],[],[],[
1117#include <unistd.h>])
1118
1119AC_CHECK_DECLS([strlcpy],[],[],[
1120#include <strings.h>])
1121
1122AC_CHECK_DECLS([vsnprintf],[],[],[
1123#include <stdio.h>
1124#include <stdarg.h>])
1125
1126########
1127#
1128# C++ Support Tests (For Magick++)
1129#
1130########
1131have_magick_plus_plus='no'
1132if test "$with_magick_plus_plus" = 'yes'; then
1133 OLIBS="$LIBS"
1134 LIBS=''
1135 AC_LANG_PUSH(C++)
1136
1137 # Full set of headers used...
1138 # algorithm cctype cerrno cmath cstdio cstdlib cstring ctime exception
1139 # functional iomanip iosfwd iostream iterator list string strstream utility
1140 AC_LANG([C++])
1141 AC_PROG_CXX
cristy964cb7f2010-04-25 23:18:00 +00001142 AX_CXX_BOOL
1143 AX_CXX_NAMESPACES
1144 AX_CXX_NAMESPACE_STD
cristy3ed852e2009-09-05 21:47:34 +00001145 AC_CXX_HAVE_STD_LIBS
cristy3ed852e2009-09-05 21:47:34 +00001146 AC_OPENMP([C++])
1147 AC_LANG_POP
1148
1149 AC_MSG_CHECKING([whether C++ compiler is sufficient for Magick++])
1150 if \
cristy964cb7f2010-04-25 23:18:00 +00001151 test $ax_cv_cxx_bool = 'yes' && \
cristy964cb7f2010-04-25 23:18:00 +00001152 test $ax_cv_cxx_namespaces = 'yes' && \
cristy3ed852e2009-09-05 21:47:34 +00001153 test $ac_cv_cxx_have_std_libs = 'yes' && \
cristy964cb7f2010-04-25 23:18:00 +00001154 test $ax_cv_cxx_have_std_namespace = 'yes'; then
cristy3ed852e2009-09-05 21:47:34 +00001155 have_magick_plus_plus='yes'
1156 else
1157 have_magick_plus_plus='no (failed tests)'
1158 fi
cristya448bd22011-10-14 12:38:13 +00001159 AC_MSG_NOTICE([$have_magick_plus_plus])
cristy3ed852e2009-09-05 21:47:34 +00001160 LIBS="$OLIBS"
1161fi
1162AM_CONDITIONAL(WITH_MAGICK_PLUS_PLUS, test "$have_magick_plus_plus" = 'yes')
1163
1164# Only check for delegate libraries in subdirectories if requested.
1165if test "$enable_delegate_build" != 'no'; then
1166 # Check for delegate sub-directories and add -I & -L options as required.
1167 # This presumes that delegates are installed as detailed in the ImageMagick
1168 # README. If delegates are installed in a standard location where the
1169 # compiler will automatically find them then these options should not be
1170 # required.
1171
1172 #
1173 # Most delegates have includes in the same directory as the library, but not all...
1174 #
1175 # Includes
cristy749ce642011-11-23 01:07:20 +00001176 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 webp wmf/include xml/include zlib; do
cristy3ed852e2009-09-05 21:47:34 +00001177 if test -d "$builddir/$dir"; then
1178 CPPFLAGS="$CPPFLAGS -I$builddir/$dir"
1179 else
1180 if test -d "$srcdirfull/$dir"; then
1181 CPPFLAGS="$CPPFLAGS -I$srcdirfull/$dir"
1182 fi
1183 fi
1184 done
1185
1186 # Libraries
cristy749ce642011-11-23 01:07:20 +00001187 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 webp wmf/src xml zlib; do
cristy3ed852e2009-09-05 21:47:34 +00001188 if test -d "$builddir/$dir/.libs"; then
1189 LDFLAGS="$LDFLAGS -L$builddir/$dir/.libs"
1190 else
1191 if test -d "$srcdirfull/$dir/.libs"; then
1192 LDFLAGS="$LDFLAGS -L$srcdirfull/$dir/.libs"
1193 fi
1194 fi
1195 if test -d "$builddir/$dir"; then
1196 LDFLAGS="$LDFLAGS -L$builddir/$dir"
1197 else
1198 if test -d "$srcdirfull/$dir"; then
1199 LDFLAGS="$LDFLAGS -L$srcdirfull/$dir"
1200 fi
1201 fi
1202 done
1203fi
1204
1205# Assume that delegate headers reside under same directory as ImageMagick
1206# installation prefix.
1207MAGICK_CPPFLAGS="-I$INCLUDE_DIR/ImageMagick $MAGICK_CPPFLAGS"
1208
1209#
1210# Find the X11 RGB database
1211#
1212AC_CACHE_CHECK(for X11 configure files,im_cv_x_configure,
1213[# Look for the header file in a standard set of common directories.
1214# Check X11 before X11Rn because it is often a symlink to the current release.
1215 for ac_dir in \
1216 /lib/usr/lib/X11 \
1217 /usr/X11/lib \
1218 /usr/X11R4/lib \
1219 /usr/X11R5/lib \
1220 /usr/X11R6/lib \
1221 /usr/X11R7/lib \
1222 /usr/X386/lib \
1223 /usr/XFree86/lib/X11 \
1224 /usr/athena/lib \
1225 /usr/lib \
1226 /usr/lib/X11 \
1227 /usr/lib/X11R4 \
1228 /usr/lib/X11R5 \
1229 /usr/lib/X11R6 \
1230 /usr/lib/X11R7 \
1231 /usr/local/X11/lib \
1232 /usr/local/X11R4/lib \
1233 /usr/local/X11R5/lib \
1234 /usr/local/X11R6/lib \
1235 /usr/local/lib \
1236 /usr/local/lib/X11 \
1237 /usr/local/lib/X11R4 \
1238 /usr/local/lib/X11R5 \
1239 /usr/local/lib/X11R6 \
1240 /usr/local/lib/X11R7 \
1241 /usr/local/x11r5/lib \
1242 /usr/lpp/Xamples/lib \
1243 /usr/openwin/lib \
1244 /usr/openwin/share/lib \
1245 /usr/unsupported/lib \
1246 /usr/x386/lib \
1247 ; do
1248 if test -f "$ac_dir/X11/rgb.txt"; then
1249 im_cv_x_configure="$ac_dir/X11/"
1250 break
1251 elif test -f "$ac_dir/rgb.txt"; then
1252 im_cv_x_configure="$ac_dir/"
1253 break
1254 fi
1255
1256 done])
1257X11_CONFIGURE_PATH="$im_cv_x_configure"
1258case "${build_os}" in
1259 mingw* )
1260 X11ConfigurePath=`$WinPathScript "$X11ConfigurePath=" 1`
1261 ;;
1262esac
1263AC_DEFINE_UNQUOTED(X11_CONFIGURE_PATH,"$X11ConfigurePath",Location of X11 configure files)
1264
1265#
1266# Find OpenMP library
1267#
1268GOMP_LIBS=''
1269if test "$enable_openmp" != 'no'; then
1270 if test "${GCC}" = "yes"; then
cristy18307f12011-12-30 01:20:16 +00001271 # Open64 (passes for GCC but uses different OpenMP implementation)
1272 if test "x$GOMP_LIBS" = x ; then
1273 if $CC --version 2>&1 | grep Open64 > /dev/null ; then
1274 AC_CHECK_LIB(openmp,omp_get_num_procs,GOMP_LIBS="-lopenmp",,)
1275 fi
1276 fi
1277 # GCC
1278 if test "x$GOMP_LIBS" = x ; then
1279 AC_CHECK_LIB(gomp,GOMP_parallel_start,GOMP_LIBS="-lgomp",,)
1280 fi
cristy3ed852e2009-09-05 21:47:34 +00001281 else
cristy18307f12011-12-30 01:20:16 +00001282 # Sun CC
1283 if test "x$GOMP_LIBS" = x ; then
1284 AC_CHECK_LIB(mtsk,sunw_mp_register_warn,GOMP_LIBS="-lmtsk",,)
1285 fi
1286 # AIX xlc
1287 if test "x$GOMP_LIBS" = x ; then
1288 AC_CHECK_LIB(xlsmp,_xlsmpFlush,GOMP_LIBS="-lxlsmp",,)
1289 fi
1290 # SGI IRIX 6.5 MIPSpro C/C++
1291 if test "x$GOMP_LIBS" = x ; then
1292 AC_CHECK_LIB(mp,mp_destroy,GOMP_LIBS="-lmp",,)
1293 fi
cristy3ed852e2009-09-05 21:47:34 +00001294 fi
1295 LIBS="$GOMP_LIBS $LIBS"
1296fi
1297AC_SUBST(GOMP_LIBS)
1298
1299#
1300# Find Posix threads library
1301#
1302THREAD_LIBS=''
1303if test "$with_threads" != 'no' && test "$have_threads" = 'yes'; then
1304
1305 if test "x$PTHREAD_LIBS" = "x"; then
1306 case "${host_cpu}-${host_os}" in
1307 *-freebsd*)
1308 MAGICK_CHECK_PTHREAD_LIB(c_r,PTHREAD_LIBS=-lc_r) ;;
1309 esac
1310 fi
1311
1312 for lib in pthread pthreads; do
1313 if test "x$PTHREAD_LIBS" = "x"; then
1314 MAGICK_CHECK_PTHREAD_LIB([$lib],[PTHREAD_LIBS=-l$lib])
1315 fi
1316 done
1317
1318 THREAD_LIBS="$PTHREAD_LIBS"
1319 LIBS="$LIBS $THREAD_LIBS"
1320fi
1321AC_SUBST(THREAD_LIBS)
1322
1323#
1324# Check for umem.
1325#
1326have_umem='no'
1327UMEM_LIBS=''
1328if test "$with_umem" != 'no'; then
1329 AC_MSG_CHECKING(for UMEM support )
cristya448bd22011-10-14 12:38:13 +00001330 AC_MSG_NOTICE()
cristy3ed852e2009-09-05 21:47:34 +00001331 failed=0
1332 passed=0
1333 AC_CHECK_HEADER(umem.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1334 AC_CHECK_LIB(umem,umem_alloc,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1335 AC_CHECK_LIB(umem,umem_free,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1336 AC_MSG_CHECKING(if umem memory allocation library is complete)
1337 if test $passed -gt 0; then
1338 if test $failed -gt 0; then
cristya448bd22011-10-14 12:38:13 +00001339 AC_MSG_NOTICE(no -- some components failed test)
cristy3ed852e2009-09-05 21:47:34 +00001340 have_umem='no (failed tests)'
1341 else
1342 UMEM_LIBS='-lumem'
1343 LIBS="$UMEM_LIBS $LIBS"
1344 AC_DEFINE(HasUMEM,1,Define if you have umem memory allocation library)
cristya448bd22011-10-14 12:38:13 +00001345 AC_MSG_NOTICE(yes)
cristy3ed852e2009-09-05 21:47:34 +00001346 have_umem='yes'
1347 fi
1348 else
cristya448bd22011-10-14 12:38:13 +00001349 AC_MSG_NOTICE(no)
cristy3ed852e2009-09-05 21:47:34 +00001350 fi
1351fi
1352AM_CONDITIONAL(HasUMEM, test "$have_umem" = 'yes')
1353AC_SUBST(UMEM_LIBS)
1354
1355#
1356# Add support for ccmalloc memory debugging library if requested
1357#
1358have_ccmalloc='no'
1359CCMALLOC_LIBS=''
1360if test "$enable_ccmalloc" = 'yes'; then
1361 AC_PATH_PROG(CCMALLOCDelegate,ccmalloc,)
1362 if test -n "$CCMALLOCDelegate"; then
1363 eval `grep PREFIX= $CCMALLOCDelegate | sed -e 's/PREFIX/CCMALLOC_PREFIX/'`
1364 OLIBS="$LIBS"
1365 # Assume that gcc is used with ccmalloc.
1366 LIBS="$LIBS $CCMALLOC_PREFIX/lib/ccmalloc-gcc.o"
1367 AC_CHECK_LIB(ccmalloc,ccmalloc_malloc,CCMALLOC_LIBS="$CCMALLOC_PREFIX/lib/ccmalloc-gcc.o -lccmalloc -ldl",,-ldl)
1368 if test -n "$CCMALLOC_LIBS"; then
1369 LIBS="$OLIBS"
1370 LIBS="$LIBS $CCMALLOC_LIBS"
1371 have_ccmalloc='yes'
1372 else
1373 LIBS="$OLIBS"
1374 fi
1375 fi
1376fi
1377
1378#
1379# Add support for efence memory debugging library if requested
1380#
1381if test "$enable_efence" = 'yes'; then
1382 EFENCE_LIBS='-lefence'
1383 LIBS="$EFENCE_LIBS $LIBS"
1384fi
1385
cristy3ed852e2009-09-05 21:47:34 +00001386dnl ===========================================================================
1387
1388#
1389# Check for BZLIB
1390#
1391
1392AC_ARG_WITH([bzlib],
1393 [AC_HELP_STRING([--without-bzlib],
1394 [disable BZLIB support])],
1395 [with_bzlib=$withval],
1396 [with_bzlib='yes'])
1397
1398if test "$with_bzlib" != 'yes'; then
1399 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-bzlib=$with_bzlib "
1400fi
1401
1402have_bzlib='no'
1403if test "$with_bzlib" != 'no'; then
1404 BZLIB_LIBS=''
cristya448bd22011-10-14 12:38:13 +00001405 AC_MSG_NOTICE([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00001406 AC_MSG_CHECKING([for BZLIB])
cristya448bd22011-10-14 12:38:13 +00001407 AC_MSG_NOTICE([])
cristy3ed852e2009-09-05 21:47:34 +00001408 failed=0
1409 passed=0
1410 found_libbz=0
1411 AC_CHECK_HEADER(bzlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1412 AC_CHECK_LIB(bz2,BZ2_bzDecompress,found_libbz=`expr $found_libbz + 1`,,)
1413 if test "$native_win32_build" = 'yes'; then
1414 AC_CHECK_LIB(bz2,_imp__BZ2_decompress,found_libbz=`expr $found_libbz + 1`,,)
1415 fi
1416 if test $found_libbz -gt 0; then
1417 passed=`expr $passed + 1`
1418 else
1419 failed=`expr $failed + 1`
1420 fi
1421 AC_MSG_CHECKING(if BZLIB package is complete)
1422 if test $passed -gt 0; then
1423 if test $failed -gt 0; then
cristya448bd22011-10-14 12:38:13 +00001424 AC_MSG_NOTICE(no -- some components failed test)
cristy3ed852e2009-09-05 21:47:34 +00001425 have_bzlib='no (failed tests)'
1426 else
1427 BZLIB_LIBS='-lbz2'
1428 LIBS="$BZLIB_LIBS $LIBS"
1429 AC_DEFINE(BZLIB_DELEGATE,1,Define if you have the bzip2 library)
cristya448bd22011-10-14 12:38:13 +00001430 AC_MSG_NOTICE(yes)
cristy3ed852e2009-09-05 21:47:34 +00001431 have_bzlib='yes'
1432 fi
1433 else
cristya448bd22011-10-14 12:38:13 +00001434 AC_MSG_NOTICE(no)
cristy3ed852e2009-09-05 21:47:34 +00001435 fi
1436fi
1437AM_CONDITIONAL(BZLIB_DELEGATE, test "$have_bzlib" = 'yes')
1438AC_SUBST(BZLIB_LIBS)
1439
1440#
1441# Find the X11 include and library directories.
1442#
1443IPC_LIBS=''
1444X11_LIBS=''
1445XEXT_LIBS=''
1446XT_LIBS=''
1447AC_PATH_XTRA
1448if test "$no_x" != 'yes'; then
cristya448bd22011-10-14 12:38:13 +00001449 AC_MSG_NOTICE([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00001450 AC_MSG_CHECKING([for X11])
cristya448bd22011-10-14 12:38:13 +00001451 AC_MSG_NOTICE([])
cristy3ed852e2009-09-05 21:47:34 +00001452 LDFLAGS="$LDFLAGS $X_LIBS"
1453 X11_LIBS="$X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
1454 LIBS="$X11_LIBS $LIBS"
1455 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1456
1457 AC_DEFINE(X11_DELEGATE,1,Define if you have X11 library)dnl
1458
1459 #
1460 # Check for X11 shared memory extension
1461 #
1462 # shmctl is required to support the shared memory extension
1463 AC_CHECK_FUNC([shmctl],[have_shmctl='yes'],[])
1464 if test "$have_shmctl" != 'yes'; then
1465 PERSIST_LIBS=$LIBS
1466 LIBS="$LIBS -lcygipc"
1467 AC_TRY_LINK_FUNC([shmctl],[have_shmctl='yes'; IPC_LIBS='-lcygipc'],[])
1468 LIBS=$PERSIST_LIBS
1469 fi
1470
1471 if test "$have_shmctl" = 'yes'; then
1472 AC_CHECK_LIB([Xext],[XShmAttach],[XEXT_LIBS='-lXext' ; AC_DEFINE(HAVE_SHARED_MEMORY,1,X11 server supports shared memory extension)],[],[])
1473 fi
1474
1475 #
1476 # Check for X11 shape extension
1477 #
1478 AC_CHECK_LIB([Xext],[XShapeCombineMask],[XEXT_LIBS='-lXext' ; AC_DEFINE(HAVE_SHAPE,1,X11 server supports shape extension)],[],[])
1479 AC_CHECK_LIB(Xt,XtSetEventDispatcher,XT_LIBS='-lXt',,)
1480 LIBS="$XEXT_LIBS $XT_LIBS $LIBS"
1481fi
1482if test "$no_x" != 'yes'; then
1483 have_x='yes'
1484else
1485 have_x='no'
1486fi
1487AM_CONDITIONAL(X11_DELEGATE, test "$have_x" = 'yes')
1488AC_SUBST(X11_LIBS)
1489AC_SUBST(XEXT_LIBS)
1490
1491dnl ===========================================================================
1492
1493#
1494# Check for ZLIB
1495#
1496AC_ARG_WITH([zlib],
1497 [AC_HELP_STRING([--without-zlib],
1498 [disable ZLIB support])],
1499 [with_zlib=$withval],
1500 [with_zlib='yes'])
1501
1502if test "$with_zlib" != 'yes'; then
1503 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-zlib=$with_zlib "
1504fi
1505
1506have_zlib='no'
1507ZLIB_LIBS=''
1508dnl PNG requires zlib so enable zlib check if PNG is requested
1509if test "$with_zlib" != 'no' || test "$with_png" != 'no'; then
cristya448bd22011-10-14 12:38:13 +00001510 AC_MSG_NOTICE([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00001511 AC_MSG_CHECKING([for ZLIB])
cristya448bd22011-10-14 12:38:13 +00001512 AC_MSG_NOTICE([])
cristy3ed852e2009-09-05 21:47:34 +00001513 ZLIB_LIBS=''
1514 failed=0
1515 passed=0
1516 AC_CHECK_HEADER(zconf.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1517 AC_CHECK_HEADER(zlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1518 AC_CHECK_LIB(z,compress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1519 AC_CHECK_LIB(z,uncompress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1520 AC_CHECK_LIB(z,deflate,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1521 AC_CHECK_LIB(z,inflate,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1522 AC_CHECK_LIB(z,gzseek,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1523 AC_CHECK_LIB(z,gztell,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1524 AC_MSG_CHECKING([if ZLIB package is complete])
1525 if test $passed -gt 0; then
1526 if test $failed -gt 0; then
cristya448bd22011-10-14 12:38:13 +00001527 AC_MSG_NOTICE([no -- some components failed test])
cristy3ed852e2009-09-05 21:47:34 +00001528 have_zlib='no (failed tests)'
1529 else
1530 ZLIB_LIBS='-lz'
1531 LIBS="$ZLIB_LIBS $LIBS"
1532 AC_DEFINE(ZLIB_DELEGATE,1,Define if you have zlib compression library)
cristya448bd22011-10-14 12:38:13 +00001533 AC_MSG_NOTICE([yes])
cristy3ed852e2009-09-05 21:47:34 +00001534 have_zlib='yes'
1535 fi
1536 else
cristya448bd22011-10-14 12:38:13 +00001537 AC_MSG_NOTICE([no])
cristy3ed852e2009-09-05 21:47:34 +00001538 fi
1539fi
1540AM_CONDITIONAL(ZLIB_DELEGATE, test "$have_zlib" = 'yes')
1541AC_SUBST(ZLIB_LIBS)
1542
1543#
1544# If profiling, then check for -ldl and dlopen (required for Solaris & gcc)
1545#
1546LIB_DL=''
1547if test "$enable_profiling" = 'yes'; then
1548 AC_CHECK_LIB(dl,dlopen,LIB_DL='-ldl',,)
1549 LIBS="$LIB_DL $LIBS"
1550fi
1551AC_SUBST(LIB_DL)
1552
1553dnl ===========================================================================
1554
1555#
1556# Check for Autotrace delegate library.
1557#
1558AC_ARG_WITH([autotrace],
1559 [AC_HELP_STRING([--with-autotrace],
1560 [enable autotrace support])],
1561 [with_autotrace=$withval],
1562 [with_autotrace='no'])
1563
1564if test "$with_autotrace" != 'yes'; then
1565 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-autotrace=$with_autotrace "
1566fi
1567
1568have_autotrace='no'
1569AUTOTRACE_CFLAGS=""
1570AUTOTRACE_LIBS=""
1571AUTOTRACE_PKG=""
1572if test "x$with_autotrace" = "xyes"; then
cristya448bd22011-10-14 12:38:13 +00001573 AC_MSG_NOTICE([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00001574 PKG_CHECK_MODULES(AUTOTRACE,[autotrace >= 0.31.1], have_autotrace=yes, have_autotrace=no)
cristya448bd22011-10-14 12:38:13 +00001575 AC_MSG_NOTICE([])
cristy3ed852e2009-09-05 21:47:34 +00001576fi
1577
1578if test "$have_autotrace" = 'yes'; then
1579 failed=0
1580 AC_DEFINE(AUTOTRACE_DELEGATE,1,Define if you have AUTOTRACE library)
1581 if test "$with_modules" = 'no'; then
1582 CPPFLAGS="$AUTOTRACE_CFLAGS $CPPFLAGS"
1583 fi
1584fi
1585
1586AM_CONDITIONAL(AUTOTRACE_DELEGATE,test "$have_autotrace" = 'yes')
1587AC_SUBST(AUTOTRACE_CFLAGS)
1588AC_SUBST(AUTOTRACE_LIBS)
1589
1590dnl ===========================================================================
1591
1592#
1593# Check for Display Postscript delegate library.
1594#
1595AC_ARG_WITH([dps],
1596 [AC_HELP_STRING([--without-dps],
1597 [disable Display Postscript support])],
1598 [with_dps=$withval],
1599 [with_dps='yes'])
1600
1601if test "$with_dps" != 'yes'; then
1602 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-dps=$with_dps "
1603fi
1604
1605have_dps='no'
1606DPS_LIBS=''
1607if test "$with_dps" != 'no' && test "$with_x" != 'no'; then
cristya448bd22011-10-14 12:38:13 +00001608 AC_MSG_NOTICE([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00001609 AC_MSG_CHECKING([for DPS])
cristya448bd22011-10-14 12:38:13 +00001610 AC_MSG_NOTICE([])
cristy3ed852e2009-09-05 21:47:34 +00001611 failed=0
1612 passed=0
1613 PERSIST_CPPFLAGS="$CPPFLAGS"
1614 CPPFLAGS="$CPPFLAGS -I${ac_x_includes}/X11"
1615 AC_CHECK_HEADER(DPS/dpsXclient.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1616 # DPS issues:
1617 # XFree86-4.x needs -lXt to provide XtMalloc for -ldps.
1618 # Cygwin doesn't deliver -lXt as a DLL, which prevents a DLL build.
1619 # Adobe DPS (as delivered on Solaris) doesn't require -lXt.
1620 # ImageMagick itself doesn't use -lXt.
1621 have_libdps='no'
1622 LIBDPS_XT=''
1623 AC_CHECK_LIB(dps,DPSInitialize,have_libdps='yes',have_libdps='no',)
1624 if test "$have_libdps" != 'yes'; then
1625 # Unset cache variable so we can try again.
1626 unset ac_cv_lib_dps_DPSInitialize
1627 AC_CHECK_LIB(dps,DPSInitialize,have_libdps='yes',have_libdps='no',-lXt)
1628 if test "$have_libdps" = 'yes'; then
1629 LIBDPS_XT='-lXt'
1630 fi
1631 fi
1632 if test "$have_libdps" = 'yes'; then
1633 passed=`expr $passed + 1`
1634 else
1635 failed=`expr $failed + 1`
1636 fi
1637 AC_CHECK_LIB(dpstk,XDPSPixelsPerPoint,passed=`expr $passed + 1`,failed=`expr $failed + 1`,-ldps $LIBDPS_XT)
1638 AC_MSG_CHECKING([if DPS package is complete])
1639 if test $passed -gt 0; then
1640 if test $failed -gt 0; then
cristya448bd22011-10-14 12:38:13 +00001641 AC_MSG_NOTICE([no -- some components failed test])
cristy3ed852e2009-09-05 21:47:34 +00001642 have_dps='no (failed tests)'
1643 CPPFLAGS="$PERSIST_CPPFLAGS"
1644 else
1645 DPS_LIBS="-ldpstk -ldps ${LIBDPS_XT}"
1646 LIBS="$DPS_LIBS $LIBS"
1647 AC_DEFINE(DPS_DELEGATE,1,Define if you have Display Postscript)
cristya448bd22011-10-14 12:38:13 +00001648 AC_MSG_NOTICE([yes])
cristy3ed852e2009-09-05 21:47:34 +00001649 have_dps='yes'
1650 fi
1651 else
cristya448bd22011-10-14 12:38:13 +00001652 AC_MSG_NOTICE([no])
cristy3ed852e2009-09-05 21:47:34 +00001653 CPPFLAGS=$PERSIST_CPPFLAGS
1654 fi
1655fi
1656AM_CONDITIONAL(DPS_DELEGATE, test "$have_dps" = 'yes')
1657AC_SUBST(DPS_LIBS)
1658
1659dnl ===========================================================================
1660
1661#
1662# Check for DJVU delegate library.
1663#
1664AC_ARG_WITH([djvu],
1665 [AC_HELP_STRING([--without-djvu],
1666 [disable DjVu support])],
1667 [with_djvu=$withval],
1668 [with_djvu='yes'])
1669
1670if test "$with_djvu" != 'yes'; then
1671 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-djvu=$with_djvu "
1672fi
1673
1674have_djvu='no'
1675DJVU_LIBS=''
1676if test "$with_djvu" != 'no'; then
cristya448bd22011-10-14 12:38:13 +00001677 AC_MSG_NOTICE([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00001678 AC_MSG_CHECKING([for DJVU])
cristya448bd22011-10-14 12:38:13 +00001679 AC_MSG_NOTICE([])
cristy3ed852e2009-09-05 21:47:34 +00001680 failed=0
1681 passed=0
1682 AC_CHECK_HEADER(libdjvu/ddjvuapi.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1683 AC_CHECK_LIB(djvulibre,ddjvu_context_create,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1684 AC_MSG_CHECKING([if DJVU package is complete])
1685 if test $passed -gt 0; then
1686 if test $failed -gt 0; then
cristya448bd22011-10-14 12:38:13 +00001687 AC_MSG_NOTICE([no -- some components failed test])
cristy3ed852e2009-09-05 21:47:34 +00001688 have_djvu='no (failed tests)'
1689 else
1690 DJVU_LIBS='-ldjvulibre'
1691 LIBS="$DJVU_LIBS $LIBS"
1692 AC_DEFINE(DJVU_DELEGATE,1,Define if you have DJVU library)
cristya448bd22011-10-14 12:38:13 +00001693 AC_MSG_NOTICE([yes])
cristy3ed852e2009-09-05 21:47:34 +00001694 have_djvu='yes'
1695 fi
1696 else
cristya448bd22011-10-14 12:38:13 +00001697 AC_MSG_NOTICE([no])
cristy3ed852e2009-09-05 21:47:34 +00001698 fi
1699fi
1700AM_CONDITIONAL(DJVU_DELEGATE, test "$have_djvu" = 'yes')
1701AC_SUBST(DJVU_LIBS)
1702
1703dnl ===========================================================================
1704
1705#
cristy430a7312010-01-21 20:44:04 +00001706# Set DejaVu font directory.
1707#
1708AC_ARG_WITH([dejavu-font-dir],
1709 [AC_HELP_STRING([--with-dejavu-font-dir=DIR],
1710 [DejaVu font directory])],
1711 [with_dejavu_font_dir=$withval],
1712 [with_dejavu_font_dir='default'])
1713
1714if test "$with_dejavu_font_dir" != 'default'; then
1715 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-dejavu-font-dir=$with_dejavu_font_dir "
1716fi
1717
1718dnl ===========================================================================
1719
1720#
cristy3ed852e2009-09-05 21:47:34 +00001721# Check for FFTW delegate library.
1722#
cristy81beccd2011-10-03 18:17:24 +00001723AC_ARG_WITH([fftw],
cristy3ed852e2009-09-05 21:47:34 +00001724 [AC_HELP_STRING([--without-fftw],
1725 [disable FFTW support])],
1726 [with_fftw=$withval],
1727 [with_fftw='yes'])
1728
1729if test "$with_fftw" != 'yes'; then
1730 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fftw=$with_fftw "
1731fi
1732
cristy81beccd2011-10-03 18:17:24 +00001733have_fftw='no'
1734FFTW_LIBS=''
1735if test "$with_fftw" != 'no'; then
cristya448bd22011-10-14 12:38:13 +00001736 AC_MSG_NOTICE([-------------------------------------------------------------])
cristy81beccd2011-10-03 18:17:24 +00001737 AC_MSG_CHECKING([for FFTW])
cristya448bd22011-10-14 12:38:13 +00001738 AC_MSG_NOTICE([])
cristy81beccd2011-10-03 18:17:24 +00001739 failed=0
1740 passed=0
1741 AC_CHECK_HEADER(fftw3.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1742 AC_CHECK_LIB(fftw3,fftw_execute,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1743 AC_MSG_CHECKING([if FFTW package is complete])
1744 if test $passed -gt 0; then
1745 if test $failed -gt 0; then
cristya448bd22011-10-14 12:38:13 +00001746 AC_MSG_NOTICE([no -- some components failed test])
cristy81beccd2011-10-03 18:17:24 +00001747 have_fftw='no (failed tests)'
1748 else
1749 FFTW_LIBS='-lfftw3'
1750 LIBS="$FFTW_LIBS $LIBS"
1751 AC_DEFINE(FFTW_DELEGATE,1,Define if you have FFTW library)
cristya448bd22011-10-14 12:38:13 +00001752 AC_MSG_NOTICE([yes])
cristy81beccd2011-10-03 18:17:24 +00001753 have_fftw='yes'
1754 fi
1755 else
cristya448bd22011-10-14 12:38:13 +00001756 AC_MSG_NOTICE([no])
cristy3ed852e2009-09-05 21:47:34 +00001757 fi
1758fi
1759AM_CONDITIONAL(FFTW_DELEGATE, test "$have_fftw" = 'yes')
1760AC_SUBST(FFTW_LIBS)
1761
1762dnl ===========================================================================
1763
1764#
1765# Check for FlashPIX delegate library.
1766#
1767AC_ARG_WITH([fpx],
1768 [AC_HELP_STRING([--without-fpx],
1769 [disable FlashPIX support])],
1770 [with_fpx=$withval],
1771 [with_fpx='yes'])
1772
1773if test "$with_fpx" != 'yes'; then
1774 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fpx=$with_fpx "
1775fi
1776
1777have_fpx='no'
1778FPX_LIBS=''
1779if test "$with_fpx" != 'no'; then
cristya448bd22011-10-14 12:38:13 +00001780 AC_MSG_NOTICE([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00001781 AC_MSG_CHECKING([for FlashPIX])
cristya448bd22011-10-14 12:38:13 +00001782 AC_MSG_NOTICE([])
cristy3ed852e2009-09-05 21:47:34 +00001783 failed=0
1784 passed=0
1785 AC_LANG_PUSH(C++)
1786 AC_CHECK_HEADER(fpxlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
1787 AC_CHECK_LIB(fpx,FPX_OpenImageByFilename,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
1788 AC_LANG_POP
1789 AC_MSG_CHECKING([if FlashPIX package is complete])
1790 if test $passed -gt 0; then
1791 if test $failed -gt 0; then
cristya448bd22011-10-14 12:38:13 +00001792 AC_MSG_NOTICE([no -- some components failed test])
cristy3ed852e2009-09-05 21:47:34 +00001793 have_fpx='no (failed tests)'
1794 else
1795 FPX_LIBS='-lfpx'
1796 AC_DEFINE(FPX_DELEGATE,1,Define if you have FlashPIX library)
cristya448bd22011-10-14 12:38:13 +00001797 AC_MSG_NOTICE([yes])
cristy3ed852e2009-09-05 21:47:34 +00001798 have_fpx='yes'
1799 PERLMAINCC="$CXX"
1800 fi
1801 else
cristya448bd22011-10-14 12:38:13 +00001802 AC_MSG_NOTICE([no])
cristy3ed852e2009-09-05 21:47:34 +00001803 fi
1804fi
1805AM_CONDITIONAL(FPX_DELEGATE, test "$have_fpx" = 'yes')
1806AC_SUBST(FPX_LIBS)
1807
1808dnl ===========================================================================
1809
1810#
1811# Check for fontconfig delegate library.
1812#
1813AC_ARG_WITH([fontconfig],
1814 [AC_HELP_STRING([--without-fontconfig],
1815 [disable fontconfig support])],
1816 [with_fontconfig=$withval],
1817 [with_fontconfig=$have_x])
1818
1819if test "$with_fontconfig" != 'yes'; then
1820 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontconfig=$with_fontconfig "
1821fi
1822
1823have_fontconfig='no'
1824FONTCONFIG_CFLAGS=""
1825FONTCONFIG_LIBS=""
1826FONTCONFIG_PKG=""
1827if test "x$with_fontconfig" = "xyes"; then
cristya448bd22011-10-14 12:38:13 +00001828 AC_MSG_NOTICE([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00001829 PKG_CHECK_MODULES(FONTCONFIG,[fontconfig >= 2.1.0], have_fontconfig=yes, have_fontconfig=no)
cristya448bd22011-10-14 12:38:13 +00001830 AC_MSG_NOTICE([])
cristy3ed852e2009-09-05 21:47:34 +00001831fi
1832
1833if test "$have_fontconfig" = 'yes'; then
cristyd09bcf92010-03-25 03:04:45 +00001834 AC_DEFINE(FONTCONFIG_DELEGATE,1,Define if you have FONTCONFIG library)
1835 if test "$with_modules" = 'no'; then
cristy3ed852e2009-09-05 21:47:34 +00001836 CPPFLAGS="$FONTCONFIG_CFLAGS $CPPFLAGS"
cristyd09bcf92010-03-25 03:04:45 +00001837 fi
cristy3ed852e2009-09-05 21:47:34 +00001838fi
1839
1840AM_CONDITIONAL(FONTCONFIG_DELEGATE,test "$have_fontconfig" = 'yes')
1841AC_SUBST(FONTCONFIG_CFLAGS)
1842AC_SUBST(FONTCONFIG_LIBS)
1843
1844dnl ===========================================================================
1845
1846#
cristy81beccd2011-10-03 18:17:24 +00001847# Check for freetype delegate library.
cristy3ed852e2009-09-05 21:47:34 +00001848#
cristy81beccd2011-10-03 18:17:24 +00001849AC_ARG_WITH([freetype],
cristy3ed852e2009-09-05 21:47:34 +00001850 [AC_HELP_STRING([--without-freetype],
cristy81beccd2011-10-03 18:17:24 +00001851 [disable Freetype support])],
cristy3ed852e2009-09-05 21:47:34 +00001852 [with_freetype=$withval],
1853 [with_freetype='yes'])
1854
cristy81beccd2011-10-03 18:17:24 +00001855
cristy3ed852e2009-09-05 21:47:34 +00001856if test "$with_freetype" != 'yes'; then
1857 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-freetype=$with_freetype "
1858fi
1859
cristy81beccd2011-10-03 18:17:24 +00001860have_freetype='no'
1861FREETYPE_LIBS=''
1862if test "$with_freetype" != 'no'; then
cristya448bd22011-10-14 12:38:13 +00001863 AC_MSG_NOTICE([-------------------------------------------------------------])
cristy98ca0f52011-10-08 23:19:10 +00001864 AC_MSG_CHECKING(for FreeType 2.0 )
cristya448bd22011-10-14 12:38:13 +00001865 AC_MSG_NOTICE()
cristy81beccd2011-10-03 18:17:24 +00001866 failed=0
1867 passed=0
cristy98ca0f52011-10-08 23:19:10 +00001868 PERSIST_LDFLAGS="$LDFLAGS"
cristy81beccd2011-10-03 18:17:24 +00001869 PERSIST_CPPFLAGS="$CPPFLAGS"
cristy98ca0f52011-10-08 23:19:10 +00001870 freetype_config=''
1871 # Allow the user to specify the location of freetype.
1872 if test "$with_freetype" != 'yes'; then
1873 if test -x "${with_freetype}/bin/freetype-config"; then
1874 freetype_config="${with_freetype}/bin/freetype-config"
1875 elif test -x "${with_freetype}"; then
1876 freetype_config=${with_freetype}
1877 fi
1878 fi
1879 if test -z "$freetype_config"; then
1880 AC_PATH_PROG(freetype_config,freetype-config,)dnl
1881 fi
1882 if test -n "$freetype_config"; then
1883 freetype_prefix=`${freetype_config} --prefix`
1884 freetype_exec_prefix=`${freetype_config} --exec-prefix`
1885 LDFLAGS="$LDFLAGS -L${freetype_exec_prefix}/lib"
1886 CPPFLAGS="$CPPFLAGS -I${freetype_prefix}/include/freetype2"
cristy81beccd2011-10-03 18:17:24 +00001887 fi
cristy3ed852e2009-09-05 21:47:34 +00001888
cristy81beccd2011-10-03 18:17:24 +00001889dnl First see if there is a library
1890 if test "$FREETYPE_LIBS" = ''; then
cristy98ca0f52011-10-08 23:19:10 +00001891 AC_CHECK_LIB(freetype,FT_Init_FreeType,FREETYPE_LIBS='-lfreetype',,)
1892 if test "$FREETYPE_LIBS" != ''; then
1893 passed=`expr $passed + 1`
1894 else
1895 failed=`expr $failed + 1`
1896 LDFLAGS="$PERSIST_LDFLAGS"
1897 fi
cristy81beccd2011-10-03 18:17:24 +00001898 fi
1899
1900dnl Now test for the headers
1901 AC_CHECK_HEADER([ft2build.h],[FT2BUILD_H='#include <ft2build.h>'],[ft2build=''],[])
1902 AC_CHECK_HEADER(freetype/freetype.h,[have_freetype_h='yes'],[have_freetype_h='no'],[$FT2BUILD_H])
cristy98ca0f52011-10-08 23:19:10 +00001903 if test "$have_freetype_h" = 'yes'; then
1904 passed=`expr $passed + 1`
cristy81beccd2011-10-03 18:17:24 +00001905 else
cristy98ca0f52011-10-08 23:19:10 +00001906 failed=`expr $failed + 1`
1907 CPPFLAGS="$PERSIST_CPPFLAGS"
cristy81beccd2011-10-03 18:17:24 +00001908 fi
1909
cristy98ca0f52011-10-08 23:19:10 +00001910 AC_MSG_CHECKING(if FreeType package is complete)
cristy81beccd2011-10-03 18:17:24 +00001911 if test $passed -gt 0; then
cristy98ca0f52011-10-08 23:19:10 +00001912 if test $failed -gt 0; then
1913 FREETYPE_LIBS=''
cristya448bd22011-10-14 12:38:13 +00001914 AC_MSG_NOTICE(no -- some components failed test)
cristy98ca0f52011-10-08 23:19:10 +00001915 have_freetype='no (failed tests)'
1916 else
1917 LIBS="$FREETYPE_LIBS $LIBS"
1918 AC_DEFINE(FREETYPE_DELEGATE,1,Define if you have FreeType (TrueType font) library)
1919 if test "$ac_cv_header_ft2build_h" = 'yes'; then
1920 AC_DEFINE([HAVE_FT2BUILD_H],[1],[Define to 1 if you have the <ft2build.h> header file.])
cristy81beccd2011-10-03 18:17:24 +00001921 fi
cristya448bd22011-10-14 12:38:13 +00001922 AC_MSG_NOTICE(yes)
cristy98ca0f52011-10-08 23:19:10 +00001923 have_freetype='yes'
1924 fi
cristy81beccd2011-10-03 18:17:24 +00001925 else
cristya448bd22011-10-14 12:38:13 +00001926 AC_MSG_NOTICE(no)
cristy3ed852e2009-09-05 21:47:34 +00001927 fi
1928fi
cristy98ca0f52011-10-08 23:19:10 +00001929AM_CONDITIONAL(FREETYPE_DELEGATE, test "$have_freetype" = 'yes')
cristy3ed852e2009-09-05 21:47:34 +00001930AC_SUBST(FREETYPE_LIBS)
1931
1932dnl ===========================================================================
1933
cristy3ed852e2009-09-05 21:47:34 +00001934#
1935# Check for Ghostscript library or framework.
1936#
1937# Test for iapi.h & test for gsapi_new_instance in -lgs
1938# or -framework Ghostscript
1939
1940AC_ARG_WITH([gslib],
1941 [AC_HELP_STRING([--without-gslib],
1942 [enable Ghostscript library support])],
1943 [with_gslib=$withval],
1944 [with_gslib='no'])
1945
cristyb7931f12009-09-25 10:22:21 +00001946gslib_framework='no'
cristy3ed852e2009-09-05 21:47:34 +00001947if test "$with_gslib" != 'yes'; then
1948 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gslib=$with_gslib "
1949fi
1950
1951have_gslib='no'
1952GS_LIBS=''
1953if test "$with_gslib" != 'no'; then
cristya448bd22011-10-14 12:38:13 +00001954 AC_MSG_NOTICE([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00001955 AC_MSG_CHECKING([for Ghostscript])
cristya448bd22011-10-14 12:38:13 +00001956 AC_MSG_NOTICE([])
cristyb7931f12009-09-25 10:22:21 +00001957 framework=0
cristy3ed852e2009-09-05 21:47:34 +00001958 failed=0
1959 passed=0
1960 AC_CHECK_HEADER(ghostscript/iapi.h,passed=`expr $passed + 1`,
1961 failed=`expr $failed + 1`,)
1962 AC_CHECK_HEADER(ghostscript/ierrors.h,passed=`expr $passed + 1`,
1963 failed=`expr $failed + 1`,)
1964 AC_CHECK_FRAMEWORK(Ghostscript,gsapi_new_instance,framework=`expr $framework + 1`,
1965 AC_CHECK_LIB(gs,gsapi_new_instance,passed=`expr $passed + 1`,failed=`expr $failed + 1`,),)
1966 AC_MSG_CHECKING([if Ghostscript package is complete])
1967 if test $passed -gt 0; then
1968 if test $failed -gt 0; then
cristya448bd22011-10-14 12:38:13 +00001969 AC_MSG_NOTICE([no -- some components failed test])
cristy3ed852e2009-09-05 21:47:34 +00001970 have_gslib='no (failed tests)'
1971 else
1972 if test $framework -gt 0; then
1973 GS_LIBS='-framework Ghostscript'
cristyb7931f12009-09-25 10:22:21 +00001974 gslib_framework='yes'
cristya448bd22011-10-14 12:38:13 +00001975 AC_MSG_NOTICE([yes, using framework.])
cristy3ed852e2009-09-05 21:47:34 +00001976 else
cristya448bd22011-10-14 12:38:13 +00001977 AC_MSG_NOTICE([yes, using library.])
cristy3ed852e2009-09-05 21:47:34 +00001978 GS_LIBS='-lgs'
1979 fi
1980 LIBS="$GS_LIBS $LIBS"
1981 AC_DEFINE(GS_DELEGATE,1,Define if you have Ghostscript library or framework)
1982 have_gslib='yes'
1983 fi
1984 else
cristya448bd22011-10-14 12:38:13 +00001985 AC_MSG_NOTICE([no])
cristy3ed852e2009-09-05 21:47:34 +00001986 fi
1987fi
1988AM_CONDITIONAL(GS_DELEGATE, test "$have_gslib" = 'yes')
1989AC_SUBST(GS_LIBS)
1990
1991# Set default font search path
1992AC_ARG_WITH([fontpath],
1993 [AC_HELP_STRING([--with-fontpath=DIR],
1994 [prepend to default font search path])],
1995 [with_fontpath=$withval],
1996 [with_fontpath=''])
1997
1998if test "$with_fontpath" != "yes" && test -z "$with_fontpath"; then
1999 with_fontpath=''
2000else
2001 AC_DEFINE_UNQUOTED(MAGICK_FONT_PATH,"$with_fontpath",Define to prepend to default font search path.)
2002fi
2003if test "$with_fontpath=" != ''; then
2004 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontpath=$with_fontpath "
2005fi
2006
2007# Set Ghostscript font directory
2008AC_ARG_WITH([gs-font-dir],
2009 [AC_HELP_STRING([--with-gs-font-dir=DIR],
2010 [Ghostscript font directory])],
2011 [with_gs_font_dir=$withval],
2012 [with_gs_font_dir='default'])
2013
2014if test "$with_gs_font_dir" != 'default'; then
2015 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gs-font-dir=$with_gs_font_dir "
2016fi
2017
2018dnl ===========================================================================
2019
2020#
2021# Check for GVC delegate library.
2022#
2023AC_ARG_WITH(gvc,
2024 [AC_HELP_STRING([--without-gvc],
2025 [disable GVC support])],
2026 [with_gvc=$withval],
2027 [with_gvc='yes'])
2028
2029if test "$with_gvc" != 'yes'; then
2030 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gvc=$with_gvc "
2031fi
2032
2033GVC_PKG=""
2034if test "x$with_gvc" = "xyes"; then
cristya448bd22011-10-14 12:38:13 +00002035 AC_MSG_NOTICE([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00002036 PKG_CHECK_MODULES(GVC,[libgvc >= 2.9.0], have_gvc=yes, have_gvc=no)
cristya448bd22011-10-14 12:38:13 +00002037 AC_MSG_NOTICE([])
cristy3ed852e2009-09-05 21:47:34 +00002038fi
2039
2040if test "$have_gvc" = 'yes'; then
2041 AC_DEFINE(GVC_DELEGATE,1,Define if you have GVC library)
2042 if test "$with_modules" = 'no'; then
2043 CPPFLAGS="$GVC_CFLAGS $CPPFLAGS"
2044 fi
2045fi
2046
2047AM_CONDITIONAL(GVC_DELEGATE, test "$have_gvc" = 'yes')
2048AC_SUBST(GVC_CFLAGS)
2049AC_SUBST(GVC_LIBS)
2050
2051dnl ===========================================================================
2052
2053#
2054# Check for JBIG delegate library.
2055#
2056
2057AC_ARG_WITH([jbig],
2058 [AC_HELP_STRING([--without-jbig],
2059 [disable JBIG support])],
2060 [with_jbig=$withval],
2061 [with_jbig='yes'])
2062
2063have_jbig='no'
2064JBIG_LIBS=''
2065if test "$with_jbig" != 'no'; then
cristya448bd22011-10-14 12:38:13 +00002066 AC_MSG_NOTICE([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00002067 AC_MSG_CHECKING([for JBIG])
cristya448bd22011-10-14 12:38:13 +00002068 AC_MSG_NOTICE([])
cristy3ed852e2009-09-05 21:47:34 +00002069 failed=0
2070 passed=0
2071 AC_CHECK_HEADER(jbig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2072 AC_CHECK_LIB(jbig,jbg_dec_init,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2073 AC_MSG_CHECKING([if JBIG package is complete])
2074 if test $passed -gt 0; then
2075 if test $failed -gt 0; then
cristya448bd22011-10-14 12:38:13 +00002076 AC_MSG_NOTICE([no -- some components failed test])
cristy3ed852e2009-09-05 21:47:34 +00002077 have_jbig='no (failed tests)'
2078 else
2079 JBIG_LIBS='-ljbig'
2080 LIBS="$JBIG_LIBS $LIBS"
2081 AC_DEFINE(JBIG_DELEGATE,1,Define if you have JBIG library)
cristya448bd22011-10-14 12:38:13 +00002082 AC_MSG_NOTICE([yes])
cristy3ed852e2009-09-05 21:47:34 +00002083 have_jbig='yes'
2084 fi
2085 else
cristya448bd22011-10-14 12:38:13 +00002086 AC_MSG_NOTICE([no])
cristy3ed852e2009-09-05 21:47:34 +00002087 fi
2088fi
2089AM_CONDITIONAL(JBIG_DELEGATE, test "$have_jbig" = 'yes')
2090AC_SUBST(JBIG_LIBS)
2091
2092dnl ===========================================================================
2093
2094#
2095# Check for JPEG delegate library.
2096#
2097AC_ARG_WITH([jpeg],
2098 [AC_HELP_STRING([--without-jpeg],
2099 [disable JPEG support])],
2100 [with_jpeg=$withval],
2101 [with_jpeg='yes'])
2102
2103if test "$with_jpeg" != 'yes'; then
2104 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jpeg=$with_jpeg "
2105fi
2106
2107have_jpeg='no'
2108JPEG_LIBS=''
2109if test "$with_jpeg" != 'no'; then
cristya448bd22011-10-14 12:38:13 +00002110 AC_MSG_NOTICE([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00002111 AC_MSG_CHECKING([for JPEG])
cristya448bd22011-10-14 12:38:13 +00002112 AC_MSG_NOTICE([])
cristy3ed852e2009-09-05 21:47:34 +00002113 failed=0
2114 passed=0
2115 AC_CHECK_HEADER(jconfig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2116 AC_CHECK_HEADER(jerror.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2117 AC_CHECK_HEADER(jmorecfg.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2118 AC_CHECK_HEADER(jpeglib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2119 AC_CHECK_LIB(jpeg,jpeg_read_header,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2120
2121# Test for compatible JPEG library
2122if test "$ac_cv_jpeg_version_ok" != 'yes'; then
2123AC_CACHE_CHECK(for JPEG library is version 6b or later, ac_cv_jpeg_version_ok,
2124[AC_TRY_COMPILE(
2125#include <stdio.h>
2126#include <stdlib.h>
2127#include <jpeglib.h>
2128,
2129changequote(<<, >>)dnl
2130<<
2131#if JPEG_LIB_VERSION < 62
2132#error IJG JPEG library must be version 6b or newer!
2133#endif
2134return 0;
2135>>,
2136changequote([, ])dnl
2137ac_cv_jpeg_version_ok='yes'; passed=`expr $passed + 1`,
2138ac_cv_jpeg_version_ok='no'; failed=`expr $failed + 1`)])
2139fi
2140 AC_MSG_CHECKING([if JPEG package is complete])
2141 if test $passed -gt 0; then
2142 if test $failed -gt 0; then
cristya448bd22011-10-14 12:38:13 +00002143 AC_MSG_NOTICE([no -- some components failed test])
cristy3ed852e2009-09-05 21:47:34 +00002144 have_jpeg='no (failed tests)'
2145 else
2146 JPEG_LIBS='-ljpeg'
2147 LIBS="$JPEG_LIBS $LIBS"
2148 AC_DEFINE(JPEG_DELEGATE,1,Define if you have JPEG library)
cristya448bd22011-10-14 12:38:13 +00002149 AC_MSG_NOTICE([yes])
cristy3ed852e2009-09-05 21:47:34 +00002150 have_jpeg='yes'
2151 fi
2152 else
cristya448bd22011-10-14 12:38:13 +00002153 AC_MSG_NOTICE([no])
cristy3ed852e2009-09-05 21:47:34 +00002154 fi
2155fi
2156AM_CONDITIONAL(JPEG_DELEGATE, test "$have_jpeg" = 'yes')
2157AC_SUBST(JPEG_LIBS)
2158
2159dnl ===========================================================================
2160
2161#
2162# Check for JPEG Version 2 delegate library.
2163#
2164AC_ARG_WITH([jp2],
2165 [AC_HELP_STRING([--without-jp2],
2166 [disable JPEG-2000 support])],
2167 [with_jp2=$withval],
2168 [with_jp2='yes'])
2169
2170if test "$with_jp2" != 'yes'; then
2171 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jp2=$with_jp2 "
2172fi
2173
2174have_jp2='no'
2175JP2_LIBS=''
2176if test "$with_jp2" != 'no'; then
cristya448bd22011-10-14 12:38:13 +00002177 AC_MSG_NOTICE([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00002178 AC_MSG_CHECKING([for JPEG Version 2])
cristya448bd22011-10-14 12:38:13 +00002179 AC_MSG_NOTICE([])
cristy3ed852e2009-09-05 21:47:34 +00002180 failed=0
2181 passed=0
2182 AC_CHECK_HEADER(jasper/jasper.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2183 AC_CHECK_LIB(jasper,jas_stream_fopen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2184 AC_MSG_CHECKING([if JPEG version 2 support package is complete])
2185 if test $passed -gt 0; then
2186 if test $failed -gt 0; then
cristya448bd22011-10-14 12:38:13 +00002187 AC_MSG_NOTICE([no -- some components failed test])
cristy3ed852e2009-09-05 21:47:34 +00002188 have_jp2='no (failed tests)'
2189 else
2190 JP2_LIBS='-ljasper'
2191 LIBS="$JP2_LIBS $LIBS"
2192 AC_DEFINE(JP2_DELEGATE,1,Define if you have JPEG version 2 "Jasper" library)
cristya448bd22011-10-14 12:38:13 +00002193 AC_MSG_NOTICE([yes])
cristy3ed852e2009-09-05 21:47:34 +00002194 have_jp2='yes'
2195 fi
2196 else
cristya448bd22011-10-14 12:38:13 +00002197 AC_MSG_NOTICE([no])
cristy3ed852e2009-09-05 21:47:34 +00002198 fi
2199fi
2200AM_CONDITIONAL(JP2_DELEGATE, test "$have_jp2" = 'yes')
2201AC_SUBST(JP2_LIBS)
2202
2203dnl ===========================================================================
2204
2205#
2206# Check for LCMS delegate library.
2207#
cristy71203402010-06-18 13:12:03 +00002208# Disable LCMS.
cristy3ed852e2009-09-05 21:47:34 +00002209AC_ARG_WITH(lcms,
cristy71203402010-06-18 13:12:03 +00002210 [ --without-lcms disable lcms (v1.1X) support],
2211 [with_lcms=$withval],
2212 [with_lcms='yes'])
2213if test "$with_lcms" != 'yes' ; then
cristy3ed852e2009-09-05 21:47:34 +00002214 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lcms=$with_lcms "
2215fi
2216
cristy71203402010-06-18 13:12:03 +00002217# Disable LCMS2.
2218AC_ARG_WITH(lcms2,
2219 [ --without-lcms2 disable lcms (v2.X) support],
2220 [with_lcms2=$withval],
2221 [with_lcms2='yes'])
2222if test "$with_lcms2" != 'yes' ; then
2223 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lcms2=$with_lcms2 "
2224fi
2225
2226have_lcms2='no'
cristy3ed852e2009-09-05 21:47:34 +00002227LCMS_LIBS=''
cristy71203402010-06-18 13:12:03 +00002228if test "$with_lcms2" != 'no'; then
cristya448bd22011-10-14 12:38:13 +00002229 AC_MSG_NOTICE([-------------------------------------------------------------])
cristy71203402010-06-18 13:12:03 +00002230 AC_MSG_CHECKING([for LCMS v2])
cristya448bd22011-10-14 12:38:13 +00002231 AC_MSG_NOTICE()
cristy3ed852e2009-09-05 21:47:34 +00002232 failed=0
2233 passed=0
2234 have_lcms_header='no'
cristy71203402010-06-18 13:12:03 +00002235
2236 # Check for <lcms2.h>
cristyd09bcf92010-03-25 03:04:45 +00002237 AC_CHECK_HEADER(lcms2.h,have_lcms_header='yes',,)
2238 if test "$have_lcms_header" = 'yes'; then
cristy71203402010-06-18 13:12:03 +00002239 AC_DEFINE(HAVE_LCMS2_H,1,Define if you have the <lcms2.h> header file.)
2240 passed=`expr $passed + 1`
cristyd09bcf92010-03-25 03:04:45 +00002241 fi
cristy71203402010-06-18 13:12:03 +00002242
2243 # Check for <lcms2/lcms2.h)
2244 if test "$have_lcms_header" != 'yes'; then
2245 AC_CHECK_HEADER(lcms2/lcms2.h,have_lcms_header='yes',,)
2246 if test "$have_lcms_header" = 'yes'; then
2247 passed=`expr $passed + 1`
2248 AC_DEFINE(HAVE_LCMS2_LCMS2_H,1,Define if you have the <lcms2/lcms2.h> header file.)
2249 fi
2250 fi
2251
2252 # Failed to find lcms header?
2253 if test "$have_lcms_header" != 'yes'; then
2254 failed=`expr $failed + 1`
2255 fi
2256
2257 AC_CHECK_LIB(lcms2,cmsSetLogErrorHandler,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2258 AC_MSG_CHECKING(if LCMS v2 package is complete)
cristyd09bcf92010-03-25 03:04:45 +00002259 if test $passed -gt 0; then
cristy71203402010-06-18 13:12:03 +00002260 if test $failed -gt 0; then
cristya448bd22011-10-14 12:38:13 +00002261 AC_MSG_NOTICE(no -- some components failed test)
cristy71203402010-06-18 13:12:03 +00002262 have_lcms2='no (failed tests)'
2263 else
2264 LCMS_LIBS='-llcms2'
2265 LIBS="$LCMS_LIBS $LIBS"
cristya448bd22011-10-14 12:38:13 +00002266 AC_MSG_NOTICE(yes)
cristy71203402010-06-18 13:12:03 +00002267 have_lcms2='yes'
2268 fi
cristyd09bcf92010-03-25 03:04:45 +00002269 else
cristya448bd22011-10-14 12:38:13 +00002270 AC_MSG_NOTICE(no)
cristyd09bcf92010-03-25 03:04:45 +00002271 fi
2272fi
2273
cristy71203402010-06-18 13:12:03 +00002274#
2275# Check for LCMS v1 (1.11 or later)
2276#
2277if test $have_lcms2 = 'yes'; then
2278 with_lcms='no'
2279fi
2280
2281have_lcms='no'
cristyd09bcf92010-03-25 03:04:45 +00002282if test "$with_lcms" != 'no'; then
cristya448bd22011-10-14 12:38:13 +00002283 AC_MSG_NOTICE([-------------------------------------------------------------])
cristy71203402010-06-18 13:12:03 +00002284 AC_MSG_CHECKING([for LCMS v1.1X])
cristya448bd22011-10-14 12:38:13 +00002285 AC_MSG_NOTICE()
cristyd09bcf92010-03-25 03:04:45 +00002286 failed=0
2287 passed=0
2288 have_lcms_header='no'
cristy71203402010-06-18 13:12:03 +00002289
2290 # Check for <lcms.h>
2291 if test "$have_lcms_header" != 'yes'; then
2292 AC_CHECK_HEADER(lcms.h,have_lcms_header='yes',,)
2293 if test "$have_lcms_header" = 'yes'; then
cristy3ed852e2009-09-05 21:47:34 +00002294 passed=`expr $passed + 1`
2295 AC_DEFINE(HAVE_LCMS_H,1,Define if you have the <lcms.h> header file.)
cristy71203402010-06-18 13:12:03 +00002296 fi
cristy3ed852e2009-09-05 21:47:34 +00002297 fi
cristy71203402010-06-18 13:12:03 +00002298
2299 # Check for <lcms/lcms.h>
2300 if test "$have_lcms_header" != 'yes'; then
2301 AC_CHECK_HEADER(lcms/lcms.h,have_lcms_header='yes',,)
2302 if test "$have_lcms_header" = 'yes'; then
2303 passed=`expr $passed + 1`
2304 AC_DEFINE(HAVE_LCMS_LCMS_H,1,Define if you have the <lcms/lcms.h> header file.)
2305 fi
2306 fi
2307
2308 # Failed to find lcms header?
2309 if test "$have_lcms_header" != 'yes'; then
2310 failed=`expr $failed + 1`
2311 fi
2312
2313 AC_CHECK_LIB(lcms,cmsSetErrorHandler,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2314 AC_MSG_CHECKING(if LCMS package is complete)
cristy3ed852e2009-09-05 21:47:34 +00002315 if test $passed -gt 0; then
cristy71203402010-06-18 13:12:03 +00002316 if test $failed -gt 0; then
cristya448bd22011-10-14 12:38:13 +00002317 AC_MSG_NOTICE(no -- some components failed test)
cristy71203402010-06-18 13:12:03 +00002318 have_lcms='no (failed tests)'
2319 else
2320 LCMS_LIBS='-llcms'
2321 LIBS="$LCMS_LIBS $LIBS"
cristya448bd22011-10-14 12:38:13 +00002322 AC_MSG_NOTICE(yes)
cristy71203402010-06-18 13:12:03 +00002323 have_lcms='yes'
2324 fi
cristy3ed852e2009-09-05 21:47:34 +00002325 else
cristya448bd22011-10-14 12:38:13 +00002326 AC_MSG_NOTICE(no)
cristy3ed852e2009-09-05 21:47:34 +00002327 fi
2328fi
cristy71203402010-06-18 13:12:03 +00002329
2330AM_CONDITIONAL(LCMS_DELEGATE, test "$have_lcms2" = 'yes' -o "$have_lcms" = 'yes')
2331if test "$have_lcms2" = 'yes' -o "$have_lcms" = 'yes'; then
2332 AC_DEFINE(LCMS_DELEGATE,1,[Define if you have LCMS (v1.11 or later) library])
cristyd09bcf92010-03-25 03:04:45 +00002333fi
cristy3ed852e2009-09-05 21:47:34 +00002334AC_SUBST(LCMS_LIBS)
2335
cristy71203402010-06-18 13:12:03 +00002336
cristy3ed852e2009-09-05 21:47:34 +00002337dnl ===========================================================================
2338
2339#
2340# Check for the LQR (Liquid Rescale) delegate library.
2341#
2342AC_ARG_WITH([lqr],
2343 [AC_HELP_STRING([--without-lqr],
cristyec501352010-03-13 18:43:34 +00002344 [disable Liquid Rescale support])],
cristy3ed852e2009-09-05 21:47:34 +00002345 [with_lqr=$withval],
2346 [with_lqr='yes'])
2347
2348if test "$with_lqr" != 'yes'; then
2349 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lqr=$with_lqr "
2350fi
2351
2352have_lqr='no'
2353LQR_CFLAGS=""
2354LQR_LIBS=""
2355LQR_PKG=""
2356if test "x$with_lqr" = "xyes"; then
cristya448bd22011-10-14 12:38:13 +00002357 AC_MSG_NOTICE([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00002358 PKG_CHECK_MODULES(LQR,[lqr-1 >= 0.1.0], have_lqr=yes, have_lqr=no)
cristya448bd22011-10-14 12:38:13 +00002359 AC_MSG_NOTICE([])
cristy3ed852e2009-09-05 21:47:34 +00002360fi
2361
2362if test "$have_lqr" = 'yes'; then
2363 AC_DEFINE(LQR_DELEGATE,1,Define if you have LQR library)
2364 CFLAGS="$LQR_CFLAGS $CFLAGS"
2365fi
2366
2367AM_CONDITIONAL(LQR_DELEGATE, test "$have_lqr" = 'yes')
2368AC_SUBST(LQR_CFLAGS)
2369AC_SUBST(LQR_LIBS)
2370
2371dnl ===========================================================================
2372
cristy81beccd2011-10-03 18:17:24 +00002373# Disable LZMA (lzma library)
cristyfbb0ef02010-12-19 02:32:11 +00002374AC_ARG_WITH(lzma,
cristy81beccd2011-10-03 18:17:24 +00002375 [ --without-lzma disable LZMA support],
2376 [with_lzma=$withval],
2377 [with_lzma='yes'])
2378if test "$with_lzma" != 'yes' ; then
cristyfbb0ef02010-12-19 02:32:11 +00002379 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lzma=$with_lzma "
2380fi
2381
cristy56bbc922011-11-14 13:18:39 +00002382LZMA_PKG=""
2383if test "x$with_lzma" = "xyes"; then
cristya448bd22011-10-14 12:38:13 +00002384 AC_MSG_NOTICE([-------------------------------------------------------------])
cristy56bbc922011-11-14 13:18:39 +00002385 PKG_CHECK_MODULES(LZMA,[liblzma >= 2.9.0], have_lzma=yes, have_lzma=no)
2386 AC_MSG_NOTICE([])
cristyf805afb2011-10-03 17:17:37 +00002387fi
cristy56bbc922011-11-14 13:18:39 +00002388
2389if test "$have_lzma" = 'yes'; then
2390 AC_DEFINE(LZMA_DELEGATE,1,Define if you have LZMA library)
2391 if test "$with_modules" = 'no'; then
2392 CPPFLAGS="$LZMA_CFLAGS $CPPFLAGS"
2393 fi
2394fi
2395
cristyfbb0ef02010-12-19 02:32:11 +00002396AM_CONDITIONAL(LZMA_DELEGATE, test "$have_lzma" = 'yes')
cristy56bbc922011-11-14 13:18:39 +00002397AC_SUBST(LZMA_CFLAGS)
cristyfbb0ef02010-12-19 02:32:11 +00002398AC_SUBST(LZMA_LIBS)
2399
2400dnl ===========================================================================
2401
cristy3ed852e2009-09-05 21:47:34 +00002402#
2403# Check for the OpenEXR delegate library.
2404#
2405AC_ARG_WITH([openexr],
2406 [AC_HELP_STRING([--without-openexr],
2407 [disable OpenEXR support])],
2408 [with_openexr=$withval],
2409 [with_openexr='yes'])
2410
2411if test "$with_openexr" != 'yes'; then
2412 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-openexr=$with_openexr "
2413fi
2414
2415have_openexr='no'
2416OPENEXR_CFLAGS=""
2417OPENEXR_LIBS=""
2418OPENEXR_PKG=""
2419if test "x$with_openexr" = "xyes"; then
cristya448bd22011-10-14 12:38:13 +00002420 AC_MSG_NOTICE([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00002421 PKG_CHECK_MODULES(OPENEXR,[OpenEXR >= 1.0.6], have_openexr=yes, have_openexr=no)
cristya448bd22011-10-14 12:38:13 +00002422 AC_MSG_NOTICE([])
cristy3ed852e2009-09-05 21:47:34 +00002423fi
2424
2425if test "$have_openexr" = 'yes'; then
2426 AC_DEFINE(OPENEXR_DELEGATE,1,Define if you have OPENEXR library)
2427 if test "$with_modules" = 'no'; then
2428 CFLAGS="$OPENEXR_CFLAGS $CFLAGS"
2429 fi
2430fi
2431
2432AM_CONDITIONAL(OPENEXR_DELEGATE, test "$have_openexr" = 'yes')
2433AC_SUBST(OPENEXR_CFLAGS)
2434AC_SUBST(OPENEXR_LIBS)
2435
2436dnl ===========================================================================
2437
2438#
cristy41cbe8a2011-10-27 01:35:18 +00002439# Check for PANGO delegate library.
2440#
2441AC_ARG_WITH([pango],
2442 [AC_HELP_STRING([--without-pango],
2443 [disable PANGO support])],
2444 [with_pango=$withval],
2445 [with_pango=$have_x])
2446
2447if test "$with_pango" != 'yes'; then
2448 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-pango=$with_pango "
2449fi
2450
2451have_pango='no'
2452have_pangoft2='no'
2453PANGO_CFLAGS=""
2454PANGO_LIBS=""
2455PANGO_PKG=""
2456if test "x$with_pango" = "xyes"; then
2457 AC_MSG_RESULT([-------------------------------------------------------------])
cristyd325d042011-12-06 17:36:51 +00002458 PKG_CHECK_MODULES(PANGO, [pangoft2 >= 1.28.1], have_pangoft2=yes, have_pangoft2=no)
cristy41cbe8a2011-10-27 01:35:18 +00002459 AC_MSG_RESULT([])
cristyd325d042011-12-06 17:36:51 +00002460 PKG_CHECK_MODULES(PANGO, [pango >= 1.28.1], have_pango=yes, have_pango=no)
cristy7dc48ed2011-10-28 14:11:43 +00002461 AC_MSG_RESULT([])
cristy41cbe8a2011-10-27 01:35:18 +00002462fi
2463
2464if test "$have_pango" = 'yes'; then
2465 AC_DEFINE(PANGO_DELEGATE,1,Define if you have PANGO library)
2466 if test "$with_modules" = 'no'; then
2467 CPPFLAGS="$PANGO_CFLAGS $CPPFLAGS"
2468 fi
2469fi
2470
2471if test "$have_pangoft2" = 'yes'; then
2472 AC_DEFINE(PANGOFT2_DELEGATE,1,Define if you have PANGOFT2 library)
2473 if test "$with_modules" = 'no'; then
2474 CPPFLAGS="$PANGOFT2_CFLAGS $CPPFLAGS"
2475 fi
2476fi
2477
2478AM_CONDITIONAL(PANGO_DELEGATE, test "$have_pango" = 'yes')
2479AM_CONDITIONAL(PANGOFT2_DELEGATE, test "$have_pangoft2" = 'yes')
2480AC_SUBST(PANGO_CFLAGS)
2481AC_SUBST(PANGO_LIBS)
2482
2483dnl ===========================================================================
2484
2485#
cristy3ed852e2009-09-05 21:47:34 +00002486# Check for PNG delegate library.
2487#
2488AC_ARG_WITH(png,
2489 [AC_HELP_STRING([--without-png],
2490 [disable PNG support])],
2491 [with_png=$withval],
2492 [with_png='yes'])
2493
2494if test "$with_png" != 'yes'; then
2495 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-png=$with_png "
2496fi
2497
cristy81beccd2011-10-03 18:17:24 +00002498have_png='no'
2499PNG_LIBS=''
2500
2501if test "$with_png" != 'no' -a "$have_zlib" != 'no' ; then
cristya448bd22011-10-14 12:38:13 +00002502 AC_MSG_NOTICE([-------------------------------------------------------------])
cristy81beccd2011-10-03 18:17:24 +00002503 AC_MSG_CHECKING(for PNG support )
cristya448bd22011-10-14 12:38:13 +00002504 AC_MSG_NOTICE()
cristy81beccd2011-10-03 18:17:24 +00002505 failed=0
2506 passed=0
2507 AC_CHECK_HEADER(png.h,passed=`expr $passed + 1`,
2508 failed=`expr $failed + 1`,)
2509
2510 if test $passed -gt 0; then
2511 for var in 5 4 2 '' ; do
cristy0615f0e2011-10-12 11:36:46 +00002512 if test "$have_png" = 'no' ; then
2513 if test "x${var}" = 'x' ; then
cristy81beccd2011-10-03 18:17:24 +00002514 pnglib='png'
2515 else
2516 pnglib="png1${var}"
2517 fi
2518
2519# Test for compatible LIBPNG library
2520 failed=0
2521 passed=0
cristy0615f0e2011-10-12 11:36:46 +00002522 if test "$with_png" = 'yes' -o "$with_png" = "libpng1${var}" ; then
cristy81beccd2011-10-03 18:17:24 +00002523 if test "${pnglib}" != 'png' ; then
2524 AC_MSG_CHECKING(for LIBPNG1${var} support )
2525 AC_TRY_COMPILE(
2526#include <stdio.h>
2527#include <stdlib.h>
2528#include <png.h>
2529,
2530changequote(<<, >>)dnl
2531<<
2532#if PNG_LIBPNG_VER_MINOR != ${var}
2533#error LIBPNG library must be version 1${var}!
2534Kaboom, Kaboom
2535#endif
2536return 0;
2537>>,
2538 changequote([, ])dnl
2539 ac_cv_libpng_ok='yes',
2540 ac_cv_libpng_ok='no')
2541 if test "$ac_cv_libpng_ok" = 'yes' ; then
2542 passed=`expr $passed + 1`
cristya448bd22011-10-14 12:38:13 +00002543 AC_MSG_NOTICE(yes)
cristy81beccd2011-10-03 18:17:24 +00002544 else
2545 failed=`expr $failed + 1`
cristya448bd22011-10-14 12:38:13 +00002546 AC_MSG_NOTICE(no)
cristy81beccd2011-10-03 18:17:24 +00002547 fi
2548 else
2549 passed=`expr $passed + 1`
cristya448bd22011-10-14 12:38:13 +00002550 AC_MSG_NOTICE(yes)
cristy81beccd2011-10-03 18:17:24 +00002551 fi
2552 fi
2553
2554 if test $passed -gt 0 -a $failed -le 0; then
2555 if test "1${var}" = '15' ; then
2556 AC_CHECK_LIB(png15,png_get_io_ptr,passed=`expr $passed + 1`,
2557 failed=`expr $failed + 1`,)
2558 AC_CHECK_LIB(png15,png_longjmp,passed=`expr $passed + 1`,
2559 failed=`expr $failed + 1`,)
2560 fi
2561 if test "1${var}" = '14' ; then
2562 AC_CHECK_LIB(png14,png_get_io_ptr,passed=`expr $passed + 1`,
2563 failed=`expr $failed + 1`,)
2564 AC_CHECK_LIB(png14,png_get_io_state,passed=`expr $passed + 1`,
2565 failed=`expr $failed + 1`,)
2566 fi
2567 if test "1${var}" = '12' ; then
2568 AC_CHECK_LIB(png12,png_get_io_ptr,passed=`expr $passed + 1`,
2569 failed=`expr $failed + 1`,)
2570 fi
2571 if test "1${var}" = '1' ; then
2572 AC_CHECK_LIB(png,png_get_io_ptr,passed=`expr $passed + 1`,
2573 failed=`expr $failed + 1`,)
2574 fi
2575 if test $passed -gt 0 -a $failed -le 0 ; then
2576 AC_MSG_CHECKING(if ${pnglib} package is complete)
2577 if test $passed -gt 0 ; then
2578 if test $failed -gt 0 ; then
cristya448bd22011-10-14 12:38:13 +00002579 AC_MSG_NOTICE(no -- some components failed test)
cristy81beccd2011-10-03 18:17:24 +00002580 have_png='no (failed tests)'
2581 else
2582 PNG_LIBS="-l${pnglib}"
2583 LIBS="$PNG_LIBS $LIBS"
2584 AC_DEFINE(PNG_DELEGATE,1,Define if you have PNG library)
cristya448bd22011-10-14 12:38:13 +00002585 AC_MSG_NOTICE(yes)
cristy81beccd2011-10-03 18:17:24 +00002586 have_png='yes'
2587 fi
2588 fi
2589 fi
2590 fi
2591 fi
2592 done
2593 fi
cristy3ed852e2009-09-05 21:47:34 +00002594fi
cristy64877302011-08-23 19:10:31 +00002595
cristy81beccd2011-10-03 18:17:24 +00002596AM_CONDITIONAL(PNG_DELEGATE,test "$have_png" = 'yes')
cristyf805afb2011-10-03 17:17:37 +00002597AC_SUBST(PNG_LIBS)
cristy3ed852e2009-09-05 21:47:34 +00002598
cristy81beccd2011-10-03 18:17:24 +00002599
cristy3ed852e2009-09-05 21:47:34 +00002600dnl ===========================================================================
2601
2602#
2603# Check for RSVG delegate library.
2604#
2605AC_ARG_WITH([rsvg],
2606 [AC_HELP_STRING([--without-rsvg],
2607 [disable RSVG support])],
2608 [with_rsvg=$withval],
2609 [with_rsvg=$have_x])
2610
2611if test "$with_rsvg" != 'yes'; then
2612 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-rsvg=$with_rsvg "
2613fi
2614
2615have_rsvg='no'
2616have_cairo='no'
2617RSVG_CFLAGS=""
2618RSVG_LIBS=""
2619RSVG_PKG=""
2620if test "x$with_rsvg" = "xyes"; then
cristya448bd22011-10-14 12:38:13 +00002621 AC_MSG_NOTICE([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00002622 PKG_CHECK_MODULES(RSVG,[librsvg-2.0 >= 2.9.0], have_rsvg=yes, have_rsvg=no)
cristya448bd22011-10-14 12:38:13 +00002623 AC_MSG_NOTICE([])
cristy3ed852e2009-09-05 21:47:34 +00002624 PKG_CHECK_MODULES(CAIRO_SVG, cairo-svg, have_cairo=yes, have_cairo=no)
cristya448bd22011-10-14 12:38:13 +00002625 AC_MSG_NOTICE([])
cristy3ed852e2009-09-05 21:47:34 +00002626fi
2627
2628if test "$have_rsvg" = 'yes'; then
2629 AC_DEFINE(RSVG_DELEGATE,1,Define if you have RSVG library)
2630 if test "$with_modules" = 'no'; then
2631 CPPFLAGS="$RSVG_CFLAGS $CPPFLAGS"
2632 fi
2633fi
2634
2635if test "$have_cairo" = 'yes'; then
2636 AC_DEFINE(CAIRO_DELEGATE,1,Define if you have CAIRO library)
2637 if test "$with_modules" = 'no'; then
2638 CPPFLAGS="$CAIRO_SVG_CFLAGS $CPPFLAGS"
2639 fi
2640fi
2641
2642AM_CONDITIONAL(RSVG_DELEGATE, test "$have_rsvg" = 'yes')
2643AM_CONDITIONAL(CAIRO_DELEGATE, test "$have_cairo" = 'yes')
2644AC_SUBST(RSVG_CFLAGS)
2645AC_SUBST(RSVG_LIBS)
2646
2647dnl ===========================================================================
2648
2649#
2650# Check for TIFF delegate library.
2651#
2652AC_ARG_WITH([tiff],
2653 [AC_HELP_STRING([--without-tiff],
2654 [disable TIFF support])],
2655 [with_tiff=$withval],
2656 [with_tiff='yes'])
2657
2658if test "$with_tiff" != 'yes'; then
2659 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-tiff=$with_tiff "
2660fi
2661
2662have_tiff='no'
2663TIFF_LIBS=''
2664if test "$with_tiff" != 'no'; then
cristya448bd22011-10-14 12:38:13 +00002665 AC_MSG_NOTICE([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00002666 AC_MSG_CHECKING([for TIFF])
cristya448bd22011-10-14 12:38:13 +00002667 AC_MSG_NOTICE([])
cristy3ed852e2009-09-05 21:47:34 +00002668 failed=0
2669 passed=0
2670 AC_CHECK_HEADER(tiff.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2671 AC_CHECK_HEADER(tiffio.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2672 AC_CHECK_LIB(tiff,TIFFOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2673 AC_CHECK_LIB(tiff,TIFFClientOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2674 AC_CHECK_LIB(tiff,TIFFIsByteSwapped,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2675 AC_CHECK_LIB(tiff,TIFFReadRGBATile,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2676 AC_CHECK_LIB(tiff,TIFFReadRGBAStrip,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2677 AC_MSG_CHECKING([if TIFF package is complete])
2678 if test $passed -gt 0; then
2679 if test $failed -gt 0; then
cristya448bd22011-10-14 12:38:13 +00002680 AC_MSG_NOTICE([no -- some components failed test])
cristy3ed852e2009-09-05 21:47:34 +00002681 have_tiff='no (failed tests)'
2682 else
2683 TIFF_LIBS='-ltiff'
2684 LIBS="$TIFF_LIBS $LIBS"
2685 AC_DEFINE(TIFF_DELEGATE,1,Define if you have TIFF library)
cristya448bd22011-10-14 12:38:13 +00002686 AC_MSG_NOTICE([yes])
cristy3ed852e2009-09-05 21:47:34 +00002687 have_tiff='yes'
2688 AC_CHECK_HEADERS(tiffconf.h)
2689 AC_CHECK_FUNCS([TIFFIsCODECConfigured TIFFMergeFieldInfo \
cristy3f590e52011-11-14 14:29:44 +00002690 TIFFIsBigEndian TIFFReadEXIFDirectory TIFFSetErrorHandlerExt \
2691 TIFFSetTagExtender TIFFSetWarningHandlerExt \
2692 TIFFSwabArrayOfTriples])
cristy3ed852e2009-09-05 21:47:34 +00002693 fi
2694 else
cristya448bd22011-10-14 12:38:13 +00002695 AC_MSG_NOTICE([no])
cristy3ed852e2009-09-05 21:47:34 +00002696 fi
2697fi
2698AM_CONDITIONAL(TIFF_DELEGATE, test "$have_tiff" = 'yes')
2699AC_SUBST(TIFF_LIBS)
2700
2701dnl ===========================================================================
2702
2703#
cristyb1860752011-03-14 00:27:46 +00002704# Check for WEBP delegate library.
2705#
2706AC_ARG_WITH(webp,
2707 [AC_HELP_STRING([--without-webp],
2708 [disable WEBP support])],
2709 [with_webp=$withval],
2710 [with_webp='yes'])
2711
2712if test "$with_webp" != 'yes'; then
2713 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-webp=$with_webp "
2714fi
2715
2716have_webp='no'
2717WEBP_LIBS=''
2718if test "$with_webp" != 'no'; then
cristya448bd22011-10-14 12:38:13 +00002719 AC_MSG_NOTICE([-------------------------------------------------------------])
cristyb1860752011-03-14 00:27:46 +00002720 AC_MSG_CHECKING([for WEBP])
cristya448bd22011-10-14 12:38:13 +00002721 AC_MSG_NOTICE([])
cristyb1860752011-03-14 00:27:46 +00002722 failed=0
2723 passed=0
2724 AC_CHECK_HEADER(webp/decode.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2725 AC_CHECK_LIB(webp,WebPDecodeRGB,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2726 AC_MSG_CHECKING([if WEBP package is complete])
2727 if test $passed -gt 0; then
2728 if test $failed -gt 0; then
cristya448bd22011-10-14 12:38:13 +00002729 AC_MSG_NOTICE([no -- some components failed test])
cristyb1860752011-03-14 00:27:46 +00002730 have_webp='no (failed tests)'
2731 else
2732 WEBP_LIBS='-lwebp'
2733 LIBS="$WEBP_LIBS $LIBS"
2734 AC_DEFINE(WEBP_DELEGATE,1,Define if you have WEBP library)
cristya448bd22011-10-14 12:38:13 +00002735 AC_MSG_NOTICE([yes])
cristyb1860752011-03-14 00:27:46 +00002736 have_webp='yes'
2737 fi
2738 else
cristya448bd22011-10-14 12:38:13 +00002739 AC_MSG_NOTICE([no])
cristyb1860752011-03-14 00:27:46 +00002740 fi
2741fi
2742AM_CONDITIONAL(WEBP_DELEGATE,test "$have_webp" = 'yes')
2743AC_SUBST(WEBP_LIBS)
2744
2745dnl ===========================================================================
2746
2747#
cristy3ed852e2009-09-05 21:47:34 +00002748# Set Windows font directory.
2749#
cristy74554ef2011-10-27 12:56:11 +00002750AC_ARG_WITH([windows-font-dir],
cristy3ed852e2009-09-05 21:47:34 +00002751 [AC_HELP_STRING([--with-windows-font-dir=DIR],
2752 [directory containing MS-Windows fonts])],
2753 [with_windows_font_dir=$withval],
2754 [with_windows_font_dir=''])
2755if test "$with_windows_font_dir" != '' ; then
2756 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-windows-font-dir=$with_windows_font_dir "
2757fi
2758
2759dnl ===========================================================================
2760
2761#
2762# Check for WMF delegate library.
2763#
2764AC_ARG_WITH([wmf],
2765 [AC_HELP_STRING([--without-wmf],
2766 [disable WMF support])],
2767 [with_wmf=$withval],
cristy8d63d1d2010-01-06 20:38:37 +00002768 [with_wmf='yes'])
cristy3ed852e2009-09-05 21:47:34 +00002769
2770if test "$with_wmf" != 'yes'; then
2771 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-wmf=$with_wmf "
2772fi
2773
2774have_wmf='no'
2775WMF_LIBS=''
cristy03f7cf92011-12-15 01:40:41 +00002776WMF_LIBS_DEPS=''
2777OLIBS="$LIBS"
cristy3ed852e2009-09-05 21:47:34 +00002778if test "$with_wmf" != 'no'; then
cristy03f7cf92011-12-15 01:40:41 +00002779 AC_MSG_RESULT([-------------------------------------------------------------])
glennrp84cc1bd2011-08-24 14:01:52 +00002780 AC_MSG_CHECKING([for WMF])
cristy03f7cf92011-12-15 01:40:41 +00002781 AC_MSG_RESULT([])
2782 have_libwmf='no'
2783 have_libwmflite='no'
2784 have_libwmf_ipa_h='no'
2785
2786 AC_CHECK_HEADER([libwmf/ipa.h],[have_libwmf_ipa_h='yes'],,[$FT2BUILD_H])
2787 if test "$have_libwmf_ipa_h" = 'yes'; then
2788 AC_CHECK_LIB(wmflite,wmf_lite_create,have_libwmflite='yes',,)
2789 if test "$have_libwmflite" = 'yes'; then
2790 AC_DEFINE(WMFLITE_DELEGATE,1,Define if you have wmflite library)
2791 WMF_LIBS='-lwmflite'
glennrp84cc1bd2011-08-24 14:01:52 +00002792 LIBS="$WMF_LIBS $LIBS"
glennrp84cc1bd2011-08-24 14:01:52 +00002793 have_wmf='yes'
cristy03f7cf92011-12-15 01:40:41 +00002794 else
2795 WMF_LIBS_DEPS=''
2796 WMF_CONFIG_LIBS=`libwmf-config --libs`
2797 for lib in xml2 expat freetype jpeg png z; do
2798 testlib="-l${lib}"
2799 echo "$WMF_CONFIG_LIBS" | grep -- "$testlib" > /dev/null && WMF_LIBS_DEPS="$WMF_LIBS_DEPS $testlib"
2800 done
2801 AC_CHECK_LIB(wmf,wmf_api_create,have_libwmf='yes',,$WMF_LIBS_DEPS)
2802 if test "$have_libwmf" = 'yes'; then
2803 AC_DEFINE(WMF_DELEGATE,1,Define if you have wmf library)
2804 WMF_LIBS='-lwmf'
2805 LIBS="$WMF_LIBS $LIBS"
2806 have_wmf='yes'
2807 else
2808 AC_MSG_RESULT([no -- some components failed test])
2809 have_wmf='no (failed tests)'
2810 have_wmflite='no (failed tests)'
2811 LIBS="$OLIBS"
2812 WMF_LIBS=''
2813 fi
glennrp84cc1bd2011-08-24 14:01:52 +00002814 fi
cristy03f7cf92011-12-15 01:40:41 +00002815 fi
2816 AC_MSG_CHECKING([if WMF package is complete])
2817 if test "$have_wmf" = 'yes'; then
2818 AC_MSG_RESULT([yes])
cristy3ed852e2009-09-05 21:47:34 +00002819 else
cristy03f7cf92011-12-15 01:40:41 +00002820 AC_MSG_RESULT([no])
cristy3ed852e2009-09-05 21:47:34 +00002821 fi
2822fi
cristy03f7cf92011-12-15 01:40:41 +00002823AM_CONDITIONAL(WMF_DELEGATE, test "$have_wmf" = 'yes')
cristy3ed852e2009-09-05 21:47:34 +00002824AC_SUBST(WMF_LIBS)
cristy03f7cf92011-12-15 01:40:41 +00002825AC_SUBST(WMF_LIBS_DEPS)
cristy735e8942010-04-02 20:32:57 +00002826
cristy81beccd2011-10-03 18:17:24 +00002827
2828dnl ===========================================================================
2829
cristy3ed852e2009-09-05 21:47:34 +00002830#
2831# Check for XML delegate library.
2832#
cristy81beccd2011-10-03 18:17:24 +00002833AC_ARG_WITH([xml],
cristy3ed852e2009-09-05 21:47:34 +00002834 [AC_HELP_STRING([--without-xml],
2835 [disable XML support])],
2836 [with_xml=$withval],
cristy81beccd2011-10-03 18:17:24 +00002837 [with_xml=$have_x])
cristy3ed852e2009-09-05 21:47:34 +00002838
cristy81beccd2011-10-03 18:17:24 +00002839if test "$with_xml" != 'yes' ; then
cristy3ed852e2009-09-05 21:47:34 +00002840 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-xml=$with_xml "
2841fi
2842
cristy81beccd2011-10-03 18:17:24 +00002843have_xml='no'
2844XML_LIBS=''
2845if test "$with_xml" != 'no'; then
cristya448bd22011-10-14 12:38:13 +00002846 AC_MSG_NOTICE([-------------------------------------------------------------])
cristy81beccd2011-10-03 18:17:24 +00002847 AC_MSG_CHECKING([for XML])
cristya448bd22011-10-14 12:38:13 +00002848 AC_MSG_NOTICE([])
cristy81beccd2011-10-03 18:17:24 +00002849 PERSIST_LDFLAGS=$LDFLAGS
2850 PERSIST_CPPFLAGS=$CPPFLAGS
2851 xml2_config=''
2852 AC_PATH_PROG(xml2_config,xml2-config,)dnl
2853 if test -n "$xml2_config"; then
2854 # Debian installs libxml headers under /usr/include/libxml2/libxml with
2855 # the shared library installed under /usr/lib, whereas the package
2856 # installs itself under $prefix/libxml and $prefix/lib.
2857 xml2_prefix=`xml2-config --prefix`
2858 if test -d "${xml2_prefix}/include/libxml2"; then
2859 CPPFLAGS="$CPPFLAGS -I${xml2_prefix}/include/libxml2"
2860 fi
2861 if test "${xml2_prefix}" != '/usr'; then
2862 LDFLAGS="$LDFLAGS -L${xml2_prefix}/lib"
2863 fi
2864 fi
2865 failed=0
2866 passed=0
2867 AC_CHECK_HEADER(libxml/parser.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
2868 AC_CHECK_LIB(xml2,xmlSAXVersion,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2869 AC_CHECK_LIB(xml2,xmlParseChunk,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2870 AC_CHECK_LIB(xml2,xmlCreatePushParserCtxt,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
2871 AC_MSG_CHECKING([if XML package is complete])
2872 if test $passed -gt 0; then
2873 if test $failed -gt 0; then
cristya448bd22011-10-14 12:38:13 +00002874 AC_MSG_NOTICE([no -- some components failed test])
cristy81beccd2011-10-03 18:17:24 +00002875 have_xml='no (failed tests)'
2876 LDFLAGS="$PERSIST_LDFLAGS"
2877 CPPFLAGS="$PERSIST_CPPFLAGS"
2878 else
2879 XML_LIBS='-lxml2'
2880 LIBS="$XML_LIBS $LIBS"
2881 AC_DEFINE(XML_DELEGATE,1,Define if you have XML library)
cristya448bd22011-10-14 12:38:13 +00002882 AC_MSG_NOTICE([yes])
cristy81beccd2011-10-03 18:17:24 +00002883 have_xml='yes'
2884 fi
2885 else
cristya448bd22011-10-14 12:38:13 +00002886 AC_MSG_NOTICE([no])
cristy3ed852e2009-09-05 21:47:34 +00002887 fi
2888fi
cristy81beccd2011-10-03 18:17:24 +00002889AM_CONDITIONAL(XML_DELEGATE,test "$have_xml" = 'yes')
cristy3ed852e2009-09-05 21:47:34 +00002890AC_SUBST(XML_LIBS)
2891
2892dnl ===========================================================================
2893
2894# Substitute compiler name to build/link PerlMagick
2895#
2896AC_SUBST(PERLMAINCC)
2897
2898#
2899# Configure install Paths
2900#
cristy7def36a2011-10-28 19:04:41 +00002901
cristy2a11bef2011-10-28 18:33:11 +00002902# Path to ImageMagick header files
2903INCLUDE_RELATIVE_PATH="ImageMagick"
cristy670aa3c2011-11-03 00:54:00 +00002904INCLUDE_PATH="${INCLUDEARCH_DIR}/${INCLUDE_RELATIVE_PATH}"
2905DEFINE_INCLUDE_PATH="${INCLUDEARCH_DIR}/${INCLUDE_RELATIVE_PATH}/"
cristy2a11bef2011-10-28 18:33:11 +00002906case "${build_os}" in
2907 mingw* )
2908 DEFINE_INCLUDE_PATH=`$WinPathScript "$DEFINE_INCLUDE_PATH" 1`
2909 ;;
2910esac
2911AC_DEFINE_UNQUOTED(INCLUDE_PATH,"$DEFINE_INCLUDE_PATH",Directory where ImageMagick headers live.)
2912AC_SUBST(INCLUDE_PATH)
cristy3ed852e2009-09-05 21:47:34 +00002913
2914# Subdirectory under lib to place ImageMagick lib files
2915LIBRARY_RELATIVE_PATH="${PACKAGE_NAME}-${PACKAGE_VERSION}"
2916AC_DEFINE_UNQUOTED(LIBRARY_RELATIVE_PATH,"$LIBRARY_RELATIVE_PATH",Subdirectory of lib where ImageMagick architecture dependent files are installed)
2917
2918# Path to ImageMagick bin directory
2919EXECUTABLE_PATH="${BIN_DIR}"
2920DEFINE_EXECUTABLE_PATH="${BIN_DIR}/"
2921case "${build_os}" in
2922 mingw* )
2923 DEFINE_EXECUTABLE_PATH=`$WinPathScript "$DEFINE_EXECUTABLE_PATH" 1`
2924 ;;
2925esac
2926AC_DEFINE_UNQUOTED(EXECUTABLE_PATH,"$DEFINE_EXECUTABLE_PATH",Directory where executables are installed.)
2927AC_SUBST(EXECUTABLE_PATH)
2928
2929# Path to ImageMagick lib
2930LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}"
2931DEFINE_LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}/"
2932case "${build_os}" in
2933 mingw* )
2934 DEFINE_LIBRARY_PATH=`$WinPathScript "$DEFINE_LIBRARY_PATH" 1`
2935 ;;
2936esac
2937AC_DEFINE_UNQUOTED(LIBRARY_PATH,"$DEFINE_LIBRARY_PATH",Directory where architecture-dependent files live.)
2938AC_SUBST(LIBRARY_PATH)
2939
cristy3ed852e2009-09-05 21:47:34 +00002940#
2941# Subdirectory under lib to place ImageMagick coder module files
2942CODER_RELATIVE_PATH="${LIBRARY_RELATIVE_PATH}/modules-Q${QUANTUM_DEPTH}/coders"
2943AC_DEFINE_UNQUOTED(CODER_RELATIVE_PATH,"$CODER_RELATIVE_PATH",Subdirectory of lib where coder modules are installed)
2944CODER_PATH="${LIB_DIR}/${CODER_RELATIVE_PATH}"
2945DEFINE_CODER_PATH="${LIB_DIR}/${CODER_RELATIVE_PATH}/"
2946case "${build_os}" in
2947 mingw* )
2948 DEFINE_CODER_PATH=`$WinPathScript "$DEFINE_CODER_PATH" 1`
2949 ;;
2950esac
2951AC_DEFINE_UNQUOTED(CODER_PATH,"$DEFINE_CODER_PATH",Location of coder modules)
2952AC_SUBST(CODER_PATH)
2953
2954#
2955# Subdirectory under lib to place ImageMagick filter module files
2956FILTER_RELATIVE_PATH="${LIBRARY_RELATIVE_PATH}/modules-Q${QUANTUM_DEPTH}/filters"
2957AC_DEFINE_UNQUOTED(FILTER_RELATIVE_PATH,"$FILTER_RELATIVE_PATH",Subdirectory of lib where filter modules are installed)
2958FILTER_PATH="${LIB_DIR}/${FILTER_RELATIVE_PATH}"
2959DEFINE_FILTER_PATH="${LIB_DIR}/${FILTER_RELATIVE_PATH}/"
2960case "${build_os}" in
2961 mingw* )
2962 DEFINE_FILTER_PATH=`$WinPathScript "$DEFINE_FILTER_PATH" 1`
2963 ;;
2964esac
2965AC_DEFINE_UNQUOTED(FILTER_PATH,"$DEFINE_FILTER_PATH",Location of filter modules)
2966AC_SUBST(FILTER_PATH)
2967
2968#
2969# Path to ImageMagick documentation files
cristyd55889c2011-03-27 00:50:24 +00002970DOCUMENTATION_RELATIVE_PATH=""
2971DOCUMENTATION_PATH="${DOC_DIR}/${DOCUMENTATION_RELATIVE_PATH}"
2972DEFINE_DOCUMENTATION_PATH="${DOC_DIR}/${DOCUMENTATION_RELATIVE_PATH}/"
cristy3ed852e2009-09-05 21:47:34 +00002973case "${build_os}" in
2974 mingw* )
2975 DEFINE_DOCUMENTATION_PATH=`$WinPathScript "$DEFINE_DOCUMENTATION_PATH" 1`
2976 ;;
2977esac
2978AC_DEFINE_UNQUOTED(DOCUMENTATION_PATH,"$DEFINE_DOCUMENTATION_PATH",Directory where ImageMagick documents live.)
2979AC_SUBST(DOCUMENTATION_PATH)
2980
cristy2a11bef2011-10-28 18:33:11 +00002981# Subdirectory to place architecture-dependent configuration files
cristyba0f1972011-03-28 12:42:52 +00002982CONFIGURE_RELATIVE_PATH="${PACKAGE_NAME}"
cristy29b1f6f2011-03-27 14:02:38 +00002983AC_DEFINE_UNQUOTED(CONFIGURE_RELATIVE_PATH,"$CONFIGURE_RELATIVE_PATH",Subdirectory of lib where architecture-dependent configuration files live.)
cristy7def36a2011-10-28 19:04:41 +00002984CONFIGURE_PATH="${SYSCONF_DIR}/${CONFIGURE_RELATIVE_PATH}/"
cristy29b1f6f2011-03-27 14:02:38 +00002985DEFINE_CONFIGURE_PATH="${SYSCONF_DIR}/${CONFIGURE_RELATIVE_PATH}/"
2986case "${build_os}" in
2987 mingw* )
2988 DEFINE_CONFIGURE_PATH=`$WinPathScript "$DEFINE_CONFIGURE_PATH" 1`
2989 ;;
2990esac
2991AC_DEFINE_UNQUOTED(CONFIGURE_PATH,"$DEFINE_CONFIGURE_PATH",Directory where architecture-dependent configuration files live.)
2992AC_SUBST(CONFIGURE_PATH)
2993
cristy2a11bef2011-10-28 18:33:11 +00002994# Subdirectory to place architecture-independent configuration files
cristy4f820712011-04-01 12:35:43 +00002995SHARE_RELATIVE_PATH="${LIBRARY_RELATIVE_PATH}"
2996AC_DEFINE_UNQUOTED(SHARE_RELATIVE_PATH,"$SHARE_RELATIVE_PATH",Subdirectory of lib where architecture-independent configuration files live.)
cristy670aa3c2011-11-03 00:54:00 +00002997SHARE_PATH="${DATA_DIR}/${SHARE_RELATIVE_PATH}"
cristy4f820712011-04-01 12:35:43 +00002998DEFINE_SHARE_PATH="${DATA_DIR}/${SHARE_RELATIVE_PATH}/"
cristy3ed852e2009-09-05 21:47:34 +00002999case "${build_os}" in
3000 mingw* )
cristy4f820712011-04-01 12:35:43 +00003001 DEFINE_SHARE_PATH=`$WinPathScript "$DEFINE_SHARE_PATH" 1`
cristy3ed852e2009-09-05 21:47:34 +00003002 ;;
3003esac
cristy4f820712011-04-01 12:35:43 +00003004AC_DEFINE_UNQUOTED(SHARE_PATH,"$DEFINE_SHARE_PATH",Directory where architecture-independent configuration files live.)
3005AC_SUBST(SHARE_PATH)
cristy3ed852e2009-09-05 21:47:34 +00003006
cristy408ebcd2011-11-14 01:36:57 +00003007# Subdirectory to place architecture-dependent configuration files
3008SHAREARCH_RELATIVE_PATH="${LIBRARY_RELATIVE_PATH}/config"
cristy670aa3c2011-11-03 00:54:00 +00003009AC_DEFINE_UNQUOTED(SHAREARCH_RELATIVE_PATH,"$SHAREARCH_RELATIVE_PATH",Subdirectory of lib where architecture-independent configuration files live.)
cristy408ebcd2011-11-14 01:36:57 +00003010SHAREARCH_PATH="${SHAREARCH_DIR}/${SHAREARCH_RELATIVE_PATH}"
3011DEFINE_SHAREARCH_PATH="${SHAREARCH_DIR}/${SHAREARCH_RELATIVE_PATH}/"
cristy670aa3c2011-11-03 00:54:00 +00003012case "${build_os}" in
3013 mingw* )
3014 DEFINE_SHAREARCH_PATH=`$WinPathScript "$DEFINE_SHAREARCH_PATH" 1`
3015 ;;
3016esac
3017AC_DEFINE_UNQUOTED(SHAREARCH_PATH,"$DEFINE_SHAREARCH_PATH",Directory where architecture-independent configuration files live.)
3018AC_SUBST(SHAREARCH_PATH)
3019
cristy3ed852e2009-09-05 21:47:34 +00003020#
3021# program_transform_name is formed for use in a Makefile, so create a
3022# modified version for use in a shell script.
3023configure_transform_name=`echo ${program_transform_name} | sed 's,\\$\\$,$,'`
3024
3025# Default delegate definitions
cristya448bd22011-10-14 12:38:13 +00003026AC_MSG_NOTICE([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00003027AC_MSG_CHECKING([for ImageMagick delegate programs])
cristya448bd22011-10-14 12:38:13 +00003028AC_MSG_NOTICE([])
cristy3ed852e2009-09-05 21:47:34 +00003029AutotraceDecodeDelegateDefault='autotrace'
cristy3d7f8062009-09-24 20:45:35 +00003030BlenderDecodeDelegateDefault='blender'
cristy3ed852e2009-09-05 21:47:34 +00003031BZIPDelegateDefault='bzip2'
3032BrowseDelegateDefault='xdg-open'
3033CGMDecodeDelegateDefault='ralcgm'
3034CatDelegateDefault='cat'
3035DNGDecodeDelegateDefault='ufraw-batch'
3036GVCDecodeDelegateDefault='dot'
3037DVIDecodeDelegateDefault='dvips'
3038EchoDelegateDefault='echo'
3039EditorDelegateDefault='xterm'
3040FIGDecodeDelegateDefault='fig2dev'
3041ConvertDelegateDefault=`echo convert | sed ${configure_transform_name}`
3042DisplayDelegateDefault=`echo display | sed ${configure_transform_name}`
3043MogrifyDelegateDefault=`echo mogrify | sed ${configure_transform_name}`
3044GnuplotDecodeDelegateDefault='gnuplot'
cristy3ed852e2009-09-05 21:47:34 +00003045HPGLDecodeDelegateDefault='hp2xx'
3046HTMLDecodeDelegateDefault='html2ps'
3047ILBMDecodeDelegateDefault='ilbmtoppm'
3048ILBMEncodeDelegateDefault='ppmtoilbm'
3049LPDelegateDefault='lp'
3050LPRDelegateDefault='lpr'
3051LZWDecodeDelegateDefault='uncompress'
3052LZWEncodeDelegateDefault='compress'
3053LaunchDelegateDefault='gimp'
3054MANDelegateDefault='groff'
3055MPEGDecodeDelegateDefault='ffmpeg'
3056MPEGEncodeDelegateDefault='ffmpeg'
cristy935c86e2010-06-05 23:50:07 +00003057MrSIDDecodeDelegateDefault='mrsidgeodecode'
cristy3ed852e2009-09-05 21:47:34 +00003058MVDelegateDefault='mv'
3059PCLDelegateDefault='pcl6'
3060PGPDecodeDelegateDefault='pgpv'
3061POVDelegateDefault='povray'
3062if test "$native_win32_build" = 'yes'; then
3063 PSDelegateDefault='gswin32c'
cristyb7931f12009-09-25 10:22:21 +00003064elif test "$gslib_framework" = 'yes'; then
cristy3ed852e2009-09-05 21:47:34 +00003065 PSDelegateDefault='gsc'
3066else
3067 PSDelegateDefault='gs'
3068fi
3069RLEEncodeDelegateDefault='rawtorle'
3070RMDelegateDefault='rm'
cristy4689cf02010-02-17 21:15:45 +00003071RSVGDecodeDelegateDefault='rsvg'
cristy3ed852e2009-09-05 21:47:34 +00003072SCANDecodeDelegateDefault='scanimage'
3073TXTDelegateDefault='enscript'
cristy16db5ed2010-07-29 13:32:02 +00003074UniconvertorDelegateDefault='uniconvertor'
cristy3ed852e2009-09-05 21:47:34 +00003075WMFDecodeDelegateDefault='wmf2eps'
3076WWWDecodeDelegateDefault='curl'
3077XPSDelegateDefault='gxps'
3078ZipDelegateDefault='gzip'
3079
3080# Search for delegates
3081AC_PATH_PROG(AutotraceDecodeDelegate, "$AutotraceDecodeDelegateDefault", "$AutotraceDecodeDelegateDefault")
cristy3ed852e2009-09-05 21:47:34 +00003082AC_PATH_PROG(BlenderDecodeDelegate, "$BlenderDecodeDelegateDefault", "$BlenderDecodeDelegateDefault")
3083AC_PATH_PROG(BZIPDelegate, "$BZIPDelegateDefault", "$BZIPDelegateDefault")
3084AC_PATH_PROG(BrowseDelegate, "$BrowseDelegateDefault" mozilla firefox netscape, "$BrowseDelegateDefault")
3085AC_PATH_PROG(CGMDecodeDelegate, "$CGMDecodeDelegateDefault", "$CGMDecodeDelegateDefault")
3086AC_PATH_PROG(CatDelegate, "$CatDelegateDefault", "$CatDelegateDefault")
3087AC_PATH_PROG(DNGDecodeDelegate, "$DNGDecodeDelegateDefault", "$DNGDecodeDelegateDefault")
3088AC_PATH_PROG(GVCDecodeDelegate, "$GVCDecodeDelegateDefault", "$GVCDecodeDelegateDefault")
3089AC_PATH_PROG(DVIDecodeDelegate, "$DVIDecodeDelegateDefault", "$DVIDecodeDelegateDefault")
3090AC_PATH_PROG(EchoDelegate, "$EchoDelegateDefault", "$EchoDelegateDefault")
3091AC_PATH_PROG(EditorDelegate, "$EditorDelegateDefault", "$EditorDelegateDefault")
3092AC_PATH_PROG(FIGDecodeDelegate, "$FIGDecodeDelegateDefault", "$FIGDecodeDelegateDefault")
3093AC_PATH_PROG(ConvertDelegate, "$ConvertDelegateDefault", "$ConvertDelegateDefault")
3094AC_PATH_PROG(DisplayDelegate, "$DisplayDelegateDefault", "$DisplayDelegateDefault")
3095AC_PATH_PROG(MogrifyDelegate, "$MogrifyDelegateDefault", "$MogrifyDelegateDefault")
3096AC_PATH_PROG(GnuplotDecodeDelegate, "$GnuplotDecodeDelegateDefault", "$GnuplotDecodeDelegateDefault")
cristy3ed852e2009-09-05 21:47:34 +00003097AC_PATH_PROG(HPGLDecodeDelegate, "$HPGLDecodeDelegateDefault", "$HPGLDecodeDelegateDefault")
3098AC_PATH_PROG(HTMLDecodeDelegate, "$HTMLDecodeDelegateDefault", "$HTMLDecodeDelegateDefault")
3099AC_PATH_PROG(ILBMDecodeDelegate, "$ILBMDecodeDelegateDefault", "$ILBMDecodeDelegateDefault")
3100AC_PATH_PROG(ILBMEncodeDelegate, "$ILBMEncodeDelegateDefault", "$ILBMEncodeDelegateDefault")
3101AC_PATH_PROG(LPDelegate, "$LPDelegateDefault", no)
3102AC_PATH_PROG(LPRDelegate, "$LPRDelegateDefault", "$LPRDelegateDefault")
3103AC_PATH_PROG(LZWDecodeDelegate, "$LZWDecodeDelegateDefault", "$LZWDecodeDelegateDefault")
3104AC_PATH_PROG(LZWEncodeDelegate, "$LZWEncodeDelegateDefault", "$LZWEncodeDelegateDefault")
3105AC_PATH_PROG(LaunchDelegate, "$LaunchDelegateDefault", "$LaunchDelegateDefault")
3106AC_PATH_PROG(MANDelegate, "$MANDelegateDefault", "$MANDelegateDefault")
3107AC_PATH_PROG(MPEGDecodeDelegate, "$MPEGDecodeDelegateDefault", "$MPEGDecodeDelegateDefault")
3108AC_PATH_PROG(MPEGEncodeDelegate, "$MPEGEncodeDelegateDefault", "$MPEGEncodeDelegateDefault")
cristy935c86e2010-06-05 23:50:07 +00003109AC_PATH_PROG(MrSIDDecodeDelegate, "$MrSIDDecodeDelegateDefault", "$MrSIDDecodeDelegateDefault")
cristy3ed852e2009-09-05 21:47:34 +00003110AC_PATH_PROG(MVDelegate, "$MVDelegateDefault", "$MVDelegateDefault")
3111AC_PATH_PROG(PCLDelegate, "$PCLDelegateDefault", "$PCLDelegateDefault")
3112AC_PATH_PROG(PGPDecodeDelegate, "$PGPDecodeDelegateDefault", "$PGPDecodeDelegateDefault")
3113AC_PATH_PROG(POVDelegate, "$POVDelegateDefault", "$POVDelegateDefault")
3114AC_PATH_PROGS(PSDelegate, gsx gsc "$PSDelegateDefault", "$PSDelegateDefault")
3115AC_PATH_PROG(RLEEncodeDelegate, "$RLEEncodeDelegateDefault", "$RLEEncodeDelegateDefault")
3116AC_PATH_PROG(RMDelegate, "$RMDelegateDefault", "$RMDelegateDefault")
cristy4689cf02010-02-17 21:15:45 +00003117AC_PATH_PROG(RSVGDecodeDelegate, "$RSVGDecodeDelegateDefault", "$RSVGDecodeDelegateDefault")
cristy3ed852e2009-09-05 21:47:34 +00003118AC_PATH_PROG(SCANDecodeDelegate, "$SCANDecodeDelegateDefault", "$SCANDecodeDelegateDefault")
3119AC_PATH_PROG(TXTDelegate, "$TXTDelegateDefault", "$TXTDelegateDefault")
cristy5ac9ac82010-07-29 13:24:24 +00003120AC_PATH_PROG(UniconvertorDelegate, "$UniconvertorDelegateDefault", "$UniconvertorDelegateDefault")
cristy3ed852e2009-09-05 21:47:34 +00003121AC_PATH_PROG(WMFDecodeDelegate, "$WMFDecodeDelegateDefault", "$WMFDecodeDelegateDefault")
3122AC_PATH_PROG(WWWDecodeDelegate, "$WWWDecodeDelegateDefault", "$WWWDecodeDelegateDefault")
3123AC_PATH_PROG(XPSDelegate, "$XPSDelegateDefault", "$XPSDelegateDefault")
3124AC_PATH_PROG(ZipDelegate, "$ZipDelegateDefault", "$ZipDelegateDefault")
3125
3126# Prefer lpr to lp; lp needs options tacked on.
3127if test "$LPRDelegate" != no; then
3128 PrintDelegate="$LPRDelegate"
3129else
3130 PrintDelegate="$LPDelegate -c -s"
3131fi
3132AC_SUBST(PrintDelegate)
3133
3134# Installed ImageMagick utiltity paths
3135ConvertDelegate="${BIN_DIR}/${ConvertDelegateDefault}"
3136DisplayDelegate="${BIN_DIR}/${DisplayDelegateDefault}"
3137MogrifyDelegate="${BIN_DIR}/${MogrifyDelegateDefault}"
3138
3139# Set delegate booleans
3140have_ffmpeg='no'; if test "$MPEGDecodeDelegate" != "$MPEGDecodeDelegateDefault" ; then have_ffmpeg='yes'; fi
3141have_fig2dev='no' ; if test "$FIGDecodeDelegate" != "$FIGDecodeDelegateDefault" ; then have_fig2dev='yes'; fi
3142have_gs='no' ; if test "$PSDelegate" != "$PSDelegateDefault"; then have_gs='yes'; fi
3143have_hp2xx='no' ; if test "$HPGLDecodeDelegate" != "$HPGLDecodeDelegateDefault" ; then have_hp2xx='yes'; fi
3144have_ilbmtoppm='no' ; if test "$ILBMDecodeDelegate" != "$ILBMDecodeDelegateDefault" ; then have_ilbmtoppm='yes'; fi
cristy935c86e2010-06-05 23:50:07 +00003145have_mrsid='no'; if test "$MrSIDDecodeDelegate" != "$MrSIDDecodeDelegateDefault" ; then have_mrsid='yes'; fi
cristy3ed852e2009-09-05 21:47:34 +00003146have_pcl='no' ; if test "$PCLDelegate" != "$PCLDelegateDefault"; then have_pcl='yes'; fi
3147have_ppmtoilbm='no' ; if test "$ILBMEncodeDelegate" != "$ILBMEncodeDelegateDefault" ; then have_ppmtoilbm='yes'; fi
cristy3ed852e2009-09-05 21:47:34 +00003148have_ralcgm='no' ; if test "$CGMDecodeDelegate" != "$CGMDecodeDelegateDefault" ; then have_ralcgm='yes'; fi
3149have_xps='no' ; if test "$XPSDelegate" != "$XPSDelegateDefault"; then have_xps='yes'; fi
3150
3151#
3152# Test for font directories
3153#
3154type_include_files=''
3155
cristy430a7312010-01-21 20:44:04 +00003156# Dejavu fonts.
3157AC_MSG_CHECKING(for Dejavu fonts directory)
3158dejavu_font_dir=''
3159if test "${with_dejavu_font_dir}" != 'default'; then
3160 dejavu_font_dir="${with_dejavu_font_dir}/"
3161else
3162 for font_dir in "${prefix}/share/dejavu/fonts/" '/usr/share/fonts/dejavu/'; do
3163 if test -f "${font_dir}DejaVuSerif.ttf"; then
3164 dejavu_font_dir="${font_dir}"
3165 break 1
3166 fi
3167 done
3168fi
3169if test "${dejavu_font_dir}x" != 'x'; then
3170 type_include_files="${type_include_files} "'<include file="type-dejavu.xml" />'
cristya448bd22011-10-14 12:38:13 +00003171 AC_MSG_NOTICE([$dejavu_font_dir])
cristy430a7312010-01-21 20:44:04 +00003172else
cristya448bd22011-10-14 12:38:13 +00003173 AC_MSG_NOTICE([not found!]);
cristy430a7312010-01-21 20:44:04 +00003174fi
3175AC_SUBST(dejavu_font_dir)
3176
cristy3ed852e2009-09-05 21:47:34 +00003177# Windows
3178windows_font_dir=''
3179if test "$with_windows_font_dir" != "no" && test -n "$with_windows_font_dir"; then
3180 windows_font_dir="${with_windows_font_dir}/"
3181fi
cristy430a7312010-01-21 20:44:04 +00003182if test "${windows_font_dir}x" != 'x'; then
cristy3ed852e2009-09-05 21:47:34 +00003183 if test -f '/usr/X11R6/lib/X11/fonts/truetype/arial.ttf'; then
3184 windows_font_dir='/usr/X11R6/lib/X11/fonts/truetype/'
3185 fi
3186 if test -f '/usr/X11R7/lib/X11/fonts/truetype/arial.ttf'; then
3187 windows_font_dir='/usr/X11R7/lib/X11/fonts/truetype/'
3188 fi
3189 if test -f '/usr/share/fonts/msttcore/arial.ttf'; then
3190 windows_font_dir='/usr/share/fonts/msttcore/truetype/'
3191 fi
3192fi
cristy430a7312010-01-21 20:44:04 +00003193if test "${windows_font_dir}x" != 'x'; then
cristy3ed852e2009-09-05 21:47:34 +00003194 type_include_files="$type_include_files "'<include file="type-windows.xml" />'
3195fi
3196AC_SUBST(windows_font_dir)
3197
3198# Ghostscript
3199AC_MSG_CHECKING(for Ghostscript fonts directory)
3200ghostscript_font_dir=''
3201if test "${with_gs_font_dir}" != 'default'; then
3202 ghostscript_font_dir="${with_gs_font_dir}/"
3203else
3204 if test "${native_win32_build}" = 'yes'; then
3205 # Native Windows Build
3206 for font_dir in "c:\\Program Files\\gs\\fonts\\" "c:\\Program Files \(x86\)\\gs\\fonts\\" "c:\\gs\\fonts\\"; do
3207 if test -f "${font_dir}a010013l.pfb"; then
3208 ghostscript_font_dir="$font_dir"
3209 break 1
3210 fi
3211 done
3212 if test "${PSDelegate}" != 'gswin32c'; then
3213 ghostscript_font_dir=`echo "${PSDelegate}" | sed -e 's:/gs/.*:/gs:;s:^/::;s/./&:/;s:/:\\\\:g'`"\\fonts\\"
3214 fi
3215 else
3216 # Linux / Mac OS X / Unix Build
3217 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
3218 if test -f "${font_dir}a010013l.pfb"; then
3219 ghostscript_font_dir="${font_dir}"
3220 break 1
3221 fi
3222 done
3223 if test "${ghostscript_font_dir}x" = 'x'; then
3224 if test "$PSDelegate" != 'gs'; then
3225 ghostscript_font_dir=`echo "$PSDelegate" | sed -e 's:/bin/gs:/share/ghostscript/fonts:'`"/"
3226 fi
3227 fi
3228 fi
3229fi
3230if test "${ghostscript_font_dir}x" != 'x'; then
3231 type_include_files="${type_include_files} "'<include file="type-ghostscript.xml" />'
cristya448bd22011-10-14 12:38:13 +00003232 AC_MSG_NOTICE([$ghostscript_font_dir])
cristy3ed852e2009-09-05 21:47:34 +00003233else
cristya448bd22011-10-14 12:38:13 +00003234 AC_MSG_NOTICE([not found!]);
cristy3ed852e2009-09-05 21:47:34 +00003235fi
3236AC_SUBST(ghostscript_font_dir)
3237case "${build_os}" in
3238 mingw* )
3239 PSDelegate=`$WinPathScript "$PSDelegate" 1`
3240 ;;
3241esac
3242
3243AC_SUBST(type_include_files)
3244
3245#
3246# Handle case where user doesn't want frozen paths
3247#
3248if test "$with_frozenpaths" != 'yes'; then
3249 # Re-set delegate definitions to default (no paths)
3250 AutotraceDecodeDelegate="$AutotraceDecodeDelegateDefault"
cristy3ed852e2009-09-05 21:47:34 +00003251 BlenderDecodeDelegate="$BlenderDecodeDelegateDefault"
3252 BZIPDelegate="$BZIPDelegateDefault"
3253 BrowseDelegate="$BrowseDelegateDefault"
3254 CGMDecodeDelegate="$CGMDecodeDelegateDefault"
3255 CatDelegate="$CatDelegateDefault"
3256 ConvertDelegate="$ConvertDelegateDefault"
3257 GVCDecodeDelegate="$GVCDecodeDelegateDefault"
3258 DVIDecodeDelegate="$DVIDecodeDelegateDefault"
3259 EchoDelegate="$EchoDelegateDefault"
3260 EditorDelegate="$EditorDelegateDefault"
3261 FIGDecodeDelegate="$FIGDecodeDelegateDefault"
3262 GnuplotDecodeDelegate="$GnuplotDecodeDelegateDefault"
3263 HPGLDecodeDelegate="$HPGLDecodeDelegateDefault"
3264 HTMLDecodeDelegate="$HTMLDecodeDelegateDefault"
3265 ILBMDecodeDelegate="$ILBMDecodeDelegateDefault"
3266 ILBMEncodeDelegate="$ILBMEncodeDelegateDefault"
3267 LPDelegate="$LPDelegateDefault"
3268 LZWDecodeDelegate="$LZWDecodeDelegateDefault"
3269 LZWEncodeDelegate="$LZWEncodeDelegateDefault"
3270 LaunchDelegate="$LaunchDelegateDefault"
3271 MANDelegate="$MANDelegateDefault"
3272 MPEGDecodeDelegate="$MPEGDecodeDelegateDefault"
3273 MPEGEncodeDelegate="$MPEGEncodeDelegateDefault"
cristy3ed852e2009-09-05 21:47:34 +00003274 MogrifyDelegate="$MogrifyDelegateDefault"
cristy935c86e2010-06-05 23:50:07 +00003275 MrSIDDecodeDelegate="$MrSIDDecodeDelegateDefault"
3276 MVDelegate="$MVDelegateDefault"
cristy3ed852e2009-09-05 21:47:34 +00003277 PCLDelegate="$PCLDelegateDefault"
3278 PGPDecodeDelegate="$PGPDecodeDelegateDefault"
3279 POVDelegate="$POVDelegateDefault"
3280 PSDelegate="$PSDelegateDefault"
cristy3ed852e2009-09-05 21:47:34 +00003281 RLEEncodeDelegate="$RLEEncodeDelegateDefault"
3282 RMDelegate="$RMDelegateDefault"
cristy4689cf02010-02-17 21:15:45 +00003283 RSVGDecodeDelegate="$RSVGDecodeDelegateDefault"
cristy3ed852e2009-09-05 21:47:34 +00003284 SCANDecodeDelegate="$SCANDecodeDelegateDefault"
3285 ShowImageDelegate="$ShowImageDelegateDefault"
3286 TXTDelegate="$TXTDelegateDefault"
cristy5ac9ac82010-07-29 13:24:24 +00003287 UniconvertorDelegate="$UniconvertorDelegateDefault"
cristy3ed852e2009-09-05 21:47:34 +00003288 WMFDecodeDelegate="$WMFDecodeDelegateDefault"
3289 WWWDecodeDelegate="$WWWDecodeDelegateDefault"
3290 XPSDelegate="$XPSDelegateDefault"
3291 ZipDelegate="$ZipDelegateDefault"
3292fi
3293
3294# Delegate substitutions
3295AC_SUBST(AutotraceDecodeDelegate)
cristy3ed852e2009-09-05 21:47:34 +00003296AC_SUBST(BlenderDecodeDelegate)
3297AC_SUBST(BZIPDelegate)
3298AC_SUBST(BrowseDelegate)
3299AC_SUBST(CGMDecodeDelegate)
3300AC_SUBST(CatDelegate)
3301AC_SUBST(ConvertDelegate)
3302AC_SUBST(GVCDecodeDelegate)
3303AC_SUBST(DVIDecodeDelegate)
3304AC_SUBST(EchoDelegate)
3305AC_SUBST(EditorDelegate)
3306AC_SUBST(FIGDecodeDelegate)
3307AC_SUBST(GnuplotDecodeDelegate)
cristy3ed852e2009-09-05 21:47:34 +00003308AC_SUBST(HPGLDecodeDelegate)
3309AC_SUBST(HTMLDecodeDelegate)
3310AC_SUBST(ILBMDecodeDelegate)
3311AC_SUBST(ILBMEncodeDelegate)
3312AC_SUBST(LPDelegate)
3313AC_SUBST(LZWDecodeDelegate)
3314AC_SUBST(LZWEncodeDelegate)
3315AC_SUBST(LaunchDelegate)
3316AC_SUBST(MANDelegate)
3317AC_SUBST(MPEGDecodeDelegate)
3318AC_SUBST(MPEGEncodeDelegate)
cristy3ed852e2009-09-05 21:47:34 +00003319AC_SUBST(MogrifyDelegate)
cristy935c86e2010-06-05 23:50:07 +00003320AC_SUBST(MrSIDDecodeDelegate)
3321AC_SUBST(MVDelegate)
cristy3ed852e2009-09-05 21:47:34 +00003322AC_SUBST(PCLDelegate)
3323AC_SUBST(PGPDecodeDelegate)
3324AC_SUBST(POVDelegate)
3325AC_SUBST(PSDelegate)
3326AC_SUBST(RLEEncodeDelegate)
3327AC_SUBST(RMDelegate)
3328AC_SUBST(SCANDecodeDelegate)
3329AC_SUBST(ShowImageDelegate)
3330AC_SUBST(TXTDelegate)
cristy5ac9ac82010-07-29 13:24:24 +00003331AC_SUBST(UniconvertorDelegate)
cristy3ed852e2009-09-05 21:47:34 +00003332AC_SUBST(WMFDecodeDelegate)
3333AC_SUBST(WWWDecodeDelegate)
3334AC_SUBST(XPSDelegate)
3335AC_SUBST(ZipDelegate)
3336
3337#
3338# RPM support.
3339#
3340RPM=''
3341AC_CHECK_PROGS(TAR,gnutar gtar tar)
3342AC_CHECK_PROGS(PERL,perl)
3343AC_CHECK_PROGS(RPM,rpmbuild rpm)
3344AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
3345AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
3346AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
3347AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
3348AC_SUBST(RPM)
3349AM_CONDITIONAL(RPM_DELEGATE, test "x$RPM" != "x" )
3350
3351#
3352# 7ZIP support (http://p7zip.sourceforge.net/)
3353#
3354P7ZIP=''
3355AC_CHECK_PROGS(P7ZIP,[7za])
3356AC_SUBST(P7ZIP)
3357AM_CONDITIONAL(P7ZIP_DELEGATE, test "x$P7ZIP" != "x" )
3358
3359#
3360# ZIP support (http://www.info-zip.org/Zip.html)
3361#
3362ZIP=''
3363AC_CHECK_PROGS(ZIP,[zip])
3364AC_SUBST(ZIP)
3365AM_CONDITIONAL(ZIP_DELEGATE, test "x$ZIP" != "x" )
3366
3367#
3368# GhostPCL related configuration.
3369#
3370PCLColorDevice=ppmraw
cristy8bc84082011-09-07 13:57:00 +00003371PCLCMYKDevice=pamcmyk32
cristy3ed852e2009-09-05 21:47:34 +00003372PCLMonoDevice=pbmraw
3373if test -z "$PCLVersion"; then
3374 PCLVersion='unknown'
3375fi
3376if test $have_pcl = 'yes'; then
cristya448bd22011-10-14 12:38:13 +00003377 AC_MSG_NOTICE([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00003378 AC_MSG_CHECKING([for PCL])
cristya448bd22011-10-14 12:38:13 +00003379 AC_MSG_NOTICE([])
cristy3ed852e2009-09-05 21:47:34 +00003380 # PCLColorDevice
3381 AC_MSG_CHECKING([for pcl color device])
3382 if $PCLDelegate -dBATCH -sDEVICE=$PCLColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3383 :
3384 else
3385 PCLColorDevice=ppmraw
3386 fi
cristya448bd22011-10-14 12:38:13 +00003387 AC_MSG_NOTICE([$PCLColorDevice])
cristy3ed852e2009-09-05 21:47:34 +00003388
3389 # PCLCMYKDevice
3390 AC_MSG_CHECKING([for pcl CMYK device])
3391 if $PCLDelegate -dBATCH -sDEVICE=$PCLColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3392 :
3393 else
3394 PCLCMYKDevice=$PCLColorDevice
3395 fi
cristya448bd22011-10-14 12:38:13 +00003396 AC_MSG_NOTICE([$PCLCMYKDevice])
cristy3ed852e2009-09-05 21:47:34 +00003397
3398 # PCLMonoDevice
3399 AC_MSG_CHECKING([for pcl mono device])
3400 if $PCLDelegate -dBATCH -sDEVICE=$PCLMonoDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3401 :
3402 else
3403 PCLMonoDevice=$PCLColorDevice
3404 fi
cristya448bd22011-10-14 12:38:13 +00003405 AC_MSG_NOTICE([$PCLMonoDevice])
cristy3ed852e2009-09-05 21:47:34 +00003406fi
3407
3408AC_SUBST(PCLMonoDevice)
3409AC_SUBST(PCLColorDevice)
3410AC_SUBST(PCLCMYKDevice)
3411AC_SUBST(PCLVersion)
3412
3413#
3414# GhostXPS related configuration.
3415#
3416XPSColorDevice=ppmraw
3417XPSCMYKDevice=bmpsep8
3418XPSMonoDevice=pbmraw
3419if test -z "$XPSVersion"; then
3420 XPSVersion='unknown'
3421fi
3422if test $have_xps = 'yes'; then
cristya448bd22011-10-14 12:38:13 +00003423 AC_MSG_NOTICE([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00003424 AC_MSG_CHECKING([for XPS])
cristya448bd22011-10-14 12:38:13 +00003425 AC_MSG_NOTICE([])
cristy3ed852e2009-09-05 21:47:34 +00003426 # XPSColorDevice
3427 AC_MSG_CHECKING([for xps color device])
3428 if $XPSDelegate -dBATCH -sDEVICE=$XPSColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3429 :
3430 else
3431 XPSColorDevice=ppmraw
3432 fi
cristya448bd22011-10-14 12:38:13 +00003433 AC_MSG_NOTICE([$XPSColorDevice])
cristy3ed852e2009-09-05 21:47:34 +00003434
3435 # XPSCMYKDevice
3436 AC_MSG_CHECKING([for xps CMYK device])
3437 if $XPSDelegate -dBATCH -sDEVICE=$XPSColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3438 :
3439 else
3440 XPSCMYKDevice=$XPSColorDevice
3441 fi
cristya448bd22011-10-14 12:38:13 +00003442 AC_MSG_NOTICE([$XPSCMYKDevice])
cristy3ed852e2009-09-05 21:47:34 +00003443
3444 # XPSMonoDevice
3445 AC_MSG_CHECKING([for xps mono device])
3446 if $XPSDelegate -dBATCH -sDEVICE=$XPSMonoDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3447 :
3448 else
3449 XPSMonoDevice=$XPSColorDevice
3450 fi
cristya448bd22011-10-14 12:38:13 +00003451 AC_MSG_NOTICE([$XPSMonoDevice])
cristy3ed852e2009-09-05 21:47:34 +00003452fi
3453
3454AC_SUBST(XPSMonoDevice)
3455AC_SUBST(XPSColorDevice)
3456AC_SUBST(XPSCMYKDevice)
3457AC_SUBST(XPSVersion)
3458
3459#
3460# Ghostscript related configuration.
3461#
cristya97426c2011-02-04 01:41:27 +00003462GSAlphaDevice=pngalpha
cristy3ed852e2009-09-05 21:47:34 +00003463GSColorDevice=pnmraw
3464GSCMYKDevice=pam
3465GSMonoDevice=pbmraw
3466GSPDFDevice=pdfwrite
3467GSPSDevice=pswrite
3468GSEPSDevice=epswrite
3469GSVersion='unknown'
3470if test $have_gs = 'yes'; then
cristya448bd22011-10-14 12:38:13 +00003471 AC_MSG_NOTICE([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00003472 AC_MSG_CHECKING([for Ghostscript])
cristya448bd22011-10-14 12:38:13 +00003473 AC_MSG_NOTICE([])
cristy3ed852e2009-09-05 21:47:34 +00003474 AC_MSG_CHECKING([for Ghostscript version])
3475 if GSVersion=`$PSDelegate --version`; then
3476 :
3477 else
3478 GSVersion=`$PSDelegate --help | sed -e '1q' | awk '{ print $3 }'`
3479 fi
cristya448bd22011-10-14 12:38:13 +00003480 AC_MSG_NOTICE([$GSVersion])
cristy3ed852e2009-09-05 21:47:34 +00003481
3482 # GSAlphaDevice
3483 AC_MSG_CHECKING([for gs alpha device])
3484 if $PSDelegate -q -dBATCH -sDEVICE=$GSAlphaDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3485 :
3486 else
3487 GSAlphaDevice=pnmraw
3488 fi
cristya448bd22011-10-14 12:38:13 +00003489 AC_MSG_NOTICE([$GSAlphaDevice])
cristy3ed852e2009-09-05 21:47:34 +00003490
3491 # GSColorDevice
3492 AC_MSG_CHECKING([for gs color device])
3493 if $PSDelegate -q -dBATCH -sDEVICE=$GSColorDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3494 :
3495 else
3496 GSColorDevice=pnmraw
3497 fi
cristya448bd22011-10-14 12:38:13 +00003498 AC_MSG_NOTICE([$GSColorDevice])
cristy3ed852e2009-09-05 21:47:34 +00003499
3500 # GSCMYKDevice
3501 AC_MSG_CHECKING([for gs CMYK device])
3502 if $PSDelegate -q -dBATCH -sDEVICE=$GSCMYKDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3503 :
3504 else
3505 GSCMYKDevice=bmpsep8
3506 fi
cristya448bd22011-10-14 12:38:13 +00003507 AC_MSG_NOTICE([$GSCMYKDevice])
cristy3ed852e2009-09-05 21:47:34 +00003508
3509 # GSMonoDevice
3510 AC_MSG_CHECKING([for gs mono device])
3511 if $PSDelegate -q -dBATCH -sDEVICE=$GSMonoDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3512 :
3513 else
3514 GSMonoDevice=$GSColorDevice
3515 fi
cristya448bd22011-10-14 12:38:13 +00003516 AC_MSG_NOTICE([$GSMonoDevice])
cristy3ed852e2009-09-05 21:47:34 +00003517
3518 # GSPDFDevice
3519 AC_MSG_CHECKING([for gs PDF writing device])
3520 if $PSDelegate -q -dBATCH -sDEVICE=$GSPDFDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3521 :
3522 else
3523 GSPDFDevice=nodevice
3524 fi
cristya448bd22011-10-14 12:38:13 +00003525 AC_MSG_NOTICE([$GSPDFDevice])
cristy3ed852e2009-09-05 21:47:34 +00003526
3527 # GSPSDevice
3528 AC_MSG_CHECKING([for gs PS writing device])
3529 if $PSDelegate -q -dBATCH -sDEVICE=$GSPSDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3530 :
3531 else
3532 GSPSDevice=nodevice
3533 fi
cristya448bd22011-10-14 12:38:13 +00003534 AC_MSG_NOTICE([$GSPSDevice])
cristy3ed852e2009-09-05 21:47:34 +00003535
3536 # GSEPSDevice
3537 AC_MSG_CHECKING([for gs EPS writing device])
3538 if $PSDelegate -q -dBATCH -sDEVICE=$GSEPSDevice -sOutputFile=/dev/null < /dev/null 2> /dev/null; then
3539 :
3540 else
3541 GSEPSDevice=nodevice
3542 fi
cristya448bd22011-10-14 12:38:13 +00003543 AC_MSG_NOTICE([$GSEPSDevice])
cristy3ed852e2009-09-05 21:47:34 +00003544fi
3545
3546AC_SUBST(GSAlphaDevice)
3547AC_SUBST(GSCMYKDevice)
3548AC_SUBST(GSColorDevice)
3549AC_SUBST(GSEPSDevice)
3550AC_SUBST(GSMonoDevice)
3551AC_SUBST(GSPDFDevice)
3552AC_SUBST(GSPSDevice)
3553AC_SUBST(GSVersion)
3554
3555#
3556# PerlMagick-related configuration
3557#
3558
3559# Look for PERL if PerlMagick requested
3560# If name/path of desired PERL interpreter is specified, look for that one first
3561have_perl='no'
3562if test "$with_perl" != 'no'; then
cristya448bd22011-10-14 12:38:13 +00003563 AC_MSG_NOTICE([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00003564 AC_MSG_CHECKING([for Perl])
cristya448bd22011-10-14 12:38:13 +00003565 AC_MSG_NOTICE([])
cristy3ed852e2009-09-05 21:47:34 +00003566 if test "$with_perl" != 'yes'; then
3567 AC_CACHE_CHECK(for perl,ac_cv_path_PERL,ac_cv_path_PERL="$with_perl");
3568 PERL=$ac_cv_path_PERL
3569 AC_SUBST(PERL)dnl
3570 have_perl="$ac_cv_path_PERL"
3571 else
3572 AC_PATH_PROGS(PERL,perl perl5,)dnl
3573 if test "$ac_cv_path_PERL"; then
3574 have_perl="$ac_cv_path_PERL"
3575 fi
3576 fi
3577fi
3578
cristy949301e2010-01-06 01:38:40 +00003579if test "$with_perl" != 'yes' ; then
3580 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-perl=$with_perl "
3581fi
3582
3583PERL_SUPPORTS_DESTDIR='no'
3584
cristy3ed852e2009-09-05 21:47:34 +00003585with_perl_static='no'
3586with_perl_dynamic='no'
3587if test "$have_perl" != 'no'; then
3588 if test "$with_perl" != 'no' && test "$libtool_build_shared_libs" = 'no'; then
3589 with_perl_static='yes'
3590 fi
3591 if test "$with_perl" != 'no' && test "$libtool_build_shared_libs" = 'yes'; then
3592 with_perl_dynamic='yes'
3593 fi
3594 # Is PERL's MakeMaker new enough to support DESTDIR?
cristy964cb7f2010-04-25 23:18:00 +00003595 AX_PROG_PERL_VERSION(5.8.1,[PERL_SUPPORTS_DESTDIR='yes'],[PERL_SUPPORTS_DESTDIR='no'])
cristy3ed852e2009-09-05 21:47:34 +00003596fi
3597AM_CONDITIONAL(WITH_PERL, test "$have_perl" != 'no')
3598AM_CONDITIONAL(WITH_PERL_STATIC, test $with_perl_static = 'yes')
3599AM_CONDITIONAL(WITH_PERL_DYNAMIC, test $with_perl_dynamic = 'yes')
3600AC_SUBST(PERL_SUPPORTS_DESTDIR)
3601
3602# Determine path to pick up MagickCore library from for use with building PerlMagick
3603MAGICKCORE_PATH="${LIB_DIR}"
3604if test $with_perl_static = 'yes'; then
3605 # Find out where libtool hides its uninstalled libraries (as libtool_objdir)
3606 libtool_objdir=$objdir
3607
3608 # Linker search path to library, followed by -lMagickCore
cristy4c08aed2011-07-01 19:47:50 +00003609 MAGICKCORE_PATH="${builddir}/MagickCore/${libtool_objdir}"
cristy3ed852e2009-09-05 21:47:34 +00003610fi
3611AC_SUBST(MAGICKCORE_PATH)
3612
3613# Create a simple string containing format names for all delegate libraries
3614DELEGATES=''
3615if test "$have_autotrace" = 'yes'; then DELEGATES="$DELEGATES autotrace"; fi
3616if test "$have_bzlib" = 'yes'; then DELEGATES="$DELEGATES bzlib"; fi
3617if test "$have_djvu" = 'yes'; then DELEGATES="$DELEGATES djvu"; fi
3618if test "$have_dps" = 'yes'; then DELEGATES="$DELEGATES dps"; fi
3619if test "$have_fftw" = 'yes'; then DELEGATES="$DELEGATES fftw"; fi
3620if test "$have_fpx" = 'yes'; then DELEGATES="$DELEGATES fpx"; fi
3621if test "$have_fontconfig" = 'yes'; then DELEGATES="$DELEGATES fontconfig"; fi
3622if test "$have_freetype" = 'yes'; then DELEGATES="$DELEGATES freetype"; fi
3623if test "$have_gslib" = 'yes'; then DELEGATES="$DELEGATES gs"; fi
3624if test "$have_gvc" = 'yes'; then DELEGATES="$DELEGATES gvc"; fi
3625if test "$have_jbig" = 'yes'; then DELEGATES="$DELEGATES jbig"; fi
3626if test "$have_jpeg" = 'yes'; then
3627 DELEGATES="$DELEGATES jpeg";
3628 if test "$have_png" = 'yes'; then DELEGATES="$DELEGATES jng"; fi
3629fi
3630if test "$have_jp2" = 'yes'; then DELEGATES="$DELEGATES jp2"; fi
cristy71203402010-06-18 13:12:03 +00003631if test "$have_lcms2" = 'yes'; then DELEGATES="$DELEGATES lcms2"; fi
cristy3ed852e2009-09-05 21:47:34 +00003632if test "$have_lcms" = 'yes'; then DELEGATES="$DELEGATES lcms"; fi
3633if test "$have_lqr" = 'yes'; then DELEGATES="$DELEGATES lqr"; fi
cristyfbb0ef02010-12-19 02:32:11 +00003634if test "$have_lzma" = 'yes'; then DELEGATES="$DELEGATES lzma"; fi
cristy3ed852e2009-09-05 21:47:34 +00003635if test "$have_ffmpeg" = 'yes'; then DELEGATES="$DELEGATES mpeg"; fi
3636if test "$have_openexr" = 'yes'; then DELEGATES="$DELEGATES openexr"; fi
3637if test "$have_png" = 'yes'; then DELEGATES="$DELEGATES png"; fi
3638if test "$have_rsvg" = 'yes'; then DELEGATES="$DELEGATES rsvg"; fi
3639if test "$have_tiff" = 'yes'; then DELEGATES="$DELEGATES tiff"; fi
3640if test "$have_x" = 'yes'; then DELEGATES="$DELEGATES x11"; fi
3641if test "$have_xml" = 'yes'; then DELEGATES="$DELEGATES xml"; fi
3642if test "$have_wmf" = 'yes'; then DELEGATES="$DELEGATES wmf"; fi
3643if test "$have_zlib" = 'yes'; then DELEGATES="$DELEGATES zlib"; fi
3644
3645AC_SUBST(DELEGATES)
3646
3647#
3648# Handle special compiler flags
3649#
3650
3651# Add '-p' if prof source profiling support enabled
3652if test "$enable_prof" = 'yes'; then
3653 CFLAGS="-p $CFLAGS"
3654 CXXFLAGS="-p $CXXFLAGS"
3655 LDFLAGS="-p $LDFLAGS"
3656fi
3657
3658# Add '-pg' if gprof source profiling support enabled
3659if test "$enable_gprof" = 'yes'; then
3660 CFLAGS="-pg $CFLAGS"
3661 CXXFLAGS="-pg $CXXFLAGS"
3662 LDFLAGS="-pg $LDFLAGS"
3663fi
3664
3665# Add '-ftest-coverage -fprofile-arcs' if gcov source profiling support enabled
3666# This is a gcc-specific feature
3667if test "$enable_gcov" = 'yes'; then
3668 AC_CHECK_LIB(gcov,_gcov_init)
3669 AC_CHECK_LIB(gcov,__gcov_init)
3670 case "$target_os" in
3671 darwin*)
3672 OSX_GCOV_LDFLAG="-Wl,-single_module"
3673 ;;
3674 *)
3675 OSX_GCOV_LDFLAG=""
3676 ;;
3677 esac
3678 AC_SUBST(OSX_GCOV_LDFLAG)
3679 CFLAGS="-ftest-coverage -fprofile-arcs $CFLAGS"
3680 CXXFLAGS="-ftest-coverage -fprofile-arcs $CXXFLAGS"
3681 LDFLAGS="-ftest-coverage -fprofile-arcs $LDFLAGS"
3682fi
3683
3684#
3685# Build library dependency list for libMagickCore
3686#
3687
3688MAGICK_LIBLTDL='' # Libltdl for build
3689MAGICK_API_LIBLTDL='' # libltdl for dependent application (API) build
3690MAGICK_LTDLDEPS='' # extra libltdl dependencies
3691if test "$with_ltdl" != 'no'
3692then
3693 if test \( "$with_included_ltdl" = 'no' -o "$enable_ltdl_convenience" = 'no' \) -o "$enable_ltdl_install" = 'yes'; then
3694 MAGICK_API_LIBLTDL='-lltdl'
3695 fi
3696 MAGICK_LIBLTDL=${LIBLTDL}
3697 MAGICK_LTDLDEPS=${LTDLDEPS}
3698fi
3699AC_SUBST(MAGICK_LIBLTDL)
3700AC_SUBST(MAGICK_LTDLDEPS)
3701
3702if test "$with_modules" != 'no'; then
cristyfbb0ef02010-12-19 02:32:11 +00003703 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 +00003704else
cristy41cbe8a2011-10-27 01:35:18 +00003705 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 $PANGO_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 +00003706fi
3707AC_SUBST(MAGICK_DEP_LIBS)
3708
3709#
3710# Remove extraneous spaces from output variables (asthetic)
3711#
3712X_CFLAGS=`echo $X_CFLAGS | sed -e 's/ */ /g'`
3713X_PRE_LIBS=`echo $X_PRE_LIBS | sed -e 's/ */ /g'`
3714X_LIBS=`echo $X_LIBS | sed -e 's/ */ /g'`
3715X_EXTRA_LIBS=`echo $X_EXTRA_LIBS | sed -e 's/ */ /g'`
3716
3717CC=`echo $CC | sed -e 's/ */ /g'`
3718CFLAGS=`echo $CFLAGS | sed -e 's/ */ /g'`
3719CPPFLAGS=`echo $CPPFLAGS | sed -e 's/ */ /g'`
3720CXXFLAGS=`echo $CXXFLAGS | sed -e 's/ */ /g'`
3721DELEGATES=`echo $DELEGATES | sed -e 's/^ //g'`
3722DISTCHECK_CONFIG_FLAGS=`echo $DISTCHECK_CONFIG_FLAGS | sed -e 's/ */ /g'`
3723LDFLAGS=`echo $LDFLAGS | sed -e 's/ */ /g'`
3724TESTED_LIBS=`echo $LIBS | sed -e 's/ */ /g'`
3725MAGICK_DEP_LIBS=`echo $MAGICK_DEP_LIBS | sed -e 's/ */ /g'`
3726#LIBS=`echo $LIBS | sed -e 's/ */ /g'`
3727
3728# Pass only user-provided LIBS as "global" libraries
3729LIBS=$USER_LIBS
3730
3731#AC_SUBST(CPPFLAGS)
3732AC_SUBST(X_CFLAGS)
3733#AC_SUBST(LDFLAGS)
3734#AC_SUBST(X_PRE_LIBS)
3735#AC_SUBST(X_LIBS)
3736#AC_SUBST(X_EXTRA_LIBS)
3737
3738MAGICK_CFLAGS=$CFLAGS
3739MAGICK_CXXFLAGS="$CXXFLAGS"
3740MAGICK_CPPFLAGS=`echo $MAGICK_CPPFLAGS | sed -e 's/ */ /g'`
3741MAGICK_PCFLAGS=`echo $MAGICK_PCFLAGS | sed -e 's/ */ /g'`
3742MAGICK_LDFLAGS="-L$LIB_DIR $LDFLAGS"
3743MAGICK_LIBS="-lMagickCore $MAGICK_DEP_LIBS $MAGICK_API_LIBLTDL"
3744
3745AC_SUBST(MAGICK_CFLAGS)
3746AC_SUBST(MAGICK_CXXFLAGS)
3747AC_SUBST(MAGICK_CPPFLAGS)
3748AC_SUBST(MAGICK_PCFLAGS)
3749AC_SUBST(MAGICK_LDFLAGS)
3750AC_SUBST(MAGICK_LIBS)
cristyfd9dcd42010-08-08 18:07:02 +00003751AC_SUBST(MAGICK_FEATURES)
cristy3ed852e2009-09-05 21:47:34 +00003752
3753# Set configured scripts to executable.
3754AC_CONFIG_COMMANDS([default],[],[])
cristy4c08aed2011-07-01 19:47:50 +00003755AC_CONFIG_COMMANDS([MagickCore-config.in],[chmod +x MagickCore/MagickCore-config])
cristy4c08aed2011-07-01 19:47:50 +00003756AC_CONFIG_COMMANDS([MagickWand-config.in],[chmod +x MagickWand/MagickWand-config])
cristy3ed852e2009-09-05 21:47:34 +00003757AC_CONFIG_COMMANDS([Magick++-config.in],[chmod +x Magick++/bin/Magick++-config])
3758AC_CONFIG_COMMANDS([PerlMagick/check.sh.in],[chmod +x PerlMagick/check.sh])
3759
cristya448bd22011-10-14 12:38:13 +00003760AC_MSG_NOTICE([-------------------------------------------------------------])
3761AC_MSG_NOTICE([Update ImageMagick configuration])
cristy3ed852e2009-09-05 21:47:34 +00003762AC_OUTPUT
3763
3764rm -f magick-version
3765
cristy430a7312010-01-21 20:44:04 +00003766result_dejavu_font_dir='none'
3767if test "${dejavu_font_dir}x" != 'x'; then
3768 result_dejavu_font_dir=$dejavu_font_dir
3769fi
3770
cristy3ed852e2009-09-05 21:47:34 +00003771result_ghostscript_font_dir='none'
3772if test "${ghostscript_font_dir}x" != 'x'; then
3773 result_ghostscript_font_dir=$ghostscript_font_dir
3774fi
3775
3776result_windows_font_dir='none'
3777if test "${windows_font_dir}x" != 'x'; then
3778 result_windows_font_dir=${windows_font_dir}
3779fi
3780
cristya448bd22011-10-14 12:38:13 +00003781AC_MSG_NOTICE([
cristy3ed852e2009-09-05 21:47:34 +00003782ImageMagick is configured as follows. Please verify that this configuration
3783matches your expectations.
3784
3785Host system type: $host
3786Build system type: $build
3787
3788 Option Value
3789-------------------------------------------------------------------------------
3790Shared libraries --enable-shared=$enable_shared $libtool_build_shared_libs
3791Static libraries --enable-static=$enable_static $libtool_build_static_libs
3792Module support --with-modules=$with_modules $with_modules
3793GNU ld --with-gnu-ld=$with_gnu_ld $lt_cv_prog_gnu_ld
3794Quantum depth --with-quantum-depth=$with_quantum_depth $with_quantum_depth
3795High Dynamic Range Imagery
3796 --enable-hdri=$enable_hdri $enable_hdri
3797
3798Delegate Configuration:
3799BZLIB --with-bzlib=$with_bzlib $have_bzlib
3800Autotrace --with-autotrace=$with_autotrace $have_autotrace
cristy430a7312010-01-21 20:44:04 +00003801Dejavu fonts --with-dejavu-font-dir=$with_dejavu_font_dir $result_dejavu_font_dir
cristy3ed852e2009-09-05 21:47:34 +00003802DJVU --with-djvu=$with_djvu $have_djvu
3803DPS --with-dps=$with_dps $have_dps
3804FFTW --with-fftw=$with_fftw $have_fftw
3805FlashPIX --with-fpx=$with_fpx $have_fpx
3806FontConfig --with-fontconfig=$with_fontconfig $have_fontconfig
3807FreeType --with-freetype=$with_freetype $have_freetype
3808GhostPCL None $PCLDelegate ($PCLVersion)
3809GhostXPS None $XPSDelegate ($XPSVersion)
3810Ghostscript None $PSDelegate ($GSVersion)
3811Ghostscript fonts --with-gs-font-dir=$with_gs_font_dir $result_ghostscript_font_dir
3812Ghostscript lib --with-gslib=$with_gslib $have_gslib
3813Graphviz --with-gvc=$with_gvc $have_gvc
3814JBIG --with-jbig=$with_jbig $have_jbig
3815JPEG v1 --with-jpeg=$with_jpeg $have_jpeg
3816JPEG-2000 --with-jp2=$with_jp2 $have_jp2
cristy71203402010-06-18 13:12:03 +00003817LCMS v1 --with-lcms=$with_lcms $have_lcms
3818LCMS v2 --with-lcms2=$with_lcms2 $have_lcms2
cristy3ed852e2009-09-05 21:47:34 +00003819LQR --with-lqr=$with_lqr $have_lqr
cristyfbb0ef02010-12-19 02:32:11 +00003820LZMA --with-lzma=$with_lzma $have_lzma
cristy3ed852e2009-09-05 21:47:34 +00003821Magick++ --with-magick-plus-plus=$with_magick_plus_plus $have_magick_plus_plus
3822OpenEXR --with-openexr=$with_openexr $have_openexr
cristy41cbe8a2011-10-27 01:35:18 +00003823PANGO --with-pango=$with_pango $have_pango
cristy3ed852e2009-09-05 21:47:34 +00003824PERL --with-perl=$with_perl $have_perl
3825PNG --with-png=$with_png $have_png
3826RSVG --with-rsvg=$with_rsvg $have_rsvg
3827TIFF --with-tiff=$with_tiff $have_tiff
cristyb1860752011-03-14 00:27:46 +00003828WEBP --with-webp=$with_webp $have_webp
cristy3ed852e2009-09-05 21:47:34 +00003829Windows fonts --with-windows-font-dir=$with_windows_font_dir $result_windows_font_dir
3830WMF --with-wmf=$with_wmf $have_wmf
3831X11 --with-x=$with_x $have_x
3832XML --with-xml=$with_xml $have_xml
3833ZLIB --with-zlib=$with_zlib $have_zlib
3834
3835X11 Configuration:
3836 X_CFLAGS = $X_CFLAGS
3837 X_PRE_LIBS = $X_PRE_LIBS
3838 X_LIBS = $X_LIBS
3839 X_EXTRA_LIBS = $X_EXTRA_LIBS
3840
3841Options used to compile and link:
3842 PREFIX = $PREFIX_DIR
3843 EXEC-PREFIX = $EXEC_PREFIX_DIR
3844 VERSION = $PACKAGE_VERSION
3845 CC = $CC
3846 CFLAGS = $CFLAGS
cristy3ed852e2009-09-05 21:47:34 +00003847 CPPFLAGS = $MAGICK_CPPFLAGS
3848 PCFLAGS = $MAGICK_PCFLAGS
3849 DEFS = $DEFS
3850 LDFLAGS = $LDFLAGS
3851 MAGICK_LDFLAGS = $MAGICK_LDFLAGS
3852 LIBS = $MAGICK_LIBS
3853 CXX = $CXX
3854 CXXFLAGS = $CXXFLAGS
cristyfd9dcd42010-08-08 18:07:02 +00003855 FEATURES = $MAGICK_FEATURES
cristy3ed852e2009-09-05 21:47:34 +00003856])