blob: ab88c518baf91858c24185d37eaaa528ccc873ea [file] [log] [blame]
Cristyd8420112021-01-01 14:52:00 -05001# Copyright 1999-2021 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#
Cristy1eccad32018-09-09 19:34:39 -04007# https://imagemagick.org/script/license.php
cristy3ed852e2009-09-05 21:47:34 +00008#
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
cristy568c2d42012-07-27 01:41:20 +000016#
17# Copying and distribution of this file, with or without modification,
18# are permitted in any medium without royalty provided the copyright
19# notice and this notice are preserved.
cristyc8051dc2012-08-20 23:50:31 +000020AC_PREREQ(2.69)
cristyfddf7752011-02-26 19:25:10 +000021
cristy9af1cbf2014-12-28 22:03:09 +000022# ==============================================================================
Elliott Hughes5d41fba2021-04-12 16:36:42 -070023# Initialize Automake
cristy9af1cbf2014-12-28 22:03:09 +000024# ==============================================================================
Elliott Hughes5d41fba2021-04-12 16:36:42 -070025m4_include([m4/version.m4])
26m4_define([magick_base_version],
27 [magick_major_version.magick_minor_version.magick_micro_version])
cristyfddf7752011-02-26 19:25:10 +000028m4_define([magick_version],
Elliott Hughes5d41fba2021-04-12 16:36:42 -070029 [magick_base_version-magick_patchlevel_version])
30m4_define([magick_lib_version_number],
31 [magick_major_version,magick_minor_version,magick_micro_version,magick_patchlevel_version])
Cristyed7fd172019-12-07 10:52:28 -050032m4_define([magick_git_revision],
Elliott Hughes5d41fba2021-04-12 16:36:42 -070033 m4_esyscmd([
Cristyed7fd172019-12-07 10:52:28 -050034 c=$(git log --full-history --format=tformat:. HEAD | wc -l)
35 h=$(git rev-parse --short HEAD)
36 d=$(date +%Y%m%d)
37 printf %s "$c:$h:$d"
38 ]))
Elliott Hughes5d41fba2021-04-12 16:36:42 -070039m4_define([magick_release_date],
40 m4_esyscmd([
41 d=$(date +%F -r ./ChangeLog)
42 printf %s "$d"
43 ]))
cristyfddf7752011-02-26 19:25:10 +000044
Elliott Hughes5d41fba2021-04-12 16:36:42 -070045AC_INIT([magick_name],
Cristy6720ed72016-02-09 09:27:35 -050046 [magick_version],
Elliott Hughes5d41fba2021-04-12 16:36:42 -070047 [magick_bugreport],
48 [magick_tarname],
49 [magick_url])
50
cristy4c08aed2011-07-01 19:47:50 +000051AC_CONFIG_SRCDIR([MagickCore/MagickCore.h])
cristy3ed852e2009-09-05 21:47:34 +000052AC_CONFIG_AUX_DIR([config])
cristybc556452012-08-17 19:44:03 +000053AC_REQUIRE_AUX_FILE([tap-driver.sh])
cristy3ed852e2009-09-05 21:47:34 +000054AC_CONFIG_MACRO_DIR([m4])
cristy3ed852e2009-09-05 21:47:34 +000055AC_CONFIG_HEADERS([config/config.h])
cristy01ff9f32012-12-01 18:15:29 +000056AX_PREFIX_CONFIG_H([MagickCore/magick-baseconfig.h],[MagickCore])
cristy9af1cbf2014-12-28 22:03:09 +000057AC_CANONICAL_SYSTEM
58AC_CANONICAL_TARGET
Elliott Hughes5d41fba2021-04-12 16:36:42 -070059
60AM_INIT_AUTOMAKE([foreign no-define color-tests parallel-tests -Wall -Wno-portability subdir-objects dist-bzip2 dist-lzip dist-xz dist-zip tar-ustar])
61
Cristy6720ed72016-02-09 09:27:35 -050062AM_SILENT_RULES([yes])
Elliott Hughes5d41fba2021-04-12 16:36:42 -070063AC_SUBST([CONFIGURE_DEPENDENCIES],["$CONFIGURE_DEPENDENCIES \$(top_srcdir)/ChangeLog \$(top_srcdir)/m4/version.m4"])
cristy3ed852e2009-09-05 21:47:34 +000064
65#
66# Save initial user-tunable values
67#
68USER_LIBS=$LIBS
Cristyed7fd172019-12-07 10:52:28 -050069for var in CC CFLAGS CPPFLAGS CXX CXXCPP LDFLAGS AR_FLAGS LIBS ; do
cristy3ed852e2009-09-05 21:47:34 +000070 eval isset=\${$var+set}
71 if test "$isset" = 'set'; then
72 eval val=$`echo $var`
73 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS}'${var}=${val}' "
74 fi
75done
Cristyc1bfec22020-10-04 15:40:32 +000076AC_SUBST([DISTCHECK_CONFIG_FLAGS])
cristy3ed852e2009-09-05 21:47:34 +000077
78CONFIGURE_ARGS="$0 ${ac_configure_args}"
Cristyc1bfec22020-10-04 15:40:32 +000079AC_SUBST([CONFIGURE_ARGS])
cristy3ed852e2009-09-05 21:47:34 +000080
Elliott Hughes5d41fba2021-04-12 16:36:42 -070081echo "Configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}"
cristy3ed852e2009-09-05 21:47:34 +000082
cristy19615b82011-04-13 20:02:01 +000083MAGICK_TARGET_CPU=$host_cpu
Cristyc1bfec22020-10-04 15:40:32 +000084AC_SUBST([MAGICK_TARGET_CPU])
85AC_DEFINE_UNQUOTED([MAGICK_TARGET_CPU],[$MAGICK_TARGET_CPU],[Target Host CPU])
cristy3225a072010-04-17 01:47:28 +000086
cristy19615b82011-04-13 20:02:01 +000087MAGICK_TARGET_VENDOR=$host_vendor
Cristyc1bfec22020-10-04 15:40:32 +000088AC_SUBST([MAGICK_TARGET_VENDOR])
89AC_DEFINE_UNQUOTED([MAGICK_TARGET_VENDOR],[$MAGICK_TARGET_VENDOR],[Target Host Vendor])
cristy3225a072010-04-17 01:47:28 +000090
cristy19615b82011-04-13 20:02:01 +000091MAGICK_TARGET_OS=$host_os
Cristyc1bfec22020-10-04 15:40:32 +000092AC_SUBST([MAGICK_TARGET_OS])
93AC_DEFINE_UNQUOTED([MAGICK_TARGET_OS],[$MAGICK_TARGET_OS],[Target Host OS])
cristy3225a072010-04-17 01:47:28 +000094
cristy37442762013-02-10 21:07:23 +000095
96# Substitute versioning
97AC_SUBST([MAGICK_MAJOR_VERSION],[magick_major_version])
98AC_SUBST([MAGICK_MINOR_VERSION],[magick_minor_version])
99AC_SUBST([MAGICK_MICRO_VERSION],[magick_micro_version])
100AC_SUBST([MAGICK_PATCHLEVEL_VERSION],[magick_patchlevel_version])
101AC_SUBST([MAGICK_VERSION],[magick_version])
Cristyfbb8d802015-09-02 11:41:34 -0400102AC_SUBST([MAGICK_GIT_REVISION],[magick_git_revision])
cristy37442762013-02-10 21:07:23 +0000103
cristy3ed852e2009-09-05 21:47:34 +0000104# Substitute library versioning
Elliott Hughes5d41fba2021-04-12 16:36:42 -0700105AC_SUBST([MAGICK_LIBRARY_CURRENT],[magick_library_current])dnl
106AC_SUBST([MAGICK_LIBRARY_REVISION],[magick_library_revision])dnl
107AC_SUBST([MAGICK_LIBRARY_AGE],[magick_library_age])dnl
cristybab87c32010-02-09 20:54:22 +0000108AC_SUBST([MAGICK_LIBRARY_CURRENT_MIN],
109 [`expr $MAGICK_LIBRARY_CURRENT - $MAGICK_LIBRARY_AGE`])
110AC_SUBST([MAGICK_LIBRARY_VERSION_INFO],
111 [$MAGICK_LIBRARY_CURRENT:$MAGICK_LIBRARY_REVISION:$MAGICK_LIBRARY_AGE])
cristy37442762013-02-10 21:07:23 +0000112
Elliott Hughes5d41fba2021-04-12 16:36:42 -0700113AC_SUBST([MAGICKPP_LIBRARY_CURRENT],[magickpp_library_current])dnl
114AC_SUBST([MAGICKPP_LIBRARY_REVISION],[magickpp_library_revision])dnl
115AC_SUBST([MAGICKPP_LIBRARY_AGE],[magickpp_library_age])dnl
cristy5ed9c6e2013-07-14 21:20:31 +0000116AC_SUBST([MAGICKPP_LIBRARY_CURRENT_MIN],
117 [`expr $MAGICKPP_LIBRARY_CURRENT - $MAGICKPP_LIBRARY_AGE`])
118AC_SUBST([MAGICKPP_LIBRARY_VERSION_INFO],
119 [$MAGICKPP_LIBRARY_CURRENT:$MAGICKPP_LIBRARY_REVISION:$MAGICKPP_LIBRARY_AGE])
120
Elliott Hughes5d41fba2021-04-12 16:36:42 -0700121AC_SUBST([PACKAGE_BASE_VERSION],[magick_base_version])
122AC_SUBST([PACKAGE_PATCHLEVEL_VERSION],[magick_patchlevel_version])
123AC_SUBST([PACKAGE_VERSION_ADDENDUM],[-magick_patchlevel_version])
124AC_SUBST([PACKAGE_LIB_VERSION],[magick_lib_version])
125AC_SUBST([PACKAGE_LIB_VERSION_NUMBER],[magick_lib_version_number])
126AC_SUBST([PACKAGE_RELEASE_DATE],[magick_release_date])
cristy3ed852e2009-09-05 21:47:34 +0000127
128# Ensure that make can run correctly
129AM_SANITY_CHECK
130
cristyf279b692014-08-13 12:01:27 +0000131# versioning of library
cristy3ed852e2009-09-05 21:47:34 +0000132MAGICK_LIB_VERSION="0x"
133if test ${MAGICK_LIBRARY_CURRENT} -lt 10 ; then
134 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
135fi
136MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_CURRENT}
137if test ${MAGICK_LIBRARY_AGE} -lt 10 ; then
138 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
139fi
140MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_AGE}
141if test ${MAGICK_LIBRARY_REVISION} -lt 10 ; then
142 MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
143fi
144MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_REVISION}
Cristyc1bfec22020-10-04 15:40:32 +0000145AC_SUBST([MAGICK_LIB_VERSION])
cristy3ed852e2009-09-05 21:47:34 +0000146
147# Definition used to define MagickLibVersionText in version.h
Elliott Hughes5d41fba2021-04-12 16:36:42 -0700148MAGICK_LIB_VERSION_TEXT="${PACKAGE_BASE_VERSION}"
Cristyc1bfec22020-10-04 15:40:32 +0000149AC_SUBST([MAGICK_LIB_VERSION_TEXT])
cristy3ed852e2009-09-05 21:47:34 +0000150
151# Definition used to define MagickLibVersionNumber in version.h
152MAGICK_LIB_VERSION_NUMBER="${MAGICK_LIBRARY_CURRENT},${MAGICK_LIBRARY_AGE},${MAGICK_LIBRARY_REVISION}"
Cristyc1bfec22020-10-04 15:40:32 +0000153AC_SUBST([MAGICK_LIB_VERSION_NUMBER])
cristy3ed852e2009-09-05 21:47:34 +0000154
cristy5ed9c6e2013-07-14 21:20:31 +0000155MAGICKPP_LIB_VERSION="0x"
156if test ${MAGICKPP_LIBRARY_CURRENT} -lt 10 ; then
157 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}0
158fi
159MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}${MAGICKPP_LIBRARY_CURRENT}
160if test ${MAGICKPP_LIBRARY_AGE} -lt 10 ; then
161 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}0
162fi
163MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}${MAGICKPP_LIBRARY_AGE}
164if test ${MAGICKPP_LIBRARY_REVISION} -lt 10 ; then
165 MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}0
166fi
167MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}${MAGICKPP_LIBRARY_REVISION}
Cristyc1bfec22020-10-04 15:40:32 +0000168AC_SUBST([MAGICKPP_LIB_VERSION])
cristy5ed9c6e2013-07-14 21:20:31 +0000169
170# Definition used to define MagickLibVersionText in version.h
Elliott Hughes5d41fba2021-04-12 16:36:42 -0700171MAGICKPP_LIB_VERSION_TEXT="${PACKAGE_BASE_VERSION}"
Cristyc1bfec22020-10-04 15:40:32 +0000172AC_SUBST([MAGICKPP_LIB_VERSION_TEXT])
cristy5ed9c6e2013-07-14 21:20:31 +0000173
174# Definition used to define MagickLibVersionNumber in version.h
175MAGICK_LIB_VERSION_NUMBER="${MAGICK_LIBRARY_CURRENT},${MAGICK_LIBRARY_AGE},${MAGICK_LIBRARY_REVISION}"
Cristyc1bfec22020-10-04 15:40:32 +0000176AC_SUBST([MAGICK_LIB_VERSION_NUMBER])
cristy5ed9c6e2013-07-14 21:20:31 +0000177
cristy3ed852e2009-09-05 21:47:34 +0000178PERLMAINCC=$CC
179
180MAGICK_CFLAGS=''
181MAGICK_CPPFLAGS=$CPPFLAGS_USER
182MAGICK_PCFLAGS=$CPPFLAGS_USER
183MAGICK_LDFLAGS=''
184MAGICK_LIBS=''
cristyfd9dcd42010-08-08 18:07:02 +0000185MAGICK_FEATURES=''
cristy3ed852e2009-09-05 21:47:34 +0000186
187#
188# Evaluate shell variable equivalents to Makefile directory variables
189#
190if test "x$prefix" = xNONE; then
191 prefix=$ac_default_prefix
192fi
193# Let make expand exec_prefix.
194if test "x$exec_prefix" = xNONE; then
195 exec_prefix='${prefix}'
196fi
197
198#
199eval "eval PREFIX_DIR=${prefix}"
Cristyc1bfec22020-10-04 15:40:32 +0000200AC_SUBST([PREFIX_DIR])
cristy3ed852e2009-09-05 21:47:34 +0000201eval "eval EXEC_PREFIX_DIR=${exec_prefix}"
Cristyc1bfec22020-10-04 15:40:32 +0000202AC_SUBST([EXEC_PREFIX_DIR])
cristy3ed852e2009-09-05 21:47:34 +0000203eval "eval BIN_DIR=$bindir"
Cristyc1bfec22020-10-04 15:40:32 +0000204AC_SUBST([BIN_DIR])
cristy3ed852e2009-09-05 21:47:34 +0000205eval "eval SBIN_DIR=$sbindir"
Cristyc1bfec22020-10-04 15:40:32 +0000206AC_SUBST([SBIN_DIR])
cristy3ed852e2009-09-05 21:47:34 +0000207eval "eval LIBEXEC_DIR=$libexecdir"
Cristyc1bfec22020-10-04 15:40:32 +0000208AC_SUBST([LIBEXEC_DIR])
cristy3ed852e2009-09-05 21:47:34 +0000209eval "eval DATA_DIR=$datadir"
Cristyc1bfec22020-10-04 15:40:32 +0000210AC_SUBST([DATA_DIR])
Cristye35bdc62015-09-19 18:29:00 -0400211eval "eval DOC_DIR=$datadir/doc"
Cristyc1bfec22020-10-04 15:40:32 +0000212AC_SUBST([DOC_DIR])
cristy3ed852e2009-09-05 21:47:34 +0000213eval "eval SYSCONF_DIR=$sysconfdir"
Cristyc1bfec22020-10-04 15:40:32 +0000214AC_SUBST([SYSCONF_DIR])
cristy3ed852e2009-09-05 21:47:34 +0000215eval "eval SHAREDSTATE_DIR=$sharedstatedir"
Cristyc1bfec22020-10-04 15:40:32 +0000216AC_SUBST([SHAREDSTATE_DIR])
cristy3ed852e2009-09-05 21:47:34 +0000217eval "eval LOCALSTATE_DIR=$localstatedir"
Cristyc1bfec22020-10-04 15:40:32 +0000218AC_SUBST([LOCALSTATE_DIR])
cristy3ed852e2009-09-05 21:47:34 +0000219eval "eval LIB_DIR=$libdir"
Cristyc1bfec22020-10-04 15:40:32 +0000220AC_SUBST([LIB_DIR])
cristy3ed852e2009-09-05 21:47:34 +0000221eval "eval INCLUDE_DIR=$includedir"
Cristyc1bfec22020-10-04 15:40:32 +0000222AC_SUBST([INCLUDE_DIR])
cristy3ed852e2009-09-05 21:47:34 +0000223eval "eval PERSISTINCLUDE_DIR=$oldincludedir"
Cristyc1bfec22020-10-04 15:40:32 +0000224AC_SUBST([PERSISTINCLUDE_DIR])
cristy3ed852e2009-09-05 21:47:34 +0000225eval "eval INFO_DIR=$infodir"
Cristyc1bfec22020-10-04 15:40:32 +0000226AC_SUBST([INFO_DIR])
cristy3ed852e2009-09-05 21:47:34 +0000227eval "eval MAN_DIR=$mandir"
Cristyc1bfec22020-10-04 15:40:32 +0000228AC_SUBST([MAN_DIR])
cristy3ed852e2009-09-05 21:47:34 +0000229
230# Get full paths to source and build directories
231srcdirfull="`cd $srcdir && pwd`"
232builddir="`pwd`"
233
234#
235# Compute variables useful for running uninstalled software.
236#
237MAGICK_CODER_MODULE_PATH="${builddir}/coders"
238MAGICK_CONFIGURE_SRC_PATH="${srcdirfull}/config"
239MAGICK_CONFIGURE_BUILD_PATH="${builddir}/config"
240MAGICK_FILTER_MODULE_PATH="${builddir}/filters"
241DIRSEP=':'
242case "${build_os}" in
243 mingw* )
244 MAGICK_CODER_MODULE_PATH=`$WinPathScript "${MAGICK_CODER_MODULE_PATH}" 0`
245 MAGICK_CONFIGURE_SRC_PATH=`$WinPathScript "${MAGICK_CONFIGURE_SRC_PATH}" 0`
246 MAGICK_CONFIGURE_BUILD_PATH=`$WinPathScript "${MAGICK_CONFIGURE_BUILD_PATH}" 0`
247 MAGICK_FILTER_MODULE_PATH=`$WinPathScript "${MAGICK_FILTER_MODULE_PATH}" 0`
248 DIRSEP=';'
249 ;;
250esac
251case "${host_os}" in
252 mingw* )
253 DIRSEP=';'
254 ;;
255esac
Cristyc1bfec22020-10-04 15:40:32 +0000256AC_SUBST([MAGICK_CODER_MODULE_PATH])
257AC_SUBST([MAGICK_CONFIGURE_SRC_PATH])
258AC_SUBST([MAGICK_CONFIGURE_BUILD_PATH])
259AC_SUBST([MAGICK_FILTER_MODULE_PATH])
260AC_SUBST([DIRSEP])
cristy3ed852e2009-09-05 21:47:34 +0000261
cristya0b81c32010-01-22 02:54:33 +0000262
263#
264# Enable OS features.
265#
266AC_USE_SYSTEM_EXTENSIONS
267
cristy9af1cbf2014-12-28 22:03:09 +0000268# ==============================================================================
269# Find required base packages
270# ==============================================================================
271m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
cristy3ed852e2009-09-05 21:47:34 +0000272AC_PROG_CC
cristy3ed852e2009-09-05 21:47:34 +0000273AC_PROG_CPP
274AC_PROG_LD
Cristy12452732020-10-02 16:23:46 +0000275LT_PATH_LD
Cristyc1bfec22020-10-04 15:40:32 +0000276AC_SUBST([LD])
cristy837d6dc2010-02-27 01:16:57 +0000277AC_PROG_CC_C99
cristy3ed852e2009-09-05 21:47:34 +0000278AM_PROG_CC_C_O
cristy92703d82010-04-26 00:18:18 +0000279AX_CFLAGS_WARN_ALL
cristy3ed852e2009-09-05 21:47:34 +0000280AC_PROG_INSTALL
281AC_PROG_MAKE_SET
cristy3ed852e2009-09-05 21:47:34 +0000282AC_PROG_LN_S
cristy8d0ff762013-03-10 20:33:28 +0000283AC_PROG_SED
cristybc556452012-08-17 19:44:03 +0000284AC_PROG_AWK
Cristyb123ba32019-05-16 07:47:17 -0400285AC_PROG_MKDIR_P
Elliott Hughes5d41fba2021-04-12 16:36:42 -0700286AC_PROG_RANLIB
cristy3ed852e2009-09-05 21:47:34 +0000287AM_WITH_DMALLOC
cristy92703d82010-04-26 00:18:18 +0000288AX_C___ATTRIBUTE__
Cristy01043c62019-10-05 11:39:30 -0400289AX_GCC_ARCHFLAG([yes])
Cristy6720ed72016-02-09 09:27:35 -0500290PKG_PROG_PKG_CONFIG([0.20])
cristy9af1cbf2014-12-28 22:03:09 +0000291AC_CANONICAL_BUILD
292AC_CANONICAL_HOST
cristy3ed852e2009-09-05 21:47:34 +0000293
cristyd95b7a52013-10-23 13:12:53 +0000294AX_COMPILER_VENDOR
cristyd95b7a52013-10-23 13:12:53 +0000295
296if test "x$GCC" = "xyes"; then
297 CFLAGS="$CFLAGS -fexceptions"
298 touch local.exp
299else
300 cat > local.exp <<EOF
301set CC_FOR_TARGET "$CC"
302EOF
303fi
304
cristy496c0902013-02-26 12:57:44 +0000305# Check for linker script support
cristy9b86f202012-11-28 21:55:35 +0000306gl_LD_VERSION_SCRIPT
307
cristy3ed852e2009-09-05 21:47:34 +0000308#
cristy3ed852e2009-09-05 21:47:34 +0000309# Enable run-time checking.
310#
311AC_ARG_ENABLE([bounds-checking],
cristya3824692012-03-30 17:22:07 +0000312 [AC_HELP_STRING([--enable-bounds-checking],
cristy3ed852e2009-09-05 21:47:34 +0000313 [enable run-time bounds-checking])],
314 [enable_bounds_checking=$enableval],
315 [enable_bounds_checking='no'])
316
317if test "$enable_bounds_checking" = yes; then
318 AC_DEFINE([_FORTIFY_SOURCE], [2],
319 [enable run-time bounds-checking])
320fi
321
322#
323# Tests for Windows
324#
325AC_EXEEXT
326AC_OBJEXT
327
cristy3ed852e2009-09-05 21:47:34 +0000328native_win32_build='no'
329cygwin_build='no'
330case "${host_os}" in
331 cygwin* )
cristy3ed852e2009-09-05 21:47:34 +0000332 cygwin_build='yes'
cristy3ed852e2009-09-05 21:47:34 +0000333 ;;
334 mingw* )
cristy3ed852e2009-09-05 21:47:34 +0000335 native_win32_build='yes'
cristy3ed852e2009-09-05 21:47:34 +0000336 ;;
337esac
Elliott Hughes5d41fba2021-04-12 16:36:42 -0700338AM_CONDITIONAL([WIN32_NATIVE_BUILD],[test "${native_win32_build}" = 'yes'])
339AM_CONDITIONAL([CYGWIN_BUILD],[test "${cygwin_build}" = 'yes'])
cristy3ed852e2009-09-05 21:47:34 +0000340
341WinPathScript="${srcdirfull}/winpath.sh"
Cristyc1bfec22020-10-04 15:40:32 +0000342AC_SUBST([WinPathScript])
cristy3ed852e2009-09-05 21:47:34 +0000343
344#
345# Compiler flags tweaks
346#
347if test "${GCC}" != "yes"; then
348 case "${host}" in
349 *-*-hpux* )
350 # aCC: HP ANSI C++ B3910B A.03.34
351 CFLAGS="${CFLAGS} -Wp,-H30000"
352 if test -n "${CXXFLAGS}"; then
353 CXXFLAGS='-AA'
354 else
355 CXXFLAGS="${CXXFLAGS} -AA"
356 fi
357 ;;
358 *-dec-osf5.* )
359 # Compaq alphaev68-dec-osf5.1 compiler
360 if test -n "${CXXFLAGS}"; then
361 CXXFLAGS='-std strict_ansi -noimplicit_include'
362 else
363 CXXFLAGS="${CXXFLAGS} -std strict_ansi -noimplicit_include"
364 fi
365 esac
366fi
367
368# Check for lazy-loading.
369AC_CACHE_CHECK([for linker lazyload option],[im_cv_ld_lazyload],
370[
371im_cv_ld_lazyload='none'
372case "${host}" in
373 *-*-solaris2.8 | *-*-solaris2.9 | *-*-solaris2.1? )
374 if test "$lt_cv_prog_gnu_ld" != 'yes' ; then
375 im_cv_ld_lazyload='-Wl,-zlazyload'
376 fi
377 ;;
378esac
379])
380if test "${im_cv_ld_lazyload}" != 'none' ; then
381 if test -z "${LDFLAGS}" ; then
382 LDFLAGS="${im_cv_ld_lazyload}"
383 else
384 LDFLAGS="${im_cv_ld_lazyload} ${LDFLAGS}"
385 fi
386fi
387
388dnl Platform-specific stuff
389case "$host" in
cristyc37574e2013-02-16 01:04:55 +0000390 *darwin* | *-macos10*)
391 dnl Disable FORTIFY_SOURCE to fix a bug in LVVM / OpenMP support
cristyb3b90d32013-02-16 15:44:08 +0000392 CFLAGS="${CFLAGS} -D_FORTIFY_SOURCE=0"
cristyc37574e2013-02-16 01:04:55 +0000393 dnl OS X universal binary support, requires --disable-dependency-tracking
394 AC_ARG_ENABLE([osx-universal-binary],
cristy3ed852e2009-09-05 21:47:34 +0000395 AC_HELP_STRING([--enable-osx-universal-binary],
396 [build universal binary on OS X [[default=no]]]),
397 [build_osxuniversal="${enableval}"], [build_osxuniversal=no])
398
cristyc37574e2013-02-16 01:04:55 +0000399 if test "${build_osxuniversal}" != no ; then
400 if test "$enable_dependency_tracking" != no ; then
401 AC_MSG_ERROR([--enable-osx-universal-binary requires --disable-dependency-tracking.
cristy3ed852e2009-09-05 21:47:34 +0000402Please re-run configure with these options:
403 --disable-dependency-tracking --enable-osx-universal-binary
404 ])
cristyc37574e2013-02-16 01:04:55 +0000405 fi
406 CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
407 CXXFLAGS="$CXXFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
408 LDFLAGS="$LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
cristy3ed852e2009-09-05 21:47:34 +0000409 fi
410 ;;
411esac
412
cristy0151ae12011-10-28 16:32:29 +0000413#
414# ARCH specific include directory
415#
cristy670aa3c2011-11-03 00:54:00 +0000416AC_ARG_WITH([includearch-dir],
417 [AC_HELP_STRING([--includearch-dir=DIR],
cristy0151ae12011-10-28 16:32:29 +0000418 [ARCH specific include directory])],
cristy670aa3c2011-11-03 00:54:00 +0000419 [includearch_dir=$withval],
420 [includearch_dir=$INCLUDE_DIR])
cristy0151ae12011-10-28 16:32:29 +0000421
cristyd286fd72013-02-24 19:25:33 +0000422eval "eval INCLUDEARCH_DIR=$includearch_dir"
Cristyc1bfec22020-10-04 15:40:32 +0000423AC_SUBST([INCLUDEARCH_DIR])
cristy0151ae12011-10-28 16:32:29 +0000424
425#
426# ARCH specific configuration directory
427#
cristy670aa3c2011-11-03 00:54:00 +0000428AC_ARG_WITH([sharearch-dir],
429 [AC_HELP_STRING([--sharearch-dir=DIR],
cristy0151ae12011-10-28 16:32:29 +0000430 [ARCH specific config directory])],
cristy670aa3c2011-11-03 00:54:00 +0000431 [sharearch_dir=$withval],
cristy408ebcd2011-11-14 01:36:57 +0000432 [sharearch_dir="${LIB_DIR}"])
cristy0151ae12011-10-28 16:32:29 +0000433
cristy670aa3c2011-11-03 00:54:00 +0000434eval "eval SHAREARCH_DIR=$sharearch_dir"
Cristyc1bfec22020-10-04 15:40:32 +0000435AC_SUBST([SHAREARCH_DIR])
cristy0151ae12011-10-28 16:32:29 +0000436
cristy496c0902013-02-26 12:57:44 +0000437# Path to the pkgconfig folder
cristy2ec87cc2013-02-18 17:46:50 +0000438AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=DIR],
439 [Path to the pkgconfig directory @<:@LIBDIR/pkgconfig@:>@]),
440 [pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
441AC_SUBST([pkgconfigdir])
442
cristy0151ae12011-10-28 16:32:29 +0000443#
Cristyad9483d2018-11-10 18:43:37 -0500444# Enable support for POSIX thread APIs
cristy1ae5c992013-07-30 14:55:07 +0000445#
cristy3ed852e2009-09-05 21:47:34 +0000446AC_ARG_WITH([threads],
Cristyad9483d2018-11-10 18:43:37 -0500447 [AC_HELP_STRING([--without-threads], [disable POSIX threads API support])],
cristy3ed852e2009-09-05 21:47:34 +0000448 [with_threads=$withval],
449 [with_threads='yes'])
450
cristy1ae5c992013-07-30 14:55:07 +0000451THREAD_LIBS=''
cristy3ed852e2009-09-05 21:47:34 +0000452have_threads=no
453if test "$with_threads" != 'no'; then
cristyf6fcb5d2010-09-24 01:19:13 +0000454 AX_PTHREAD()
cristy7acf8fb2010-09-23 19:58:53 +0000455 if test "$ax_pthread_ok" = yes; then
cristy3ed852e2009-09-05 21:47:34 +0000456 have_threads=yes
457 DEF_THREAD="$PTHREAD_CFLAGS"
458 CFLAGS="$CFLAGS $DEF_THREAD"
459 CXXFLAGS="$CXXFLAGS $DEF_THREAD"
Cristyad9483d2018-11-10 18:43:37 -0500460 THREAD_LIBS="$PTHREAD_LIBS"
cristy3ed852e2009-09-05 21:47:34 +0000461 if test "$CC" != "$PTHREAD_CC"; then
462 AC_MSG_WARN([Replacing compiler $CC with compiler $PTHREAD_CC to support pthreads.])
463 CC="$PTHREAD_CC"
464 fi
Cristy93b90482020-10-05 14:57:52 +0000465 AC_DEFINE([THREAD_SUPPORT],[1],[Define if you have POSIX threads libraries and header files.])
cristy3ed852e2009-09-05 21:47:34 +0000466 fi
467fi
cristy1ae5c992013-07-30 14:55:07 +0000468LIBS="$LIBS $THREAD_LIBS"
Cristyc1bfec22020-10-04 15:40:32 +0000469AC_SUBST([THREAD_LIBS])
cristy3ed852e2009-09-05 21:47:34 +0000470
471# Enable support for OpenMP
472if test "$have_threads" != 'yes'; then
473 ac_cv_prog_c_openmp=unsupported
474fi
475AC_OPENMP([C])
476CFLAGS="$OPENMP_CFLAGS $CFLAGS"
477MAGICK_PCFLAGS="$MAGICK_PCFLAGS $OPENMP_CFLAGS"
Cristyc1bfec22020-10-04 15:40:32 +0000478AC_SUBST([OPENMP_CFLAGS])
cristy391f1ce2010-09-09 17:23:28 +0000479if test "$enable_openmp" != no; then
480 if test "$ac_cv_prog_c_openmp" != 'unsupported'; then
481 MAGICK_FEATURES="OpenMP $MAGICK_FEATURES"
482 fi
483fi
cristy3ed852e2009-09-05 21:47:34 +0000484
cristy736173a2009-09-20 21:18:22 +0000485# Enable support for OpenCL
Cristy2a67d0e2020-08-25 20:17:54 -0400486no_cl=yes
Cristyd08a9942020-08-25 16:46:18 -0400487AX_HAVE_OPENCL([C])
Cristy2a67d0e2020-08-25 20:17:54 -0400488if test "X$no_cl" != 'Xyes'; then
Cristy141a3002019-10-29 17:10:27 -0400489 MAGICK_FEATURES="OpenCL $MAGICK_FEATURES"
cristyfd9dcd42010-08-08 18:07:02 +0000490fi
cristy736173a2009-09-20 21:18:22 +0000491
cristy3ed852e2009-09-05 21:47:34 +0000492########
493#
494# Check for large file support
495#
496########
497AC_SYS_LARGEFILE
498AC_FUNC_FSEEKO
499LFS_CPPFLAGS=''
500if test "$enable_largefile" != no; then
cristyc1e0cc12011-09-21 16:41:16 +0000501 case $ac_cv_sys_file_offset_bits in
502 no)
503 # nothing to do here as the host supports LFS fine
504 ;;
505 unknown)
cristy3ed852e2009-09-05 21:47:34 +0000506 AC_MSG_CHECKING([for native large file support])
cristyda16f162011-02-19 23:52:17 +0000507 AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>
cristy3ed852e2009-09-05 21:47:34 +0000508 main () {
509 exit(!(sizeof(off_t) == 8));
cristyda16f162011-02-19 23:52:17 +0000510 }])],
cristy3ed852e2009-09-05 21:47:34 +0000511 [ac_cv_sys_file_offset_bits=64; AC_DEFINE(_FILE_OFFSET_BITS,64)
cristyad38abe2012-12-23 23:03:21 +0000512 AC_MSG_RESULT([yes])],
513 [AC_MSG_RESULT([no])])
cristyc1e0cc12011-09-21 16:41:16 +0000514 ;;
515 *)
516 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
517 ;;
518 esac
cristy3ed852e2009-09-05 21:47:34 +0000519 if test "$ac_cv_sys_large_files" != 'no'; then
520 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGE_FILES=1"
521 fi
522 if test "$ac_cv_sys_largefile_source" != 'no'; then
523 LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGEFILE_SOURCE=1"
524 fi
525fi
Cristyc1bfec22020-10-04 15:40:32 +0000526AC_SUBST([LFS_CPPFLAGS])
cristy3ed852e2009-09-05 21:47:34 +0000527
Cristy745f17d2020-05-05 16:37:32 -0400528#
Cristy6654e6d2020-10-05 21:57:31 +0000529# Check for sendfile support
530#
531########
532AC_CACHE_CHECK([Linux compatible sendfile()],ac_cv_have_linux_sendfile,[
533 AC_TRY_LINK([
534 #undef _FILE_OFFSET_BITS
535 #include <sys/types.h>
536 #include <sys/socket.h>
537 #include <sys/sendfile.h>
538 ], [
539 sendfile(0, 0, (void *) 0, 0);
540 ], [
541 ac_cv_have_linux_sendfile=yes
542 ], [
543 ac_cv_have_linux_sendfile=no
544 ])
545])
546if test $ac_cv_have_linux_sendfile = yes; then
547 AC_DEFINE([HAVE_LINUX_SENDFILE],[1], [Define if you have Linux-compatible sendfile()])
548fi
549
550#
Cristy745f17d2020-05-05 16:37:32 -0400551# Set SETJMP_IS_THREAD_SAFE define.
552#
553case "${host_os}" in
554 solaris2* ) ;;
Cristy93b90482020-10-05 14:57:52 +0000555 *) AC_DEFINE([SETJMP_IS_THREAD_SAFE],[1],[Setjmp/longjmp are thread safe]) ;;
Cristy745f17d2020-05-05 16:37:32 -0400556esac
557
cristy3ed852e2009-09-05 21:47:34 +0000558# Configure libtool
Cristyed7fd172019-12-07 10:52:28 -0500559: ${AR_FLAGS=cr}
Cristy6ca2abc2020-10-04 00:04:30 +0000560LT_INIT([win32-dll dlopen])
cristy3ed852e2009-09-05 21:47:34 +0000561LT_LANG([C++])
Cristyc1bfec22020-10-04 15:40:32 +0000562AC_SUBST([LIBTOOL_DEPS])
cristy3ed852e2009-09-05 21:47:34 +0000563
cristy3ed852e2009-09-05 21:47:34 +0000564# Check to see if building shared libraries
565libtool_build_shared_libs='no'
566if test "$enable_shared" = 'yes'; then
567 libtool_build_shared_libs='yes'
568fi
569
570# Check to see if building static libraries
571libtool_build_static_libs='no'
572if test "$enable_static" = 'yes'; then
573 libtool_build_static_libs='yes'
574fi
575
Elliott Hughes5d41fba2021-04-12 16:36:42 -0700576AM_CONDITIONAL([WITH_SHARED_LIBS],[test "${libtool_build_shared_libs}" = 'yes'])
cristy3ed852e2009-09-05 21:47:34 +0000577#
578# Enable support for building loadable modules
579#
cristyaf4cbf32012-10-16 23:47:41 +0000580build_modules='no'
cristy3ed852e2009-09-05 21:47:34 +0000581AC_ARG_WITH([modules],
582 [AC_HELP_STRING([--with-modules],
583 [enable building dynamically loadable modules])],
584 [with_modules=$withval],
cristy5a1cefd2010-01-06 20:42:35 +0000585 [with_modules='no'])
cristy3ed852e2009-09-05 21:47:34 +0000586
587# Only allow building loadable modules if we are building shared libraries
588if test "$with_modules" != 'no' ; then
589 if test "$libtool_build_shared_libs" = 'no'; then
590 AC_MSG_WARN([Modules may only be built if building shared libraries is enabled.])
cristyc6722092012-10-14 00:19:31 +0000591 build_modules='no'
592 else
593 build_modules='yes'
594 fi
cristy3ed852e2009-09-05 21:47:34 +0000595fi
cristyc6722092012-10-14 00:19:31 +0000596if test "$build_modules" != 'no' ; then
Cristyc1bfec22020-10-04 15:40:32 +0000597 AC_DEFINE([BUILD_MODULES],[1],[Define if coders and filters are to be built as modules.])
cristye78d2532012-12-17 20:41:10 +0000598 MAGICK_FEATURES="$MAGICK_FEATURES Modules"
cristy3ed852e2009-09-05 21:47:34 +0000599fi
Elliott Hughes5d41fba2021-04-12 16:36:42 -0700600AM_CONDITIONAL([WITH_MODULES],[test "$build_modules" != 'no'])
cristy3ed852e2009-09-05 21:47:34 +0000601
cristy3ed852e2009-09-05 21:47:34 +0000602# Enable build using delegate libraries built in subdirectories rather than installed
Christopher Chianelli7a1a92c2020-08-02 10:16:01 -0400603# delegate libraries (bzlib fftw fpx gslib jp2 jbig jpeg lcms lzma png tiff ttf wmf xml zlib zip)
cristy3ed852e2009-09-05 21:47:34 +0000604AC_ARG_ENABLE([delegate-build],
605 [AC_HELP_STRING([--enable-delegate-build],
606 [look for delegate libraries in build directory])],
607 [enable_delegate_build=$enableval],
608 [enable_delegate_build='no'])
609
610AC_ARG_ENABLE([deprecated],
611 [AC_HELP_STRING([--disable-deprecated],
cristy3a75f062012-09-08 23:29:40 +0000612 [exclude deprecated methods in MagickCore and MagickWand APIs])],
cristy3ed852e2009-09-05 21:47:34 +0000613 [enable_deprecated=$enableval],
614 [enable_deprecated='no'])
615
616if test "$enable_deprecated" = 'yes'; then
Cristy93b90482020-10-05 14:57:52 +0000617 AC_DEFINE([EXCLUDE_DEPRECATED],[1],[exclude deprecated methods in MagickCore API])
cristy3ed852e2009-09-05 21:47:34 +0000618else
619 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-deprecated "
620fi
621
622# Build a version of ImageMagick which operates uninstalled.
623# Used to build distributions located via MAGICK_HOME / executable path
624AC_ARG_ENABLE([installed],
625 [AC_HELP_STRING([--disable-installed],
626 [Formally install ImageMagick under PREFIX])],
627 [enable_installed=$enableval],
628 [enable_installed='yes'])
629
630if test "$enable_installed" = 'yes'; then
Cristy93b90482020-10-05 14:57:52 +0000631 AC_DEFINE([INSTALLED_SUPPORT],[1],[ImageMagick is formally installed under prefix])
cristy3ed852e2009-09-05 21:47:34 +0000632else
633 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-installed "
634fi
635
636# Permit enciphering and deciphering image pixels.
637AC_ARG_ENABLE([cipher],
638 [AC_HELP_STRING([--disable-cipher],
639 [disable enciphering and deciphering image pixels])],
640 [enable_cipher=$enableval],
641 [enable_cipher='yes'])
642
643if test "$enable_cipher" = 'yes'; then
Cristy93b90482020-10-05 14:57:52 +0000644 AC_DEFINE([CIPHER_SUPPORT],[1],[permit enciphering and deciphering image pixels])
cristy0f6fc2d2015-05-30 00:49:11 +0000645 MAGICK_FEATURES="Cipher $MAGICK_FEATURES"
cristy3ed852e2009-09-05 21:47:34 +0000646fi
647
cristy6e3607c2011-09-13 13:59:17 +0000648# Build a zero-configuration version of ImageMagick.
649AC_ARG_ENABLE([zero-configuration],
650 [AC_HELP_STRING([--enable-zero-configuration],
cristy3ed852e2009-09-05 21:47:34 +0000651 [enable self-contained, embeddable, zero-configuration ImageMagick])],
cristy6e3607c2011-09-13 13:59:17 +0000652 [enable_zero_configuration=$enableval],
653 [enable_zero_configuration='no'])
cristy3ed852e2009-09-05 21:47:34 +0000654
cristy6e3607c2011-09-13 13:59:17 +0000655if test "$enable_zero_configuration" = 'yes'; then
Cristy93b90482020-10-05 14:57:52 +0000656 AC_DEFINE([ZERO_CONFIGURATION_SUPPORT],[1],[Build self-contained, embeddable, zero-configuration ImageMagick])
cristy0f6fc2d2015-05-30 00:49:11 +0000657 MAGICK_FEATURES="Zero-configuration $MAGICK_FEATURES"
cristy3ed852e2009-09-05 21:47:34 +0000658fi
Cristyc1bfec22020-10-04 15:40:32 +0000659AM_CONDITIONAL([MAGICKCORE_ZERO_CONFIGURATION_SUPPORT],[test "$enable_zero_configuration" = yes])
cristy3ed852e2009-09-05 21:47:34 +0000660
661# Build a high dynamic range version of ImageMagick.
662AC_ARG_ENABLE([hdri],
cristyf314dbd2012-11-15 13:35:28 +0000663 [AC_HELP_STRING([--enable-hdri],
cristy3ed852e2009-09-05 21:47:34 +0000664 [accurately represent the wide range of intensity levels found in real scenes])],
665 [enable_hdri=$enableval],
cristy191c0b72012-08-12 16:29:52 +0000666 [enable_hdri='yes'])
cristy3ed852e2009-09-05 21:47:34 +0000667
668MAGICK_HDRI=""
669if test "$enable_hdri" = 'yes'; then
670 MAGICK_HDRI="HDRI"
cristye52f12f2012-12-31 15:32:36 +0000671 magick_hdri_enable='1';
cristyfd9dcd42010-08-08 18:07:02 +0000672 MAGICK_FEATURES="HDRI $MAGICK_FEATURES"
cristye52f12f2012-12-31 15:32:36 +0000673else
674 magick_hdri_enable='0'
cristy3ed852e2009-09-05 21:47:34 +0000675fi
Cristyc1bfec22020-10-04 15:40:32 +0000676AC_DEFINE_UNQUOTED([HDRI_ENABLE_OBSOLETE_IN_H],[$magick_hdri_enable],[Whether hdri is enabled or not])
677AC_SUBST([MAGICK_HDRI])dnl
cristye52f12f2012-12-31 15:32:36 +0000678MAGICK_PCFLAGS="$MAGICK_PCFLAGS -DMAGICKCORE_HDRI_ENABLE=$magick_hdri_enable"
679CFLAGS="$CFLAGS -DMAGICKCORE_HDRI_ENABLE=$magick_hdri_enable"
cristy72062382012-12-31 16:49:52 +0000680CPPFLAGS="$CPPFLAGS -DMAGICKCORE_HDRI_ENABLE=$magick_hdri_enable"
cristy3ed852e2009-09-05 21:47:34 +0000681
Cristy697159d2016-05-31 07:21:31 -0400682# Enable pipes (|) in filenames.
683AC_ARG_ENABLE([pipes],
684 [AC_HELP_STRING([--enable-pipes],
685 [enable pipes (|) in filenames])],
686 [enable_pipes=$enableval],
687 [enable_pipes='no'])
688
689if test "$enable_pipes" = 'yes'; then
Cristy93b90482020-10-05 14:57:52 +0000690 AC_DEFINE([PIPES_SUPPORT],[1],[enable pipes (|) in filenames])
Cristy697159d2016-05-31 07:21:31 -0400691 MAGICK_FEATURES="Pipes $MAGICK_FEATURES"
692fi
693
cristy3ed852e2009-09-05 21:47:34 +0000694# Build a version of ImageMagick with assert statements.
695AC_ARG_ENABLE([assert],
696 [AC_HELP_STRING([--disable-assert],
697 [disable assert() statements in build])],
698 [enable_assert=$enableval],
699 [enable_assert='yes'])
700
701if test "$enable_assert" = 'no'; then
Cristy93b90482020-10-05 14:57:52 +0000702 AC_DEFINE([NDEBUG],[1],[Turn off assert statements])
cristy3ed852e2009-09-05 21:47:34 +0000703fi
704
cristya448bd22011-10-14 12:38:13 +0000705# Don't emit "rebuild rules" for configure, Makefile.ins, etc.
cristy3ed852e2009-09-05 21:47:34 +0000706AM_MAINTAINER_MODE
707
cristy944e51f2013-04-16 18:45:02 +0000708# Enable hugepages support
709AC_ARG_ENABLE([hugepages],
710 [AC_HELP_STRING([--enable-hugepages],
711 [enable 'huge pages' support])],
712 [enable_hugepages=$enableval],
713 [enable_hugepages='no'])
714
cristy3ed852e2009-09-05 21:47:34 +0000715# Enable ccmalloc memory debugging support
716AC_ARG_ENABLE([ccmalloc],
717 [AC_HELP_STRING([--enable-ccmalloc],
718 [enable 'ccmalloc' memory debug support])],
719 [enable_ccmalloc=$enableval],
720 [enable_ccmalloc='no'])
721
722# Enable Electric Fence memory debugging support
723AC_ARG_ENABLE([efence],
724 [AC_HELP_STRING([--enable-efence],
725 [enable 'efence' memory debug support])],
726 [enable_efence=$enableval],
727 [enable_efence='no'])
728
729# Enable prof-based profiling support
730AC_ARG_ENABLE([prof],
731 [AC_HELP_STRING([--enable-prof],
732 [enable 'prof' profiling support])],
733 [enable_prof=$enableval],
734 [enable_prof='no'])
735
736# Enable gprof-based profiling support
737AC_ARG_ENABLE([gprof],
738 [AC_HELP_STRING([--enable-gprof],
739 [enable 'gprof' profiling support])],
740 [enable_gprof=$enableval],
741 [enable_gprof='no'])
742
743# Enable gcov-based profiling support
744AC_ARG_ENABLE([gcov],
745 [AC_HELP_STRING([--enable-gcov],
746 [enable 'gcov' profiling support])],
747 [enable_gcov=$enableval],
748 [enable_gcov='no'])
749
750enable_profiling='no'
751if test "$enable_prof" = 'yes' || test "$enable_gprof" = 'yes' || test "$enable_gcov" = 'yes'; then
752 enable_profiling='yes'
753 if test "$libtool_build_shared_libs" = 'yes'; then
754 echo "Warning: Can not profile code using shared libraries"
755 fi
756fi
757
758# Magick API method prefix
759AC_ARG_WITH([method-prefix],
760 [AC_HELP_STRING([--with-method-prefix=PREFIX],
761 [prefix MagickCore API methods])],
cristyfc3d0222012-02-07 15:05:57 +0000762 [with_method_prefix=$withval],
763 [with_method_prefix='no'])
cristy3ed852e2009-09-05 21:47:34 +0000764
cristyfc3d0222012-02-07 15:05:57 +0000765if test "$with_method_prefix" != 'no'; then
Elliott Hughes5d41fba2021-04-12 16:36:42 -0700766 AC_DEFINE_UNQUOTED([NAMESPACE_PREFIX],[$with_method_prefix],[Magick API method prefix])
767 AC_DEFINE_UNQUOTED([NAMESPACE_PREFIX_TAG],[$with_method_prefix],[Magick API method prefix tag])
cristyfc3d0222012-02-07 15:05:57 +0000768 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-method-prefix "
cristy3ed852e2009-09-05 21:47:34 +0000769fi
770
cristy71d8c202012-03-20 17:05:01 +0000771# Enable legacy support (default no)
Cristyc1bfec22020-10-04 15:40:32 +0000772AC_ARG_ENABLE([legacy-support],
Cristy519e0052016-10-16 15:28:40 -0400773 [ --enable-legacy-support install legacy command-line utilities (default disabled)],
cristy71d8c202012-03-20 17:05:01 +0000774 [with_legacy_support=$enableval],
775 [with_legacy_support='no'])
Elliott Hughes5d41fba2021-04-12 16:36:42 -0700776AM_CONDITIONAL([LEGACY_SUPPORT],[test "$with_legacy_support" != 'no'])
cristy71d8c202012-03-20 17:05:01 +0000777
Paul Kehrer6ac37232018-03-31 10:33:53 -0500778# Enable building command line utilities (default yes)
Cristyc1bfec22020-10-04 15:40:32 +0000779AC_ARG_WITH([utilities],
Cristye3723ab2019-09-11 08:21:22 -0400780 [ --with-utilities enable building command-line utilities (default yes)],
Paul Kehrer6ac37232018-03-31 10:33:53 -0500781 [with_utilities=$withval], [with_utilities='yes'])
Elliott Hughes5d41fba2021-04-12 16:36:42 -0700782AM_CONDITIONAL([WITH_UTILITIES],[test "$with_utilities" = 'yes'])
Paul Kehrer6ac37232018-03-31 10:33:53 -0500783
cristy3ed852e2009-09-05 21:47:34 +0000784# Number of bits in a Quantum
785AC_ARG_WITH([quantum-depth],
786 [AC_HELP_STRING([--with-quantum-depth=DEPTH],
787 [number of bits in a pixel quantum (default 16)])],
788 [with_quantum_depth=$withval],
789 [with_quantum_depth=16])
790
791if test "$with_quantum_depth" != '8'; then
792 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-quantum-depth=$with_quantum_depth "
793fi
794
795case "${with_quantum_depth}" in
796 8 ) ;;
797 16 ) ;;
798 32 ) ;;
799 64 ) ;;
cristycdae12a2010-09-19 02:24:31 +0000800 * ) AC_MSG_ERROR("Pixel quantum depth must have value of 8, 16, 32, or 64") ;;
cristy3ed852e2009-09-05 21:47:34 +0000801esac
802QUANTUM_DEPTH="$with_quantum_depth"
Matthew Dawson2fd2bcc2020-10-22 06:52:12 -0400803AC_DEFINE_UNQUOTED([QUANTUM_DEPTH_OBSOLETE_IN_H],[$QUANTUM_DEPTH],[Number of bits in a pixel Quantum (8/16/32/64)])
Cristyc1bfec22020-10-04 15:40:32 +0000804AC_SUBST([QUANTUM_DEPTH])dnl
cristy0a9565b2013-01-30 19:57:08 +0000805MAGICK_PCFLAGS="$MAGICK_PCFLAGS -DMAGICKCORE_QUANTUM_DEPTH=$QUANTUM_DEPTH"
cristye52f12f2012-12-31 15:32:36 +0000806CFLAGS="$CFLAGS -DMAGICKCORE_QUANTUM_DEPTH=$QUANTUM_DEPTH"
cristy72062382012-12-31 16:49:52 +0000807CPPFLAGS="$CPPFLAGS -DMAGICKCORE_QUANTUM_DEPTH=$QUANTUM_DEPTH"
cristy3ed852e2009-09-05 21:47:34 +0000808
cristy01ff9f32012-12-01 18:15:29 +0000809# define a lib suffix for abi purpose
cristy7a26abd2012-12-03 00:18:59 +0000810MAGICK_ABI_SUFFIX="Q${QUANTUM_DEPTH}"
cristye386d192012-12-01 21:05:20 +0000811if test "$enable_hdri" = 'yes'; then
cristy7a26abd2012-12-03 00:18:59 +0000812 MAGICK_ABI_SUFFIX="Q${QUANTUM_DEPTH}${MAGICK_HDRI}"
cristye386d192012-12-01 21:05:20 +0000813fi
Cristyc1bfec22020-10-04 15:40:32 +0000814AC_SUBST([MAGICK_ABI_SUFFIX])
cristy01ff9f32012-12-01 18:15:29 +0000815
cristy3ed852e2009-09-05 21:47:34 +0000816# Set pixel cache threshold
817AC_ARG_WITH([cache],
818 [AC_HELP_STRING([--with-cache=THRESHOLD],
819 [set pixel cache threshhold in MB (default available memory)])],
820 [with_cache=$withval],
821 [with_cache=''])
822
823if test "$with_cache" != ''; then
Cristyc1bfec22020-10-04 15:40:32 +0000824 AC_DEFINE_UNQUOTED([PixelCacheThreshold],["$with_cache"],[Pixel cache threshold in MB (defaults to available memory)])
cristy3ed852e2009-09-05 21:47:34 +0000825 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-cache=$with_cache "
826fi
827
828# Disable/Enable support for full delegate paths
829AC_ARG_WITH([frozenpaths],
830 [AC_HELP_STRING([--with-frozenpaths],
831 [freeze delegate paths])],
832 [with_frozenpaths=$withval],
833 [with_frozenpaths='no'])
834
835# Enable build/install of Magick++
836AC_ARG_WITH([magick-plus-plus],
837 [AC_HELP_STRING([--without-magick-plus-plus],
838 [disable build/install of Magick++])],
839 [with_magick_plus_plus=$withval],
840 [with_magick_plus_plus='yes'])
841
cristy3a75f062012-09-08 23:29:40 +0000842# Encode the this name into the shared library.
843AC_ARG_WITH([package-release-name],
844 [AC_HELP_STRING([--with-package-release-name=NAME],
845 [encode this name into the shared library])],
846[MAGICK_LT_RELEASE_OPTS="-release $withval"])
Cristyc1bfec22020-10-04 15:40:32 +0000847AC_SUBST([MAGICK_LT_RELEASE_OPTS])
cristy3a75f062012-09-08 23:29:40 +0000848
cristy3ed852e2009-09-05 21:47:34 +0000849# Disable build/install of PerlMagick.
850AC_ARG_WITH([perl],
851 [AC_HELP_STRING([--with-perl],
852 [enable build/install of PerlMagick])],
853 [with_perl=$withval],
cristyb5f4e2f2010-04-25 00:49:11 +0000854 [with_perl='no'])
cristy3ed852e2009-09-05 21:47:34 +0000855
856# Options to pass when configuring PerlMagick
857AC_ARG_WITH([perl-options],
858 [AC_HELP_STRING([--with-perl-options=OPTIONS],
cristyfc3d0222012-02-07 15:05:57 +0000859 [options to pass on command-line when generating PerlMagick build file])],
cristy949301e2010-01-06 01:38:40 +0000860PERL_MAKE_OPTIONS=$withval)
Cristyc1bfec22020-10-04 15:40:32 +0000861AC_SUBST([PERL_MAKE_OPTIONS])
cristy3ed852e2009-09-05 21:47:34 +0000862
cristy3b0097d2014-11-04 15:34:47 +0000863# Enable jemalloc, object-caching memory allocation library.
Cristyc1bfec22020-10-04 15:40:32 +0000864AC_ARG_WITH([jemalloc],
cristy3b0097d2014-11-04 15:34:47 +0000865 [ --with-jemalloc enable jemalloc memory allocation library support],
866 [with_jemalloc=$withval],
867 [with_jemalloc='no'])
868if test "$with_jemalloc" != 'yes' ; then
869 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jemalloc=$with_jemalloc "
870fi
871
Cristy001b1da2019-09-11 08:38:23 -0400872# Enable use of TCMalloc library.
Cristyc1bfec22020-10-04 15:40:32 +0000873AC_ARG_WITH([tcmalloc],
Cristy001b1da2019-09-11 08:38:23 -0400874 AS_HELP_STRING([--with-tcmalloc],
875 [enable tcmalloc memory allocation library support]),
876 [with_tcmalloc=$withval],
877 [with_tcmalloc='no'])
878if test "$with_tcmalloc" != 'no' ; then
879 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-tcmalloc=$with_tcmalloc "
880fi
881
cristy3ed852e2009-09-05 21:47:34 +0000882# Enable umem, object-caching memory allocation library.
Cristyc1bfec22020-10-04 15:40:32 +0000883AC_ARG_WITH([umem],
cristy3ed852e2009-09-05 21:47:34 +0000884 [ --with-umem enable umem memory allocation library support],
885 [with_umem=$withval],
886 [with_umem='no'])
887if test "$with_umem" != 'yes' ; then
888 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-umem=$with_umem "
889fi
890
891#
892# Specify path to shared libstdc++ if not in normal location
893#
894AC_ARG_WITH([libstdc],
895 [AC_HELP_STRING([--with-libstdc=DIR],
896 [ use libstdc++ in DIR (for GNU C++)])],
897 [with_libstdc=$withval],
898 [with_libstdc=''])
899
900if test "$with_libstdc" != ''; then
901 if test -d "$with_libstdc"; then
902 LIBSTDCLDFLAGS="-L$with_libstdc"
903 fi
904fi
Cristyc1bfec22020-10-04 15:40:32 +0000905AC_SUBST([LIBSTDCLDFLAGS])
cristy3ed852e2009-09-05 21:47:34 +0000906
907# Does gcc required -traditional?
908AC_PROG_GCC_TRADITIONAL
909
910########
911#
912# Set defines required to build DLLs and modules using MinGW
913#
914########
915# These options are set for multi-thread DLL module build
916# libMagickCore: _DLL _MAGICKMOD_ _MAGICKLIB_
917# module: _DLL
918# executable/Magick++: _DLL _MAGICKMOD_
919MODULE_EXTRA_CPPFLAGS=''
920LIBRARY_EXTRA_CPPFLAGS=''
921if test "${native_win32_build}" = 'yes'; then
922 if test "${libtool_build_shared_libs}" = 'yes'; then
923 CPPFLAGS="$CPPFLAGS -D_DLL"
924 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_DLL"
925 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_DLL"
926 LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKLIB_"
cristyc6722092012-10-14 00:19:31 +0000927 if test "$build_modules" = 'yes'; then
cristy3ed852e2009-09-05 21:47:34 +0000928 LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKMOD_"
929 else
930 MODULE_EXTRA_CPPFLAGS="$MODULE_EXTRA_CPPFLAGS -D_MAGICKLIB_"
931 fi
932 else
933 CPPFLAGS="$CPPFLAGS -D_LIB"
934 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_LIB"
935 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_LIB"
936 fi
937 if test "$with_threads" = 'yes'; then
938 CPPFLAGS="$CPPFLAGS -D_MT"
939 MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_MT"
940 MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_MT"
941 fi
942fi
Cristyc1bfec22020-10-04 15:40:32 +0000943AC_SUBST([MODULE_EXTRA_CPPFLAGS])
944AC_SUBST([LIBRARY_EXTRA_CPPFLAGS])
cristy3ed852e2009-09-05 21:47:34 +0000945
946# Check standard headers
947AC_HEADER_STDC
948if ! test x"$ac_cv_header_stdc" = x"yes"; then
949 AC_MSG_WARN([configure has detected that you do not have the ANSI standard C
950 header files. Compilation cannot proceed. Please install the ANSI C
951 headers and rerun this script.]);
952fi
cristya0b81c32010-01-22 02:54:33 +0000953AC_HEADER_ASSERT
cristy3ed852e2009-09-05 21:47:34 +0000954AC_HEADER_DIRENT
955
956# Check additional headers
Elliott Hughes5d41fba2021-04-12 16:36:42 -0700957AC_CHECK_HEADERS(arm/limits.h arpa/inet.h complex.h errno.h fcntl.h float.h limits.h linux/unistd.h locale.h machine/param.h mach-o/dyld.h malloc.h netdb.h netinet/in.h OS.h process.h sun_prefetch.h stdarg.h stddef.h sys/ipc.h sys/mman.h sys/resource.h sys/sendfile.h sys/socket.h sys/syslimits.h sys/time.h sys/timeb.h sys/times.h sys/uio.h sys/wait.h utime.h wchar.h xlocale.h)
cristy3ed852e2009-09-05 21:47:34 +0000958
959########
960#
961# Checks for typedefs, structures, and compiler characteristics.
962#
963########
964
965AC_HEADER_STDBOOL
966AC_C_VOLATILE
967AC_C_STRINGIZE
968AC_HEADER_STAT
969AC_HEADER_TIME
970AC_STRUCT_TM
cristy92703d82010-04-26 00:18:18 +0000971AC_STRUCT_TIMEZONE
cristy3ed852e2009-09-05 21:47:34 +0000972AC_SYS_INTERPRETER
973
cristya9ee2842013-01-08 15:56:39 +0000974#
975# Checks for language qualifiers and semantics.
976#
977AC_C_CHAR_UNSIGNED
978AC_C_CONST
cristy3ed852e2009-09-05 21:47:34 +0000979AC_C_INLINE
cristy3ed852e2009-09-05 21:47:34 +0000980AC_C_RESTRICT
cristya9ee2842013-01-08 15:56:39 +0000981AC_C_VOLATILE
cristy3ed852e2009-09-05 21:47:34 +0000982
983# If words are stored with the most significant byte first (like
984# Motorola and SPARC CPUs), define `WORDS_BIGENDIAN'.
985AC_C_BIGENDIAN
986
cristy501c8042011-05-26 17:46:28 +0000987# Define to a suitable type, if standard headers do not define it.
988AC_TYPE_INT8_T
989AC_TYPE_INT16_T
990AC_TYPE_INT32_T
991AC_TYPE_INT64_T
992AC_TYPE_INTMAX_T
993AC_TYPE_INTPTR_T
cristy501c8042011-05-26 17:46:28 +0000994AC_TYPE_MBSTATE_T
995AC_TYPE_MODE_T
996AC_TYPE_OFF_T
997AC_TYPE_PID_T
998AC_TYPE_SIZE_T
999AC_TYPE_SSIZE_T
1000AC_TYPE_UID_T
1001AC_TYPE_UINT8_T
1002AC_TYPE_UINT16_T
1003AC_TYPE_UINT32_T
1004AC_TYPE_UINT64_T
1005AC_TYPE_UINTMAX_T
1006AC_TYPE_UINTPTR_T
cristy98beafc2015-05-14 19:55:55 +00001007
cristyfec31822013-05-23 12:32:12 +00001008# Float_t and double_t are intended to be the the most efficient type.
cristyfec31822013-05-23 12:32:12 +00001009AC_CHECK_SIZEOF([float_t], [], [[#include <math.h>]])
1010AC_CHECK_SIZEOF([double_t], [], [[#include <math.h>]])
1011
cristy9b86f202012-11-28 21:55:35 +00001012# Get size of float, double and long double for comparaison.
1013AC_CHECK_SIZEOF([float])
1014AC_CHECK_SIZEOF([double])
cristy9e2b6242014-03-25 11:49:41 +00001015AC_CHECK_SIZEOF([long double])
cristyf0cf9a22012-10-24 12:05:01 +00001016
cristy3ed852e2009-09-05 21:47:34 +00001017# Obtain size of a 'unsigned long long' and define as
1018# SIZEOF_UNSIGNED_LONG_LONG. If 'unsigned long long' is not
1019# supported then the value defined is zero.
Cristyc1bfec22020-10-04 15:40:32 +00001020AC_CHECK_SIZEOF([unsigned long long])
Elliott Hughes5d41fba2021-04-12 16:36:42 -07001021AC_CHECK_SIZEOF([ssize_t])
cristy3ed852e2009-09-05 21:47:34 +00001022
Cristyc1bfec22020-10-04 15:40:32 +00001023AC_CHECK_SIZEOF([void *])
cristy3ed852e2009-09-05 21:47:34 +00001024
1025AC_MSG_CHECKING([whether our compiler supports __func__])
1026AC_TRY_COMPILE([],
1027 [{ const char *func = __func__; return(func != 0 ? 0 : 1); }],
cristyad38abe2012-12-23 23:03:21 +00001028 AC_MSG_RESULT([yes]),
1029 AC_MSG_RESULT([no])
cristy3ed852e2009-09-05 21:47:34 +00001030 AC_MSG_CHECKING([whether our compiler supports __FUNCTION__])
1031 AC_TRY_COMPILE([],
1032 [{ const char *func = __FUNCTION__; return(func != 0 ? 0 : 1); }],
cristyad38abe2012-12-23 23:03:21 +00001033 AC_MSG_RESULT([yes])
cristy3ed852e2009-09-05 21:47:34 +00001034 AC_DEFINE(__func__, __FUNCTION__,
iplxp00j62abaa32019-05-30 21:28:20 +02001035 [Define to appropriate substitute if compiler does not have __func__]),
cristyad38abe2012-12-23 23:03:21 +00001036 AC_MSG_RESULT([no])
cristy3ed852e2009-09-05 21:47:34 +00001037 AC_DEFINE(__func__, __FILE__,
iplxp00j62abaa32019-05-30 21:28:20 +02001038 [Define to appropriate substitute if compiler does not have __func__])))
cristy3ed852e2009-09-05 21:47:34 +00001039
1040########
1041#
1042# Check for functions
1043#
1044########
cristy3ed852e2009-09-05 21:47:34 +00001045AC_FUNC_CLOSEDIR_VOID
1046AC_FUNC_MMAP
1047AC_FUNC_FORK
Elliott Hughes5d41fba2021-04-12 16:36:42 -07001048AC_FUNC_MALLOC
cristy3ed852e2009-09-05 21:47:34 +00001049AC_FUNC_MEMCMP
Elliott Hughes5d41fba2021-04-12 16:36:42 -07001050AC_FUNC_REALLOC
cristy3ed852e2009-09-05 21:47:34 +00001051AC_FUNC_SELECT_ARGTYPES
1052AC_FUNC_SETVBUF_REVERSED
cristy3ed852e2009-09-05 21:47:34 +00001053AC_FUNC_STRTOD
cristy7d4a1d62011-10-13 15:54:12 +00001054AC_FUNC_STRERROR_R
cristy3ed852e2009-09-05 21:47:34 +00001055AC_FUNC_VPRINTF
1056
cristy161b9262010-03-20 19:34:32 +00001057#
1058# Find math library
1059#
1060MATH_LIBS=''
Cristyc1bfec22020-10-04 15:40:32 +00001061AC_CHECK_LIB([m],[sqrt],[MATH_LIBS="-lm"],[])
cristy161b9262010-03-20 19:34:32 +00001062LIBS="$MATH_LIBS $LIBS"
Cristyc1bfec22020-10-04 15:40:32 +00001063AC_SUBST([MATH_LIBS])
cristy161b9262010-03-20 19:34:32 +00001064
cristy85572162013-01-04 19:19:32 +00001065#
1066# Find socket library
1067#
cristy85572162013-01-04 19:19:32 +00001068AC_SEARCH_LIBS(gethostbyname, resolv nsl)
cristy8a5d7f42013-01-06 15:24:33 +00001069AC_SEARCH_LIBS(socket, socket,
1070[
1071 AC_DEFINE([HAVE_SOCKET],[1],[Define to 1 if you have socket support.])
cristyfac03342013-01-12 02:03:32 +00001072 MAGICK_FEATURES="DPC $MAGICK_FEATURES"
cristy8a5d7f42013-01-06 15:24:33 +00001073])
cristy85572162013-01-04 19:19:32 +00001074
cristye43a45e2009-09-28 14:49:00 +00001075#
1076# Check for clock_gettime().
1077#
1078AC_SEARCH_LIBS(clock_gettime, rt,
1079[
1080 AC_DEFINE([HAVE_CLOCK_GETTIME],[1],[Define to 1 if you have clock_gettime.])
1081 AC_MSG_CHECKING([whether clock_gettime supports CLOCK_REALTIME])
cristyda16f162011-02-19 23:52:17 +00001082 AC_COMPILE_IFELSE([
cristye43a45e2009-09-28 14:49:00 +00001083 AC_LANG_PROGRAM(
1084 [[#include <time.h>]],
cristyda16f162011-02-19 23:52:17 +00001085 [[clockid_t clockType = CLOCK_REALTIME;]])],
cristye43a45e2009-09-28 14:49:00 +00001086 [
Cristyc1bfec22020-10-04 15:40:32 +00001087 AC_MSG_RESULT([yes])
glennrp3fc1c212013-01-10 01:52:32 +00001088 AC_DEFINE([HAVE_CLOCK_REALTIME],[1],
cristye43a45e2009-09-28 14:49:00 +00001089 [Define to 1 if clock_gettime supports CLOCK_REALTIME.])
1090 ],
Cristyc1bfec22020-10-04 15:40:32 +00001091 AC_MSG_RESULT([no])
cristye43a45e2009-09-28 14:49:00 +00001092 )
1093 ],
1094 [
1095 AC_CHECK_FUNCS([gettimeofday ftime], [break])
1096 ]
1097)
cristy3ed852e2009-09-05 21:47:34 +00001098
1099########
1100#
1101# Check for function prototypes
1102#
1103########
1104
1105AC_CHECK_DECLS([pread, pwrite],[],[],[
1106#include <unistd.h>])
1107
1108AC_CHECK_DECLS([strlcpy],[],[],[
1109#include <strings.h>])
1110
1111AC_CHECK_DECLS([vsnprintf],[],[],[
1112#include <stdio.h>
1113#include <stdarg.h>])
1114
1115########
1116#
1117# C++ Support Tests (For Magick++)
1118#
1119########
1120have_magick_plus_plus='no'
1121if test "$with_magick_plus_plus" = 'yes'; then
1122 OLIBS="$LIBS"
1123 LIBS=''
Cristyc1bfec22020-10-04 15:40:32 +00001124 AC_LANG_PUSH([C++])
cristy3ed852e2009-09-05 21:47:34 +00001125
1126 # Full set of headers used...
1127 # algorithm cctype cerrno cmath cstdio cstdlib cstring ctime exception
1128 # functional iomanip iosfwd iostream iterator list string strstream utility
1129 AC_LANG([C++])
1130 AC_PROG_CXX
cristy964cb7f2010-04-25 23:18:00 +00001131 AX_CXX_BOOL
1132 AX_CXX_NAMESPACES
1133 AX_CXX_NAMESPACE_STD
cristy3ed852e2009-09-05 21:47:34 +00001134 AC_CXX_HAVE_STD_LIBS
cristy3ed852e2009-09-05 21:47:34 +00001135 AC_OPENMP([C++])
1136 AC_LANG_POP
1137
1138 AC_MSG_CHECKING([whether C++ compiler is sufficient for Magick++])
1139 if \
cristy964cb7f2010-04-25 23:18:00 +00001140 test $ax_cv_cxx_bool = 'yes' && \
cristy964cb7f2010-04-25 23:18:00 +00001141 test $ax_cv_cxx_namespaces = 'yes' && \
cristy3ed852e2009-09-05 21:47:34 +00001142 test $ac_cv_cxx_have_std_libs = 'yes' && \
cristy964cb7f2010-04-25 23:18:00 +00001143 test $ax_cv_cxx_have_std_namespace = 'yes'; then
cristy3ed852e2009-09-05 21:47:34 +00001144 have_magick_plus_plus='yes'
1145 else
1146 have_magick_plus_plus='no (failed tests)'
1147 fi
cristyad38abe2012-12-23 23:03:21 +00001148 AC_MSG_RESULT([$have_magick_plus_plus])
cristy3ed852e2009-09-05 21:47:34 +00001149 LIBS="$OLIBS"
1150fi
Elliott Hughes5d41fba2021-04-12 16:36:42 -07001151AM_CONDITIONAL([WITH_MAGICK_PLUS_PLUS],[test "$have_magick_plus_plus" = 'yes'])
cristy3ed852e2009-09-05 21:47:34 +00001152
1153# Only check for delegate libraries in subdirectories if requested.
1154if test "$enable_delegate_build" != 'no'; then
1155 # Check for delegate sub-directories and add -I & -L options as required.
1156 # This presumes that delegates are installed as detailed in the ImageMagick
1157 # README. If delegates are installed in a standard location where the
1158 # compiler will automatically find them then these options should not be
1159 # required.
1160
1161 #
1162 # Most delegates have includes in the same directory as the library, but not all...
1163 #
1164 # Includes
Cristyb7c02fa2020-08-09 17:20:25 -04001165 for dir in bzlib fftw fpx gslib/src jp2 jbig/libjbig jpeg lcms/include lzma magick openjp2/include png tiff/libtiff ttf/include wand webp/src wmf/include xml/include zlib zip; do
cristy3ed852e2009-09-05 21:47:34 +00001166 if test -d "$builddir/$dir"; then
1167 CPPFLAGS="$CPPFLAGS -I$builddir/$dir"
1168 else
1169 if test -d "$srcdirfull/$dir"; then
1170 CPPFLAGS="$CPPFLAGS -I$srcdirfull/$dir"
1171 fi
1172 fi
1173 done
1174
1175 # Libraries
Cristyb7c02fa2020-08-09 17:20:25 -04001176 for dir in bzlib fftw fpx gslib/src jbig/libjbig jpeg lcms/src lzma magick openjp2 png tiff/libtiff ttf/objs wand webp wmf/src xml zlib zip; do
cristy3ed852e2009-09-05 21:47:34 +00001177 if test -d "$builddir/$dir/.libs"; then
1178 LDFLAGS="$LDFLAGS -L$builddir/$dir/.libs"
1179 else
1180 if test -d "$srcdirfull/$dir/.libs"; then
1181 LDFLAGS="$LDFLAGS -L$srcdirfull/$dir/.libs"
1182 fi
1183 fi
1184 if test -d "$builddir/$dir"; then
1185 LDFLAGS="$LDFLAGS -L$builddir/$dir"
1186 else
1187 if test -d "$srcdirfull/$dir"; then
1188 LDFLAGS="$LDFLAGS -L$srcdirfull/$dir"
1189 fi
1190 fi
1191 done
1192fi
1193
1194# Assume that delegate headers reside under same directory as ImageMagick
1195# installation prefix.
cristybdabdd62013-03-04 17:43:36 +00001196MAGICK_CPPFLAGS="-I$INCLUDE_DIR/${PACKAGE_NAME}-$MAGICK_MAJOR_VERSION $MAGICK_CPPFLAGS"
cristy3ed852e2009-09-05 21:47:34 +00001197
1198#
1199# Find the X11 RGB database
1200#
Cristyc1bfec22020-10-04 15:40:32 +00001201AC_CACHE_CHECK([for X11 configure files],[im_cv_x_configure],
cristy3ed852e2009-09-05 21:47:34 +00001202[# Look for the header file in a standard set of common directories.
1203# Check X11 before X11Rn because it is often a symlink to the current release.
1204 for ac_dir in \
1205 /lib/usr/lib/X11 \
1206 /usr/X11/lib \
1207 /usr/X11R4/lib \
1208 /usr/X11R5/lib \
1209 /usr/X11R6/lib \
1210 /usr/X11R7/lib \
1211 /usr/X386/lib \
1212 /usr/XFree86/lib/X11 \
1213 /usr/athena/lib \
1214 /usr/lib \
1215 /usr/lib/X11 \
1216 /usr/lib/X11R4 \
1217 /usr/lib/X11R5 \
1218 /usr/lib/X11R6 \
1219 /usr/lib/X11R7 \
1220 /usr/local/X11/lib \
1221 /usr/local/X11R4/lib \
1222 /usr/local/X11R5/lib \
1223 /usr/local/X11R6/lib \
1224 /usr/local/lib \
1225 /usr/local/lib/X11 \
1226 /usr/local/lib/X11R4 \
1227 /usr/local/lib/X11R5 \
1228 /usr/local/lib/X11R6 \
1229 /usr/local/lib/X11R7 \
1230 /usr/local/x11r5/lib \
1231 /usr/lpp/Xamples/lib \
1232 /usr/openwin/lib \
1233 /usr/openwin/share/lib \
1234 /usr/unsupported/lib \
1235 /usr/x386/lib \
1236 ; do
1237 if test -f "$ac_dir/X11/rgb.txt"; then
1238 im_cv_x_configure="$ac_dir/X11/"
1239 break
1240 elif test -f "$ac_dir/rgb.txt"; then
1241 im_cv_x_configure="$ac_dir/"
1242 break
1243 fi
1244
1245 done])
1246X11_CONFIGURE_PATH="$im_cv_x_configure"
1247case "${build_os}" in
1248 mingw* )
1249 X11ConfigurePath=`$WinPathScript "$X11ConfigurePath=" 1`
1250 ;;
1251esac
Cristyc1bfec22020-10-04 15:40:32 +00001252AC_DEFINE_UNQUOTED([X11_CONFIGURE_PATH],["$X11ConfigurePath"],[Location of X11 configure files])
cristy3ed852e2009-09-05 21:47:34 +00001253
1254#
1255# Find OpenMP library
1256#
1257GOMP_LIBS=''
1258if test "$enable_openmp" != 'no'; then
1259 if test "${GCC}" = "yes"; then
cristy18307f12011-12-30 01:20:16 +00001260 # Open64 (passes for GCC but uses different OpenMP implementation)
1261 if test "x$GOMP_LIBS" = x ; then
1262 if $CC --version 2>&1 | grep Open64 > /dev/null ; then
Cristyc1bfec22020-10-04 15:40:32 +00001263 AC_CHECK_LIB([openmp],[omp_get_num_procs],[GOMP_LIBS="-lopenmp"],[],[])
cristy18307f12011-12-30 01:20:16 +00001264 fi
1265 fi
Cristy530d3d72016-08-07 08:42:26 -04001266 # Clang (passes for GCC but uses different OpenMP implementation)
1267 if test "x$LIB_OMP" = x ; then
1268 if $CC --version 2>&1 | grep clang > /dev/null ; then
Cristyc1bfec22020-10-04 15:40:32 +00001269 AC_CHECK_LIB([omp],[GOMP_parallel_start],[LIB_OMP="-lomp"],[],[])
Cristy530d3d72016-08-07 08:42:26 -04001270 fi
1271 fi
cristy18307f12011-12-30 01:20:16 +00001272 # GCC
1273 if test "x$GOMP_LIBS" = x ; then
Cristyc1bfec22020-10-04 15:40:32 +00001274 AC_CHECK_LIB([gomp],[GOMP_parallel_start],[GOMP_LIBS="-lgomp"],[],[])
cristy18307f12011-12-30 01:20:16 +00001275 fi
cristy3ed852e2009-09-05 21:47:34 +00001276 else
cristy18307f12011-12-30 01:20:16 +00001277 # Sun CC
1278 if test "x$GOMP_LIBS" = x ; then
Cristyc1bfec22020-10-04 15:40:32 +00001279 AC_CHECK_LIB([mtsk],[sunw_mp_register_warn],[GOMP_LIBS="-lmtsk"],[],[])
cristy18307f12011-12-30 01:20:16 +00001280 fi
1281 # AIX xlc
1282 if test "x$GOMP_LIBS" = x ; then
Cristyc1bfec22020-10-04 15:40:32 +00001283 AC_CHECK_LIB([xlsmp],[_xlsmpFlush],[GOMP_LIBS="-lxlsmp"],[],[])
cristy18307f12011-12-30 01:20:16 +00001284 fi
1285 # SGI IRIX 6.5 MIPSpro C/C++
1286 if test "x$GOMP_LIBS" = x ; then
Cristyc1bfec22020-10-04 15:40:32 +00001287 AC_CHECK_LIB([mp],[mp_destroy],[GOMP_LIBS="-lmp"],[],[])
cristy18307f12011-12-30 01:20:16 +00001288 fi
cristy3ed852e2009-09-05 21:47:34 +00001289 fi
1290 LIBS="$GOMP_LIBS $LIBS"
1291fi
Cristyc1bfec22020-10-04 15:40:32 +00001292AC_SUBST([GOMP_LIBS])
cristy3ed852e2009-09-05 21:47:34 +00001293
cristy12ac8192014-11-04 13:59:13 +00001294#
cristy3b0097d2014-11-04 15:34:47 +00001295# Check for jemalloc.
cristy12ac8192014-11-04 13:59:13 +00001296#
cristy3b0097d2014-11-04 15:34:47 +00001297have_jemalloc='no'
1298JEMALLOC_LIBS=''
1299if test "$with_jemalloc" != 'no'; then
Cristyc1bfec22020-10-04 15:40:32 +00001300 AC_MSG_CHECKING([for JEMALLOC support])
1301 AC_MSG_RESULT([])
cristy3b0097d2014-11-04 15:34:47 +00001302 failed=0
1303 passed=0
cristy22007ae2014-11-04 15:59:22 +00001304 AC_CHECK_HEADER([jemalloc/jemalloc.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
Cristyc1bfec22020-10-04 15:40:32 +00001305 AC_CHECK_LIB([jemalloc],[malloc_stats_print],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[])
1306 AC_MSG_CHECKING([if jemalloc memory allocation library is complete])
cristy3b0097d2014-11-04 15:34:47 +00001307 if test $passed -gt 0; then
1308 if test $failed -gt 0; then
Cristyc1bfec22020-10-04 15:40:32 +00001309 AC_MSG_RESULT([no -- some components failed test])
cristy3b0097d2014-11-04 15:34:47 +00001310 have_jemalloc='no (failed tests)'
1311 else
1312 JEMALLOC_LIBS='-ljemalloc'
1313 LIBS="$JEMALLOC_LIBS $LIBS"
Cristycf715c72020-12-30 07:48:03 -05001314 AC_DEFINE([HAVE_JEMALLOC],[1],[Define if you have jemalloc memory allocation library])
Cristyc1bfec22020-10-04 15:40:32 +00001315 AC_MSG_RESULT([yes])
cristy3b0097d2014-11-04 15:34:47 +00001316 have_jemalloc='yes'
1317 fi
1318 else
Cristyc1bfec22020-10-04 15:40:32 +00001319 AC_MSG_RESULT([no])
cristy3b0097d2014-11-04 15:34:47 +00001320 fi
1321fi
Elliott Hughes5d41fba2021-04-12 16:36:42 -07001322AM_CONDITIONAL([HAVE_JEMALLOC],[test "$have_jemalloc" = 'yes'])
Cristyc1bfec22020-10-04 15:40:32 +00001323AC_SUBST([JEMALLOC_LIBS])
cristy3ed852e2009-09-05 21:47:34 +00001324
1325#
Cristy001b1da2019-09-11 08:38:23 -04001326# Check for TCMalloc library
1327#
1328have_tcmalloc='no'
1329TCMALLOC_LIBS=''
1330OLIBS="$LIBS"
1331if test "$have_threads" = 'yes' -a "$with_tcmalloc" != 'no'; then
Elliott Hughes5d41fba2021-04-12 16:36:42 -07001332 AC_MSG_CHECKING([tcmalloc library support])
Cristy001b1da2019-09-11 08:38:23 -04001333 AC_MSG_RESULT([])
1334 failed=0
1335 passed=0
1336
1337 AC_CHECK_LIB([tcmalloc_minimal],[mallinfo],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[])
1338
1339 if test $passed -gt 0; then
1340 if test $failed -gt 0; then
1341 have_tcmalloc='no (some components failed test)'
1342 else
1343 TCMALLOC_LIBS=-ltcmalloc_minimal
1344 LIBS="$TCMALLOC_LIBS $LIBS"
1345 CFLAGS="$CFLAGS -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free"
1346 AC_DEFINE([HAVE_TCMALLOC],[1],[Define if you have the tcmalloc memory allocation library])
1347 have_tcmalloc='yes'
1348 fi
1349 fi
Elliott Hughes5d41fba2021-04-12 16:36:42 -07001350 AC_MSG_CHECKING([if tcmalloc memory allocation library is complete])
Cristy001b1da2019-09-11 08:38:23 -04001351 AC_MSG_RESULT([$have_tcmalloc])
1352fi
Cristyc1bfec22020-10-04 15:40:32 +00001353AM_CONDITIONAL([HAVE_TCMALLOC],[test "$have_tcmalloc" = 'yes'])
Cristy001b1da2019-09-11 08:38:23 -04001354AC_SUBST([TCMALLOC_LIBS])
1355
1356#
cristy3ed852e2009-09-05 21:47:34 +00001357# Check for umem.
1358#
1359have_umem='no'
1360UMEM_LIBS=''
1361if test "$with_umem" != 'no'; then
Cristyc1bfec22020-10-04 15:40:32 +00001362 AC_MSG_CHECKING([for UMEM support])
1363 AC_MSG_RESULT([])
cristy3ed852e2009-09-05 21:47:34 +00001364 failed=0
1365 passed=0
Cristyc1bfec22020-10-04 15:40:32 +00001366 AC_CHECK_HEADER([umem.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
1367 AC_CHECK_LIB([umem],[umem_alloc],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[])
1368
1369 AC_CHECK_LIB([umem],[umem_free],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[])
1370
1371 AC_MSG_CHECKING([if umem memory allocation library is complete])
cristy3ed852e2009-09-05 21:47:34 +00001372 if test $passed -gt 0; then
1373 if test $failed -gt 0; then
Cristyc1bfec22020-10-04 15:40:32 +00001374 AC_MSG_RESULT([no -- some components failed test])
cristy3ed852e2009-09-05 21:47:34 +00001375 have_umem='no (failed tests)'
1376 else
1377 UMEM_LIBS='-lumem'
1378 LIBS="$UMEM_LIBS $LIBS"
Cristyc1bfec22020-10-04 15:40:32 +00001379 AC_DEFINE([HAVE_UMEM],[1],[Define if you have umem memory allocation library])
1380 AC_MSG_RESULT([yes])
cristy3ed852e2009-09-05 21:47:34 +00001381 have_umem='yes'
1382 fi
1383 else
Cristyc1bfec22020-10-04 15:40:32 +00001384 AC_MSG_RESULT([no])
cristy3ed852e2009-09-05 21:47:34 +00001385 fi
1386fi
Elliott Hughes5d41fba2021-04-12 16:36:42 -07001387AM_CONDITIONAL([HAVE_UMEM],[test "$have_umem" = 'yes'])
Cristyc1bfec22020-10-04 15:40:32 +00001388AC_SUBST([UMEM_LIBS])
cristy3ed852e2009-09-05 21:47:34 +00001389
1390#
1391# Add support for ccmalloc memory debugging library if requested
1392#
1393have_ccmalloc='no'
1394CCMALLOC_LIBS=''
1395if test "$enable_ccmalloc" = 'yes'; then
Cristyc1bfec22020-10-04 15:40:32 +00001396 AC_PATH_PROG([CCMALLOCDelegate],[ccmalloc],[])
cristy3ed852e2009-09-05 21:47:34 +00001397 if test -n "$CCMALLOCDelegate"; then
1398 eval `grep PREFIX= $CCMALLOCDelegate | sed -e 's/PREFIX/CCMALLOC_PREFIX/'`
1399 OLIBS="$LIBS"
1400 # Assume that gcc is used with ccmalloc.
1401 LIBS="$LIBS $CCMALLOC_PREFIX/lib/ccmalloc-gcc.o"
Cristyc1bfec22020-10-04 15:40:32 +00001402 AC_CHECK_LIB([ccmalloc],[ccmalloc_malloc],[CCMALLOC_LIBS="$CCMALLOC_PREFIX/lib/ccmalloc-gcc.o -lccmalloc -ldl"],[,-ldl])
cristy3ed852e2009-09-05 21:47:34 +00001403 if test -n "$CCMALLOC_LIBS"; then
1404 LIBS="$OLIBS"
1405 LIBS="$LIBS $CCMALLOC_LIBS"
1406 have_ccmalloc='yes'
1407 else
1408 LIBS="$OLIBS"
1409 fi
1410 fi
1411fi
1412
1413#
cristy944e51f2013-04-16 18:45:02 +00001414# Add support for 'huge pages' if requested
1415#
1416AS_IF([test "x$enable_hugepages" != "xno"],[
Cristyc1bfec22020-10-04 15:40:32 +00001417 AC_DEFINE([HAVE_HUGEPAGES],[ 1],[ [Compile with hugepage support]])
cristy944e51f2013-04-16 18:45:02 +00001418])
1419
1420#
cristy3ed852e2009-09-05 21:47:34 +00001421# Add support for efence memory debugging library if requested
1422#
1423if test "$enable_efence" = 'yes'; then
1424 EFENCE_LIBS='-lefence'
1425 LIBS="$EFENCE_LIBS $LIBS"
1426fi
1427
cristy3ed852e2009-09-05 21:47:34 +00001428dnl ===========================================================================
1429
1430#
1431# Check for BZLIB
1432#
1433
1434AC_ARG_WITH([bzlib],
1435 [AC_HELP_STRING([--without-bzlib],
1436 [disable BZLIB support])],
1437 [with_bzlib=$withval],
1438 [with_bzlib='yes'])
1439
1440if test "$with_bzlib" != 'yes'; then
1441 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-bzlib=$with_bzlib "
1442fi
1443
1444have_bzlib='no'
1445if test "$with_bzlib" != 'no'; then
1446 BZLIB_LIBS=''
cristyad38abe2012-12-23 23:03:21 +00001447 AC_MSG_RESULT([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00001448 AC_MSG_CHECKING([for BZLIB])
cristyad38abe2012-12-23 23:03:21 +00001449 AC_MSG_RESULT([])
cristy3ed852e2009-09-05 21:47:34 +00001450 failed=0
1451 passed=0
1452 found_libbz=0
Cristyc1bfec22020-10-04 15:40:32 +00001453 AC_CHECK_HEADER([bzlib.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
1454 AC_CHECK_LIB([bz2],[BZ2_bzDecompress],[found_libbz=`expr $found_libbz + 1`],[],[])
cristy3ed852e2009-09-05 21:47:34 +00001455 if test "$native_win32_build" = 'yes'; then
Cristyc1bfec22020-10-04 15:40:32 +00001456 AC_CHECK_LIB([bz2],[_imp__BZ2_decompress],[found_libbz=`expr $found_libbz + 1`],[],[])
cristy3ed852e2009-09-05 21:47:34 +00001457 fi
1458 if test $found_libbz -gt 0; then
1459 passed=`expr $passed + 1`
1460 else
1461 failed=`expr $failed + 1`
1462 fi
Cristyc1bfec22020-10-04 15:40:32 +00001463 AC_MSG_CHECKING([if BZLIB package is complete])
cristy3ed852e2009-09-05 21:47:34 +00001464 if test $passed -gt 0; then
1465 if test $failed -gt 0; then
Cristyc1bfec22020-10-04 15:40:32 +00001466 AC_MSG_RESULT([no -- some components failed test])
cristy3ed852e2009-09-05 21:47:34 +00001467 have_bzlib='no (failed tests)'
1468 else
1469 BZLIB_LIBS='-lbz2'
1470 LIBS="$BZLIB_LIBS $LIBS"
Cristyc1bfec22020-10-04 15:40:32 +00001471 AC_DEFINE([BZLIB_DELEGATE],[1],[Define if you have the bzip2 library])
1472 AC_MSG_RESULT([yes])
cristy3ed852e2009-09-05 21:47:34 +00001473 have_bzlib='yes'
1474 fi
1475 else
Cristyc1bfec22020-10-04 15:40:32 +00001476 AC_MSG_RESULT([no])
cristy3ed852e2009-09-05 21:47:34 +00001477 fi
1478fi
Elliott Hughes5d41fba2021-04-12 16:36:42 -07001479AM_CONDITIONAL([BZLIB_DELEGATE],[test "$have_bzlib" = 'yes'])
Cristyc1bfec22020-10-04 15:40:32 +00001480AC_SUBST([BZLIB_LIBS])
cristy3ed852e2009-09-05 21:47:34 +00001481
1482#
1483# Find the X11 include and library directories.
1484#
1485IPC_LIBS=''
1486X11_LIBS=''
1487XEXT_LIBS=''
1488XT_LIBS=''
1489AC_PATH_XTRA
1490if test "$no_x" != 'yes'; then
cristyad38abe2012-12-23 23:03:21 +00001491 AC_MSG_RESULT([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00001492 AC_MSG_CHECKING([for X11])
cristyad38abe2012-12-23 23:03:21 +00001493 AC_MSG_RESULT([])
cristy3ed852e2009-09-05 21:47:34 +00001494 LDFLAGS="$LDFLAGS $X_LIBS"
1495 X11_LIBS="$X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
1496 LIBS="$X11_LIBS $LIBS"
1497 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1498
Cristyc1bfec22020-10-04 15:40:32 +00001499 AC_DEFINE([X11_DELEGATE],[1],[Define if you have X11 library])dnl
cristy3ed852e2009-09-05 21:47:34 +00001500
1501 #
1502 # Check for X11 shared memory extension
1503 #
1504 # shmctl is required to support the shared memory extension
1505 AC_CHECK_FUNC([shmctl],[have_shmctl='yes'],[])
1506 if test "$have_shmctl" != 'yes'; then
1507 PERSIST_LIBS=$LIBS
1508 LIBS="$LIBS -lcygipc"
1509 AC_TRY_LINK_FUNC([shmctl],[have_shmctl='yes'; IPC_LIBS='-lcygipc'],[])
1510 LIBS=$PERSIST_LIBS
1511 fi
1512
1513 if test "$have_shmctl" = 'yes'; then
1514 AC_CHECK_LIB([Xext],[XShmAttach],[XEXT_LIBS='-lXext' ; AC_DEFINE(HAVE_SHARED_MEMORY,1,X11 server supports shared memory extension)],[],[])
1515 fi
1516
1517 #
1518 # Check for X11 shape extension
1519 #
1520 AC_CHECK_LIB([Xext],[XShapeCombineMask],[XEXT_LIBS='-lXext' ; AC_DEFINE(HAVE_SHAPE,1,X11 server supports shape extension)],[],[])
Cristyc1bfec22020-10-04 15:40:32 +00001521 AC_CHECK_LIB([Xt],[XtSetEventDispatcher],[XT_LIBS='-lXt'],[],[])
cristy3ed852e2009-09-05 21:47:34 +00001522 LIBS="$XEXT_LIBS $XT_LIBS $LIBS"
1523fi
1524if test "$no_x" != 'yes'; then
1525 have_x='yes'
1526else
1527 have_x='no'
1528fi
Elliott Hughes5d41fba2021-04-12 16:36:42 -07001529AM_CONDITIONAL([X11_DELEGATE],[test "$have_x" = 'yes'])
Cristyc1bfec22020-10-04 15:40:32 +00001530AC_SUBST([X11_LIBS])
1531AC_SUBST([XEXT_LIBS])
cristy3ed852e2009-09-05 21:47:34 +00001532
1533dnl ===========================================================================
1534
1535#
Elliott Hughes5d41fba2021-04-12 16:36:42 -07001536# Check for ZIP
Cristyb7c02fa2020-08-09 17:20:25 -04001537#
Elliott Hughes5d41fba2021-04-12 16:36:42 -07001538AC_ARG_WITH([zip],
1539 [AC_HELP_STRING([--without-zip],
1540 [disable ZIP support])],
1541 [with_zip=$withval],
1542 [with_zip='yes'])
Cristyb7c02fa2020-08-09 17:20:25 -04001543
Elliott Hughes5d41fba2021-04-12 16:36:42 -07001544if test "$with_zip" != 'yes'; then
1545 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-zip=$with_zip "
Cristyb7c02fa2020-08-09 17:20:25 -04001546fi
1547
Elliott Hughes5d41fba2021-04-12 16:36:42 -07001548have_zip='no'
1549ZIP_CFLAGS=""
1550ZIP_LIBS=""
1551ZIP_PKG=""
1552if test "x$with_zip" = "xyes"; then
Cristyb7c02fa2020-08-09 17:20:25 -04001553 AC_MSG_RESULT([-------------------------------------------------------------])
Elliott Hughes5d41fba2021-04-12 16:36:42 -07001554 PKG_CHECK_MODULES([ZIP],[libzip >= 1.0.0],[have_zip=yes],[have_zip=no])
Cristyb7c02fa2020-08-09 17:20:25 -04001555 AC_MSG_RESULT([])
1556fi
1557
Elliott Hughes5d41fba2021-04-12 16:36:42 -07001558if test "$have_zip" = 'yes'; then
1559 AC_DEFINE([ZIP_DELEGATE],[1],[Define if you have ZIP library])
1560 CFLAGS="$ZIP_CFLAGS $CFLAGS"
1561 LIBS="$ZIP_LIBS $LIBS"
Cristyb7c02fa2020-08-09 17:20:25 -04001562fi
1563
Elliott Hughes5d41fba2021-04-12 16:36:42 -07001564AM_CONDITIONAL([ZIP_DELEGATE],[test "$have_zip" = 'yes'])
1565AC_SUBST([ZIP_CFLAGS])
1566AC_SUBST([ZIP_LIBS])
Cristyb7c02fa2020-08-09 17:20:25 -04001567
1568dnl ===========================================================================
1569
1570#
cristy3ed852e2009-09-05 21:47:34 +00001571# Check for ZLIB
1572#
1573AC_ARG_WITH([zlib],
1574 [AC_HELP_STRING([--without-zlib],
1575 [disable ZLIB support])],
1576 [with_zlib=$withval],
1577 [with_zlib='yes'])
1578
1579if test "$with_zlib" != 'yes'; then
1580 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-zlib=$with_zlib "
1581fi
1582
1583have_zlib='no'
cristy32f75d42015-06-05 18:46:23 +00001584ZLIB_CFLAGS=""
1585ZLIB_LIBS=""
1586ZLIB_PKG=""
1587if test "x$with_zlib" = "xyes"; then
1588 AC_MSG_RESULT([-------------------------------------------------------------])
Cristyc1bfec22020-10-04 15:40:32 +00001589 PKG_CHECK_MODULES([ZLIB],[zlib >= 1.0.0],[have_zlib=yes],[have_zlib=no])
cristy32f75d42015-06-05 18:46:23 +00001590 AC_MSG_RESULT([])
cristy3ed852e2009-09-05 21:47:34 +00001591fi
cristy32f75d42015-06-05 18:46:23 +00001592
1593if test "$have_zlib" = 'yes'; then
Cristyc1bfec22020-10-04 15:40:32 +00001594 AC_DEFINE([ZLIB_DELEGATE],[1],[Define if you have ZLIB library])
cristy32f75d42015-06-05 18:46:23 +00001595 CFLAGS="$ZLIB_CFLAGS $CFLAGS"
Cristyb94e76e2017-06-22 19:18:20 -04001596 LIBS="$ZLIB_LIBS $LIBS"
cristy32f75d42015-06-05 18:46:23 +00001597fi
1598
Elliott Hughes5d41fba2021-04-12 16:36:42 -07001599AM_CONDITIONAL([ZLIB_DELEGATE],[test "$have_zlib" = 'yes'])
Cristyc1bfec22020-10-04 15:40:32 +00001600AC_SUBST([ZLIB_CFLAGS])
1601AC_SUBST([ZLIB_LIBS])
cristy3ed852e2009-09-05 21:47:34 +00001602
cristy32f75d42015-06-05 18:46:23 +00001603dnl ===========================================================================
1604
Cristy08170e62018-10-14 10:33:46 -04001605#
1606# Check for ZSTD
1607#
1608AC_ARG_WITH([zstd],
1609 [AC_HELP_STRING([--without-zstd],
1610 [disable ZSTD support])],
1611 [with_zstd=$withval],
1612 [with_zstd='yes'])
1613
1614if test "$with_zstd" != 'yes'; then
1615 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-zstd=$with_zstd "
1616fi
1617
1618have_zstd='no'
1619ZSTD_CFLAGS=""
1620ZSTD_LIBS=""
1621ZSTD_PKG=""
1622if test "x$with_zstd" = "xyes"; then
1623 AC_MSG_RESULT([-------------------------------------------------------------])
Cristyc1bfec22020-10-04 15:40:32 +00001624 PKG_CHECK_MODULES([LIBZSTD],[libzstd >= 1.0.0],[have_zstd=yes],[have_zstd=no])
Cristy08170e62018-10-14 10:33:46 -04001625 AC_MSG_RESULT([])
1626fi
1627
1628if test "$have_zstd" = 'yes'; then
Cristyc1bfec22020-10-04 15:40:32 +00001629 AC_DEFINE([ZSTD_DELEGATE],[1],[Define if you have ZSTD library])
Cristy08170e62018-10-14 10:33:46 -04001630 CFLAGS="$ZSTD_CFLAGS $CFLAGS"
1631 LIBS="$ZSTD_LIBS $LIBS"
1632fi
1633
Elliott Hughes5d41fba2021-04-12 16:36:42 -07001634AM_CONDITIONAL([ZSTD_DELEGATE],[test "$have_zstd" = 'yes'])
Cristyc1bfec22020-10-04 15:40:32 +00001635AC_SUBST([ZSTD_CFLAGS])
1636AC_SUBST([ZSTD_LIBS])
Cristy08170e62018-10-14 10:33:46 -04001637
1638dnl ===========================================================================
1639
cristy5eef09f2012-10-16 12:08:28 +00001640# whether modules are built or not.
Dirk Lemstraeacaed72020-09-19 12:27:35 +02001641if test "$build_modules" != 'no' || test "X$no_cl" != 'Xyes'; then
1642 with_ltdl='yes'
1643else
1644 with_ltdl='no'
1645fi
cristy5eef09f2012-10-16 12:08:28 +00001646have_ltdl='no'
1647LTDL_LIBS=''
Dirk Lemstraeacaed72020-09-19 12:27:35 +02001648if test "$with_ltdl" = 'yes'; then
cristyad38abe2012-12-23 23:03:21 +00001649 AC_MSG_RESULT([-------------------------------------------------------------])
cristy5eef09f2012-10-16 12:08:28 +00001650 AC_MSG_CHECKING([for libltdl])
cristyad38abe2012-12-23 23:03:21 +00001651 AC_MSG_RESULT([])
cristy5eef09f2012-10-16 12:08:28 +00001652 failed=0
1653 passed=0
cristyaf4cbf32012-10-16 23:47:41 +00001654 AC_CHECK_HEADER([ltdl.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
Cristyc1bfec22020-10-04 15:40:32 +00001655 AC_CHECK_LIB([ltdl],[lt_dlinit],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[])
cristyaf4cbf32012-10-16 23:47:41 +00001656 AC_MSG_CHECKING([if libltdl package is complete])
cristy5eef09f2012-10-16 12:08:28 +00001657 if test $passed -gt 0 ; then
1658 if test $failed -gt 0 ; then
cristyaf4cbf32012-10-16 23:47:41 +00001659 AC_MSG_RESULT([no -- some components failed test])
cristy5eef09f2012-10-16 12:08:28 +00001660 have_ltdl='no (failed tests)'
1661 else
1662 LTDL_LIBS='-lltdl'
1663 LIBS="$LTDL_LIBS $LIBS"
Cristy93b90482020-10-05 14:57:52 +00001664 AC_DEFINE([LTDL_DELEGATE],[1],[Define if using libltdl to support dynamically loadable modules and OpenCL])
David Seifert21ed292a2017-12-16 19:01:03 +01001665 AC_DEFINE_UNQUOTED([LTDL_MODULE_EXT],["${shrext_cmds}"],[Native module suffix])
cristyaf4cbf32012-10-16 23:47:41 +00001666 AC_MSG_RESULT([yes])
cristy5eef09f2012-10-16 12:08:28 +00001667 have_ltdl='yes'
1668 fi
1669 else
cristyaf4cbf32012-10-16 23:47:41 +00001670 AC_MSG_RESULT([no])
1671 fi
1672 if test "$have_ltdl" != 'yes' ; then
Cristy89e83492017-11-12 08:09:05 -05001673 AC_MSG_FAILURE([libltdl is required for modules and OpenCL builds],[1])
cristy5eef09f2012-10-16 12:08:28 +00001674 fi
1675fi
Elliott Hughes5d41fba2021-04-12 16:36:42 -07001676AM_CONDITIONAL([WITH_LTDL],[test "$have_ltdl" != 'no'])
cristy5eef09f2012-10-16 12:08:28 +00001677
cristy3ed852e2009-09-05 21:47:34 +00001678#
1679# If profiling, then check for -ldl and dlopen (required for Solaris & gcc)
1680#
1681LIB_DL=''
1682if test "$enable_profiling" = 'yes'; then
Cristyc1bfec22020-10-04 15:40:32 +00001683 AC_CHECK_LIB([dl],[dlopen],[LIB_DL='-ldl'],[],[])
cristy3ed852e2009-09-05 21:47:34 +00001684 LIBS="$LIB_DL $LIBS"
1685fi
Cristyc1bfec22020-10-04 15:40:32 +00001686AC_SUBST([LIB_DL])
cristy3ed852e2009-09-05 21:47:34 +00001687
1688dnl ===========================================================================
1689
1690#
cristy5a3dc992014-12-05 19:50:04 +00001691# Set Apple font directory.
1692#
1693AC_ARG_WITH([apple-font-dir],
1694 [AC_HELP_STRING([--with-apple-font-dir=DIR],
1695 [Apple font directory])],
1696 [with_apple_font_dir=$withval],
1697 [with_apple_font_dir='default'])
1698
1699if test "$with_apple_font_dir" != 'default'; then
1700 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-apple-font-dir=$with_apple_font_dir "
1701fi
1702
1703dnl ===========================================================================
1704
1705#
cristy3ed852e2009-09-05 21:47:34 +00001706# Check for Autotrace delegate library.
1707#
1708AC_ARG_WITH([autotrace],
1709 [AC_HELP_STRING([--with-autotrace],
1710 [enable autotrace support])],
1711 [with_autotrace=$withval],
1712 [with_autotrace='no'])
1713
1714if test "$with_autotrace" != 'yes'; then
1715 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-autotrace=$with_autotrace "
1716fi
1717
1718have_autotrace='no'
1719AUTOTRACE_CFLAGS=""
1720AUTOTRACE_LIBS=""
1721AUTOTRACE_PKG=""
1722if test "x$with_autotrace" = "xyes"; then
cristy32f75d42015-06-05 18:46:23 +00001723 AC_MSG_RESULT([-------------------------------------------------------------])
Cristyc1bfec22020-10-04 15:40:32 +00001724 PKG_CHECK_MODULES([AUTOTRACE],[autotrace >= 0.31.2],[have_autotrace=yes],[have_autotrace=no])
cristy32f75d42015-06-05 18:46:23 +00001725 AC_MSG_RESULT([])
cristy3ed852e2009-09-05 21:47:34 +00001726fi
1727
1728if test "$have_autotrace" = 'yes'; then
Cristyc1bfec22020-10-04 15:40:32 +00001729 AC_DEFINE([AUTOTRACE_DELEGATE],[1],[Define if you have AUTOTRACE library])
cristy32f75d42015-06-05 18:46:23 +00001730 CFLAGS="$AUTOTRACE_CFLAGS $CFLAGS"
cristy3ed852e2009-09-05 21:47:34 +00001731fi
1732
Cristyc1bfec22020-10-04 15:40:32 +00001733AM_CONDITIONAL([AUTOTRACE_DELEGATE],[test "$have_autotrace" = 'yes'])
1734AC_SUBST([AUTOTRACE_CFLAGS])
1735AC_SUBST([AUTOTRACE_LIBS])
cristy3ed852e2009-09-05 21:47:34 +00001736
1737dnl ===========================================================================
1738
1739#
1740# Check for Display Postscript delegate library.
1741#
1742AC_ARG_WITH([dps],
1743 [AC_HELP_STRING([--without-dps],
1744 [disable Display Postscript support])],
1745 [with_dps=$withval],
1746 [with_dps='yes'])
1747
1748if test "$with_dps" != 'yes'; then
1749 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-dps=$with_dps "
1750fi
1751
1752have_dps='no'
1753DPS_LIBS=''
1754if test "$with_dps" != 'no' && test "$with_x" != 'no'; then
cristyad38abe2012-12-23 23:03:21 +00001755 AC_MSG_RESULT([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00001756 AC_MSG_CHECKING([for DPS])
cristyad38abe2012-12-23 23:03:21 +00001757 AC_MSG_RESULT([])
cristy3ed852e2009-09-05 21:47:34 +00001758 failed=0
1759 passed=0
1760 PERSIST_CPPFLAGS="$CPPFLAGS"
1761 CPPFLAGS="$CPPFLAGS -I${ac_x_includes}/X11"
Cristyc1bfec22020-10-04 15:40:32 +00001762 AC_CHECK_HEADER([DPS/dpsXclient.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
cristy3ed852e2009-09-05 21:47:34 +00001763 # DPS issues:
1764 # XFree86-4.x needs -lXt to provide XtMalloc for -ldps.
1765 # Cygwin doesn't deliver -lXt as a DLL, which prevents a DLL build.
1766 # Adobe DPS (as delivered on Solaris) doesn't require -lXt.
1767 # ImageMagick itself doesn't use -lXt.
1768 have_libdps='no'
1769 LIBDPS_XT=''
Cristyc1bfec22020-10-04 15:40:32 +00001770 AC_CHECK_LIB([dps],[DPSInitialize],[have_libdps='yes'],[have_libdps='no',])
cristy3ed852e2009-09-05 21:47:34 +00001771 if test "$have_libdps" != 'yes'; then
1772 # Unset cache variable so we can try again.
1773 unset ac_cv_lib_dps_DPSInitialize
Cristyc1bfec22020-10-04 15:40:32 +00001774 AC_CHECK_LIB([dps],[DPSInitialize],[have_libdps='yes'],[have_libdps='no',-lXt])
cristy3ed852e2009-09-05 21:47:34 +00001775 if test "$have_libdps" = 'yes'; then
1776 LIBDPS_XT='-lXt'
1777 fi
1778 fi
1779 if test "$have_libdps" = 'yes'; then
1780 passed=`expr $passed + 1`
1781 else
1782 failed=`expr $failed + 1`
1783 fi
Cristyc1bfec22020-10-04 15:40:32 +00001784 AC_CHECK_LIB([dpstk],[XDPSPixelsPerPoint],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`,-ldps $LIBDPS_XT])
cristy3ed852e2009-09-05 21:47:34 +00001785 AC_MSG_CHECKING([if DPS package is complete])
1786 if test $passed -gt 0; then
1787 if test $failed -gt 0; then
cristyad38abe2012-12-23 23:03:21 +00001788 AC_MSG_RESULT([no -- some components failed test])
cristy3ed852e2009-09-05 21:47:34 +00001789 have_dps='no (failed tests)'
1790 CPPFLAGS="$PERSIST_CPPFLAGS"
1791 else
1792 DPS_LIBS="-ldpstk -ldps ${LIBDPS_XT}"
1793 LIBS="$DPS_LIBS $LIBS"
Cristyc1bfec22020-10-04 15:40:32 +00001794 AC_DEFINE([DPS_DELEGATE],[1],[Define if you have Display Postscript])
cristyad38abe2012-12-23 23:03:21 +00001795 AC_MSG_RESULT([yes])
cristy3ed852e2009-09-05 21:47:34 +00001796 have_dps='yes'
1797 fi
1798 else
cristyad38abe2012-12-23 23:03:21 +00001799 AC_MSG_RESULT([no])
cristy3ed852e2009-09-05 21:47:34 +00001800 CPPFLAGS=$PERSIST_CPPFLAGS
1801 fi
1802fi
Elliott Hughes5d41fba2021-04-12 16:36:42 -07001803AM_CONDITIONAL([DPS_DELEGATE],[test "$have_dps" = 'yes'])
Cristyc1bfec22020-10-04 15:40:32 +00001804AC_SUBST([DPS_LIBS])
cristy3ed852e2009-09-05 21:47:34 +00001805
1806dnl ===========================================================================
1807
1808#
cristy430a7312010-01-21 20:44:04 +00001809# Set DejaVu font directory.
1810#
1811AC_ARG_WITH([dejavu-font-dir],
1812 [AC_HELP_STRING([--with-dejavu-font-dir=DIR],
1813 [DejaVu font directory])],
1814 [with_dejavu_font_dir=$withval],
1815 [with_dejavu_font_dir='default'])
1816
1817if test "$with_dejavu_font_dir" != 'default'; then
1818 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-dejavu-font-dir=$with_dejavu_font_dir "
1819fi
1820
1821dnl ===========================================================================
1822
1823#
cristy3ed852e2009-09-05 21:47:34 +00001824# Check for FFTW delegate library.
1825#
cristy81beccd2011-10-03 18:17:24 +00001826AC_ARG_WITH([fftw],
Elliott Hughes5d41fba2021-04-12 16:36:42 -07001827 [AC_HELP_STRING([--with-fftw],
1828 [enable FFTW support])],
cristy3ed852e2009-09-05 21:47:34 +00001829 [with_fftw=$withval],
Elliott Hughes5d41fba2021-04-12 16:36:42 -07001830 [with_fftw='no'])
cristy3ed852e2009-09-05 21:47:34 +00001831
1832if test "$with_fftw" != 'yes'; then
1833 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fftw=$with_fftw "
1834fi
1835
cristy81beccd2011-10-03 18:17:24 +00001836have_fftw='no'
cristy32f75d42015-06-05 18:46:23 +00001837FFTW_CFLAGS=""
1838FFTW_LIBS=""
1839FFTW_PKG=""
1840if test "x$with_fftw" = "xyes"; then
1841 AC_MSG_RESULT([-------------------------------------------------------------])
Cristyc1bfec22020-10-04 15:40:32 +00001842 PKG_CHECK_MODULES([fftw3],[fftw3 >= 3.0.0],[have_fftw=yes],[have_fftw=no])
cristy32f75d42015-06-05 18:46:23 +00001843 AC_MSG_RESULT([])
cristy3ed852e2009-09-05 21:47:34 +00001844fi
cristy32f75d42015-06-05 18:46:23 +00001845
1846if test "$have_fftw" = 'yes'; then
Cristyc1bfec22020-10-04 15:40:32 +00001847 AC_DEFINE([FFTW_DELEGATE],[1],[Define if you have FFTW library])
cristyb74ab6e2015-06-06 12:39:54 +00001848 FFTW_CFLAGS="$fftw3_CFLAGS"
1849 FFTW_LIBS="$fftw3_LIBS"
cristy32f75d42015-06-05 18:46:23 +00001850 CFLAGS="$fftw3_CFLAGS $CFLAGS"
1851fi
1852
Elliott Hughes5d41fba2021-04-12 16:36:42 -07001853AM_CONDITIONAL([FFTW_DELEGATE],[test "$have_fftw" = 'yes'])
Cristyc1bfec22020-10-04 15:40:32 +00001854AC_SUBST([FFTW_CFLAGS])
1855AC_SUBST([FFTW_LIBS])
cristy3ed852e2009-09-05 21:47:34 +00001856
1857dnl ===========================================================================
1858
1859#
Cristy6d2f14b2016-04-26 01:41:09 -04001860# Check for FLIF delegate library.
1861#
Cristyc1bfec22020-10-04 15:40:32 +00001862AC_ARG_WITH([flif],
Cristy6d2f14b2016-04-26 01:41:09 -04001863 [AC_HELP_STRING([--without-flif],
1864 [disable FLIF support])],
1865 [with_flif=$withval],
1866 [with_flif='yes'])
1867
1868if test "$with_flif" != 'yes'; then
1869 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-flif=$with_flif "
1870fi
1871
1872have_flif='no'
1873FLIF_LIBS=''
1874if test "$with_flif" != 'no'; then
1875 AC_MSG_RESULT([-------------------------------------------------------------])
1876 AC_MSG_CHECKING([for FLIF])
1877 AC_MSG_RESULT([])
1878 failed=0
1879 passed=0
Cristyc1bfec22020-10-04 15:40:32 +00001880 AC_CHECK_HEADER([flif.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
1881 AC_CHECK_LIB([flif],[flif_create_decoder],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[])
Cristy6d2f14b2016-04-26 01:41:09 -04001882 AC_MSG_CHECKING([if FLIF package is complete])
1883 if test $passed -gt 0; then
1884 if test $failed -gt 0; then
1885 AC_MSG_RESULT([no -- some components failed test])
1886 have_flif='no (failed tests)'
1887 else
1888 FLIF_LIBS='-lflif'
1889 LIBS="$FLIF_LIBS $LIBS"
Cristyc1bfec22020-10-04 15:40:32 +00001890 AC_DEFINE([FLIF_DELEGATE],[1],[Define if you have FLIF library])
Cristy6d2f14b2016-04-26 01:41:09 -04001891 AC_MSG_RESULT([yes])
1892 have_flif='yes'
1893 fi
1894 else
1895 AC_MSG_RESULT([no])
1896 fi
1897fi
Cristyc1bfec22020-10-04 15:40:32 +00001898AM_CONDITIONAL([FLIF_DELEGATE],[test "$have_flif" = 'yes'])
1899AC_SUBST([FLIF_LIBS])
Cristy6d2f14b2016-04-26 01:41:09 -04001900
1901dnl ===========================================================================
1902
1903#
cristy3ed852e2009-09-05 21:47:34 +00001904# Check for FlashPIX delegate library.
1905#
1906AC_ARG_WITH([fpx],
1907 [AC_HELP_STRING([--without-fpx],
1908 [disable FlashPIX support])],
1909 [with_fpx=$withval],
1910 [with_fpx='yes'])
1911
1912if test "$with_fpx" != 'yes'; then
1913 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fpx=$with_fpx "
1914fi
1915
1916have_fpx='no'
1917FPX_LIBS=''
1918if test "$with_fpx" != 'no'; then
cristyad38abe2012-12-23 23:03:21 +00001919 AC_MSG_RESULT([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00001920 AC_MSG_CHECKING([for FlashPIX])
cristyad38abe2012-12-23 23:03:21 +00001921 AC_MSG_RESULT([])
cristy3ed852e2009-09-05 21:47:34 +00001922 failed=0
1923 passed=0
Cristyc1bfec22020-10-04 15:40:32 +00001924 AC_LANG_PUSH([C++])
1925 AC_CHECK_HEADER([fpxlib.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
1926 AC_CHECK_LIB([fpx],[FPX_OpenImageByFilename],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[])
1927
cristy3ed852e2009-09-05 21:47:34 +00001928 AC_LANG_POP
1929 AC_MSG_CHECKING([if FlashPIX package is complete])
1930 if test $passed -gt 0; then
1931 if test $failed -gt 0; then
cristyad38abe2012-12-23 23:03:21 +00001932 AC_MSG_RESULT([no -- some components failed test])
cristy3ed852e2009-09-05 21:47:34 +00001933 have_fpx='no (failed tests)'
1934 else
1935 FPX_LIBS='-lfpx'
Cristyc1bfec22020-10-04 15:40:32 +00001936 AC_DEFINE([FPX_DELEGATE],[1],[Define if you have FlashPIX library])
cristyad38abe2012-12-23 23:03:21 +00001937 AC_MSG_RESULT([yes])
cristy3ed852e2009-09-05 21:47:34 +00001938 have_fpx='yes'
1939 PERLMAINCC="$CXX"
1940 fi
1941 else
cristyad38abe2012-12-23 23:03:21 +00001942 AC_MSG_RESULT([no])
cristy3ed852e2009-09-05 21:47:34 +00001943 fi
1944fi
Elliott Hughes5d41fba2021-04-12 16:36:42 -07001945AM_CONDITIONAL([FPX_DELEGATE],[test "$have_fpx" = 'yes'])
Cristyc1bfec22020-10-04 15:40:32 +00001946AC_SUBST([FPX_LIBS])
cristy853d9902014-08-21 18:50:43 +00001947
1948dnl ===========================================================================
1949
1950#
1951# Check for DJVU delegate library.
1952#
1953AC_ARG_WITH([djvu],
1954 [AC_HELP_STRING([--without-djvu],
1955 [disable DjVu support])],
1956 [with_djvu=$withval],
1957 [with_djvu='yes'])
1958
1959if test "$with_djvu" != 'yes'; then
1960 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-djvu=$with_djvu "
1961fi
1962
1963have_djvu='no'
cristy32f75d42015-06-05 18:46:23 +00001964DJVU_CFLAGS=""
1965DJVU_LIBS=""
1966DJVU_PKG=""
1967if test "x$with_djvu" = "xyes"; then
1968 AC_MSG_RESULT([-------------------------------------------------------------])
Cristyc1bfec22020-10-04 15:40:32 +00001969 PKG_CHECK_MODULES([ddjvuapi],[ddjvuapi >= 3.5.0],[have_djvu=yes],[have_djvu=no])
cristy32f75d42015-06-05 18:46:23 +00001970 AC_MSG_RESULT([])
cristy853d9902014-08-21 18:50:43 +00001971fi
cristy32f75d42015-06-05 18:46:23 +00001972
1973if test "$have_djvu" = 'yes'; then
Cristyc1bfec22020-10-04 15:40:32 +00001974 AC_DEFINE([DJVU_DELEGATE],[1],[Define if you have DJVU library])
cristyc83c2cc2015-06-06 16:35:26 +00001975 DJVU_CFLAGS="$ddjvuapi_CFLAGS"
1976 DJVU_LIBS="$ddjvuapi_LIBS"
1977 CFLAGS="$ddjvuapi_CFLAGS $CFLAGS"
cristy32f75d42015-06-05 18:46:23 +00001978fi
1979
Elliott Hughes5d41fba2021-04-12 16:36:42 -07001980AM_CONDITIONAL([DJVU_DELEGATE],[test "$have_djvu" = 'yes'])
Cristyc1bfec22020-10-04 15:40:32 +00001981AC_SUBST([DJVU_CFLAGS])
1982AC_SUBST([DJVU_LIBS])
cristy3ed852e2009-09-05 21:47:34 +00001983
1984dnl ===========================================================================
1985
1986#
1987# Check for fontconfig delegate library.
1988#
1989AC_ARG_WITH([fontconfig],
1990 [AC_HELP_STRING([--without-fontconfig],
1991 [disable fontconfig support])],
1992 [with_fontconfig=$withval],
cristyfc3d0222012-02-07 15:05:57 +00001993 [with_fontconfig='yes'])
cristy3ed852e2009-09-05 21:47:34 +00001994
1995if test "$with_fontconfig" != 'yes'; then
1996 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontconfig=$with_fontconfig "
1997fi
1998
1999have_fontconfig='no'
2000FONTCONFIG_CFLAGS=""
2001FONTCONFIG_LIBS=""
2002FONTCONFIG_PKG=""
2003if test "x$with_fontconfig" = "xyes"; then
cristy32f75d42015-06-05 18:46:23 +00002004 AC_MSG_RESULT([-------------------------------------------------------------])
Cristyc1bfec22020-10-04 15:40:32 +00002005 PKG_CHECK_MODULES([FONTCONFIG],[fontconfig >= 2.1.0],[have_fontconfig=yes],[have_fontconfig=no])
cristy32f75d42015-06-05 18:46:23 +00002006 AC_MSG_RESULT([])
cristy3ed852e2009-09-05 21:47:34 +00002007fi
2008
2009if test "$have_fontconfig" = 'yes'; then
Cristyc1bfec22020-10-04 15:40:32 +00002010 AC_DEFINE([FONTCONFIG_DELEGATE],[1],[Define if you have FONTCONFIG library])
cristy32f75d42015-06-05 18:46:23 +00002011 CFLAGS="$FONTCONFIG_CFLAGS $CFLAGS"
cristy3ed852e2009-09-05 21:47:34 +00002012fi
2013
Cristyc1bfec22020-10-04 15:40:32 +00002014AM_CONDITIONAL([FONTCONFIG_DELEGATE],[test "$have_fontconfig" = 'yes'])
2015AC_SUBST([FONTCONFIG_CFLAGS])
2016AC_SUBST([FONTCONFIG_LIBS])
cristy3ed852e2009-09-05 21:47:34 +00002017
2018dnl ===========================================================================
2019
2020#
cristy03f187e2013-01-24 00:22:19 +00002021# Check for the Freetype delegate library.
cristy3ed852e2009-09-05 21:47:34 +00002022#
cristy81beccd2011-10-03 18:17:24 +00002023AC_ARG_WITH([freetype],
cristy3ed852e2009-09-05 21:47:34 +00002024 [AC_HELP_STRING([--without-freetype],
cristy81beccd2011-10-03 18:17:24 +00002025 [disable Freetype support])],
cristy3ed852e2009-09-05 21:47:34 +00002026 [with_freetype=$withval],
2027 [with_freetype='yes'])
2028
cristy3ed852e2009-09-05 21:47:34 +00002029if test "$with_freetype" != 'yes'; then
2030 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-freetype=$with_freetype "
2031fi
2032
cristy81beccd2011-10-03 18:17:24 +00002033have_freetype='no'
cristy03f187e2013-01-24 00:22:19 +00002034FREETYPE_CFLAGS=""
2035FREETYPE_LIBS=""
2036FREETYPE_PKG=""
2037if test "x$with_freetype" = "xyes"; then
cristy32f75d42015-06-05 18:46:23 +00002038 AC_MSG_RESULT([-------------------------------------------------------------])
Cristyc1bfec22020-10-04 15:40:32 +00002039 PKG_CHECK_MODULES([FREETYPE],[freetype2],[have_freetype=yes],[have_freetype=no])
cristy32f75d42015-06-05 18:46:23 +00002040 AC_MSG_RESULT([])
cristy3ed852e2009-09-05 21:47:34 +00002041fi
cristy03f187e2013-01-24 00:22:19 +00002042
2043if test "$have_freetype" = 'yes'; then
Cristyc1bfec22020-10-04 15:40:32 +00002044 AC_DEFINE([FREETYPE_DELEGATE],[1],[Define if you have FREETYPE library])
cristy32f75d42015-06-05 18:46:23 +00002045 CFLAGS="$FREETYPE_CFLAGS $CFLAGS"
Cristyed7fd172019-12-07 10:52:28 -05002046 MAGICKCORE_FREETYPE_DELEGATE=1
2047else
2048 MAGICKCORE_FREETYPE_DELEGATE=0
cristy03f187e2013-01-24 00:22:19 +00002049fi
2050
Cristyc1bfec22020-10-04 15:40:32 +00002051AC_SUBST([FREETYPE_CFLAGS])
2052AC_SUBST([FREETYPE_LIBS])
Cristyed7fd172019-12-07 10:52:28 -05002053AC_SUBST([MAGICKCORE_FREETYPE_DELEGATE])
cristy3ed852e2009-09-05 21:47:34 +00002054
2055dnl ===========================================================================
2056
cristy3ed852e2009-09-05 21:47:34 +00002057#
Cristy17f8c722016-01-31 09:42:56 -05002058# Check for the raqm delegate library.
2059#
2060AC_ARG_WITH([raqm],
2061 [AC_HELP_STRING([--without-raqm],
2062 [disable Raqm support])],
2063 [with_raqm=$withval],
2064 [with_raqm='yes'])
2065
2066if test "$with_raqm" != 'yes'; then
2067 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-raqm=$with_raqm "
2068fi
2069
2070have_raqm='no'
2071RAQM_CFLAGS=""
2072RAQM_LIBS=""
2073RAQM_PKG=""
2074if test "x$with_raqm" = "xyes"; then
2075 AC_MSG_RESULT([-------------------------------------------------------------])
Cristyc1bfec22020-10-04 15:40:32 +00002076 PKG_CHECK_MODULES([RAQM],[raqm],[have_raqm=yes],[have_raqm=no])
Cristy17f8c722016-01-31 09:42:56 -05002077 AC_MSG_RESULT([])
2078fi
2079
2080if test "$have_raqm" = 'yes'; then
Cristyc1bfec22020-10-04 15:40:32 +00002081 AC_DEFINE([RAQM_DELEGATE],[1],[Define if you have RAQM library])
Cristy17f8c722016-01-31 09:42:56 -05002082 CFLAGS="$RAQM_CFLAGS $CFLAGS"
2083fi
2084
Elliott Hughes5d41fba2021-04-12 16:36:42 -07002085AM_CONDITIONAL([RAQM_DELEGATE],[test "$have_raqm" = 'yes'])
Cristyc1bfec22020-10-04 15:40:32 +00002086AC_SUBST([RAQM_CFLAGS])
2087AC_SUBST([RAQM_LIBS])
Cristy17f8c722016-01-31 09:42:56 -05002088
2089dnl ===========================================================================
2090
2091#
Cristycf715c72020-12-30 07:48:03 -05002092# Enable Windows gdi32 libraries
2093#
2094AC_ARG_WITH([gdi32],
2095 AS_HELP_STRING([--without-gdi32],
2096 [disable Windows gdi32 support]),
2097 [with_gdi32=$withval],
2098 [with_gdi32='yes'])
2099if test "$with_gdi32" != 'yes' ; then
2100 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gdi32=$with_gdi32 "
2101fi
2102
2103#
2104# Check for Windows gdi32 library.
2105#
2106have_gdi32='no'
2107if test "$with_gdi32" != 'no'; then
2108 GDI32_LIBS=''
2109 AC_MSG_CHECKING([for Windows GDI32 support])
2110 AC_MSG_RESULT()
2111 failed=0
2112 passed=0
Cristycf715c72020-12-30 07:48:03 -05002113 AC_CHECK_HEADER([windows.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
2114 AC_CHECK_HEADER([winuser.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[#include <windows.h>])
2115 AC_CHECK_HEADER([wingdi.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[#include <windows.h>])
Cristyc459e8f2021-01-01 15:28:24 -05002116 if test "$cygwin_build" = yes -o "$native_win32_build" = yes; then
Cristycf715c72020-12-30 07:48:03 -05002117 passed=`expr $passed + 1`
Cristycf715c72020-12-30 07:48:03 -05002118 fi
2119 AC_MSG_CHECKING([if Windows GDI32 support is complete])
2120 if test $passed -gt 0; then
2121 if test $failed -gt 0; then
2122 AC_MSG_RESULT([no -- some components failed test])
2123 have_gdi32='no (failed tests)'
2124 else
2125 GDI32_LIBS='-lgdi32 -luser32'
2126 LIBS="$GDI32_LIBS $LIBS"
2127 AC_DEFINE([WINGDI32_DELEGATE],[1],[Define to use the Windows GDI32 library])
2128 AC_MSG_RESULT([yes])
2129 have_gdi32='yes'
2130 fi
2131 else
2132 AC_MSG_RESULT([no])
2133 fi
2134fi
2135AM_CONDITIONAL([WINGDI32_DELEGATE], [test "$have_gdi32" = 'yes'])
2136AC_SUBST([GDI32_LIBS])
2137
2138
2139dnl ===========================================================================
2140
2141#
cristy3ed852e2009-09-05 21:47:34 +00002142# Check for Ghostscript library or framework.
2143#
2144# Test for iapi.h & test for gsapi_new_instance in -lgs
2145# or -framework Ghostscript
2146
2147AC_ARG_WITH([gslib],
cristy8d733f42013-03-04 11:27:54 +00002148 [AC_HELP_STRING([--with-gslib],
cristy3ed852e2009-09-05 21:47:34 +00002149 [enable Ghostscript library support])],
2150 [with_gslib=$withval],
2151 [with_gslib='no'])
2152
cristyb7931f12009-09-25 10:22:21 +00002153gslib_framework='no'
cristy3ed852e2009-09-05 21:47:34 +00002154if test "$with_gslib" != 'yes'; then
2155 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gslib=$with_gslib "
2156fi
2157
2158have_gslib='no'
2159GS_LIBS=''
2160if test "$with_gslib" != 'no'; then
cristyad38abe2012-12-23 23:03:21 +00002161 AC_MSG_RESULT([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00002162 AC_MSG_CHECKING([for Ghostscript])
cristyad38abe2012-12-23 23:03:21 +00002163 AC_MSG_RESULT([])
cristyb7931f12009-09-25 10:22:21 +00002164 framework=0
cristy3ed852e2009-09-05 21:47:34 +00002165 failed=0
2166 passed=0
Cristyc1bfec22020-10-04 15:40:32 +00002167 AC_CHECK_HEADER([ghostscript/iapi.h],[passed=`expr $passed + 1`],
2168 [failed=`expr $failed + 1`],[])
2169 AC_CHECK_HEADER([ghostscript/ierrors.h],[passed=`expr $passed + 1`],
2170 [failed=`expr $failed + 1`],[])
2171 AC_CHECK_FRAMEWORK([Ghostscript],[gsapi_new_instance],[framework=`expr $framework + 1`],
2172 AC_CHECK_LIB([gs],[gsapi_new_instance],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[]),[])
cristy3ed852e2009-09-05 21:47:34 +00002173 AC_MSG_CHECKING([if Ghostscript package is complete])
2174 if test $passed -gt 0; then
2175 if test $failed -gt 0; then
cristyad38abe2012-12-23 23:03:21 +00002176 AC_MSG_RESULT([no -- some components failed test])
cristy3ed852e2009-09-05 21:47:34 +00002177 have_gslib='no (failed tests)'
2178 else
2179 if test $framework -gt 0; then
2180 GS_LIBS='-framework Ghostscript'
cristyb7931f12009-09-25 10:22:21 +00002181 gslib_framework='yes'
cristyad38abe2012-12-23 23:03:21 +00002182 AC_MSG_RESULT([yes, using framework.])
cristy3ed852e2009-09-05 21:47:34 +00002183 else
cristyad38abe2012-12-23 23:03:21 +00002184 AC_MSG_RESULT([yes, using library.])
cristy3ed852e2009-09-05 21:47:34 +00002185 GS_LIBS='-lgs'
2186 fi
2187 LIBS="$GS_LIBS $LIBS"
Cristyc1bfec22020-10-04 15:40:32 +00002188 AC_DEFINE([GS_DELEGATE],[1],[Define if you have Ghostscript library or framework])
cristy3ed852e2009-09-05 21:47:34 +00002189 have_gslib='yes'
2190 fi
2191 else
cristyad38abe2012-12-23 23:03:21 +00002192 AC_MSG_RESULT([no])
cristy3ed852e2009-09-05 21:47:34 +00002193 fi
2194fi
Elliott Hughes5d41fba2021-04-12 16:36:42 -07002195AM_CONDITIONAL([GS_DELEGATE],[test "$have_gslib" = 'yes'])
Cristyc1bfec22020-10-04 15:40:32 +00002196AC_SUBST([GS_LIBS])
cristy3ed852e2009-09-05 21:47:34 +00002197
2198# Set default font search path
2199AC_ARG_WITH([fontpath],
2200 [AC_HELP_STRING([--with-fontpath=DIR],
2201 [prepend to default font search path])],
2202 [with_fontpath=$withval],
2203 [with_fontpath=''])
2204
2205if test "$with_fontpath" != "yes" && test -z "$with_fontpath"; then
2206 with_fontpath=''
2207else
Cristyc1bfec22020-10-04 15:40:32 +00002208 AC_DEFINE_UNQUOTED([MAGICK_FONT_PATH],["$with_fontpath"],[Define to prepend to default font search path.])
cristy3ed852e2009-09-05 21:47:34 +00002209fi
2210if test "$with_fontpath=" != ''; then
2211 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontpath=$with_fontpath "
2212fi
2213
2214# Set Ghostscript font directory
2215AC_ARG_WITH([gs-font-dir],
2216 [AC_HELP_STRING([--with-gs-font-dir=DIR],
2217 [Ghostscript font directory])],
2218 [with_gs_font_dir=$withval],
2219 [with_gs_font_dir='default'])
2220
2221if test "$with_gs_font_dir" != 'default'; then
2222 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gs-font-dir=$with_gs_font_dir "
2223fi
2224
2225dnl ===========================================================================
2226
2227#
2228# Check for GVC delegate library.
2229#
Cristyc1bfec22020-10-04 15:40:32 +00002230AC_ARG_WITH([gvc],
cristy24aeba92012-06-26 12:22:26 +00002231 [AC_HELP_STRING([--with-gvc],
cristy8d733f42013-03-04 11:27:54 +00002232 [enable GVC support])],
cristy3ed852e2009-09-05 21:47:34 +00002233 [with_gvc=$withval],
cristy86e31f32015-06-06 15:47:32 +00002234 [with_gvc='yes'])
cristy3ed852e2009-09-05 21:47:34 +00002235
2236if test "$with_gvc" != 'yes'; then
2237 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gvc=$with_gvc "
2238fi
2239
2240GVC_PKG=""
2241if test "x$with_gvc" = "xyes"; then
cristy32f75d42015-06-05 18:46:23 +00002242 AC_MSG_RESULT([-------------------------------------------------------------])
Cristyc1bfec22020-10-04 15:40:32 +00002243 PKG_CHECK_MODULES([GVC],[libgvc >= 2.9.0],[have_gvc=yes],[have_gvc=no])
cristy32f75d42015-06-05 18:46:23 +00002244 AC_MSG_RESULT([])
cristy3ed852e2009-09-05 21:47:34 +00002245fi
2246
2247if test "$have_gvc" = 'yes'; then
Cristyc1bfec22020-10-04 15:40:32 +00002248 AC_DEFINE([GVC_DELEGATE],[1],[Define if you have GVC library])
cristy32f75d42015-06-05 18:46:23 +00002249 CFLAGS="$GVC_CFLAGS $CFLAGS"
cristy3ed852e2009-09-05 21:47:34 +00002250fi
2251
Elliott Hughes5d41fba2021-04-12 16:36:42 -07002252AM_CONDITIONAL([GVC_DELEGATE],[test "$have_gvc" = 'yes'])
Cristyc1bfec22020-10-04 15:40:32 +00002253AC_SUBST([GVC_CFLAGS])
2254AC_SUBST([GVC_LIBS])
cristy3ed852e2009-09-05 21:47:34 +00002255
2256dnl ===========================================================================
2257
2258#
Cristy9e7b9812017-11-19 09:35:36 -05002259# Check for the HEIC delegate library.
2260#
2261AC_ARG_WITH([heic],
2262 [AC_HELP_STRING([--without-heic],
2263 [disable HEIC support])],
2264 [with_heic=$withval],
2265 [with_heic='yes'])
2266
2267if test "$with_heic" != 'yes'; then
2268 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-heic=$with_heic "
2269fi
2270
2271have_heic='no'
farindk41794572018-04-27 10:26:21 +02002272HEIF_CFLAGS=""
2273HEIF_LIBS=""
2274HEIF_PKG=""
Cristy9e7b9812017-11-19 09:35:36 -05002275if test "x$with_heic" = "xyes"; then
2276 AC_MSG_RESULT([-------------------------------------------------------------])
Cristyc1bfec22020-10-04 15:40:32 +00002277 PKG_CHECK_MODULES([HEIF],[libheif],[have_heic=yes],[have_heic=no])
Cristy9e7b9812017-11-19 09:35:36 -05002278 AC_MSG_RESULT([])
2279fi
2280
2281if test "$have_heic" = 'yes'; then
Cristyc1bfec22020-10-04 15:40:32 +00002282 AC_DEFINE([HEIC_DELEGATE],[1],[Define if you have libheif library])
farindk41794572018-04-27 10:26:21 +02002283 CFLAGS="$HEIF_CFLAGS $CFLAGS"
Cristy9e7b9812017-11-19 09:35:36 -05002284fi
2285
Elliott Hughes5d41fba2021-04-12 16:36:42 -07002286AM_CONDITIONAL([HEIC_DELEGATE],[test "$have_heic" = 'yes'])
Cristyc1bfec22020-10-04 15:40:32 +00002287AC_SUBST([HEIF_CFLAGS])
2288AC_SUBST([HEIF_LIBS])
Cristy9e7b9812017-11-19 09:35:36 -05002289
2290dnl ===========================================================================
2291
2292#
cristy3ed852e2009-09-05 21:47:34 +00002293# Check for JBIG delegate library.
2294#
cristy3ed852e2009-09-05 21:47:34 +00002295AC_ARG_WITH([jbig],
2296 [AC_HELP_STRING([--without-jbig],
2297 [disable JBIG support])],
2298 [with_jbig=$withval],
2299 [with_jbig='yes'])
2300
2301have_jbig='no'
2302JBIG_LIBS=''
2303if test "$with_jbig" != 'no'; then
cristyad38abe2012-12-23 23:03:21 +00002304 AC_MSG_RESULT([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00002305 AC_MSG_CHECKING([for JBIG])
cristyad38abe2012-12-23 23:03:21 +00002306 AC_MSG_RESULT([])
cristy3ed852e2009-09-05 21:47:34 +00002307 failed=0
2308 passed=0
Cristyc1bfec22020-10-04 15:40:32 +00002309 AC_CHECK_HEADER([jbig.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
2310 AC_CHECK_LIB([jbig],[jbg_dec_init],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[])
2311
cristy3ed852e2009-09-05 21:47:34 +00002312 AC_MSG_CHECKING([if JBIG package is complete])
2313 if test $passed -gt 0; then
2314 if test $failed -gt 0; then
cristyad38abe2012-12-23 23:03:21 +00002315 AC_MSG_RESULT([no -- some components failed test])
cristy3ed852e2009-09-05 21:47:34 +00002316 have_jbig='no (failed tests)'
2317 else
2318 JBIG_LIBS='-ljbig'
2319 LIBS="$JBIG_LIBS $LIBS"
Cristyc1bfec22020-10-04 15:40:32 +00002320 AC_DEFINE([JBIG_DELEGATE],[1],[Define if you have JBIG library])
cristyad38abe2012-12-23 23:03:21 +00002321 AC_MSG_RESULT([yes])
cristy3ed852e2009-09-05 21:47:34 +00002322 have_jbig='yes'
2323 fi
2324 else
cristyad38abe2012-12-23 23:03:21 +00002325 AC_MSG_RESULT([no])
cristy3ed852e2009-09-05 21:47:34 +00002326 fi
2327fi
Elliott Hughes5d41fba2021-04-12 16:36:42 -07002328AM_CONDITIONAL([JBIG_DELEGATE],[test "$have_jbig" = 'yes'])
Cristyc1bfec22020-10-04 15:40:32 +00002329AC_SUBST([JBIG_LIBS])
cristy3ed852e2009-09-05 21:47:34 +00002330
2331dnl ===========================================================================
2332
2333#
2334# Check for JPEG delegate library.
2335#
2336AC_ARG_WITH([jpeg],
2337 [AC_HELP_STRING([--without-jpeg],
2338 [disable JPEG support])],
2339 [with_jpeg=$withval],
2340 [with_jpeg='yes'])
2341
2342if test "$with_jpeg" != 'yes'; then
2343 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jpeg=$with_jpeg "
2344fi
2345
2346have_jpeg='no'
2347JPEG_LIBS=''
2348if test "$with_jpeg" != 'no'; then
cristyad38abe2012-12-23 23:03:21 +00002349 AC_MSG_RESULT([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00002350 AC_MSG_CHECKING([for JPEG])
cristyad38abe2012-12-23 23:03:21 +00002351 AC_MSG_RESULT([])
cristy3ed852e2009-09-05 21:47:34 +00002352 failed=0
2353 passed=0
Cristyc1bfec22020-10-04 15:40:32 +00002354 AC_CHECK_HEADER([jconfig.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
2355 AC_CHECK_HEADER([jerror.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
2356 AC_CHECK_HEADER([jmorecfg.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
2357 AC_CHECK_HEADER([jpeglib.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
2358 AC_CHECK_LIB([jpeg],[jpeg_read_header],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[])
2359
cristy3ed852e2009-09-05 21:47:34 +00002360 AC_MSG_CHECKING([if JPEG package is complete])
2361 if test $passed -gt 0; then
2362 if test $failed -gt 0; then
cristyad38abe2012-12-23 23:03:21 +00002363 AC_MSG_RESULT([no -- some components failed test])
cristy3ed852e2009-09-05 21:47:34 +00002364 have_jpeg='no (failed tests)'
2365 else
2366 JPEG_LIBS='-ljpeg'
2367 LIBS="$JPEG_LIBS $LIBS"
Cristyc1bfec22020-10-04 15:40:32 +00002368 AC_DEFINE([JPEG_DELEGATE],[1],[Define if you have JPEG library])
cristyad38abe2012-12-23 23:03:21 +00002369 AC_MSG_RESULT([yes])
cristy3ed852e2009-09-05 21:47:34 +00002370 have_jpeg='yes'
2371 fi
2372 else
cristyad38abe2012-12-23 23:03:21 +00002373 AC_MSG_RESULT([no])
cristy3ed852e2009-09-05 21:47:34 +00002374 fi
2375fi
Elliott Hughes5d41fba2021-04-12 16:36:42 -07002376AM_CONDITIONAL([JPEG_DELEGATE],[test "$have_jpeg" = 'yes'])
Cristyc1bfec22020-10-04 15:40:32 +00002377AC_SUBST([JPEG_LIBS])
cristy3ed852e2009-09-05 21:47:34 +00002378
2379dnl ===========================================================================
2380
2381#
Elliott Hughes5d41fba2021-04-12 16:36:42 -07002382# Check for JPEG-XL delegate library.
Cristyb316fbb2019-10-05 10:51:15 -04002383#
2384AC_ARG_WITH([jxl],
Elliott Hughes5d41fba2021-04-12 16:36:42 -07002385 [AC_HELP_STRING([--with-jxl],
2386 [enable JPEG-XL support])],
Cristyb316fbb2019-10-05 10:51:15 -04002387 [with_jxl=$withval],
Cristy5b7d1b72020-12-28 10:37:01 -05002388 [with_jxl='no'])
Cristyb316fbb2019-10-05 10:51:15 -04002389
2390if test "$with_jxl" != 'yes'; then
2391 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jxl=$with_jxl "
2392fi
Dirk Lemstra133411f2020-12-29 01:31:45 +01002393if test "$enable_static" = 'yes'; then
2394 if test "$with_utilities" = 'yes'; then
2395 with_jxl='no'
2396 fi
2397fi
Cristyb316fbb2019-10-05 10:51:15 -04002398
Cristyb0314b22020-12-26 07:59:17 -05002399# Check for the JPEG-XL library.
Cristyb316fbb2019-10-05 10:51:15 -04002400have_jxl='no'
2401JXL_LIBS=''
2402if test "$with_jxl" != 'no'; then
2403 AC_MSG_RESULT([-------------------------------------------------------------])
Cristyb0314b22020-12-26 07:59:17 -05002404 AC_MSG_CHECKING([for jpeg-xl])
Cristyb316fbb2019-10-05 10:51:15 -04002405 AC_MSG_RESULT([])
2406 failed=0
2407 passed=0
Cristyb0314b22020-12-26 07:59:17 -05002408 AC_CHECK_HEADER([jxl/decode.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
2409 AC_CHECK_HEADER([jxl/encode.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
Dirk Lemstra133411f2020-12-29 01:31:45 +01002410 # This check should be changed once we have a .pc file for the JPEG-XL library.
2411 if test "$enable_static" != 'yes'; then
2412 AC_CHECK_LIB([jxl],[JxlDecoderCreate],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[])
Elliott Hughes5d41fba2021-04-12 16:36:42 -07002413 AC_CHECK_LIB([jxl],[JxlEncoderSetBasicInfo],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[])
Dirk Lemstra133411f2020-12-29 01:31:45 +01002414 fi
Cristyc1bfec22020-10-04 15:40:32 +00002415
Cristyb0314b22020-12-26 07:59:17 -05002416 AC_MSG_CHECKING([if jpeg-xl package is complete])
Cristyb316fbb2019-10-05 10:51:15 -04002417 if test $passed -gt 0; then
2418 if test $failed -gt 0; then
2419 AC_MSG_RESULT([no -- some components failed test])
2420 have_jxl='no (failed tests)'
2421 else
Cristyb0314b22020-12-26 07:59:17 -05002422 JXL_LIBS='-ljxl'
Cristyb316fbb2019-10-05 10:51:15 -04002423 LIBS="$JXL_LIBS $LIBS"
Cristyb0314b22020-12-26 07:59:17 -05002424 AC_DEFINE([JXL_DELEGATE],[1],[Define if you have jpeg-xl library])
Cristyb316fbb2019-10-05 10:51:15 -04002425 AC_MSG_RESULT([yes])
2426 have_jxl='yes'
2427 fi
2428 else
2429 AC_MSG_RESULT([no])
2430 fi
2431fi
Elliott Hughes5d41fba2021-04-12 16:36:42 -07002432AM_CONDITIONAL([JXL_DELEGATE],[test "$have_jxl" = 'yes'])
Cristyc1bfec22020-10-04 15:40:32 +00002433AC_SUBST([JXL_LIBS])
Cristyb316fbb2019-10-05 10:51:15 -04002434
2435dnl ===========================================================================
2436
2437#
cristy3ed852e2009-09-05 21:47:34 +00002438# Check for LCMS delegate library.
2439#
Cristyc1bfec22020-10-04 15:40:32 +00002440AC_ARG_WITH([lcms],
cristy71203402010-06-18 13:12:03 +00002441 [ --without-lcms disable lcms (v1.1X) support],
2442 [with_lcms=$withval],
2443 [with_lcms='yes'])
2444if test "$with_lcms" != 'yes' ; then
cristy3ed852e2009-09-05 21:47:34 +00002445 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lcms=$with_lcms "
2446fi
2447
cristy71203402010-06-18 13:12:03 +00002448have_lcms='no'
cristy32f75d42015-06-05 18:46:23 +00002449LCMS_CFLAGS=""
2450LCMS_LIBS=""
2451LCMS_PKG=""
2452if test "x$with_lcms" = "xyes"; then
2453 AC_MSG_RESULT([-------------------------------------------------------------])
Cristyc1bfec22020-10-04 15:40:32 +00002454 PKG_CHECK_MODULES([LCMS2],[lcms2 >= 2.0.0],[have_lcms=yes],[have_lcms=no])
cristy32f75d42015-06-05 18:46:23 +00002455 AC_MSG_RESULT([])
cristy3ed852e2009-09-05 21:47:34 +00002456fi
cristy71203402010-06-18 13:12:03 +00002457
cristy32f75d42015-06-05 18:46:23 +00002458if test "$have_lcms" = 'yes'; then
Cristyc1bfec22020-10-04 15:40:32 +00002459 AC_DEFINE([LCMS_DELEGATE],[1],[Define if you have LCMS library])
cristyb74ab6e2015-06-06 12:39:54 +00002460 LCMS_CFLAGS="$LCMS2_CFLAGS"
2461 LCMS_LIBS="$LCMS2_LIBS"
cristyb054e072015-06-05 20:35:43 +00002462 CFLAGS="$LCMS2_CFLAGS $CFLAGS"
Cristyc1bfec22020-10-04 15:40:32 +00002463 AC_CHECK_HEADER([lcms2/lcms2.h],[have_lcms_header='yes'],[])
cristyd6ac47f2015-06-06 13:46:55 +00002464 if test "$have_lcms_header" = 'yes'; then
Cristyc1bfec22020-10-04 15:40:32 +00002465 AC_DEFINE([HAVE_LCMS2_LCMS2_H],[1],[Define if you have the <lcms2/lcms2.h> header file.])
cristybc8ef1c2015-06-06 14:32:21 +00002466 else
Cristyc1bfec22020-10-04 15:40:32 +00002467 AC_DEFINE([HAVE_LCMS2_H],[1],[Define if you have the <lcms2.h> header file.])
cristyd6ac47f2015-06-06 13:46:55 +00002468 fi
cristyd09bcf92010-03-25 03:04:45 +00002469fi
cristy32f75d42015-06-05 18:46:23 +00002470
Elliott Hughes5d41fba2021-04-12 16:36:42 -07002471AM_CONDITIONAL([LCMS_DELEGATE],[test "$have_lcms" = 'yes'])
Cristyc1bfec22020-10-04 15:40:32 +00002472AC_SUBST([LCMS_CFLAGS])
2473AC_SUBST([LCMS_LIBS])
cristy3ed852e2009-09-05 21:47:34 +00002474
2475dnl ===========================================================================
2476
2477#
cristy99db3872014-01-01 15:11:34 +00002478# Check for the OpenJP2 delegate library.
2479#
2480AC_ARG_WITH([openjp2],
2481 [AC_HELP_STRING([--without-openjp2],
2482 [disable OpenJP2 support])],
2483 [with_openjp2=$withval],
2484 [with_openjp2='yes'])
2485
2486if test "$with_openjp2" != 'yes'; then
2487 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-openjp2=$with_openjp2 "
2488fi
2489
2490have_openjp2='no'
2491LIBOPENJP2_CFLAGS=""
2492LIBOPENJP2_LIBS=""
2493LIBOPENJP2_PKG=""
Yoshihiro Yamazakiec98dde2020-03-24 03:46:01 +09002494if test "$with_openjp2" != 'no'; then
cristy32f75d42015-06-05 18:46:23 +00002495 AC_MSG_RESULT([-------------------------------------------------------------])
Cristyc1bfec22020-10-04 15:40:32 +00002496 PKG_CHECK_MODULES([LIBOPENJP2],[libopenjp2 >= 2.1.0],[have_openjp2=yes],[have_openjp2=no])
cristy32f75d42015-06-05 18:46:23 +00002497 AC_MSG_RESULT([])
cristy99db3872014-01-01 15:11:34 +00002498fi
2499
2500if test "$have_openjp2" = 'yes'; then
Cristyc1bfec22020-10-04 15:40:32 +00002501 AC_DEFINE([LIBOPENJP2_DELEGATE],[1],[Define if you have OPENJP2 library])
cristy32f75d42015-06-05 18:46:23 +00002502 CFLAGS="$LIBOPENJP2_CFLAGS $CFLAGS"
cristy99db3872014-01-01 15:11:34 +00002503fi
2504
Elliott Hughes5d41fba2021-04-12 16:36:42 -07002505AM_CONDITIONAL([LIBOPENJP2_DELEGATE],[test "$have_openjp2" = 'yes'])
Cristyc1bfec22020-10-04 15:40:32 +00002506AC_SUBST([LIBOPENJP2_CFLAGS])
2507AC_SUBST([LIBOPENJP2_LIBS])
cristy99db3872014-01-01 15:11:34 +00002508
2509
2510dnl ===========================================================================
2511
2512#
cristy3ed852e2009-09-05 21:47:34 +00002513# Check for the LQR (Liquid Rescale) delegate library.
2514#
2515AC_ARG_WITH([lqr],
2516 [AC_HELP_STRING([--without-lqr],
cristyec501352010-03-13 18:43:34 +00002517 [disable Liquid Rescale support])],
cristy3ed852e2009-09-05 21:47:34 +00002518 [with_lqr=$withval],
2519 [with_lqr='yes'])
2520
2521if test "$with_lqr" != 'yes'; then
2522 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lqr=$with_lqr "
2523fi
2524
2525have_lqr='no'
2526LQR_CFLAGS=""
2527LQR_LIBS=""
2528LQR_PKG=""
2529if test "x$with_lqr" = "xyes"; then
cristy32f75d42015-06-05 18:46:23 +00002530 AC_MSG_RESULT([-------------------------------------------------------------])
Cristyc1bfec22020-10-04 15:40:32 +00002531 PKG_CHECK_MODULES([LQR],[lqr-1 >= 0.1.0],[have_lqr=yes],[have_lqr=no])
cristy32f75d42015-06-05 18:46:23 +00002532 AC_MSG_RESULT([])
cristy3ed852e2009-09-05 21:47:34 +00002533fi
2534
2535if test "$have_lqr" = 'yes'; then
Cristyc1bfec22020-10-04 15:40:32 +00002536 AC_DEFINE([LQR_DELEGATE],[1],[Define if you have LQR library])
cristy32f75d42015-06-05 18:46:23 +00002537 CFLAGS="$LQR_CFLAGS $CFLAGS"
cristy3ed852e2009-09-05 21:47:34 +00002538fi
2539
Elliott Hughes5d41fba2021-04-12 16:36:42 -07002540AM_CONDITIONAL([LQR_DELEGATE],[test "$have_lqr" = 'yes'])
Cristyc1bfec22020-10-04 15:40:32 +00002541AC_SUBST([LQR_CFLAGS])
2542AC_SUBST([LQR_LIBS])
cristy3ed852e2009-09-05 21:47:34 +00002543
2544dnl ===========================================================================
2545
cristy81beccd2011-10-03 18:17:24 +00002546# Disable LZMA (lzma library)
Cristyc1bfec22020-10-04 15:40:32 +00002547AC_ARG_WITH([lzma],
glennrp3fc1c212013-01-10 01:52:32 +00002548 [ --without-lzma disable LZMA support],
2549 [with_lzma=$withval],
2550 [with_lzma='yes'])
cristy81beccd2011-10-03 18:17:24 +00002551if test "$with_lzma" != 'yes' ; then
cristyfbb0ef02010-12-19 02:32:11 +00002552 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lzma=$with_lzma "
2553fi
2554
cristy56bbc922011-11-14 13:18:39 +00002555LZMA_PKG=""
2556if test "x$with_lzma" = "xyes"; then
cristy32f75d42015-06-05 18:46:23 +00002557 AC_MSG_RESULT([-------------------------------------------------------------])
Cristyc1bfec22020-10-04 15:40:32 +00002558 PKG_CHECK_MODULES([LZMA],[liblzma >= 2.9.0],[have_lzma=yes],[have_lzma=no])
cristy32f75d42015-06-05 18:46:23 +00002559 AC_MSG_RESULT([])
Dirk Lemstradb6f0b92020-09-19 13:32:08 +02002560else
2561 have_lzma=no
cristyf805afb2011-10-03 17:17:37 +00002562fi
cristy56bbc922011-11-14 13:18:39 +00002563
2564if test "$have_lzma" = 'yes'; then
Cristyc1bfec22020-10-04 15:40:32 +00002565 AC_DEFINE([LZMA_DELEGATE],[1],[Define if you have LZMA library])
cristy32f75d42015-06-05 18:46:23 +00002566 CFLAGS="$LZMA_CFLAGS $CFLAGS"
cristy56bbc922011-11-14 13:18:39 +00002567fi
2568
Elliott Hughes5d41fba2021-04-12 16:36:42 -07002569AM_CONDITIONAL([LZMA_DELEGATE],[test "$have_lzma" = 'yes'])
Cristyc1bfec22020-10-04 15:40:32 +00002570AC_SUBST([LZMA_CFLAGS])
2571AC_SUBST([LZMA_LIBS])
cristyfbb0ef02010-12-19 02:32:11 +00002572
2573dnl ===========================================================================
2574
cristy3ed852e2009-09-05 21:47:34 +00002575#
2576# Check for the OpenEXR delegate library.
2577#
2578AC_ARG_WITH([openexr],
2579 [AC_HELP_STRING([--without-openexr],
2580 [disable OpenEXR support])],
2581 [with_openexr=$withval],
2582 [with_openexr='yes'])
2583
2584if test "$with_openexr" != 'yes'; then
2585 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-openexr=$with_openexr "
2586fi
2587
2588have_openexr='no'
2589OPENEXR_CFLAGS=""
2590OPENEXR_LIBS=""
2591OPENEXR_PKG=""
2592if test "x$with_openexr" = "xyes"; then
cristy32f75d42015-06-05 18:46:23 +00002593 AC_MSG_RESULT([-------------------------------------------------------------])
Cristyc1bfec22020-10-04 15:40:32 +00002594 PKG_CHECK_MODULES([OPENEXR],[OpenEXR >= 1.0.6],[have_openexr=yes],[have_openexr=no])
cristy32f75d42015-06-05 18:46:23 +00002595 AC_MSG_RESULT([])
cristy3ed852e2009-09-05 21:47:34 +00002596fi
2597
2598if test "$have_openexr" = 'yes'; then
Cristyc1bfec22020-10-04 15:40:32 +00002599 AC_DEFINE([OPENEXR_DELEGATE],[1],[Define if you have OPENEXR library])
cristy32f75d42015-06-05 18:46:23 +00002600 CFLAGS="$OPENEXR_CFLAGS $CFLAGS"
cristy3ed852e2009-09-05 21:47:34 +00002601fi
2602
Elliott Hughes5d41fba2021-04-12 16:36:42 -07002603AM_CONDITIONAL([OPENEXR_DELEGATE],[test "$have_openexr" = 'yes'])
Cristyc1bfec22020-10-04 15:40:32 +00002604AC_SUBST([OPENEXR_CFLAGS])
2605AC_SUBST([OPENEXR_LIBS])
cristy3ed852e2009-09-05 21:47:34 +00002606
2607dnl ===========================================================================
2608
2609#
cristy41cbe8a2011-10-27 01:35:18 +00002610# Check for PANGO delegate library.
2611#
2612AC_ARG_WITH([pango],
2613 [AC_HELP_STRING([--without-pango],
2614 [disable PANGO support])],
2615 [with_pango=$withval],
cristyfc3d0222012-02-07 15:05:57 +00002616 [with_pango='yes'])
cristy41cbe8a2011-10-27 01:35:18 +00002617
2618if test "$with_pango" != 'yes'; then
2619 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-pango=$with_pango "
2620fi
2621
2622have_pango='no'
cristya054b762012-03-26 23:16:00 +00002623have_pangocairo='no'
cristy41cbe8a2011-10-27 01:35:18 +00002624PANGO_CFLAGS=""
2625PANGO_LIBS=""
2626PANGO_PKG=""
2627if test "x$with_pango" = "xyes"; then
cristy32f75d42015-06-05 18:46:23 +00002628 AC_MSG_RESULT([-------------------------------------------------------------])
Cristyc1bfec22020-10-04 15:40:32 +00002629 PKG_CHECK_MODULES([PANGO],[pangocairo >= 1.28.1],[have_pangocairo=yes],[have_pangocairo=no])
cristy32f75d42015-06-05 18:46:23 +00002630 AC_MSG_RESULT([])
Cristyc1bfec22020-10-04 15:40:32 +00002631 PKG_CHECK_MODULES([PANGO],[pango >= 1.28.1],[have_pango=yes],[have_pango=no])
cristy32f75d42015-06-05 18:46:23 +00002632 AC_MSG_RESULT([])
cristy41cbe8a2011-10-27 01:35:18 +00002633fi
2634
2635if test "$have_pango" = 'yes'; then
Cristyc1bfec22020-10-04 15:40:32 +00002636 AC_DEFINE([PANGO_DELEGATE],[1],[Define if you have PANGO library])
cristy32f75d42015-06-05 18:46:23 +00002637 CFLAGS="$PANGO_CFLAGS $CFLAGS"
cristy41cbe8a2011-10-27 01:35:18 +00002638fi
2639
cristya054b762012-03-26 23:16:00 +00002640if test "$have_pangocairo" = 'yes'; then
Cristyc1bfec22020-10-04 15:40:32 +00002641 AC_DEFINE([PANGOCAIRO_DELEGATE],[1],[Define if you have PANGOCAIRO library])
cristy32f75d42015-06-05 18:46:23 +00002642 CFLAGS="$PANGOCAIRO_CFLAGS $CFLAGS"
cristy41cbe8a2011-10-27 01:35:18 +00002643fi
2644
Elliott Hughes5d41fba2021-04-12 16:36:42 -07002645AM_CONDITIONAL([PANGO_DELEGATE],[test "$have_pango" = 'yes'])
2646AM_CONDITIONAL([PANGOCAIRO_DELEGATE],[test "$have_pangocairo" = 'yes'])
Cristyc1bfec22020-10-04 15:40:32 +00002647AC_SUBST([PANGO_CFLAGS])
2648AC_SUBST([PANGO_LIBS])
cristy41cbe8a2011-10-27 01:35:18 +00002649
2650dnl ===========================================================================
2651
2652#
cristy3ed852e2009-09-05 21:47:34 +00002653# Check for PNG delegate library.
2654#
Cristyc1bfec22020-10-04 15:40:32 +00002655AC_ARG_WITH([png],
Cristy12452732020-10-02 16:23:46 +00002656 [AC_HELP_STRING([--without-png], [disable PNG support])],
cristy3ed852e2009-09-05 21:47:34 +00002657 [with_png=$withval],
2658 [with_png='yes'])
2659
2660if test "$with_png" != 'yes'; then
2661 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-png=$with_png "
2662fi
2663
cristy81beccd2011-10-03 18:17:24 +00002664have_png='no'
cristy32f75d42015-06-05 18:46:23 +00002665PNG_CFLAGS=""
2666PNG_LIBS=""
2667PNG_PKG=""
2668if test "x$with_png" = "xyes"; then
cristyad38abe2012-12-23 23:03:21 +00002669 AC_MSG_RESULT([-------------------------------------------------------------])
Cristyc1bfec22020-10-04 15:40:32 +00002670 PKG_CHECK_MODULES([PNG],[libpng >= 1.0.0],[have_png=yes],[have_png=no])
cristy32f75d42015-06-05 18:46:23 +00002671 AC_MSG_RESULT([])
cristy3ed852e2009-09-05 21:47:34 +00002672fi
cristy64877302011-08-23 19:10:31 +00002673
cristy32f75d42015-06-05 18:46:23 +00002674if test "$have_png" = 'yes'; then
Cristyc1bfec22020-10-04 15:40:32 +00002675 AC_DEFINE([PNG_DELEGATE],[1],[Define if you have PNG library])
cristy32f75d42015-06-05 18:46:23 +00002676 CFLAGS="$PNG_CFLAGS $CFLAGS"
2677fi
cristy3ed852e2009-09-05 21:47:34 +00002678
Elliott Hughes5d41fba2021-04-12 16:36:42 -07002679AM_CONDITIONAL([PNG_DELEGATE],[test "$have_png" = 'yes'])
Cristyc1bfec22020-10-04 15:40:32 +00002680AC_SUBST([PNG_CFLAGS])
2681AC_SUBST([PNG_LIBS])
cristy81beccd2011-10-03 18:17:24 +00002682
cristy3ed852e2009-09-05 21:47:34 +00002683dnl ===========================================================================
2684
2685#
Cristycefed482017-07-14 07:56:27 -04002686# Check for the Raw delegate library.
2687#
Cristy42ab1bc2017-07-18 17:59:43 -04002688AC_ARG_WITH([raw],
Cristycefed482017-07-14 07:56:27 -04002689 [AC_HELP_STRING([--without-raw],
2690 [disable Raw support])],
2691 [with_raw=$withval],
2692 [with_raw='yes'])
2693
2694if test "$with_raw" != 'yes'; then
2695 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-libraw=$with_raw "
2696fi
2697
2698have_raw='no'
Cristy31c3c132017-07-14 18:49:05 -04002699RAW_R_CFLAGS=""
2700RAW_R_LIBS=""
2701RAW_R_PKG=""
Cristycefed482017-07-14 07:56:27 -04002702if test "x$with_raw" = "xyes"; then
2703 AC_MSG_RESULT([-------------------------------------------------------------])
Cristyc1bfec22020-10-04 15:40:32 +00002704 PKG_CHECK_MODULES([RAW_R],[libraw_r >= 0.14.8],[have_raw=yes],[have_raw=no])
Cristycefed482017-07-14 07:56:27 -04002705 AC_MSG_RESULT([])
2706fi
2707
2708if test "$have_raw" = 'yes'; then
Cristyc1bfec22020-10-04 15:40:32 +00002709 AC_DEFINE([RAW_R_DELEGATE],[1],[Define if you have LIBRAW library])
Cristy31c3c132017-07-14 18:49:05 -04002710 CFLAGS="$RAW_R_CFLAGS $CFLAGS"
Cristycefed482017-07-14 07:56:27 -04002711fi
2712
Elliott Hughes5d41fba2021-04-12 16:36:42 -07002713AM_CONDITIONAL([RAW_R_DELEGATE],[test "$have_raw" = 'yes'])
Cristyc1bfec22020-10-04 15:40:32 +00002714AC_SUBST([RAW_R_CFLAGS])
2715AC_SUBST([RAW_R_LIBS])
Cristycefed482017-07-14 07:56:27 -04002716
2717dnl ===========================================================================
2718
2719#
cristy3ed852e2009-09-05 21:47:34 +00002720# Check for RSVG delegate library.
2721#
2722AC_ARG_WITH([rsvg],
cristy51633f52013-04-23 14:03:19 +00002723 [AC_HELP_STRING([--with-rsvg],
cristy1164d5f2012-08-15 00:58:25 +00002724 [enable RSVG support])],
cristy3ed852e2009-09-05 21:47:34 +00002725 [with_rsvg=$withval],
cristy1164d5f2012-08-15 00:58:25 +00002726 [with_rsvg='no'])
cristy3ed852e2009-09-05 21:47:34 +00002727
2728if test "$with_rsvg" != 'yes'; then
2729 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-rsvg=$with_rsvg "
2730fi
2731
2732have_rsvg='no'
2733have_cairo='no'
2734RSVG_CFLAGS=""
2735RSVG_LIBS=""
2736RSVG_PKG=""
2737if test "x$with_rsvg" = "xyes"; then
cristy32f75d42015-06-05 18:46:23 +00002738 AC_MSG_RESULT([-------------------------------------------------------------])
Cristyc1bfec22020-10-04 15:40:32 +00002739 PKG_CHECK_MODULES([RSVG],[librsvg-2.0 >= 2.9.0],[have_rsvg=yes],[have_rsvg=no])
cristy32f75d42015-06-05 18:46:23 +00002740 AC_MSG_RESULT([])
Cristyc1bfec22020-10-04 15:40:32 +00002741 PKG_CHECK_MODULES([CAIRO_SVG],[cairo-svg],[have_cairo=yes],[have_cairo=no])
cristy32f75d42015-06-05 18:46:23 +00002742 AC_MSG_RESULT([])
cristy3ed852e2009-09-05 21:47:34 +00002743fi
2744
2745if test "$have_rsvg" = 'yes'; then
Cristyc1bfec22020-10-04 15:40:32 +00002746 AC_DEFINE([RSVG_DELEGATE],[1],[Define if you have RSVG library])
cristy32f75d42015-06-05 18:46:23 +00002747 CFLAGS="$RSVG_CFLAGS $CFLAGS"
cristy3ed852e2009-09-05 21:47:34 +00002748fi
2749
2750if test "$have_cairo" = 'yes'; then
Cristyc1bfec22020-10-04 15:40:32 +00002751 AC_DEFINE([CAIRO_DELEGATE],[1],[Define if you have CAIRO library])
cristy32f75d42015-06-05 18:46:23 +00002752 CFLAGS="$CAIRO_SVG_CFLAGS $CFLAGS"
cristy3ed852e2009-09-05 21:47:34 +00002753fi
2754
Elliott Hughes5d41fba2021-04-12 16:36:42 -07002755AM_CONDITIONAL([RSVG_DELEGATE],[test "$have_rsvg" = 'yes'])
2756AM_CONDITIONAL([CAIRO_DELEGATE],[test "$have_cairo" = 'yes'])
Cristyc1bfec22020-10-04 15:40:32 +00002757AC_SUBST([RSVG_CFLAGS])
2758AC_SUBST([RSVG_LIBS])
cristy3ed852e2009-09-05 21:47:34 +00002759
2760dnl ===========================================================================
2761
2762#
2763# Check for TIFF delegate library.
2764#
2765AC_ARG_WITH([tiff],
2766 [AC_HELP_STRING([--without-tiff],
2767 [disable TIFF support])],
2768 [with_tiff=$withval],
2769 [with_tiff='yes'])
2770
2771if test "$with_tiff" != 'yes'; then
2772 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-tiff=$with_tiff "
2773fi
2774
2775have_tiff='no'
2776TIFF_LIBS=''
2777if test "$with_tiff" != 'no'; then
cristyad38abe2012-12-23 23:03:21 +00002778 AC_MSG_RESULT([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00002779 AC_MSG_CHECKING([for TIFF])
cristyad38abe2012-12-23 23:03:21 +00002780 AC_MSG_RESULT([])
cristy3ed852e2009-09-05 21:47:34 +00002781 failed=0
2782 passed=0
Cristyc1bfec22020-10-04 15:40:32 +00002783 AC_CHECK_HEADER([tiff.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
2784 AC_CHECK_HEADER([tiffio.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
2785 AC_CHECK_LIB([tiff],[TIFFOpen],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[])
2786 AC_CHECK_LIB([tiff],[TIFFClientOpen],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[])
2787 AC_CHECK_LIB([tiff],[TIFFIsByteSwapped],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[])
2788 AC_CHECK_LIB([tiff],[TIFFReadRGBATile],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[])
2789 AC_CHECK_LIB([tiff],[TIFFReadRGBAStrip],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[])
cristy3ed852e2009-09-05 21:47:34 +00002790 AC_MSG_CHECKING([if TIFF package is complete])
2791 if test $passed -gt 0; then
2792 if test $failed -gt 0; then
cristyad38abe2012-12-23 23:03:21 +00002793 AC_MSG_RESULT([no -- some components failed test])
cristy3ed852e2009-09-05 21:47:34 +00002794 have_tiff='no (failed tests)'
2795 else
2796 TIFF_LIBS='-ltiff'
2797 LIBS="$TIFF_LIBS $LIBS"
Cristyc1bfec22020-10-04 15:40:32 +00002798 AC_DEFINE([TIFF_DELEGATE],[1],[Define if you have TIFF library])
cristyad38abe2012-12-23 23:03:21 +00002799 AC_MSG_RESULT([yes])
cristy3ed852e2009-09-05 21:47:34 +00002800 have_tiff='yes'
2801 AC_CHECK_HEADERS(tiffconf.h)
2802 AC_CHECK_FUNCS([TIFFIsCODECConfigured TIFFMergeFieldInfo \
Elliott Hughes5d41fba2021-04-12 16:36:42 -07002803 TIFFIsBigEndian TIFFSetErrorHandlerExt TIFFSetTagExtender \
2804 TIFFReadEXIFDirectory TIFFReadGPSDirectory \
2805 TIFFSetWarningHandlerExt TIFFSwabArrayOfTriples])
cristy3ed852e2009-09-05 21:47:34 +00002806 fi
2807 else
cristyad38abe2012-12-23 23:03:21 +00002808 AC_MSG_RESULT([no])
cristy3ed852e2009-09-05 21:47:34 +00002809 fi
2810fi
Elliott Hughes5d41fba2021-04-12 16:36:42 -07002811AM_CONDITIONAL([TIFF_DELEGATE],[test "$have_tiff" = 'yes'])
Cristyc1bfec22020-10-04 15:40:32 +00002812AC_SUBST([TIFF_LIBS])
cristy3ed852e2009-09-05 21:47:34 +00002813
Cristyea6e8ae2019-09-30 07:21:16 -04002814dnl ===========================================================================
2815
Cristyfbca0d02017-09-27 16:52:52 -04002816#
2817# Set URW Base35 font directory.
2818#
2819AC_ARG_WITH([urw-base35-font-dir],
2820 [AC_HELP_STRING([--with-urw-base35-font-dir=DIR],
2821 [URW-base35 font directory])],
2822 [with_urw_base35_font_dir=$withval],
2823 [with_urw_base35_font_dir='default'])
2824
2825if test "$with_urw_base35_font_dir" != 'default'; then
2826 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-urw-base35-font-dir=$with_urw_base35_font_dir "
2827fi
2828
cristy3ed852e2009-09-05 21:47:34 +00002829dnl ===========================================================================
2830
2831#
Cristy692b6782017-11-19 12:35:18 -05002832# Check for the WEBP delegate library.
cristyb1860752011-03-14 00:27:46 +00002833#
Cristy692b6782017-11-19 12:35:18 -05002834AC_ARG_WITH([webp],
cristyb1860752011-03-14 00:27:46 +00002835 [AC_HELP_STRING([--without-webp],
2836 [disable WEBP support])],
2837 [with_webp=$withval],
2838 [with_webp='yes'])
2839
2840if test "$with_webp" != 'yes'; then
2841 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-webp=$with_webp "
2842fi
2843
2844have_webp='no'
Cristy692b6782017-11-19 12:35:18 -05002845have_webpmux='no'
2846WEBP_CFLAGS=""
2847WEBP_LIBS=""
2848WEBP_PKG=""
2849WEBPMUX_CFLAGS=""
2850WEBPMUX_LIBS=""
2851WEBPMUX_PKG=""
2852if test "x$with_webp" = "xyes"; then
2853 AC_MSG_RESULT([-------------------------------------------------------------])
Cristyc1bfec22020-10-04 15:40:32 +00002854 PKG_CHECK_MODULES([WEBP],[libwebp],[have_webp=yes],[have_webp=no])
2855 PKG_CHECK_MODULES([WEBPMUX],[libwebpmux >= 0.5.0 libwebpdemux >= 0.5.0],[have_webpmux=yes],[have_webpmux=no])
Cristy692b6782017-11-19 12:35:18 -05002856 AC_MSG_RESULT([])
cristyb1860752011-03-14 00:27:46 +00002857fi
cristyb1860752011-03-14 00:27:46 +00002858
Cristy692b6782017-11-19 12:35:18 -05002859if test "$have_webp" = 'yes'; then
Cristyc1bfec22020-10-04 15:40:32 +00002860 AC_DEFINE([WEBP_DELEGATE],[1],[Define if you have WEBP library])
Cristy692b6782017-11-19 12:35:18 -05002861 CFLAGS="$WEBP_CFLAGS $CFLAGS"
2862fi
2863
2864if test "$have_webpmux" = 'yes'; then
Cristyc1bfec22020-10-04 15:40:32 +00002865 AC_DEFINE([WEBPMUX_DELEGATE],[1],[Define if you have WEBPMUX library])
Cristy692b6782017-11-19 12:35:18 -05002866 CFLAGS="$WEBPMUX_CFLAGS $CFLAGS"
2867fi
2868
Elliott Hughes5d41fba2021-04-12 16:36:42 -07002869AM_CONDITIONAL([WEBP_DELEGATE],[test "$have_webp" = 'yes'])
2870AM_CONDITIONAL([WEBPMUX_DELEGATE],[test "$have_webpmux" = 'yes'])
Cristyc1bfec22020-10-04 15:40:32 +00002871AC_SUBST([WEBPMUX_CFLAGS])
2872AC_SUBST([WEBPMUX_LIBS])
2873AC_SUBST([WEBP_CFLAGS])
2874AC_SUBST([WEBP_LIBS])
Cristyfbca0d02017-09-27 16:52:52 -04002875
cristyb1860752011-03-14 00:27:46 +00002876dnl ===========================================================================
2877
2878#
cristy3ed852e2009-09-05 21:47:34 +00002879# Set Windows font directory.
2880#
cristy74554ef2011-10-27 12:56:11 +00002881AC_ARG_WITH([windows-font-dir],
cristy3ed852e2009-09-05 21:47:34 +00002882 [AC_HELP_STRING([--with-windows-font-dir=DIR],
cristy5a3dc992014-12-05 19:50:04 +00002883 [Windows font directory])],
2884 [with_windows_font_dir=$withval],
2885 [with_windows_font_dir='default'])
2886
2887if test "$with_windows_font_dir" != 'default'; then
cristy3ed852e2009-09-05 21:47:34 +00002888 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-windows-font-dir=$with_windows_font_dir "
2889fi
2890
2891dnl ===========================================================================
2892
2893#
2894# Check for WMF delegate library.
2895#
2896AC_ARG_WITH([wmf],
cristyd0a9a682012-02-11 00:21:53 +00002897 [AC_HELP_STRING([--with-wmf],
2898 [enable WMF support])],
cristy3ed852e2009-09-05 21:47:34 +00002899 [with_wmf=$withval],
Cristy35ed1a52020-09-28 20:09:36 +00002900 [with_wmf=$build_modules])
cristy3ed852e2009-09-05 21:47:34 +00002901
2902if test "$with_wmf" != 'yes'; then
2903 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-wmf=$with_wmf "
2904fi
2905
2906have_wmf='no'
cristyebc8f692015-06-16 10:36:30 +00002907WMF_LIBS=''
2908WMF_CFLAGS=''
2909OLIBS="$LIBS"
2910if test "$with_wmf" != 'no'; then
Elliott Hughes5d41fba2021-04-12 16:36:42 -07002911 AC_MSG_CHECKING([for WMF support])
cristy32f75d42015-06-05 18:46:23 +00002912 AC_MSG_RESULT([])
cristy735e8942010-04-02 20:32:57 +00002913
Cristyd111aac2019-11-24 13:04:06 -05002914 have_libwmflite='no'
cristyebc8f692015-06-16 10:36:30 +00002915 have_libwmf_ipa_h='no'
2916
2917 AC_CHECK_HEADER([libwmf/ipa.h],[have_libwmf_ipa_h='yes'],[],[$FT2BUILD_H])
2918 if test "$have_libwmf_ipa_h" = 'yes'; then
Cristyd111aac2019-11-24 13:04:06 -05002919 AC_CHECK_LIB([wmflite],[wmf_lite_create],[have_libwmflite='yes'],[],[])
2920 if test "$have_libwmflite" = 'yes'; then
Cristyc1bfec22020-10-04 15:40:32 +00002921 AC_DEFINE([WMF_DELEGATE],[1],[Define if you have WMF library])
Cristyd111aac2019-11-24 13:04:06 -05002922 WMF_LIBS='-lwmflite'
cristyebc8f692015-06-16 10:36:30 +00002923 LIBS="$WMF_LIBS $LIBS"
2924 have_wmf='yes'
2925 else
2926 AC_MSG_RESULT([no -- some components failed test])
2927 have_wmf='no (failed tests)'
Cristyd111aac2019-11-24 13:04:06 -05002928 have_wmflite='no (failed tests)'
cristyebc8f692015-06-16 10:36:30 +00002929 LIBS="$OLIBS"
2930 WMF_LIBS=''
2931 fi
2932 fi
2933fi
Elliott Hughes5d41fba2021-04-12 16:36:42 -07002934AC_MSG_CHECKING([if WMF package is complete])
cristy32f75d42015-06-05 18:46:23 +00002935if test "$have_wmf" = 'yes'; then
cristyebc8f692015-06-16 10:36:30 +00002936 AC_MSG_RESULT([yes])
2937else
2938 AC_MSG_RESULT([no])
cristy32f75d42015-06-05 18:46:23 +00002939fi
Cristyc1bfec22020-10-04 15:40:32 +00002940AM_CONDITIONAL([WMF_DELEGATE],[test "$have_wmf" = 'yes'])
cristyebc8f692015-06-16 10:36:30 +00002941AC_SUBST([WMF_CFLAGS])
2942AC_SUBST([WMF_LIBS])
cristy81beccd2011-10-03 18:17:24 +00002943
2944dnl ===========================================================================
2945
cristy3ed852e2009-09-05 21:47:34 +00002946#
2947# Check for XML delegate library.
2948#
cristy81beccd2011-10-03 18:17:24 +00002949AC_ARG_WITH([xml],
cristy3ed852e2009-09-05 21:47:34 +00002950 [AC_HELP_STRING([--without-xml],
2951 [disable XML support])],
2952 [with_xml=$withval],
cristyfc3d0222012-02-07 15:05:57 +00002953 [with_xml='yes'])
cristy3ed852e2009-09-05 21:47:34 +00002954
cristy81beccd2011-10-03 18:17:24 +00002955if test "$with_xml" != 'yes' ; then
cristy3ed852e2009-09-05 21:47:34 +00002956 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-xml=$with_xml "
2957fi
2958
cristy81beccd2011-10-03 18:17:24 +00002959have_xml='no'
cristy32f75d42015-06-05 18:46:23 +00002960XML_CFLAGS=""
2961XML_LIBS=""
2962XML_PKG=""
2963if test "x$with_xml" = "xyes"; then
2964 AC_MSG_RESULT([-------------------------------------------------------------])
Cristyc1bfec22020-10-04 15:40:32 +00002965 PKG_CHECK_MODULES([XML],[libxml-2.0 >= 2.0.0],[have_xml=yes],[have_xml=no])
cristy32f75d42015-06-05 18:46:23 +00002966 AC_MSG_RESULT([])
cristy3ed852e2009-09-05 21:47:34 +00002967fi
cristy32f75d42015-06-05 18:46:23 +00002968
2969if test "$have_xml" = 'yes'; then
Cristyc1bfec22020-10-04 15:40:32 +00002970 AC_DEFINE([XML_DELEGATE],[1],[Define if you have XML library])
cristy32f75d42015-06-05 18:46:23 +00002971 CFLAGS="$XML_CFLAGS $CFLAGS"
2972fi
2973
Elliott Hughes5d41fba2021-04-12 16:36:42 -07002974AM_CONDITIONAL([XML_DELEGATE],[test "$have_xml" = 'yes'])
Cristyc1bfec22020-10-04 15:40:32 +00002975AC_SUBST([XML_CFLAGS])
2976AC_SUBST([XML_LIBS])
cristy3ed852e2009-09-05 21:47:34 +00002977
2978dnl ===========================================================================
2979
Cristyd2b61342019-05-05 12:07:47 -04002980# Check for functions
2981#
Elliott Hughes5d41fba2021-04-12 16:36:42 -07002982AC_CHECK_FUNCS([acosh _aligned_malloc aligned_malloc asinh atanh atoll atexit cabs carg cimag creal clock clock_getres clock_gettime ctime_r directio erf _exit execvp fchmod floor fork ftime ftruncate getc_unlocked getcwd getpid getexecname getdtablesize getpagesize getpwnam_r getrlimit getrusage gettimeofday gmtime_r isnan j0 j1 lltostr localtime_r lstat memmove memset mkdir mkstemp munmap nanosleep newlocale _NSGetExecutablePath pclose _pclose poll popen _popen posix_fadvise posix_fallocate posix_madvise posix_memalign posix_spawnp pow pread putenv pwrite qsort_r raise rand_r readlink realpath select seekdir sendfile setlocale socket sqrt setvbuf stat strcasestr 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])
Cristyd2b61342019-05-05 12:07:47 -04002983
cristy3ed852e2009-09-05 21:47:34 +00002984# Substitute compiler name to build/link PerlMagick
2985#
cristy86b6e552015-06-06 13:25:16 +00002986AC_SUBST([PERLMAINCC])
cristy3ed852e2009-09-05 21:47:34 +00002987
2988#
2989# Configure install Paths
2990#
cristy7def36a2011-10-28 19:04:41 +00002991
cristy2a11bef2011-10-28 18:33:11 +00002992# Path to ImageMagick header files
cristybdabdd62013-03-04 17:43:36 +00002993INCLUDE_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
cristye52f12f2012-12-31 15:32:36 +00002994INCLUDE_PATH="${INCLUDE_DIR}/${INCLUDE_RELATIVE_PATH}"
2995DEFINE_INCLUDE_PATH="${INCLUDE_DIR}/${INCLUDE_RELATIVE_PATH}/"
cristy2a11bef2011-10-28 18:33:11 +00002996case "${build_os}" in
2997 mingw* )
2998 DEFINE_INCLUDE_PATH=`$WinPathScript "$DEFINE_INCLUDE_PATH" 1`
2999 ;;
3000esac
Cristyc1bfec22020-10-04 15:40:32 +00003001AC_DEFINE_UNQUOTED([INCLUDE_PATH],["$DEFINE_INCLUDE_PATH"],[Directory where ImageMagick headers live.])
3002AC_SUBST([INCLUDE_PATH])
cristy3ed852e2009-09-05 21:47:34 +00003003
cristye52f12f2012-12-31 15:32:36 +00003004# Path to ImageMagick header files (arch part)
3005INCLUDEARCH_PATH="${INCLUDEARCH_DIR}/${INCLUDE_RELATIVE_PATH}"
3006DEFINE_INCLUDEARCH_PATH="${INCLUDEARCH_DIR}/${INCLUDE_RELATIVE_PATH}/"
3007case "${build_os}" in
3008 mingw* )
3009 DEFINE_INCLUDEARCH_PATH=`$WinPathScript "$DEFINE_INCLUDEARCH_PATH" 1`
3010 ;;
3011esac
Cristyc1bfec22020-10-04 15:40:32 +00003012AC_DEFINE_UNQUOTED([INCLUDEARCH_PATH],["$DEFINE_INCLUDE_PATH"],[Directory where ImageMagick architecture headers live.])
3013AC_SUBST([INCLUDEARCH_PATH])
cristye52f12f2012-12-31 15:32:36 +00003014
cristy3ed852e2009-09-05 21:47:34 +00003015# Subdirectory under lib to place ImageMagick lib files
Elliott Hughes5d41fba2021-04-12 16:36:42 -07003016LIBRARY_RELATIVE_PATH="${PACKAGE_NAME}-${PACKAGE_BASE_VERSION}"
Cristyc1bfec22020-10-04 15:40:32 +00003017AC_DEFINE_UNQUOTED([LIBRARY_RELATIVE_PATH],["$LIBRARY_RELATIVE_PATH"],[Subdirectory of lib where ImageMagick architecture dependent files are installed.])
cristy3ed852e2009-09-05 21:47:34 +00003018
3019# Path to ImageMagick bin directory
3020EXECUTABLE_PATH="${BIN_DIR}"
3021DEFINE_EXECUTABLE_PATH="${BIN_DIR}/"
3022case "${build_os}" in
3023 mingw* )
3024 DEFINE_EXECUTABLE_PATH=`$WinPathScript "$DEFINE_EXECUTABLE_PATH" 1`
3025 ;;
3026esac
Cristyc1bfec22020-10-04 15:40:32 +00003027AC_DEFINE_UNQUOTED([EXECUTABLE_PATH],["$DEFINE_EXECUTABLE_PATH"],[Directory where executables are installed.])
3028AC_SUBST([EXECUTABLE_PATH])
cristy3ed852e2009-09-05 21:47:34 +00003029
3030# Path to ImageMagick lib
3031LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}"
3032DEFINE_LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}/"
3033case "${build_os}" in
3034 mingw* )
3035 DEFINE_LIBRARY_PATH=`$WinPathScript "$DEFINE_LIBRARY_PATH" 1`
3036 ;;
3037esac
Cristyc1bfec22020-10-04 15:40:32 +00003038AC_DEFINE_UNQUOTED([LIBRARY_PATH],["$DEFINE_LIBRARY_PATH"],[Directory where architecture-dependent files live.])
3039AC_SUBST([LIBRARY_PATH])
cristy3ed852e2009-09-05 21:47:34 +00003040
cristy3ed852e2009-09-05 21:47:34 +00003041#
cristy8d0ff762013-03-10 20:33:28 +00003042# path to local binaries
3043if test "x$LIB_BIN_BASEDIRNAME" = "x"; then
3044 LIB_BIN_BASEDIRNAME="bin"
3045fi
Cristyc1bfec22020-10-04 15:40:32 +00003046AC_DEFINE_UNQUOTED([LIB_BIN_BASEDIRNAME],["$LIB_BIN_BASEDIRNAME"],[Binaries in libraries path base name (will be during install linked to bin)])
3047AC_SUBST([LIB_BIN_BASEDIRNAME])
cristy8d0ff762013-03-10 20:33:28 +00003048
3049if test "x$LIB_BIN_DIR" = "x"; then
3050 LIB_BIN_DIR=${LIB_BIN_BASEDIRNAME}-${MAGICK_ABI_SUFFIX}
3051fi
Cristyc1bfec22020-10-04 15:40:32 +00003052AC_SUBST([LIB_BIN_DIR])
cristy8d0ff762013-03-10 20:33:28 +00003053
3054LIB_BIN_DIR_RELATIVE_PATH=$LIB_BIN_DIR
Cristyc1bfec22020-10-04 15:40:32 +00003055AC_SUBST([LIB_BIN_DIR_RELATIVE_PATH])
cristy8d0ff762013-03-10 20:33:28 +00003056LIB_BIN_DIR_PATH="${LIBRARY_PATH}/${LIB_BIN_DIR_RELATIVE_PATH}"
Cristyc1bfec22020-10-04 15:40:32 +00003057AC_SUBST([LIB_BIN_DIR_PATH])
cristy8d0ff762013-03-10 20:33:28 +00003058
3059#
cristy01ff9f32012-12-01 18:15:29 +00003060# path to modules lib
3061if test "x$MODULES_BASEDIRNAME" = "x"; then
3062 MODULES_BASEDIRNAME="modules"
3063fi
Cristyc1bfec22020-10-04 15:40:32 +00003064AC_DEFINE_UNQUOTED([MODULES_BASEDIRNAME],["$MODULES_BASEDIRNAME"],[Module directory name without ABI part.])
3065AC_SUBST([MODULES_BASEDIRNAME])
cristy01ff9f32012-12-01 18:15:29 +00003066
3067if test "x$MODULES_DIRNAME" = "x"; then
cristy7a26abd2012-12-03 00:18:59 +00003068 MODULES_DIRNAME=${MODULES_BASEDIRNAME}-${MAGICK_ABI_SUFFIX}
cristy4bdbd342012-12-03 18:41:18 +00003069else
Cristyc1bfec22020-10-04 15:40:32 +00003070 AC_DEFINE_UNQUOTED([MODULES_DIRNAME],["$MODULES_DIRNAME"],[Module directory dirname])
cristy01ff9f32012-12-01 18:15:29 +00003071fi
Cristyc1bfec22020-10-04 15:40:32 +00003072AC_SUBST([MODULES_DIRNAME])
cristy01ff9f32012-12-01 18:15:29 +00003073
cristy371d4812012-12-01 19:48:10 +00003074MODULES_RELATIVE_PATH="${MODULES_DIRNAME}"
Cristyc1bfec22020-10-04 15:40:32 +00003075AC_SUBST([MODULES_RELATIVE_PATH])
cristy01ff9f32012-12-01 18:15:29 +00003076MODULES_PATH="${LIBRARY_PATH}/${MODULES_RELATIVE_PATH}"
Cristyc1bfec22020-10-04 15:40:32 +00003077AC_SUBST([MODULES_PATH])
cristy01ff9f32012-12-01 18:15:29 +00003078
3079#
3080# path to coders lib
3081if test "x$CODER_DIRNAME" = "x"; then
3082 CODER_DIRNAME="coders"
3083fi
Cristyc1bfec22020-10-04 15:40:32 +00003084AC_DEFINE_UNQUOTED([CODER_DIRNAME],["$CODER_DIRNAME"],[coders subdirectory.])
3085AC_SUBST([CODER_DIRNAME])
cristy01ff9f32012-12-01 18:15:29 +00003086
cristy371d4812012-12-01 19:48:10 +00003087CODER_RELATIVE_PATH="${CODER_DIRNAME}"
cristy01ff9f32012-12-01 18:15:29 +00003088CODER_PATH="${MODULES_PATH}/${CODER_DIRNAME}"
Cristyc1bfec22020-10-04 15:40:32 +00003089AC_SUBST([CODER_PATH])
cristy3ed852e2009-09-05 21:47:34 +00003090
3091#
3092# Subdirectory under lib to place ImageMagick filter module files
cristy01ff9f32012-12-01 18:15:29 +00003093#
3094# path to coders lib
3095if test "x$FILTER_DIRNAME" = "x"; then
3096 FILTER_DIRNAME="filters"
3097fi
Cristyc1bfec22020-10-04 15:40:32 +00003098AC_DEFINE_UNQUOTED([FILTER_DIRNAME],["$FILTER_DIRNAME"],[filter subdirectory.])
3099AC_SUBST([FILTER_DIRNAME])
cristy01ff9f32012-12-01 18:15:29 +00003100
cristy371d4812012-12-01 19:48:10 +00003101FILTER_RELATIVE_PATH="${FILTER_DIRNAME}"
cristy01ff9f32012-12-01 18:15:29 +00003102FILTER_PATH="${MODULES_PATH}/${FILTER_DIRNAME}"
Cristyc1bfec22020-10-04 15:40:32 +00003103AC_SUBST([FILTER_PATH])
cristy3ed852e2009-09-05 21:47:34 +00003104
3105#
3106# Path to ImageMagick documentation files
Cristye35bdc62015-09-19 18:29:00 -04003107DOCUMENTATION_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
3108DOCUMENTATION_PATH="${DOC_DIR}/${DOCUMENTATION_RELATIVE_PATH}"
3109DEFINE_DOCUMENTATION_PATH="${DOC_DIR}/${DOCUMENTATION_RELATIVE_PATH}/"
cristy3ed852e2009-09-05 21:47:34 +00003110case "${build_os}" in
3111 mingw* )
3112 DEFINE_DOCUMENTATION_PATH=`$WinPathScript "$DEFINE_DOCUMENTATION_PATH" 1`
3113 ;;
3114esac
Cristyc1bfec22020-10-04 15:40:32 +00003115AC_DEFINE_UNQUOTED([DOCUMENTATION_PATH],["$DEFINE_DOCUMENTATION_PATH"],[Directory where ImageMagick documents live.])
3116AC_SUBST([DOCUMENTATION_PATH])
cristy3ed852e2009-09-05 21:47:34 +00003117
cristydd17feb2014-03-05 02:06:32 +00003118#
3119# Enable/Disable documentation
3120AC_ARG_ENABLE([docs],
3121 [AS_HELP_STRING([--disable-docs],
3122 [disable building of documentation])],
cristy02272312014-03-07 00:55:25 +00003123 wantdocs=$enableval, wantdocs=yes)
Cristyc1bfec22020-10-04 15:40:32 +00003124AM_CONDITIONAL([INSTALL_DOC],[test "$wantdocs" = "yes"])
cristydd17feb2014-03-05 02:06:32 +00003125
cristy2a11bef2011-10-28 18:33:11 +00003126# Subdirectory to place architecture-dependent configuration files
cristybdabdd62013-03-04 17:43:36 +00003127CONFIGURE_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
Cristyc1bfec22020-10-04 15:40:32 +00003128AC_DEFINE_UNQUOTED([CONFIGURE_RELATIVE_PATH],["$CONFIGURE_RELATIVE_PATH"],[Subdirectory of lib where architecture-dependent configuration files live.])
cristy7def36a2011-10-28 19:04:41 +00003129CONFIGURE_PATH="${SYSCONF_DIR}/${CONFIGURE_RELATIVE_PATH}/"
cristy29b1f6f2011-03-27 14:02:38 +00003130DEFINE_CONFIGURE_PATH="${SYSCONF_DIR}/${CONFIGURE_RELATIVE_PATH}/"
3131case "${build_os}" in
3132 mingw* )
3133 DEFINE_CONFIGURE_PATH=`$WinPathScript "$DEFINE_CONFIGURE_PATH" 1`
3134 ;;
3135esac
Cristyc1bfec22020-10-04 15:40:32 +00003136AC_DEFINE_UNQUOTED([CONFIGURE_PATH],["$DEFINE_CONFIGURE_PATH"],[Directory where architecture-dependent configuration files live.])
3137AC_SUBST([CONFIGURE_PATH])
cristy29b1f6f2011-03-27 14:02:38 +00003138
cristy2a11bef2011-10-28 18:33:11 +00003139# Subdirectory to place architecture-independent configuration files
cristybdabdd62013-03-04 17:43:36 +00003140SHARE_RELATIVE_PATH="${PACKAGE_NAME}-${MAGICK_MAJOR_VERSION}"
Cristyc1bfec22020-10-04 15:40:32 +00003141AC_DEFINE_UNQUOTED([SHARE_RELATIVE_PATH],["$SHARE_RELATIVE_PATH"],[Subdirectory of lib where architecture-independent configuration files live.])
cristy670aa3c2011-11-03 00:54:00 +00003142SHARE_PATH="${DATA_DIR}/${SHARE_RELATIVE_PATH}"
cristy4f820712011-04-01 12:35:43 +00003143DEFINE_SHARE_PATH="${DATA_DIR}/${SHARE_RELATIVE_PATH}/"
cristy3ed852e2009-09-05 21:47:34 +00003144case "${build_os}" in
3145 mingw* )
cristy4f820712011-04-01 12:35:43 +00003146 DEFINE_SHARE_PATH=`$WinPathScript "$DEFINE_SHARE_PATH" 1`
cristy3ed852e2009-09-05 21:47:34 +00003147 ;;
3148esac
Cristyc1bfec22020-10-04 15:40:32 +00003149AC_DEFINE_UNQUOTED([SHARE_PATH],["$DEFINE_SHARE_PATH"],[Directory where architecture-independent configuration files live.])
3150AC_SUBST([SHARE_PATH])
cristy3ed852e2009-09-05 21:47:34 +00003151
cristy23c7e9a2012-12-04 15:47:57 +00003152#
3153# Subdirectory to place architecture-dependent configuration files.
3154if test "x$SHAREARCH_BASEDIRNAME" = "x"; then
3155 SHAREARCH_BASEDIRNAME="config"
3156fi
Cristyc1bfec22020-10-04 15:40:32 +00003157AC_DEFINE_UNQUOTED([SHAREARCH_BASEDIRNAME],["$SHAREARCH_BASEDIRNAME"],[Sharearch directory name without ABI part.])
3158AC_SUBST([SHAREARCH_BASEDIRNAME])
cristy23c7e9a2012-12-04 15:47:57 +00003159
3160if test "x$SHAREARCH_DIRNAME" = "x"; then
3161 SHAREARCH_DIRNAME=${SHAREARCH_BASEDIRNAME}-${MAGICK_ABI_SUFFIX}
3162else
Cristyc1bfec22020-10-04 15:40:32 +00003163 AC_DEFINE_UNQUOTED([SHAREARCH_DIRNAME],["$SHAREARCH_DIRNAME"],[Sharearch directory dirname])
cristy23c7e9a2012-12-04 15:47:57 +00003164fi
Cristyc1bfec22020-10-04 15:40:32 +00003165AC_SUBST([SHAREARCH_DIRNAME])
cristy23c7e9a2012-12-04 15:47:57 +00003166
3167SHAREARCH_RELATIVE_PATH="${SHAREARCH_DIRNAME}"
Cristyc1bfec22020-10-04 15:40:32 +00003168AC_SUBST([SHAREARCH_RELATIVE_PATH])
cristy23c7e9a2012-12-04 15:47:57 +00003169SHAREARCH_PATH="${LIBRARY_PATH}/${SHAREARCH_RELATIVE_PATH}"
Cristyc1bfec22020-10-04 15:40:32 +00003170AC_SUBST([SHAREARCH_PATH])
cristy670aa3c2011-11-03 00:54:00 +00003171
cristy3ed852e2009-09-05 21:47:34 +00003172#
3173# program_transform_name is formed for use in a Makefile, so create a
3174# modified version for use in a shell script.
3175configure_transform_name=`echo ${program_transform_name} | sed 's,\\$\\$,$,'`
3176
3177# Default delegate definitions
cristyad38abe2012-12-23 23:03:21 +00003178AC_MSG_RESULT([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00003179AC_MSG_CHECKING([for ImageMagick delegate programs])
cristyad38abe2012-12-23 23:03:21 +00003180AC_MSG_RESULT([])
cristy212cd792014-12-12 00:51:03 +00003181BPGDecodeDelegateDefault='bpgdec'
3182BPGEncodeDelegateDefault='bpgenc'
cristy3d7f8062009-09-24 20:45:35 +00003183BlenderDecodeDelegateDefault='blender'
cristy3ed852e2009-09-05 21:47:34 +00003184BrowseDelegateDefault='xdg-open'
cristy3ed852e2009-09-05 21:47:34 +00003185DNGDecodeDelegateDefault='ufraw-batch'
Cristyab5fe292020-06-24 19:53:02 -04003186DOCDecodeDelegateDefault='libreoffice'
cristy3ed852e2009-09-05 21:47:34 +00003187GVCDecodeDelegateDefault='dot'
3188DVIDecodeDelegateDefault='dvips'
cristy3ed852e2009-09-05 21:47:34 +00003189EditorDelegateDefault='xterm'
Cristy59748702016-05-12 21:35:47 -04003190ConvertDelegateDefault=`echo magick | sed ${configure_transform_name}`
3191DisplayDelegateDefault=`echo magick | sed ${configure_transform_name}`
Cristyb7c02fa2020-08-09 17:20:25 -04003192Fig2devDelegateDefault='fig2dev'
Cristy59748702016-05-12 21:35:47 -04003193MogrifyDelegateDefault=`echo magick | sed ${configure_transform_name}`
cristy3ed852e2009-09-05 21:47:34 +00003194HPGLDecodeDelegateDefault='hp2xx'
3195HTMLDecodeDelegateDefault='html2ps'
3196ILBMDecodeDelegateDefault='ilbmtoppm'
3197ILBMEncodeDelegateDefault='ppmtoilbm'
cristy71f53d52013-04-27 13:33:59 +00003198JXRDecodeDelegateDefault='JxrDecApp'
3199JXREncodeDelegateDefault='JxrEncApp'
Cristy3ef15c02017-01-02 07:41:13 -05003200LEPDelegateDefault='lepton'
cristy3ed852e2009-09-05 21:47:34 +00003201LPDelegateDefault='lp'
3202LPRDelegateDefault='lpr'
cristy3ed852e2009-09-05 21:47:34 +00003203LaunchDelegateDefault='gimp'
cristy935c86e2010-06-05 23:50:07 +00003204MrSIDDecodeDelegateDefault='mrsidgeodecode'
cristy3ed852e2009-09-05 21:47:34 +00003205MVDelegateDefault='mv'
3206PCLDelegateDefault='pcl6'
cristy3ed852e2009-09-05 21:47:34 +00003207if test "$native_win32_build" = 'yes'; then
3208 PSDelegateDefault='gswin32c'
cristyb7931f12009-09-25 10:22:21 +00003209elif test "$gslib_framework" = 'yes'; then
cristy3ed852e2009-09-05 21:47:34 +00003210 PSDelegateDefault='gsc'
3211else
3212 PSDelegateDefault='gs'
3213fi
cristy3ed852e2009-09-05 21:47:34 +00003214RMDelegateDefault='rm'
cristy5281e322012-02-09 21:12:45 +00003215RSVGDecodeDelegateDefault='rsvg-convert'
cristyec6934f2012-08-14 18:38:40 +00003216SVGDecodeDelegateDefault='inkscape'
Cristy6bb35342020-11-07 14:23:18 +00003217TextEncodeDelegateDefault='tesseract'
Cristy9e113482019-08-21 09:19:28 -04003218TraceEncodeDelegateDefault='potrace'
Cristy6e040832020-10-14 22:45:34 +00003219VIDEODecodeDelegateDefault='ffmpeg'
3220VIDEOEncodeDelegateDefault='ffmpeg'
cristy86e86092013-08-04 17:43:57 +00003221WebPDecodeDelegateDefault='dwebp'
3222WebPEncodeDelegateDefault='cwebp'
Cristydc553c12016-05-09 13:27:06 -04003223WWWDecodeDelegateDefault='curl'
cristy3ed852e2009-09-05 21:47:34 +00003224XPSDelegateDefault='gxps'
cristy3ed852e2009-09-05 21:47:34 +00003225
3226# Search for delegates
Elliott Hughes5d41fba2021-04-12 16:36:42 -07003227AC_PATH_PROG([BPGDecodeDelegate],["$BPGDecodeDelegateDefault"],["$BPGDecodeDelegateDefault"])
3228AC_PATH_PROG([BPGEncodeDelegate],["$BPGEncodeDelegateDefault"],["$BPGEncodeDelegateDefault"])
3229AC_PATH_PROG([BlenderDecodeDelegate],["$BlenderDecodeDelegateDefault"],["$BlenderDecodeDelegateDefault"])
Cristyc1bfec22020-10-04 15:40:32 +00003230AC_PATH_PROGS([BrowseDelegate],["$BrowseDelegateDefault" google-chrome firefox konqueror mozilla lynx],["$BrowseDelegateDefault"])
Elliott Hughes5d41fba2021-04-12 16:36:42 -07003231AC_PATH_PROG([DNGDecodeDelegate],["$DNGDecodeDelegateDefault"],["$DNGDecodeDelegateDefault"])
3232AC_PATH_PROG([DOCDecodeDelegate],["$DOCDecodeDelegateDefault"],["$DOCDecodeDelegateDefault"])
3233AC_PATH_PROG([DVIDecodeDelegate],["$DVIDecodeDelegateDefault"],["$DVIDecodeDelegateDefault"])
3234AC_PATH_PROG([ConvertDelegate],["$ConvertDelegateDefault"],["$ConvertDelegateDefault"])
3235AC_PATH_PROG([DisplayDelegate],["$DisplayDelegateDefault"],["$DisplayDelegateDefault"])
3236AC_PATH_PROG([EditorDelegate],["$EditorDelegateDefault"],["$EditorDelegateDefault"])
3237AC_PATH_PROG([GVCDecodeDelegate],["$GVCDecodeDelegateDefault"],["$GVCDecodeDelegateDefault"])
3238AC_PATH_PROG([HPGLDecodeDelegate],["$HPGLDecodeDelegateDefault"],["$HPGLDecodeDelegateDefault"])
3239AC_PATH_PROG([HTMLDecodeDelegate],["$HTMLDecodeDelegateDefault"],["$HTMLDecodeDelegateDefault"])
3240AC_PATH_PROG([ILBMDecodeDelegate],["$ILBMDecodeDelegateDefault"],["$ILBMDecodeDelegateDefault"])
3241AC_PATH_PROG([ILBMEncodeDelegate],["$ILBMEncodeDelegateDefault"],["$ILBMEncodeDelegateDefault"])
3242AC_PATH_PROG([JXRDecodeDelegate],["$JXRDecodeDelegateDefault"],["$JXRDecodeDelegateDefault"])
3243AC_PATH_PROG([JXREncodeDelegate],["$JXREncodeDelegateDefault"],["$JXREncodeDelegateDefault"])
3244AC_PATH_PROG([LEPDelegate],["$LEPDelegateDefault"],["$LEPDelegateDefault"])
3245AC_PATH_PROG([LPDelegate],["$LPDelegateDefault"],[no])
3246AC_PATH_PROG([LPRDelegate],["$LPRDelegateDefault"],["$LPRDelegateDefault"])
3247AC_PATH_PROG([LaunchDelegate],["$LaunchDelegateDefault"],["$LaunchDelegateDefault"])
3248AC_PATH_PROG([MogrifyDelegate],["$MogrifyDelegateDefault"],["$MogrifyDelegateDefault"])
3249AC_PATH_PROG([VIDEODecodeDelegate],["$VIDEODecodeDelegateDefault"],["$VIDEODecodeDelegateDefault"])
3250AC_PATH_PROG([VIDEOEncodeDelegate],["$VIDEOEncodeDelegateDefault"],["$VIDEOEncodeDelegateDefault"])
3251AC_PATH_PROG([MrSIDDecodeDelegate],["$MrSIDDecodeDelegateDefault"],["$MrSIDDecodeDelegateDefault"])
3252AC_PATH_PROG([MVDelegate],["$MVDelegateDefault"],["$MVDelegateDefault"])
3253AC_PATH_PROG([PCLDelegate],["$PCLDelegateDefault"],["$PCLDelegateDefault"])
Cristyc1bfec22020-10-04 15:40:32 +00003254AC_PATH_PROGS([PSDelegate],[gsx gsc "$PSDelegateDefault"],["$PSDelegateDefault"])
Elliott Hughes5d41fba2021-04-12 16:36:42 -07003255AC_PATH_PROG([RMDelegate],["$RMDelegateDefault"],["$RMDelegateDefault"])
3256AC_PATH_PROG([RSVGDecodeDelegate],["$RSVGDecodeDelegateDefault"],["$RSVGDecodeDelegateDefault"])
3257AC_PATH_PROG([SVGDecodeDelegate],["$SVGDecodeDelegateDefault"],["$SVGDecodeDelegateDefault"])
3258AC_PATH_PROG([TextEncodeDelegate],["$TextEncodeDelegateDefault"],["$TextEncodeDelegateDefault"])
3259AC_PATH_PROG([TraceEncodeDelegate],["$TraceEncodeDelegateDefault"],["$TraceEncodeDelegateDefault"])
3260AC_PATH_PROG([Fig2devDelegate],["$Fig2devDelegateDefault"],["$Fig2devDelegateDefault"])
3261AC_PATH_PROG([WebPDecodeDelegate],["$WebPDecodeDelegateDefault"],["$WebPDecodeDelegateDefault"])
3262AC_PATH_PROG([WebPEncodeDelegate],["$WebPEncodeDelegateDefault"],["$WebPEncodeDelegateDefault"])
3263AC_PATH_PROG([WWWDecodeDelegate],["$WWWDecodeDelegateDefault"],["$WWWDecodeDelegateDelegateDefault"])
3264AC_PATH_PROG([XPSDelegate],["$XPSDelegateDefault"],["$XPSDelegateDefault"])
cristy3ed852e2009-09-05 21:47:34 +00003265
3266# Prefer lpr to lp; lp needs options tacked on.
3267if test "$LPRDelegate" != no; then
3268 PrintDelegate="$LPRDelegate"
3269else
3270 PrintDelegate="$LPDelegate -c -s"
3271fi
Cristyc1bfec22020-10-04 15:40:32 +00003272AC_SUBST([PrintDelegate])
cristy3ed852e2009-09-05 21:47:34 +00003273
3274# Installed ImageMagick utiltity paths
3275ConvertDelegate="${BIN_DIR}/${ConvertDelegateDefault}"
3276DisplayDelegate="${BIN_DIR}/${DisplayDelegateDefault}"
3277MogrifyDelegate="${BIN_DIR}/${MogrifyDelegateDefault}"
3278
3279# Set delegate booleans
cristy3ed852e2009-09-05 21:47:34 +00003280have_gs='no' ; if test "$PSDelegate" != "$PSDelegateDefault"; then have_gs='yes'; fi
3281have_hp2xx='no' ; if test "$HPGLDecodeDelegate" != "$HPGLDecodeDelegateDefault" ; then have_hp2xx='yes'; fi
3282have_ilbmtoppm='no' ; if test "$ILBMDecodeDelegate" != "$ILBMDecodeDelegateDefault" ; then have_ilbmtoppm='yes'; fi
cristy935c86e2010-06-05 23:50:07 +00003283have_mrsid='no'; if test "$MrSIDDecodeDelegate" != "$MrSIDDecodeDelegateDefault" ; then have_mrsid='yes'; fi
cristy3ed852e2009-09-05 21:47:34 +00003284have_pcl='no' ; if test "$PCLDelegate" != "$PCLDelegateDefault"; then have_pcl='yes'; fi
3285have_ppmtoilbm='no' ; if test "$ILBMEncodeDelegate" != "$ILBMEncodeDelegateDefault" ; then have_ppmtoilbm='yes'; fi
Cristy6e040832020-10-14 22:45:34 +00003286have_video='no'; if test "$VIDEODecodeDelegate" != "$VIDEODecodeDelegateDefault" ; then have_video='yes'; fi
cristy3ed852e2009-09-05 21:47:34 +00003287have_xps='no' ; if test "$XPSDelegate" != "$XPSDelegateDefault"; then have_xps='yes'; fi
3288
3289#
3290# Test for font directories
3291#
3292type_include_files=''
3293
Cristy6263d532016-05-01 18:39:52 -04003294# Apple fonts.
Cristyc1bfec22020-10-04 15:40:32 +00003295AC_MSG_CHECKING([for Apple fonts directory])
cristy5a3dc992014-12-05 19:50:04 +00003296apple_font_dir=''
3297if test "${with_apple_font_dir}" != 'default'; then
3298 apple_font_dir="${with_apple_font_dir}/"
3299else
3300 for font_dir in '/Library/Fonts/'; do
3301 if test -f "${font_dir}Arial.ttf"; then
3302 apple_font_dir="${font_dir}"
3303 break 1
3304 fi
3305 done
3306fi
3307if test "${apple_font_dir}x" != 'x'; then
3308 type_include_files="${type_include_files} "'<include file="type-apple.xml" />'
3309 AC_MSG_RESULT([$apple_font_dir])
3310else
3311 AC_MSG_RESULT([not found!]);
3312fi
Cristyc1bfec22020-10-04 15:40:32 +00003313AC_SUBST([apple_font_dir])
cristy5a3dc992014-12-05 19:50:04 +00003314
cristy430a7312010-01-21 20:44:04 +00003315# Dejavu fonts.
Cristyc1bfec22020-10-04 15:40:32 +00003316AC_MSG_CHECKING([for Dejavu fonts directory])
cristy430a7312010-01-21 20:44:04 +00003317dejavu_font_dir=''
3318if test "${with_dejavu_font_dir}" != 'default'; then
3319 dejavu_font_dir="${with_dejavu_font_dir}/"
3320else
3321 for font_dir in "${prefix}/share/dejavu/fonts/" '/usr/share/fonts/dejavu/'; do
3322 if test -f "${font_dir}DejaVuSerif.ttf"; then
3323 dejavu_font_dir="${font_dir}"
3324 break 1
3325 fi
3326 done
3327fi
3328if test "${dejavu_font_dir}x" != 'x'; then
3329 type_include_files="${type_include_files} "'<include file="type-dejavu.xml" />'
cristyad38abe2012-12-23 23:03:21 +00003330 AC_MSG_RESULT([$dejavu_font_dir])
cristy430a7312010-01-21 20:44:04 +00003331else
cristyad38abe2012-12-23 23:03:21 +00003332 AC_MSG_RESULT([not found!]);
cristy430a7312010-01-21 20:44:04 +00003333fi
Cristyc1bfec22020-10-04 15:40:32 +00003334AC_SUBST([dejavu_font_dir])
cristy430a7312010-01-21 20:44:04 +00003335
cristy3ed852e2009-09-05 21:47:34 +00003336# Ghostscript
Cristyc1bfec22020-10-04 15:40:32 +00003337AC_MSG_CHECKING([for Ghostscript fonts directory])
cristy3ed852e2009-09-05 21:47:34 +00003338ghostscript_font_dir=''
3339if test "${with_gs_font_dir}" != 'default'; then
3340 ghostscript_font_dir="${with_gs_font_dir}/"
3341else
3342 if test "${native_win32_build}" = 'yes'; then
3343 # Native Windows Build
3344 for font_dir in "c:\\Program Files\\gs\\fonts\\" "c:\\Program Files \(x86\)\\gs\\fonts\\" "c:\\gs\\fonts\\"; do
3345 if test -f "${font_dir}a010013l.pfb"; then
3346 ghostscript_font_dir="$font_dir"
3347 break 1
3348 fi
3349 done
3350 if test "${PSDelegate}" != 'gswin32c'; then
3351 ghostscript_font_dir=`echo "${PSDelegate}" | sed -e 's:/gs/.*:/gs:;s:^/::;s/./&:/;s:/:\\\\:g'`"\\fonts\\"
3352 fi
3353 else
3354 # Linux / Mac OS X / Unix Build
3355 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
3356 if test -f "${font_dir}a010013l.pfb"; then
3357 ghostscript_font_dir="${font_dir}"
3358 break 1
3359 fi
3360 done
3361 if test "${ghostscript_font_dir}x" = 'x'; then
3362 if test "$PSDelegate" != 'gs'; then
3363 ghostscript_font_dir=`echo "$PSDelegate" | sed -e 's:/bin/gs:/share/ghostscript/fonts:'`"/"
3364 fi
3365 fi
3366 fi
3367fi
3368if test "${ghostscript_font_dir}x" != 'x'; then
3369 type_include_files="${type_include_files} "'<include file="type-ghostscript.xml" />'
cristyad38abe2012-12-23 23:03:21 +00003370 AC_MSG_RESULT([$ghostscript_font_dir])
cristy3ed852e2009-09-05 21:47:34 +00003371else
cristyad38abe2012-12-23 23:03:21 +00003372 AC_MSG_RESULT([not found!]);
cristy3ed852e2009-09-05 21:47:34 +00003373fi
Cristyc1bfec22020-10-04 15:40:32 +00003374AC_SUBST([ghostscript_font_dir])
cristy3ed852e2009-09-05 21:47:34 +00003375case "${build_os}" in
3376 mingw* )
3377 PSDelegate=`$WinPathScript "$PSDelegate" 1`
3378 ;;
3379esac
3380
Cristyfbca0d02017-09-27 16:52:52 -04003381# URW-base35 fonts.
Cristyc1bfec22020-10-04 15:40:32 +00003382AC_MSG_CHECKING([for URW-base35 fonts directory])
Cristyfbca0d02017-09-27 16:52:52 -04003383urw_base35_font_dir=''
3384if test "${with_urw_base35_font_dir}" != 'default'; then
3385 urw_base35_font_dir="${with_urw_base35_font_dir}/"
Cristyfbca0d02017-09-27 16:52:52 -04003386fi
3387if test "${urw_base35_font_dir}x" != 'x'; then
3388 type_include_files="${type_include_files} "'<include file="type-urw-base35.xml" />'
3389 AC_MSG_RESULT([$urw_base35_font_dir])
3390else
3391 AC_MSG_RESULT([not found!]);
3392fi
Cristyc1bfec22020-10-04 15:40:32 +00003393AC_SUBST([urw_base35_font_dir])
Cristyfbca0d02017-09-27 16:52:52 -04003394
cristy5a3dc992014-12-05 19:50:04 +00003395# Windows fonts.
Cristyc1bfec22020-10-04 15:40:32 +00003396AC_MSG_CHECKING([for Windows fonts directory])
cristy5a3dc992014-12-05 19:50:04 +00003397windows_font_dir=''
3398if test "${with_windows_font_dir}" != 'default'; then
3399 windows_font_dir="${with_windows_font_dir}/"
3400else
Cristy6fa18762018-12-16 14:48:50 -05003401 for font_dir in '/usr/X11R6/lib/X11/fonts/truetype/' '/usr/X11R7/lib/X11/fonts/truetype/' '/usr/share/fonts/msttcore/' '/usr/share/fonts/microsoft/' '/usr/share/fonts/truetype/msttcorefonts/'; do
cristy5a3dc992014-12-05 19:50:04 +00003402 if test -f "${font_dir}arial.ttf"; then
3403 windows_font_dir="${font_dir}"
3404 break 1
3405 fi
3406 done
3407fi
3408if test "${windows_font_dir}x" != 'x'; then
3409 type_include_files="${type_include_files} "'<include file="type-windows.xml" />'
3410 AC_MSG_RESULT([$windows_font_dir])
3411else
3412 AC_MSG_RESULT([not found!]);
3413fi
Cristyc1bfec22020-10-04 15:40:32 +00003414AC_SUBST([windows_font_dir])
cristy5a3dc992014-12-05 19:50:04 +00003415
Cristyc1bfec22020-10-04 15:40:32 +00003416AC_SUBST([type_include_files])
cristy3ed852e2009-09-05 21:47:34 +00003417
3418#
3419# Handle case where user doesn't want frozen paths
3420#
3421if test "$with_frozenpaths" != 'yes'; then
3422 # Re-set delegate definitions to default (no paths)
Cristy06c41ab2016-04-30 10:23:22 -04003423 BPGDecodeDelegate="$BPGDecodeDelegateDefault"
3424 BPGEncodeDelegate="$BPGEncodeDelegateDefault"
cristy3ed852e2009-09-05 21:47:34 +00003425 BlenderDecodeDelegate="$BlenderDecodeDelegateDefault"
cristy3ed852e2009-09-05 21:47:34 +00003426 BrowseDelegate="$BrowseDelegateDefault"
cristy3ed852e2009-09-05 21:47:34 +00003427 ConvertDelegate="$ConvertDelegateDefault"
cristy71f53d52013-04-27 13:33:59 +00003428 DisplayDelegate="$DisplayDelegateDefault"
3429 DNGDecodeDelegate="$DNGDecodeDelegateDefault"
cristy66f238e2014-05-16 12:21:48 +00003430 DOCDecodeDelegate="$DOCDecodeDelegateDefault"
cristy3ed852e2009-09-05 21:47:34 +00003431 DVIDecodeDelegate="$DVIDecodeDelegateDefault"
cristy3ed852e2009-09-05 21:47:34 +00003432 EditorDelegate="$EditorDelegateDefault"
cristy71f53d52013-04-27 13:33:59 +00003433 GVCDecodeDelegate="$GVCDecodeDelegateDefault"
cristy3ed852e2009-09-05 21:47:34 +00003434 HPGLDecodeDelegate="$HPGLDecodeDelegateDefault"
3435 HTMLDecodeDelegate="$HTMLDecodeDelegateDefault"
3436 ILBMDecodeDelegate="$ILBMDecodeDelegateDefault"
3437 ILBMEncodeDelegate="$ILBMEncodeDelegateDefault"
cristy71f53d52013-04-27 13:33:59 +00003438 JXRDecodeDelegate="$JXRDecodeDelegateDefault"
3439 JXREncodeDelegate="$JXREncodeDelegateDefault"
Cristy3ef15c02017-01-02 07:41:13 -05003440 LEPDelegate="$LEPDelegateDefault"
cristy3ed852e2009-09-05 21:47:34 +00003441 LPDelegate="$LPDelegateDefault"
cristy3ed852e2009-09-05 21:47:34 +00003442 LaunchDelegate="$LaunchDelegateDefault"
cristy3ed852e2009-09-05 21:47:34 +00003443 MogrifyDelegate="$MogrifyDelegateDefault"
cristy935c86e2010-06-05 23:50:07 +00003444 MrSIDDecodeDelegate="$MrSIDDecodeDelegateDefault"
cristy3ed852e2009-09-05 21:47:34 +00003445 PCLDelegate="$PCLDelegateDefault"
cristy3ed852e2009-09-05 21:47:34 +00003446 PSDelegate="$PSDelegateDefault"
cristy4689cf02010-02-17 21:15:45 +00003447 RSVGDecodeDelegate="$RSVGDecodeDelegateDefault"
cristyec6934f2012-08-14 18:38:40 +00003448 SVGDecodeDelegate="$SVGDecodeDelegateDefault"
cristy3ed852e2009-09-05 21:47:34 +00003449 ShowImageDelegate="$ShowImageDelegateDefault"
Cristy6bb35342020-11-07 14:23:18 +00003450 TextEncodeDelegate="$TextEncodeDelegateDefault"
Cristy9e113482019-08-21 09:19:28 -04003451 TraceEncodeDelegate="$TraceEncodeDelegateDefault"
Cristyb7c02fa2020-08-09 17:20:25 -04003452 Fig2devDelegate="$Fig2devDelegateDefault"
Cristy6e040832020-10-14 22:45:34 +00003453 VIDEODecodeDelegate="$VIDEODecodeDelegateDefault"
3454 VIDEOEncodeDelegate="$VIDEOEncodeDelegateDefault"
cristy86e86092013-08-04 17:43:57 +00003455 WebPDecodeDelegate="$WebPDecodeDelegateDefault"
3456 WebPEncodeDelegate="$WebPEncodeDelegateDefault"
Cristydc553c12016-05-09 13:27:06 -04003457 WWWDecodeDelegate="$WWWDecodeDelegateDefault"
cristy3ed852e2009-09-05 21:47:34 +00003458 XPSDelegate="$XPSDelegateDefault"
cristy3ed852e2009-09-05 21:47:34 +00003459fi
3460
3461# Delegate substitutions
Cristyc1bfec22020-10-04 15:40:32 +00003462AC_SUBST([BPGDecodeDelegate])
3463AC_SUBST([BPGEncodeDelegate])
3464AC_SUBST([BlenderDecodeDelegate])
3465AC_SUBST([BrowseDelegate])
3466AC_SUBST([ConvertDelegate])
3467AC_SUBST([GVCDecodeDelegate])
3468AC_SUBST([DVIDecodeDelegate])
3469AC_SUBST([EditorDelegate])
3470AC_SUBST([Fig2devDelegate])
3471AC_SUBST([HPGLDecodeDelegate])
3472AC_SUBST([HTMLDecodeDelegate])
3473AC_SUBST([ILBMDecodeDelegate])
3474AC_SUBST([ILBMEncodeDelegate])
3475AC_SUBST([JXRDecodeDelegate])
3476AC_SUBST([JXREncodeDelegate])
3477AC_SUBST([LaunchDelegate])
3478AC_SUBST([LEPDelegate])
3479AC_SUBST([LPDelegate])
Cristy6e040832020-10-14 22:45:34 +00003480AC_SUBST([VIDEODecodeDelegate])
3481AC_SUBST([VIDEOEncodeDelegate])
Cristyc1bfec22020-10-04 15:40:32 +00003482AC_SUBST([MogrifyDelegate])
3483AC_SUBST([MrSIDDecodeDelegate])
3484AC_SUBST([PCLDelegate])
3485AC_SUBST([PSDelegate])
3486AC_SUBST([ShowImageDelegate])
Cristy6bb35342020-11-07 14:23:18 +00003487AC_SUBST([TextEncodeDelegate])
Cristyc1bfec22020-10-04 15:40:32 +00003488AC_SUBST([TraceEncodeDelegate])
3489AC_SUBST([WebPDecodeDelegate])
3490AC_SUBST([WebPEncodeDelegate])
3491AC_SUBST([WWWDecodeDelegate])
3492AC_SUBST([XPSDelegate])
cristy3ed852e2009-09-05 21:47:34 +00003493
3494#
3495# RPM support.
3496#
3497RPM=''
Cristyc1bfec22020-10-04 15:40:32 +00003498AC_CHECK_PROGS([TAR],[gnutar gtar tar])
3499AC_CHECK_PROGS([PERL],[perl])
3500AC_CHECK_PROGS([RPM],[rpmbuild rpm])
3501AM_MISSING_PROG([ACLOCAL],[aclocal],[$missing_dir])
3502AM_MISSING_PROG([AUTOCONF],[autoconf],[$missing_dir])
3503AM_MISSING_PROG([AUTOMAKE],[automake],[$missing_dir])
3504AM_MISSING_PROG([AUTOHEADER],[autoheader],[$missing_dir])
3505AC_SUBST([RPM])
Elliott Hughes5d41fba2021-04-12 16:36:42 -07003506AM_CONDITIONAL([RPM_DELEGATE],[test "x$RPM" != "x"])
cristy3ed852e2009-09-05 21:47:34 +00003507
3508#
3509# 7ZIP support (http://p7zip.sourceforge.net/)
3510#
3511P7ZIP=''
Cristyc1bfec22020-10-04 15:40:32 +00003512AC_CHECK_PROGS([P7ZIP],[7za])
3513AC_SUBST([P7ZIP])
Elliott Hughes5d41fba2021-04-12 16:36:42 -07003514AM_CONDITIONAL([P7ZIP_DELEGATE],[test "x$P7ZIP" != "x"])
cristy3ed852e2009-09-05 21:47:34 +00003515
3516#
3517# ZIP support (http://www.info-zip.org/Zip.html)
3518#
3519ZIP=''
Cristyc1bfec22020-10-04 15:40:32 +00003520AC_CHECK_PROGS([ZIP],[zip])
3521AC_SUBST([ZIP])
Elliott Hughes5d41fba2021-04-12 16:36:42 -07003522AM_CONDITIONAL([ZIP_DELEGATE],[test "x$ZIP" != "x"])
cristy3ed852e2009-09-05 21:47:34 +00003523
3524#
3525# GhostPCL related configuration.
3526#
3527PCLColorDevice=ppmraw
cristy8bc84082011-09-07 13:57:00 +00003528PCLCMYKDevice=pamcmyk32
cristy3ed852e2009-09-05 21:47:34 +00003529PCLMonoDevice=pbmraw
3530if test -z "$PCLVersion"; then
3531 PCLVersion='unknown'
3532fi
3533if test $have_pcl = 'yes'; then
cristyad38abe2012-12-23 23:03:21 +00003534 AC_MSG_RESULT([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00003535 AC_MSG_CHECKING([for PCL])
cristyad38abe2012-12-23 23:03:21 +00003536 AC_MSG_RESULT([])
cristy3ed852e2009-09-05 21:47:34 +00003537 # PCLColorDevice
3538 AC_MSG_CHECKING([for pcl color device])
cristy86e31f32015-06-06 15:47:32 +00003539 if $PCLDelegate -dBATCH -sDEVICE=$PCLColorDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
cristy3ed852e2009-09-05 21:47:34 +00003540 :
3541 else
3542 PCLColorDevice=ppmraw
3543 fi
cristyad38abe2012-12-23 23:03:21 +00003544 AC_MSG_RESULT([$PCLColorDevice])
cristy3ed852e2009-09-05 21:47:34 +00003545
3546 # PCLCMYKDevice
3547 AC_MSG_CHECKING([for pcl CMYK device])
cristy86e31f32015-06-06 15:47:32 +00003548 if $PCLDelegate -dBATCH -sDEVICE=$PCLColorDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
cristy3ed852e2009-09-05 21:47:34 +00003549 :
3550 else
3551 PCLCMYKDevice=$PCLColorDevice
3552 fi
cristyad38abe2012-12-23 23:03:21 +00003553 AC_MSG_RESULT([$PCLCMYKDevice])
cristy3ed852e2009-09-05 21:47:34 +00003554
3555 # PCLMonoDevice
3556 AC_MSG_CHECKING([for pcl mono device])
cristy86e31f32015-06-06 15:47:32 +00003557 if $PCLDelegate -dBATCH -sDEVICE=$PCLMonoDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
cristy3ed852e2009-09-05 21:47:34 +00003558 :
3559 else
3560 PCLMonoDevice=$PCLColorDevice
3561 fi
cristyad38abe2012-12-23 23:03:21 +00003562 AC_MSG_RESULT([$PCLMonoDevice])
cristy3ed852e2009-09-05 21:47:34 +00003563fi
3564
Cristyc1bfec22020-10-04 15:40:32 +00003565AC_SUBST([PCLMonoDevice])
3566AC_SUBST([PCLColorDevice])
3567AC_SUBST([PCLCMYKDevice])
3568AC_SUBST([PCLVersion])
cristy3ed852e2009-09-05 21:47:34 +00003569
3570#
3571# GhostXPS related configuration.
3572#
3573XPSColorDevice=ppmraw
3574XPSCMYKDevice=bmpsep8
3575XPSMonoDevice=pbmraw
3576if test -z "$XPSVersion"; then
3577 XPSVersion='unknown'
3578fi
3579if test $have_xps = 'yes'; then
cristyad38abe2012-12-23 23:03:21 +00003580 AC_MSG_RESULT([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00003581 AC_MSG_CHECKING([for XPS])
cristyad38abe2012-12-23 23:03:21 +00003582 AC_MSG_RESULT([])
cristy3ed852e2009-09-05 21:47:34 +00003583 # XPSColorDevice
3584 AC_MSG_CHECKING([for xps color device])
cristy86e31f32015-06-06 15:47:32 +00003585 if $XPSDelegate -dBATCH -sDEVICE=$XPSColorDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
cristy3ed852e2009-09-05 21:47:34 +00003586 :
3587 else
3588 XPSColorDevice=ppmraw
3589 fi
cristyad38abe2012-12-23 23:03:21 +00003590 AC_MSG_RESULT([$XPSColorDevice])
cristy3ed852e2009-09-05 21:47:34 +00003591
3592 # XPSCMYKDevice
3593 AC_MSG_CHECKING([for xps CMYK device])
cristy86e31f32015-06-06 15:47:32 +00003594 if $XPSDelegate -dBATCH -sDEVICE=$XPSColorDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
cristy3ed852e2009-09-05 21:47:34 +00003595 :
3596 else
3597 XPSCMYKDevice=$XPSColorDevice
3598 fi
cristyad38abe2012-12-23 23:03:21 +00003599 AC_MSG_RESULT([$XPSCMYKDevice])
cristy3ed852e2009-09-05 21:47:34 +00003600
3601 # XPSMonoDevice
3602 AC_MSG_CHECKING([for xps mono device])
cristy86e31f32015-06-06 15:47:32 +00003603 if $XPSDelegate -dBATCH -sDEVICE=$XPSMonoDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
cristy3ed852e2009-09-05 21:47:34 +00003604 :
3605 else
3606 XPSMonoDevice=$XPSColorDevice
3607 fi
cristyad38abe2012-12-23 23:03:21 +00003608 AC_MSG_RESULT([$XPSMonoDevice])
cristy3ed852e2009-09-05 21:47:34 +00003609fi
3610
Cristyc1bfec22020-10-04 15:40:32 +00003611AC_SUBST([XPSMonoDevice])
3612AC_SUBST([XPSColorDevice])
3613AC_SUBST([XPSCMYKDevice])
3614AC_SUBST([XPSVersion])
cristy3ed852e2009-09-05 21:47:34 +00003615
3616#
3617# Ghostscript related configuration.
3618#
cristya97426c2011-02-04 01:41:27 +00003619GSAlphaDevice=pngalpha
Cristy13f5e9a2019-11-29 12:24:16 -05003620GSColorDevice=png16m
cristy63970c52015-06-06 16:09:04 +00003621GSCMYKDevice=pamcmyk32
cristy3ed852e2009-09-05 21:47:34 +00003622GSMonoDevice=pbmraw
3623GSPDFDevice=pdfwrite
cristyb096ea52013-10-26 20:56:38 +00003624GSPSDevice=ps2write
cristya5b91e72015-01-07 15:39:36 +00003625GSEPSDevice=eps2write
cristy3ed852e2009-09-05 21:47:34 +00003626GSVersion='unknown'
3627if test $have_gs = 'yes'; then
cristyad38abe2012-12-23 23:03:21 +00003628 AC_MSG_RESULT([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00003629 AC_MSG_CHECKING([for Ghostscript])
cristyad38abe2012-12-23 23:03:21 +00003630 AC_MSG_RESULT([])
cristy3ed852e2009-09-05 21:47:34 +00003631 AC_MSG_CHECKING([for Ghostscript version])
3632 if GSVersion=`$PSDelegate --version`; then
3633 :
3634 else
3635 GSVersion=`$PSDelegate --help | sed -e '1q' | awk '{ print $3 }'`
3636 fi
cristyad38abe2012-12-23 23:03:21 +00003637 AC_MSG_RESULT([$GSVersion])
cristy3ed852e2009-09-05 21:47:34 +00003638
cristy3ed852e2009-09-05 21:47:34 +00003639 # GSColorDevice
3640 AC_MSG_CHECKING([for gs color device])
cristy86e31f32015-06-06 15:47:32 +00003641 if $PSDelegate -q -dBATCH -sDEVICE=$GSColorDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
cristy3ed852e2009-09-05 21:47:34 +00003642 :
3643 else
cristy63970c52015-06-06 16:09:04 +00003644 GSColorDevice=ppmraw
cristy3ed852e2009-09-05 21:47:34 +00003645 fi
cristyad38abe2012-12-23 23:03:21 +00003646 AC_MSG_RESULT([$GSColorDevice])
cristy3ed852e2009-09-05 21:47:34 +00003647
cristy63970c52015-06-06 16:09:04 +00003648 # GSAlphaDevice
3649 AC_MSG_CHECKING([for gs alpha device])
3650 if $PSDelegate -q -dBATCH -sDEVICE=$GSAlphaDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
3651 :
3652 else
3653 GSAlphaDevice=$GSColorDevice
3654 fi
3655 AC_MSG_RESULT([$GSAlphaDevice])
3656
cristy3ed852e2009-09-05 21:47:34 +00003657 # GSCMYKDevice
3658 AC_MSG_CHECKING([for gs CMYK device])
cristy86e31f32015-06-06 15:47:32 +00003659 if $PSDelegate -q -dBATCH -sDEVICE=$GSCMYKDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
cristy3ed852e2009-09-05 21:47:34 +00003660 :
3661 else
cristy63970c52015-06-06 16:09:04 +00003662 GSCMYKDevice=pam
cristy3ed852e2009-09-05 21:47:34 +00003663 fi
cristyad38abe2012-12-23 23:03:21 +00003664 AC_MSG_RESULT([$GSCMYKDevice])
cristy3ed852e2009-09-05 21:47:34 +00003665
3666 # GSMonoDevice
3667 AC_MSG_CHECKING([for gs mono device])
cristy86e31f32015-06-06 15:47:32 +00003668 if $PSDelegate -q -dBATCH -sDEVICE=$GSMonoDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
cristy3ed852e2009-09-05 21:47:34 +00003669 :
3670 else
3671 GSMonoDevice=$GSColorDevice
3672 fi
cristyad38abe2012-12-23 23:03:21 +00003673 AC_MSG_RESULT([$GSMonoDevice])
cristy3ed852e2009-09-05 21:47:34 +00003674
3675 # GSPDFDevice
3676 AC_MSG_CHECKING([for gs PDF writing device])
cristy86e31f32015-06-06 15:47:32 +00003677 if $PSDelegate -q -dBATCH -sDEVICE=$GSPDFDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
cristy3ed852e2009-09-05 21:47:34 +00003678 :
3679 else
3680 GSPDFDevice=nodevice
3681 fi
cristy63970c52015-06-06 16:09:04 +00003682 AC_MSG_RESULT([$GSPDFDevice])
cristy3ed852e2009-09-05 21:47:34 +00003683
3684 # GSPSDevice
3685 AC_MSG_CHECKING([for gs PS writing device])
cristy86e31f32015-06-06 15:47:32 +00003686 if $PSDelegate -q -dBATCH -sDEVICE=$GSPSDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
cristy3ed852e2009-09-05 21:47:34 +00003687 :
3688 else
cristy15308162015-01-09 23:43:12 +00003689 GSPSDevice=pswrite
cristy3ed852e2009-09-05 21:47:34 +00003690 fi
cristyad38abe2012-12-23 23:03:21 +00003691 AC_MSG_RESULT([$GSPSDevice])
cristy3ed852e2009-09-05 21:47:34 +00003692
3693 # GSEPSDevice
3694 AC_MSG_CHECKING([for gs EPS writing device])
cristy86e31f32015-06-06 15:47:32 +00003695 if $PSDelegate -q -dBATCH -sDEVICE=$GSEPSDevice -sOutputFile=/dev/null < /dev/null 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
cristy3ed852e2009-09-05 21:47:34 +00003696 :
3697 else
cristy15308162015-01-09 23:43:12 +00003698 GSEPSDevice=epswrite
cristy3ed852e2009-09-05 21:47:34 +00003699 fi
cristyad38abe2012-12-23 23:03:21 +00003700 AC_MSG_RESULT([$GSEPSDevice])
cristy3ed852e2009-09-05 21:47:34 +00003701fi
3702
Cristyc1bfec22020-10-04 15:40:32 +00003703AC_SUBST([GSAlphaDevice])
3704AC_SUBST([GSCMYKDevice])
3705AC_SUBST([GSColorDevice])
3706AC_SUBST([GSEPSDevice])
3707AC_SUBST([GSMonoDevice])
3708AC_SUBST([GSPDFDevice])
3709AC_SUBST([GSPSDevice])
3710AC_SUBST([GSVersion])
cristy3ed852e2009-09-05 21:47:34 +00003711
3712#
3713# PerlMagick-related configuration
3714#
3715
3716# Look for PERL if PerlMagick requested
3717# If name/path of desired PERL interpreter is specified, look for that one first
3718have_perl='no'
3719if test "$with_perl" != 'no'; then
cristyad38abe2012-12-23 23:03:21 +00003720 AC_MSG_RESULT([-------------------------------------------------------------])
cristy3ed852e2009-09-05 21:47:34 +00003721 AC_MSG_CHECKING([for Perl])
cristyad38abe2012-12-23 23:03:21 +00003722 AC_MSG_RESULT([])
cristy3ed852e2009-09-05 21:47:34 +00003723 if test "$with_perl" != 'yes'; then
Cristyc1bfec22020-10-04 15:40:32 +00003724 AC_CACHE_CHECK([for perl],[ac_cv_path_PERL],[ac_cv_path_PERL="$with_perl"]);
cristy3ed852e2009-09-05 21:47:34 +00003725 PERL=$ac_cv_path_PERL
Cristyc1bfec22020-10-04 15:40:32 +00003726 AC_SUBST([PERL])dnl
cristy3ed852e2009-09-05 21:47:34 +00003727 have_perl="$ac_cv_path_PERL"
3728 else
Cristyc1bfec22020-10-04 15:40:32 +00003729 AC_PATH_PROGS([PERL],[perl perl5],[])dnl
cristy3ed852e2009-09-05 21:47:34 +00003730 if test "$ac_cv_path_PERL"; then
3731 have_perl="$ac_cv_path_PERL"
3732 fi
3733 fi
3734fi
3735
cristy949301e2010-01-06 01:38:40 +00003736if test "$with_perl" != 'yes' ; then
3737 DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-perl=$with_perl "
3738fi
3739
3740PERL_SUPPORTS_DESTDIR='no'
3741
cristy3ed852e2009-09-05 21:47:34 +00003742with_perl_static='no'
3743with_perl_dynamic='no'
3744if test "$have_perl" != 'no'; then
3745 if test "$with_perl" != 'no' && test "$libtool_build_shared_libs" = 'no'; then
3746 with_perl_static='yes'
3747 fi
3748 if test "$with_perl" != 'no' && test "$libtool_build_shared_libs" = 'yes'; then
3749 with_perl_dynamic='yes'
3750 fi
3751 # Is PERL's MakeMaker new enough to support DESTDIR?
cristy964cb7f2010-04-25 23:18:00 +00003752 AX_PROG_PERL_VERSION(5.8.1,[PERL_SUPPORTS_DESTDIR='yes'],[PERL_SUPPORTS_DESTDIR='no'])
cristy3ed852e2009-09-05 21:47:34 +00003753fi
Elliott Hughes5d41fba2021-04-12 16:36:42 -07003754AM_CONDITIONAL([WITH_PERL],[test "$have_perl" != 'no'])
3755AM_CONDITIONAL([WITH_PERL_STATIC],[test $with_perl_static = 'yes'])
3756AM_CONDITIONAL([WITH_PERL_DYNAMIC],[test $with_perl_dynamic = 'yes'])
Cristyc1bfec22020-10-04 15:40:32 +00003757AC_SUBST([PERL_SUPPORTS_DESTDIR])
cristy3ed852e2009-09-05 21:47:34 +00003758
3759# Determine path to pick up MagickCore library from for use with building PerlMagick
3760MAGICKCORE_PATH="${LIB_DIR}"
3761if test $with_perl_static = 'yes'; then
3762 # Find out where libtool hides its uninstalled libraries (as libtool_objdir)
3763 libtool_objdir=$objdir
3764
3765 # Linker search path to library, followed by -lMagickCore
cristy4c08aed2011-07-01 19:47:50 +00003766 MAGICKCORE_PATH="${builddir}/MagickCore/${libtool_objdir}"
cristy3ed852e2009-09-05 21:47:34 +00003767fi
Cristyc1bfec22020-10-04 15:40:32 +00003768AC_SUBST([MAGICKCORE_PATH])
cristy3ed852e2009-09-05 21:47:34 +00003769
cristy2a3eb392012-12-17 13:39:20 +00003770# Create a simple string containing format names for all delegate libraries.
cristy422d5502012-12-22 22:20:57 +00003771MAGICK_DELEGATES=''
cristy2a3eb392012-12-17 13:39:20 +00003772if test "$have_autotrace" = 'yes' ; then
cristy422d5502012-12-22 22:20:57 +00003773 MAGICK_DELEGATES="$MAGICK_DELEGATES autotrace"
cristy3ed852e2009-09-05 21:47:34 +00003774fi
cristy2a3eb392012-12-17 13:39:20 +00003775if test "$have_bzlib" = 'yes' ; then
cristy422d5502012-12-22 22:20:57 +00003776 MAGICK_DELEGATES="$MAGICK_DELEGATES bzlib"
cristy2a3eb392012-12-17 13:39:20 +00003777fi
3778if test "$have_dps" = 'yes' ; then
cristy422d5502012-12-22 22:20:57 +00003779 MAGICK_DELEGATES="$MAGICK_DELEGATES dps"
cristy2a3eb392012-12-17 13:39:20 +00003780fi
3781if test "$have_djvu" = 'yes' ; then
cristy422d5502012-12-22 22:20:57 +00003782 MAGICK_DELEGATES="$MAGICK_DELEGATES djvu"
cristy2a3eb392012-12-17 13:39:20 +00003783fi
cristy2a3eb392012-12-17 13:39:20 +00003784if test "$have_fftw" = 'yes' ; then
cristy422d5502012-12-22 22:20:57 +00003785 MAGICK_DELEGATES="$MAGICK_DELEGATES fftw"
cristy2a3eb392012-12-17 13:39:20 +00003786fi
Cristy6d2f14b2016-04-26 01:41:09 -04003787if test "$have_flif" = 'yes' ; then
3788 MAGICK_DELEGATES="$MAGICK_DELEGATES flif"
3789fi
cristy2a3eb392012-12-17 13:39:20 +00003790if test "$have_fpx" = 'yes' ; then
cristy422d5502012-12-22 22:20:57 +00003791 MAGICK_DELEGATES="$MAGICK_DELEGATES fpx"
cristy2a3eb392012-12-17 13:39:20 +00003792fi
3793if test "$have_fontconfig" = 'yes' ; then
cristy422d5502012-12-22 22:20:57 +00003794 MAGICK_DELEGATES="$MAGICK_DELEGATES fontconfig"
cristy2a3eb392012-12-17 13:39:20 +00003795fi
3796if test "$have_freetype" = 'yes' ; then
cristy422d5502012-12-22 22:20:57 +00003797 MAGICK_DELEGATES="$MAGICK_DELEGATES freetype"
cristy2a3eb392012-12-17 13:39:20 +00003798fi
3799if test "$have_gslib" = 'yes' ; then
cristy422d5502012-12-22 22:20:57 +00003800 MAGICK_DELEGATES="$MAGICK_DELEGATES gslib"
cristy2a3eb392012-12-17 13:39:20 +00003801fi
Cristy9e7b9812017-11-19 09:35:36 -05003802if test "$have_heic" = 'yes' ; then
3803 MAGICK_DELEGATES="$MAGICK_DELEGATES heic"
3804fi
cristy2a3eb392012-12-17 13:39:20 +00003805if test "$have_jbig" = 'yes' ; then
cristy422d5502012-12-22 22:20:57 +00003806 MAGICK_DELEGATES="$MAGICK_DELEGATES jbig"
cristy2a3eb392012-12-17 13:39:20 +00003807fi
3808if test "$have_png$have_jpeg" = 'yesyes' ; then
cristy422d5502012-12-22 22:20:57 +00003809 MAGICK_DELEGATES="$MAGICK_DELEGATES jng"
cristy2a3eb392012-12-17 13:39:20 +00003810fi
cristy2a3eb392012-12-17 13:39:20 +00003811if test "$have_jpeg" = 'yes' ; then
cristy422d5502012-12-22 22:20:57 +00003812 MAGICK_DELEGATES="$MAGICK_DELEGATES jpeg"
cristy2a3eb392012-12-17 13:39:20 +00003813fi
Cristyb316fbb2019-10-05 10:51:15 -04003814if test "$have_jxl" = 'yes' ; then
3815 MAGICK_DELEGATES="$MAGICK_DELEGATES jxl"
3816fi
cristy2a3eb392012-12-17 13:39:20 +00003817if test "$have_lcms" = 'yes' || test "$have_lcms2" = 'yes' ; then
cristy422d5502012-12-22 22:20:57 +00003818 MAGICK_DELEGATES="$MAGICK_DELEGATES lcms"
cristy2a3eb392012-12-17 13:39:20 +00003819fi
3820if test "$have_lqr" = 'yes' ; then
cristy422d5502012-12-22 22:20:57 +00003821 MAGICK_DELEGATES="$MAGICK_DELEGATES lqr"
cristy2a3eb392012-12-17 13:39:20 +00003822fi
3823if test "$have_lzma" = 'yes' ; then
cristy422d5502012-12-22 22:20:57 +00003824 MAGICK_DELEGATES="$MAGICK_DELEGATES lzma"
cristy2a3eb392012-12-17 13:39:20 +00003825fi
3826if test "$have_openexr" = 'yes' ; then
cristy422d5502012-12-22 22:20:57 +00003827 MAGICK_DELEGATES="$MAGICK_DELEGATES openexr"
cristy2a3eb392012-12-17 13:39:20 +00003828fi
cristy99db3872014-01-01 15:11:34 +00003829if test "$have_openjp2" = 'yes' ; then
3830 MAGICK_DELEGATES="$MAGICK_DELEGATES openjp2"
cristy3fe09452014-01-01 12:29:14 +00003831fi
cristy2a3eb392012-12-17 13:39:20 +00003832if test "$have_pango" = 'yes' ; then
cristy422d5502012-12-22 22:20:57 +00003833 MAGICK_DELEGATES="$MAGICK_DELEGATES pango"
cristy2a3eb392012-12-17 13:39:20 +00003834fi
3835if test "$have_png" = 'yes' ; then
cristy422d5502012-12-22 22:20:57 +00003836 MAGICK_DELEGATES="$MAGICK_DELEGATES png"
cristy2a3eb392012-12-17 13:39:20 +00003837fi
3838have_ps='no'
3839if test "$have_dps" = 'yes' || \
3840 test "$have_gs" = 'yes' || \
3841 test "${native_win32_build}" = 'yes' ; then
3842 have_ps='yes'
3843fi
3844if test "$have_ps" = 'yes' ; then
cristy422d5502012-12-22 22:20:57 +00003845 MAGICK_DELEGATES="$MAGICK_DELEGATES ps"
cristy2a3eb392012-12-17 13:39:20 +00003846fi
Cristy5572ef62016-02-06 16:10:00 -05003847if test "$have_raqm" = 'yes' ; then
3848 MAGICK_DELEGATES="$MAGICK_DELEGATES raqm"
3849fi
Cristyea6e8ae2019-09-30 07:21:16 -04003850if test "$have_raw" = 'yes' ; then
3851 MAGICK_DELEGATES="$MAGICK_DELEGATES raw"
3852fi
cristy2a3eb392012-12-17 13:39:20 +00003853if test "$have_ra_ppm" = 'yes' ; then
cristy422d5502012-12-22 22:20:57 +00003854 MAGICK_DELEGATES="$MAGICK_DELEGATES rad"
cristy2a3eb392012-12-17 13:39:20 +00003855fi
3856if test "$have_rsvg" = 'yes' ; then
cristy422d5502012-12-22 22:20:57 +00003857 MAGICK_DELEGATES="$MAGICK_DELEGATES rsvg"
cristy2a3eb392012-12-17 13:39:20 +00003858fi
3859if test "$have_tiff" = 'yes' ; then
cristy422d5502012-12-22 22:20:57 +00003860 MAGICK_DELEGATES="$MAGICK_DELEGATES tiff"
cristy2a3eb392012-12-17 13:39:20 +00003861fi
3862if test "$have_ttf" = 'yes' ; then
cristy422d5502012-12-22 22:20:57 +00003863 MAGICK_DELEGATES="$MAGICK_DELEGATES ttf"
cristy2a3eb392012-12-17 13:39:20 +00003864fi
Cristy6e040832020-10-14 22:45:34 +00003865if test "$have_video" = 'yes' ; then
3866 MAGICK_DELEGATES="$MAGICK_DELEGATES video"
3867fi
cristy3b640ed2013-07-29 00:27:59 +00003868if test "$have_webp" = 'yes' ; then
3869 MAGICK_DELEGATES="$MAGICK_DELEGATES webp"
3870fi
cristy2a3eb392012-12-17 13:39:20 +00003871if test "$have_wmf" = 'yes' ; then
cristy422d5502012-12-22 22:20:57 +00003872 MAGICK_DELEGATES="$MAGICK_DELEGATES wmf"
cristy2a3eb392012-12-17 13:39:20 +00003873fi
3874if test "$have_x" = 'yes' ; then
cristy422d5502012-12-22 22:20:57 +00003875 MAGICK_DELEGATES="$MAGICK_DELEGATES x"
cristy2a3eb392012-12-17 13:39:20 +00003876fi
3877if test "$have_xml" = 'yes' ; then
cristy422d5502012-12-22 22:20:57 +00003878 MAGICK_DELEGATES="$MAGICK_DELEGATES xml"
cristy2a3eb392012-12-17 13:39:20 +00003879fi
Elliott Hughes5d41fba2021-04-12 16:36:42 -07003880if test "$have_zip" = 'yes' ; then
3881 MAGICK_DELEGATES="$MAGICK_DELEGATES zip"
Christopher Chianelli7a1a92c2020-08-02 10:16:01 -04003882fi
cristy2a3eb392012-12-17 13:39:20 +00003883if test "$have_zlib" = 'yes' ; then
cristy422d5502012-12-22 22:20:57 +00003884 MAGICK_DELEGATES="$MAGICK_DELEGATES zlib"
cristy2a3eb392012-12-17 13:39:20 +00003885fi
Cristy08170e62018-10-14 10:33:46 -04003886if test "$have_zstd" = 'yes' ; then
3887 MAGICK_DELEGATES="$MAGICK_DELEGATES zstd"
3888fi
cristyead532a2015-06-05 00:49:30 +00003889
cristy2a3eb392012-12-17 13:39:20 +00003890# Remove extraneous spaces from output variables (asthetic)
cristy422d5502012-12-22 22:20:57 +00003891MAGICK_DELEGATES=`echo $MAGICK_DELEGATES | sed -e 's/ */ /g'`
cristy2a3eb392012-12-17 13:39:20 +00003892MAGICK_FEATURES=`echo $MAGICK_FEATURES | sed -e 's/ */ /g'`
Cristyc1bfec22020-10-04 15:40:32 +00003893AC_SUBST([MAGICK_DELEGATES])
3894AC_SUBST([MAGICK_FEATURES])
cristy3ed852e2009-09-05 21:47:34 +00003895
3896#
3897# Handle special compiler flags
3898#
3899
3900# Add '-p' if prof source profiling support enabled
3901if test "$enable_prof" = 'yes'; then
3902 CFLAGS="-p $CFLAGS"
3903 CXXFLAGS="-p $CXXFLAGS"
3904 LDFLAGS="-p $LDFLAGS"
3905fi
3906
3907# Add '-pg' if gprof source profiling support enabled
3908if test "$enable_gprof" = 'yes'; then
3909 CFLAGS="-pg $CFLAGS"
3910 CXXFLAGS="-pg $CXXFLAGS"
3911 LDFLAGS="-pg $LDFLAGS"
3912fi
3913
3914# Add '-ftest-coverage -fprofile-arcs' if gcov source profiling support enabled
3915# This is a gcc-specific feature
3916if test "$enable_gcov" = 'yes'; then
Cristyc1bfec22020-10-04 15:40:32 +00003917 AC_CHECK_LIB([gcov],[_gcov_init],[],[])
3918 AC_CHECK_LIB([gcov],[__gcov_init],[],[])
cristy3ed852e2009-09-05 21:47:34 +00003919 case "$target_os" in
3920 darwin*)
3921 OSX_GCOV_LDFLAG="-Wl,-single_module"
3922 ;;
3923 *)
3924 OSX_GCOV_LDFLAG=""
3925 ;;
3926 esac
Cristyc1bfec22020-10-04 15:40:32 +00003927 AC_SUBST([OSX_GCOV_LDFLAG])
cristy3ed852e2009-09-05 21:47:34 +00003928 CFLAGS="-ftest-coverage -fprofile-arcs $CFLAGS"
3929 CXXFLAGS="-ftest-coverage -fprofile-arcs $CXXFLAGS"
3930 LDFLAGS="-ftest-coverage -fprofile-arcs $LDFLAGS"
3931fi
3932
3933#
3934# Build library dependency list for libMagickCore
3935#
3936
cristyc6722092012-10-14 00:19:31 +00003937if test "$build_modules" != 'no'; then
Elliott Hughes5d41fba2021-04-12 16:36:42 -07003938 MAGICK_DEP_LIBS="$USER_LIBS $LCMS_LIBS $FREETYPE_LIBS $RAQM_LIBS $LQR_LIBS $FFTW_LIBS $XML_LIBS $FLIF_LIBS $FONTCONFIG_LIBS $XEXT_LIBS $IPC_LIBS $X11_LIBS $XT_LIBS $BZLIB_LIBS $ZLIB_LIBS $ZIP_LIBS $ZSTD_LIBS $LTDL_LIBS $GDI32_LIBS $MATH_LIBS $CL_LIBS $UMEM_LIBS $JEMALLOC_LIBS $THREAD_LIBS $TCMALLOC_LIBS"
cristy3ed852e2009-09-05 21:47:34 +00003939else
Elliott Hughes5d41fba2021-04-12 16:36:42 -07003940 MAGICK_DEP_LIBS="$USER_LIBS $JBIG_LIBS $LCMS_LIBS $TIFF_LIBS $FREETYPE_LIBS $RAQM_LIBS $JPEG_LIBS $JXL_LIBS $GS_LIBS $LQR_LIBS $PNG_LIBS $AUTOTRACE_LIBS $DJVU_LIBS $FFTW_LIBS $FLIF_LIBS $FPX_LIBS $FONTCONFIG_LIBS $HEIF_LIBS $WEBPMUX_LIBS $WEBP_LIBS $WMF_LIBS $DPS_LIBS $XEXT_LIBS $XT_LIBS $IPC_LIBS $X11_LIBS $LZMA_LIBS $BZLIB_LIBS $OPENEXR_LIBS $LIBOPENJP2_LIBS $PANGO_LIBS $RAW_R_LIBS $RSVG_LIBS $XML_LIBS $GVC_LIBS $ZLIB_LIBS $ZIP_LIBS $ZSTD_LIBS $LTDL_LIBS $GDI32_LIBS $MATH_LIBS $CL_LIBS $UMEM_LIBS $JEMALLOC_LIBS $THREAD_LIBS $TCMALLOC_LIBS"
cristy3ed852e2009-09-05 21:47:34 +00003941fi
Cristy56d66f22018-10-22 19:15:12 -04003942MAGICK_EXTRA_DEP_LIBS="$GOMP_LIBS"
Cristyc1bfec22020-10-04 15:40:32 +00003943AC_SUBST([MAGICK_DEP_LIBS])
3944AC_SUBST([MAGICK_EXTRA_DEP_LIBS])
cristy3ed852e2009-09-05 21:47:34 +00003945
cristy3ed852e2009-09-05 21:47:34 +00003946# Pass only user-provided LIBS as "global" libraries
3947LIBS=$USER_LIBS
3948
Cristyc1bfec22020-10-04 15:40:32 +00003949#AC_SUBST([CPPFLAGS])
3950AC_SUBST([X_CFLAGS])
3951#AC_SUBST([LDFLAGS])
3952#AC_SUBST([X_PRE_LIBS])
3953#AC_SUBST([X_LIBS])
3954#AC_SUBST([X_EXTRA_LIBS])
cristy3ed852e2009-09-05 21:47:34 +00003955
3956MAGICK_CFLAGS=$CFLAGS
3957MAGICK_CXXFLAGS="$CXXFLAGS"
3958MAGICK_CPPFLAGS=`echo $MAGICK_CPPFLAGS | sed -e 's/ */ /g'`
3959MAGICK_PCFLAGS=`echo $MAGICK_PCFLAGS | sed -e 's/ */ /g'`
3960MAGICK_LDFLAGS="-L$LIB_DIR $LDFLAGS"
Carsten Teibes93d248a2018-10-29 21:00:15 +01003961MAGICK_LIBS="$MAGICK_DEP_LIBS $MAGICK_EXTRA_DEP_LIBS"
cristy3ed852e2009-09-05 21:47:34 +00003962
Cristyc1bfec22020-10-04 15:40:32 +00003963AC_SUBST([MAGICK_CFLAGS])
3964AC_SUBST([MAGICK_CXXFLAGS])
3965AC_SUBST([MAGICK_CPPFLAGS])
3966AC_SUBST([MAGICK_PCFLAGS])
3967AC_SUBST([MAGICK_LDFLAGS])
3968AC_SUBST([MAGICK_LIBS])
cristy154f9fa2012-12-05 19:30:42 +00003969
cristy3ed852e2009-09-05 21:47:34 +00003970# Set configured scripts to executable.
3971AC_CONFIG_COMMANDS([default],[],[])
cristy2bd4b6e2012-07-22 15:29:11 +00003972AC_CONFIG_COMMANDS([magick.sh.in],[chmod +x magick.sh])
cristy4c08aed2011-07-01 19:47:50 +00003973AC_CONFIG_COMMANDS([MagickCore-config.in],[chmod +x MagickCore/MagickCore-config])
cristy4c08aed2011-07-01 19:47:50 +00003974AC_CONFIG_COMMANDS([MagickWand-config.in],[chmod +x MagickWand/MagickWand-config])
cristy3ed852e2009-09-05 21:47:34 +00003975AC_CONFIG_COMMANDS([Magick++-config.in],[chmod +x Magick++/bin/Magick++-config])
3976AC_CONFIG_COMMANDS([PerlMagick/check.sh.in],[chmod +x PerlMagick/check.sh])
3977
cristyad38abe2012-12-23 23:03:21 +00003978AC_MSG_RESULT([-------------------------------------------------------------])
3979AC_MSG_RESULT([Update ImageMagick configuration])
cristy3ed852e2009-09-05 21:47:34 +00003980
3981rm -f magick-version
3982
cristy430a7312010-01-21 20:44:04 +00003983result_dejavu_font_dir='none'
3984if test "${dejavu_font_dir}x" != 'x'; then
3985 result_dejavu_font_dir=$dejavu_font_dir
3986fi
3987
cristy3ed852e2009-09-05 21:47:34 +00003988result_ghostscript_font_dir='none'
3989if test "${ghostscript_font_dir}x" != 'x'; then
3990 result_ghostscript_font_dir=$ghostscript_font_dir
3991fi
3992
Cristyc5751062018-02-24 15:15:12 -05003993result_urw_base35_font_dir='none'
3994if test "${urw_base35_font_dir}x" != 'x'; then
3995 result_urw_base35_font_dir=$urw_base35_font_dir
3996fi
3997
cristy3ed852e2009-09-05 21:47:34 +00003998result_windows_font_dir='none'
3999if test "${windows_font_dir}x" != 'x'; then
4000 result_windows_font_dir=${windows_font_dir}
4001fi
4002
cristy9af1cbf2014-12-28 22:03:09 +00004003# ==============================================================================
4004# Generate build environment
4005# ==============================================================================
4006AC_CONFIG_FILES([\
4007 common.shi \
4008 config/configure.xml \
4009 config/delegates.xml \
4010 config/ImageMagick.rdf \
4011 config/MagickCore.dox \
4012 config/MagickWand.dox \
4013 config/Magick++.dox \
4014 config/type-apple.xml \
4015 config/type-dejavu.xml \
4016 config/type-ghostscript.xml \
Cristy9283d5b2017-09-27 17:40:11 -04004017 config/type-urw-base35.xml \
cristy9af1cbf2014-12-28 22:03:09 +00004018 config/type-windows.xml \
4019 config/type.xml \
4020 ImageMagick.spec \
4021 Magick++/bin/Magick++-config \
4022 MagickCore/ImageMagick.pc \
4023 Magick++/lib/Magick++.pc \
4024 MagickCore/MagickCore-config \
4025 MagickCore/MagickCore.pc \
4026 MagickCore/version.h \
4027 Makefile \
4028 magick.sh \
4029 PerlMagick/check.sh \
4030 PerlMagick/default/Magick.pm \
4031 PerlMagick/Makefile.PL \
4032 PerlMagick/default/Makefile.PL \
4033 PerlMagick/quantum/Makefile.PL \
4034 PerlMagick/quantum/quantum.pm \
4035 PerlMagick/quantum/quantum.xs \
4036 PerlMagick/quantum/typemap \
4037 utilities/animate.1 \
4038 utilities/compare.1 \
4039 utilities/composite.1 \
4040 utilities/conjure.1 \
4041 utilities/convert.1 \
4042 utilities/display.1 \
4043 utilities/identify.1 \
4044 utilities/ImageMagick.1 \
4045 utilities/import.1 \
Cristy540ea6e2016-04-01 12:06:50 -04004046 utilities/magick.1 \
4047 utilities/magick-script.1 \
cristy9af1cbf2014-12-28 22:03:09 +00004048 utilities/mogrify.1 \
4049 utilities/montage.1 \
4050 utilities/stream.1 \
4051 MagickWand/MagickWand-config \
Elliott Hughes5d41fba2021-04-12 16:36:42 -07004052 MagickWand/MagickWand.pc])
cristy9af1cbf2014-12-28 22:03:09 +00004053AC_OUTPUT
4054
4055# ==============================================================================
4056# ImageMagick Configuration
4057# ==============================================================================
4058AC_MSG_NOTICE([
4059==============================================================================
Elliott Hughes5d41fba2021-04-12 16:36:42 -07004060${PACKAGE_NAME} ${PACKAGE_VERSION} is configured as follows. Please verify that this
Cristy90ceb262019-09-11 13:22:38 -04004061configuration matches your expectations.
cristy15308162015-01-09 23:43:12 +00004062
Cristy90ceb262019-09-11 13:22:38 -04004063Host system type: $host
4064Build system type: $build
cristy15308162015-01-09 23:43:12 +00004065
Dirk Lemstradb34c402020-09-19 13:29:11 +02004066 Option Value
Cristy90ceb262019-09-11 13:22:38 -04004067------------------------------------------------------------------------------
4068Shared libraries --enable-shared=$enable_shared $libtool_build_shared_libs
4069Static libraries --enable-static=$enable_static $libtool_build_static_libs
4070Build utilities --with-utilities=$with_utilities $with_utilities
4071Module support --with-modules=$build_modules $build_modules
4072GNU ld --with-gnu-ld=$with_gnu_ld $lt_cv_prog_gnu_ld
4073Quantum depth --with-quantum-depth=$with_quantum_depth $with_quantum_depth
4074High Dynamic Range Imagery
4075 --enable-hdri=$enable_hdri $enable_hdri
cristy3ed852e2009-09-05 21:47:34 +00004076
Cristy90ceb262019-09-11 13:22:38 -04004077Install documentation: $wantdocs
cristy15308162015-01-09 23:43:12 +00004078
Cristy0b5b9682019-09-13 14:54:28 -04004079Memory allocation library:
Cristy90ceb262019-09-11 13:22:38 -04004080 JEMalloc --with-jemalloc=$with_jemalloc $have_jemalloc
4081 TCMalloc --with-tcmalloc=$with_tcmalloc $have_tcmalloc
4082 UMem --with-umem=$with_umem $have_umem
4083
Cristy0b5b9682019-09-13 14:54:28 -04004084Delegate library configuration:
cristy9af1cbf2014-12-28 22:03:09 +00004085 BZLIB --with-bzlib=$with_bzlib $have_bzlib
4086 Autotrace --with-autotrace=$with_autotrace $have_autotrace
4087 DJVU --with-djvu=$with_djvu $have_djvu
4088 DPS --with-dps=$with_dps $have_dps
4089 FFTW --with-fftw=$with_fftw $have_fftw
Cristy6d2f14b2016-04-26 01:41:09 -04004090 FLIF --with-flif=$with_flif $have_flif
cristy9af1cbf2014-12-28 22:03:09 +00004091 FlashPIX --with-fpx=$with_fpx $have_fpx
cristybc8ef1c2015-06-06 14:32:21 +00004092 FontConfig --with-fontconfig=$with_fontconfig $have_fontconfig
cristy9af1cbf2014-12-28 22:03:09 +00004093 FreeType --with-freetype=$with_freetype $have_freetype
4094 Ghostscript lib --with-gslib=$with_gslib $have_gslib
4095 Graphviz --with-gvc=$with_gvc $have_gvc
Dirk Lemstradb34c402020-09-19 13:29:11 +02004096 HEIC --with-heic=$with_heic $have_heic
cristy9af1cbf2014-12-28 22:03:09 +00004097 JBIG --with-jbig=$with_jbig $have_jbig
4098 JPEG v1 --with-jpeg=$with_jpeg $have_jpeg
Dirk Lemstradb34c402020-09-19 13:29:11 +02004099 JPEG XL --with-jxl=$with_jxl $have_jxl
cristyd6ac47f2015-06-06 13:46:55 +00004100 LCMS --with-lcms=$with_lcms $have_lcms
cristy9af1cbf2014-12-28 22:03:09 +00004101 LQR --with-lqr=$with_lqr $have_lqr
4102 LTDL --with-ltdl=$with_ltdl $have_ltdl
4103 LZMA --with-lzma=$with_lzma $have_lzma
4104 Magick++ --with-magick-plus-plus=$with_magick_plus_plus $have_magick_plus_plus
4105 OpenEXR --with-openexr=$with_openexr $have_openexr
Cristy428ba722015-11-08 15:49:24 -05004106 OpenJP2 --with-openjp2=$with_openjp2 $have_openjp2
cristy9af1cbf2014-12-28 22:03:09 +00004107 PANGO --with-pango=$with_pango $have_pango
4108 PERL --with-perl=$with_perl $have_perl
4109 PNG --with-png=$with_png $have_png
Cristy5572ef62016-02-06 16:10:00 -05004110 RAQM --with-raqm=$with_raqm $have_raqm
Dirk Lemstradb34c402020-09-19 13:29:11 +02004111 RAW --with-raw=$with_raw $have_raw
cristy9af1cbf2014-12-28 22:03:09 +00004112 RSVG --with-rsvg=$with_rsvg $have_rsvg
4113 TIFF --with-tiff=$with_tiff $have_tiff
4114 WEBP --with-webp=$with_webp $have_webp
4115 WMF --with-wmf=$with_wmf $have_wmf
4116 X11 --with-x=$with_x $have_x
4117 XML --with-xml=$with_xml $have_xml
Elliott Hughes5d41fba2021-04-12 16:36:42 -07004118 ZIP --with-zip=$with_zip $have_zip
cristy9af1cbf2014-12-28 22:03:09 +00004119 ZLIB --with-zlib=$with_zlib $have_zlib
Cristy08170e62018-10-14 10:33:46 -04004120 ZSTD --with-zstd=$with_zstd $have_zstd
cristy15308162015-01-09 23:43:12 +00004121
Cristy0b5b9682019-09-13 14:54:28 -04004122Delegate program configuration:
Cristy90ceb262019-09-11 13:22:38 -04004123 GhostPCL None $PCLDelegate ($PCLVersion)
4124 GhostXPS None $XPSDelegate ($XPSVersion)
4125 Ghostscript None $PSDelegate ($GSVersion)
cristy15308162015-01-09 23:43:12 +00004126
Cristy0b5b9682019-09-13 14:54:28 -04004127Font configuration:
cristy9af1cbf2014-12-28 22:03:09 +00004128 Apple fonts --with-apple-font-dir=$with_apple_font_dir $result_apple_font_dir
4129 Dejavu fonts --with-dejavu-font-dir=$with_dejavu_font_dir $result_dejavu_font_dir
Cristy90ceb262019-09-11 13:22:38 -04004130 Ghostscript fonts --with-gs-font-dir=$with_gs_font_dir $result_ghostscript_font_dir
4131 URW-base35 fonts --with-urw-base35-font-dir=$with_urw_base35_font_dir $result_urw_base35_font_dir
cristy9af1cbf2014-12-28 22:03:09 +00004132 Windows fonts --with-windows-font-dir=$with_windows_font_dir $result_windows_font_dir
cristy15308162015-01-09 23:43:12 +00004133
Cristy0b5b9682019-09-13 14:54:28 -04004134X11 configuration:
Cristy90ceb262019-09-11 13:22:38 -04004135 X_CFLAGS = $X_CFLAGS
4136 X_PRE_LIBS = $X_PRE_LIBS
4137 X_LIBS = $X_LIBS
4138 X_EXTRA_LIBS = $X_EXTRA_LIBS
cristy15308162015-01-09 23:43:12 +00004139
Cristy90ceb262019-09-11 13:22:38 -04004140Options used to compile and link:
4141 PREFIX = $PREFIX_DIR
4142 EXEC-PREFIX = $EXEC_PREFIX_DIR
4143 VERSION = $PACKAGE_VERSION
4144 CC = $CC
4145 CFLAGS = $CFLAGS
4146 CPPFLAGS = $CPPFLAGS
4147 PCFLAGS = $PCFLAGS
4148 DEFS = $DEFS
4149 LDFLAGS = $LDFLAGS
4150 LIBS = $MAGICK_DEP_LIBS
4151 CXX = $CXX
4152 CXXFLAGS = $CXXFLAGS
4153 FEATURES = $MAGICK_FEATURES
4154 DELEGATES = $MAGICK_DELEGATES
cristy9af1cbf2014-12-28 22:03:09 +00004155==============================================================================
cristy3ed852e2009-09-05 21:47:34 +00004156])