| 1 | # Copyright 1999-2007 ImageMagick Studio LLC, a non-profit organization |
|---|
| 2 | # dedicated to making software imaging solutions freely available. |
|---|
| 3 | # |
|---|
| 4 | # You may not use this file except in compliance with the License. You may |
|---|
| 5 | # obtain a copy of the License at |
|---|
| 6 | # |
|---|
| 7 | # http://www.imagemagick.org/script/license.php |
|---|
| 8 | # |
|---|
| 9 | # Unless required by applicable law or agreed to in writing, software |
|---|
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
|---|
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|---|
| 12 | # See the License for the specific language governing permissions and |
|---|
| 13 | # limitations under the License. |
|---|
| 14 | |
|---|
| 15 | AC_PREREQ(2.60) |
|---|
| 16 | AC_INIT([ImageMagick],[6.3.6],[http://www.imagemagick.org],[ImageMagick]) |
|---|
| 17 | AC_CONFIG_SRCDIR([magick/MagickCore.h]) |
|---|
| 18 | AC_CONFIG_AUX_DIR([config]) |
|---|
| 19 | AC_CONFIG_MACRO_DIR([m4]) |
|---|
| 20 | AC_CONFIG_LIBOBJ_DIR([ltdl]) |
|---|
| 21 | AC_CONFIG_HEADERS([magick/magick-config.h wand/wand-config.h]) |
|---|
| 22 | AC_CONFIG_FILES( \ |
|---|
| 23 | config/delegates.xml \ |
|---|
| 24 | config/configure.xml \ |
|---|
| 25 | config/ImageMagick.rdf \ |
|---|
| 26 | config/type-ghostscript.xml \ |
|---|
| 27 | config/type.xml \ |
|---|
| 28 | config/type-solaris.xml \ |
|---|
| 29 | config/type-windows.xml \ |
|---|
| 30 | ImageMagick.spec \ |
|---|
| 31 | magick/ImageMagick.pc \ |
|---|
| 32 | magick/Magick-config \ |
|---|
| 33 | magick/version.h \ |
|---|
| 34 | magick.sh \ |
|---|
| 35 | Magick++/bin/Magick++-config \ |
|---|
| 36 | Magick++/lib/ImageMagick++.pc \ |
|---|
| 37 | Makefile \ |
|---|
| 38 | PerlMagick/Magick.pm \ |
|---|
| 39 | PerlMagick/Makefile.PL \ |
|---|
| 40 | utilities/animate.1 \ |
|---|
| 41 | utilities/compare.1 \ |
|---|
| 42 | utilities/composite.1 \ |
|---|
| 43 | utilities/conjure.1 \ |
|---|
| 44 | utilities/convert.1 \ |
|---|
| 45 | utilities/display.1 \ |
|---|
| 46 | utilities/identify.1 \ |
|---|
| 47 | utilities/ImageMagick.1 \ |
|---|
| 48 | utilities/import.1 \ |
|---|
| 49 | utilities/mogrify.1 \ |
|---|
| 50 | utilities/montage.1 \ |
|---|
| 51 | utilities/stream.1 \ |
|---|
| 52 | wand/Wand-config \ |
|---|
| 53 | wand/Wand.pc ) |
|---|
| 54 | |
|---|
| 55 | # |
|---|
| 56 | # Save initial user-tunable values |
|---|
| 57 | # |
|---|
| 58 | USER_LIBS=$LIBS |
|---|
| 59 | for var in CC CFLAGS CPPFLAGS CXX CXXCPP LDFLAGS LIBS ; do |
|---|
| 60 | eval isset=\${$var+set} |
|---|
| 61 | if test "$isset" = 'set'; then |
|---|
| 62 | eval val=$`echo $var` |
|---|
| 63 | DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS}'${var}=${val}' " |
|---|
| 64 | fi |
|---|
| 65 | done |
|---|
| 66 | AC_SUBST(DISTCHECK_CONFIG_FLAGS) |
|---|
| 67 | |
|---|
| 68 | CONFIGURE_ARGS=`echo "$0 $@" | sed -e 's/ */ /g'` |
|---|
| 69 | AC_SUBST(CONFIGURE_ARGS) |
|---|
| 70 | |
|---|
| 71 | # Source file containing package/library versioning information. |
|---|
| 72 | . ${srcdir}/version.sh |
|---|
| 73 | |
|---|
| 74 | echo "configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}${PACKAGE_VERSION_ADDENDUM}" |
|---|
| 75 | AC_CANONICAL_TARGET([]) |
|---|
| 76 | |
|---|
| 77 | # Substitute library versioning |
|---|
| 78 | AC_SUBST(LIBRARY_CURRENT)dnl |
|---|
| 79 | AC_SUBST(LIBRARY_REVISION)dnl |
|---|
| 80 | AC_SUBST(LIBRARY_AGE)dnl |
|---|
| 81 | AC_SUBST(PACKAGE_NAME)dnl |
|---|
| 82 | AC_SUBST(PACKAGE_VERSION)dnl |
|---|
| 83 | AC_SUBST(PACKAGE_LIB_VERSION)dnl |
|---|
| 84 | AC_SUBST(PACKAGE_LIB_VERSION_NUMBER)dnl |
|---|
| 85 | AC_SUBST(PACKAGE_RELEASE_DATE)dnl |
|---|
| 86 | AC_SUBST(PACKAGE_VERSION_ADDENDUM)dnl |
|---|
| 87 | |
|---|
| 88 | # Ensure that make can run correctly |
|---|
| 89 | AM_SANITY_CHECK |
|---|
| 90 | |
|---|
| 91 | AM_INIT_AUTOMAKE([foreign subdir-objects dist-zip dist-bzip2 tar-ustar -Wall]) |
|---|
| 92 | AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/ChangeLog $(top_srcdir)/version.sh']) |
|---|
| 93 | |
|---|
| 94 | PERLMAINCC=$CC |
|---|
| 95 | |
|---|
| 96 | MAGICK_CFLAGS='' |
|---|
| 97 | MAGICK_CPPFLAGS=$CPPFLAGS_USER |
|---|
| 98 | MAGICK_PCFLAGS=$CPPFLAGS_USER |
|---|
| 99 | MAGICK_LDFLAGS='' |
|---|
| 100 | MAGICK_LIBS='' |
|---|
| 101 | |
|---|
| 102 | # |
|---|
| 103 | # Evaluate shell variable equivalents to Makefile directory variables |
|---|
| 104 | # |
|---|
| 105 | if test "x$prefix" = xNONE; then |
|---|
| 106 | prefix=$ac_default_prefix |
|---|
| 107 | fi |
|---|
| 108 | # Let make expand exec_prefix. |
|---|
| 109 | if test "x$exec_prefix" = xNONE; then |
|---|
| 110 | exec_prefix='${prefix}' |
|---|
| 111 | fi |
|---|
| 112 | |
|---|
| 113 | # |
|---|
| 114 | eval "eval PREFIX_DIR=${prefix}" |
|---|
| 115 | AC_SUBST(PREFIX_DIR) |
|---|
| 116 | eval "eval EXEC_PREFIX_DIR=${exec_prefix}" |
|---|
| 117 | AC_SUBST(EXEC_PREFIX_DIR) |
|---|
| 118 | eval "eval BIN_DIR=$bindir" |
|---|
| 119 | AC_SUBST(BIN_DIR) |
|---|
| 120 | eval "eval SBIN_DIR=$sbindir" |
|---|
| 121 | AC_SUBST(SBIN_DIR) |
|---|
| 122 | eval "eval LIBEXEC_DIR=$libexecdir" |
|---|
| 123 | AC_SUBST(LIBEXEC_DIR) |
|---|
| 124 | eval "eval DATA_DIR=$datadir" |
|---|
| 125 | AC_SUBST(DATA_DIR) |
|---|
| 126 | eval "eval SYSCONF_DIR=$sysconfdir" |
|---|
| 127 | AC_SUBST(SYSCONF_DIR) |
|---|
| 128 | eval "eval SHAREDSTATE_DIR=$sharedstatedir" |
|---|
| 129 | AC_SUBST(SHAREDSTATE_DIR) |
|---|
| 130 | eval "eval LOCALSTATE_DIR=$localstatedir" |
|---|
| 131 | AC_SUBST(LOCALSTATE_DIR) |
|---|
| 132 | eval "eval LIB_DIR=$libdir" |
|---|
| 133 | AC_SUBST(LIB_DIR) |
|---|
| 134 | eval "eval INCLUDE_DIR=$includedir" |
|---|
| 135 | AC_SUBST(INCLUDE_DIR) |
|---|
| 136 | eval "eval PERSISTINCLUDE_DIR=$oldincludedir" |
|---|
| 137 | AC_SUBST(PERSISTINCLUDE_DIR) |
|---|
| 138 | eval "eval INFO_DIR=$infodir" |
|---|
| 139 | AC_SUBST(INFO_DIR) |
|---|
| 140 | eval "eval MAN_DIR=$mandir" |
|---|
| 141 | AC_SUBST(MAN_DIR) |
|---|
| 142 | |
|---|
| 143 | # Get full paths to source and build directories |
|---|
| 144 | srcdirfull=`cd $srcdir && pwd` |
|---|
| 145 | builddir=`pwd` |
|---|
| 146 | |
|---|
| 147 | WinPathScript="${srcdirfull}/winpath.sh" |
|---|
| 148 | AC_SUBST(WinPathScript) |
|---|
| 149 | |
|---|
| 150 | # |
|---|
| 151 | # Compute variables useful for running uninstalled software. |
|---|
| 152 | # |
|---|
| 153 | MAGICK_CODER_MODULE_PATH="${builddir}/coders" |
|---|
| 154 | MAGICK_CONFIGURE_SRC_PATH="${srcdirfull}/config" |
|---|
| 155 | MAGICK_CONFIGURE_BUILD_PATH="${builddir}/config" |
|---|
| 156 | MAGICK_FILTER_MODULE_PATH="${builddir}/filters" |
|---|
| 157 | DIRSEP=':' |
|---|
| 158 | case "${host_os}" in |
|---|
| 159 | mingw* ) |
|---|
| 160 | MAGICK_CODER_MODULE_PATH=`$WinPathScript "${MAGICK_CODER_MODULE_PATH}" 0` |
|---|
| 161 | MAGICK_CONFIGURE_SRC_PATH=`$WinPathScript "${MAGICK_CONFIGURE_SRC_PATH}" 0` |
|---|
| 162 | MAGICK_CONFIGURE_BUILD_PATH=`$WinPathScript "${MAGICK_CONFIGURE_BUILD_PATH}" 0` |
|---|
| 163 | MAGICK_FILTER_MODULE_PATH=`$WinPathScript "${MAGICK_FILTER_MODULE_PATH}" 0` |
|---|
| 164 | DIRSEP=';' |
|---|
| 165 | ;; |
|---|
| 166 | esac |
|---|
| 167 | AC_SUBST(MAGICK_CODER_MODULE_PATH) |
|---|
| 168 | AC_SUBST(MAGICK_CONFIGURE_SRC_PATH) |
|---|
| 169 | AC_SUBST(MAGICK_CONFIGURE_BUILD_PATH) |
|---|
| 170 | AC_SUBST(MAGICK_FILTER_MODULE_PATH) |
|---|
| 171 | AC_SUBST(DIRSEP) |
|---|
| 172 | |
|---|
| 173 | # Check for programs |
|---|
| 174 | AC_PROG_CC |
|---|
| 175 | AC_PROG_CPP |
|---|
| 176 | AC_PROG_LD |
|---|
| 177 | AC_SUBST(LD) |
|---|
| 178 | AM_PROG_CC_C_O |
|---|
| 179 | AC_PROG_INSTALL |
|---|
| 180 | AC_PROG_MAKE_SET |
|---|
| 181 | AC_PROG_RANLIB |
|---|
| 182 | AC_COMPILE_WARNINGS |
|---|
| 183 | AC_PROG_LN_S |
|---|
| 184 | AM_WITH_DMALLOC |
|---|
| 185 | |
|---|
| 186 | # |
|---|
| 187 | # Enable OS features. |
|---|
| 188 | # |
|---|
| 189 | AC_GNU_SOURCE |
|---|
| 190 | |
|---|
| 191 | # |
|---|
| 192 | # Tests for Windows |
|---|
| 193 | # |
|---|
| 194 | AC_EXEEXT |
|---|
| 195 | AC_OBJEXT |
|---|
| 196 | |
|---|
| 197 | GDI32_LIBS='' |
|---|
| 198 | StaticCplusPlusLibraries='no' |
|---|
| 199 | native_win32_build='no' |
|---|
| 200 | cygwin_build='no' |
|---|
| 201 | case "${host_os}" in |
|---|
| 202 | cygwin* ) |
|---|
| 203 | StaticCplusPlusLibraries='yes' |
|---|
| 204 | cygwin_build='yes' |
|---|
| 205 | GDI32_LIBS='-lgdi32' |
|---|
| 206 | ;; |
|---|
| 207 | mingw* ) |
|---|
| 208 | StaticCplusPlusLibraries='yes' |
|---|
| 209 | native_win32_build='yes' |
|---|
| 210 | GDI32_LIBS='-lgdi32' |
|---|
| 211 | ;; |
|---|
| 212 | esac |
|---|
| 213 | if test "${GDI32_LIBS}x" != 'x'; then |
|---|
| 214 | AC_DEFINE(HasWINGDI32,1,Define to use the Windows GDI32 library) |
|---|
| 215 | fi |
|---|
| 216 | AC_SUBST(GDI32_LIBS) |
|---|
| 217 | AM_CONDITIONAL(HasWINGDI32, test "${GDI32_LIBS}x" != 'x' ) |
|---|
| 218 | AM_CONDITIONAL(WIN32_NATIVE_BUILD, test "${native_win32_build}" = 'yes' ) |
|---|
| 219 | AM_CONDITIONAL(CYGWIN_BUILD, test "${cygwin_build}" = 'yes' ) |
|---|
| 220 | |
|---|
| 221 | # |
|---|
| 222 | # Compiler flags tweaks |
|---|
| 223 | # |
|---|
| 224 | if test "${GCC}" != "yes"; then |
|---|
| 225 | case "${host}" in |
|---|
| 226 | *-*-hpux* ) |
|---|
| 227 | # aCC: HP ANSI C++ B3910B A.03.34 |
|---|
| 228 | CFLAGS="${CFLAGS} -Wp,-H30000" |
|---|
| 229 | if test -n "${CXXFLAGS}"; then |
|---|
| 230 | CXXFLAGS='-AA' |
|---|
| 231 | else |
|---|
| 232 | CXXFLAGS="${CXXFLAGS} -AA" |
|---|
| 233 | fi |
|---|
| 234 | ;; |
|---|
| 235 | *-dec-osf5.* ) |
|---|
| 236 | # Compaq alphaev68-dec-osf5.1 compiler |
|---|
| 237 | if test -n "${CXXFLAGS}"; then |
|---|
| 238 | CXXFLAGS='-std strict_ansi -noimplicit_include' |
|---|
| 239 | else |
|---|
| 240 | CXXFLAGS="${CXXFLAGS} -std strict_ansi -noimplicit_include" |
|---|
| 241 | fi |
|---|
| 242 | esac |
|---|
| 243 | fi |
|---|
| 244 | |
|---|
| 245 | dnl Platform-specific stuff |
|---|
| 246 | case "$host" in |
|---|
| 247 | *darwin*) |
|---|
| 248 | dnl OS X universal binary support, requires --disable-dependency-tracking |
|---|
| 249 | AC_ARG_ENABLE(osx-universal-binaries, |
|---|
| 250 | AC_HELP_STRING([--enable-osx-universal-binaries], |
|---|
| 251 | [build universal binaries on OS X [[default=no]]]), |
|---|
| 252 | [build_osxuniversal="${enableval}"], [build_osxuniversal=no]) |
|---|
| 253 | |
|---|
| 254 | if test "${build_osxuniversal}" != no ; then |
|---|
| 255 | if test "$enable_dependency_tracking" != no ; then |
|---|
| 256 | AC_MSG_ERROR([--enable-osx-universal-binary requires --disable-dependency-tracking. |
|---|
| 257 | Please re-run configure with these options: |
|---|
| 258 | --disable-dependency-tracking --enable-osx-universal-binary |
|---|
| 259 | ]) |
|---|
| 260 | fi |
|---|
| 261 | CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386" |
|---|
| 262 | CXXFLAGS="$CXXFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386" |
|---|
| 263 | LDFLAGS="$LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386" |
|---|
| 264 | fi |
|---|
| 265 | |
|---|
| 266 | esac |
|---|
| 267 | |
|---|
| 268 | # Enable support for threads |
|---|
| 269 | AC_ARG_WITH([threads], |
|---|
| 270 | [AC_HELP_STRING([--without-threads], |
|---|
| 271 | [disable threads support])], |
|---|
| 272 | [with_threads=$withval], |
|---|
| 273 | [with_threads='yes']) |
|---|
| 274 | |
|---|
| 275 | have_threads=no |
|---|
| 276 | if test "$with_threads" != 'no'; then |
|---|
| 277 | ACX_PTHREAD() |
|---|
| 278 | if test "$acx_pthread_ok" = yes; then |
|---|
| 279 | have_threads=yes |
|---|
| 280 | DEF_THREAD="$PTHREAD_CFLAGS" |
|---|
| 281 | CFLAGS="$CFLAGS $DEF_THREAD" |
|---|
| 282 | CXXFLAGS="$CXXFLAGS $DEF_THREAD" |
|---|
| 283 | if test "$CC" != "$PTHREAD_CC"; then |
|---|
| 284 | AC_MSG_WARN([Replacing compiler $CC with compiler $PTHREAD_CC to support pthreads.]) |
|---|
| 285 | CC="$PTHREAD_CC" |
|---|
| 286 | fi |
|---|
| 287 | fi |
|---|
| 288 | fi |
|---|
| 289 | |
|---|
| 290 | # Enable support for OpenMP |
|---|
| 291 | AC_OPENMP([C]) |
|---|
| 292 | CFLAGS="$CFLAGS $OPENMP_CFLAGS" |
|---|
| 293 | LDFLAGS="$LDFLAGS $OPENMP_CFLAGS" |
|---|
| 294 | MAGICK_PCFLAGS="$MAGICK_PCFLAGS $OPENMP_CFLAGS" |
|---|
| 295 | |
|---|
| 296 | ######## |
|---|
| 297 | # |
|---|
| 298 | # Check for large file support |
|---|
| 299 | # |
|---|
| 300 | ######## |
|---|
| 301 | AC_SYS_LARGEFILE |
|---|
| 302 | AC_FUNC_FSEEKO |
|---|
| 303 | LFS_CPPFLAGS='' |
|---|
| 304 | if test "$enable_largefile" != no; then |
|---|
| 305 | if test "$ac_cv_sys_file_offset_bits" != 'no'; then |
|---|
| 306 | LFS_CPPFLAGS="$LFS_CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits" |
|---|
| 307 | else |
|---|
| 308 | AC_MSG_CHECKING([for native large file support]) |
|---|
| 309 | AC_RUN_IFELSE([#include <unistd.h> |
|---|
| 310 | main () { |
|---|
| 311 | exit(!(sizeof(off_t) == 8)); |
|---|
| 312 | }], |
|---|
| 313 | [ac_cv_sys_file_offset_bits=64; AC_DEFINE(_FILE_OFFSET_BITS,64) |
|---|
| 314 | AC_MSG_RESULT([yes])], |
|---|
| 315 | [AC_MSG_RESULT([no])]) |
|---|
| 316 | fi |
|---|
| 317 | if test "$ac_cv_sys_large_files" != 'no'; then |
|---|
| 318 | LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGE_FILES=1" |
|---|
| 319 | fi |
|---|
| 320 | if test "$ac_cv_sys_largefile_source" != 'no'; then |
|---|
| 321 | LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGEFILE_SOURCE=1" |
|---|
| 322 | fi |
|---|
| 323 | fi |
|---|
| 324 | AC_SUBST(LFS_CPPFLAGS) |
|---|
| 325 | |
|---|
| 326 | # |
|---|
| 327 | # Configure libtool & libltdl |
|---|
| 328 | # |
|---|
| 329 | |
|---|
| 330 | # Configure libltdl |
|---|
| 331 | #AC_CONFIG_SUBDIRS(ltdl) |
|---|
| 332 | AC_LIBLTDL_CONVENIENCE(ltdl) |
|---|
| 333 | AC_LIB_LTDL |
|---|
| 334 | # Substitute INCLTDL and LIBLTDL in the Makefiles |
|---|
| 335 | #AC_SUBST(INCLTDL) |
|---|
| 336 | #AC_SUBST(LIBLTDL) |
|---|
| 337 | |
|---|
| 338 | # Configure libtool |
|---|
| 339 | AC_ENABLE_SHARED |
|---|
| 340 | AC_ENABLE_STATIC |
|---|
| 341 | AC_LIBTOOL_TAGS([CXX]) |
|---|
| 342 | AC_LIBTOOL_WIN32_DLL |
|---|
| 343 | AC_LIBTOOL_DLOPEN |
|---|
| 344 | AC_PROG_LIBTOOL |
|---|
| 345 | AC_SUBST(LIBTOOL_DEPS) |
|---|
| 346 | #AC_OUTPUT |
|---|
| 347 | |
|---|
| 348 | # Check to see if building shared libraries |
|---|
| 349 | libtool_build_shared_libs='no' |
|---|
| 350 | if test "$enable_shared" = 'yes'; then |
|---|
| 351 | libtool_build_shared_libs='yes' |
|---|
| 352 | fi |
|---|
| 353 | |
|---|
| 354 | # Check to see if building static libraries |
|---|
| 355 | libtool_build_static_libs='no' |
|---|
| 356 | if test "$enable_static" = 'yes'; then |
|---|
| 357 | libtool_build_static_libs='yes' |
|---|
| 358 | fi |
|---|
| 359 | |
|---|
| 360 | # MinGW and Cygwin can't build C++ DLLs which support exceptions. |
|---|
| 361 | if test "${StaticCplusPlusLibraries}" = 'yes'; then |
|---|
| 362 | LTCXXLIBOPTS='--static' |
|---|
| 363 | AC_SUBST(LTCXXLIBOPTS) |
|---|
| 364 | fi |
|---|
| 365 | |
|---|
| 366 | # |
|---|
| 367 | # Enable support for building loadable modules |
|---|
| 368 | # |
|---|
| 369 | AC_ARG_WITH([modules], |
|---|
| 370 | [AC_HELP_STRING([--with-modules], |
|---|
| 371 | [support dynamically loadable modules])], |
|---|
| 372 | [with_modules=$withval], |
|---|
| 373 | [with_modules=$libtool_build_shared_libs]) |
|---|
| 374 | |
|---|
| 375 | # Only allow building loadable modules if we are building shared libraries |
|---|
| 376 | if test "$with_modules" != 'no' ; then |
|---|
| 377 | if test "$libtool_build_shared_libs" = 'no'; then |
|---|
| 378 | AC_MSG_WARN([Modules may only be built if building shared libraries is enabled.]) |
|---|
| 379 | with_modules='no' |
|---|
| 380 | fi |
|---|
| 381 | fi |
|---|
| 382 | if test "$with_modules" != 'no'; then |
|---|
| 383 | AC_DEFINE(BuildMagickModules,1,Define if coders and filters are to be built as modules.) |
|---|
| 384 | fi |
|---|
| 385 | AM_CONDITIONAL(WITH_MODULES, test "$with_modules" != 'no') |
|---|
| 386 | |
|---|
| 387 | # Enable building/use of libltdl if we are building shared libraries regardless |
|---|
| 388 | # of whether modules are built or not. |
|---|
| 389 | with_ltdl='no' |
|---|
| 390 | if test "$libtool_build_shared_libs" != 'no'; then |
|---|
| 391 | with_ltdl='yes' |
|---|
| 392 | fi |
|---|
| 393 | |
|---|
| 394 | AM_CONDITIONAL(WITH_LTDL, test "$with_ltdl" != 'no') |
|---|
| 395 | if test "$with_ltdl" != 'no'; then |
|---|
| 396 | AC_DEFINE(HasLTDL,1,Define if using libltdl to support dynamically loadable modules) |
|---|
| 397 | |
|---|
| 398 | # Set DLLDFLAGS |
|---|
| 399 | if test X"$enable_shared" = Xyes; then |
|---|
| 400 | DLLDFLAGS=-export-dynamic |
|---|
| 401 | AC_SUBST(DLLDFLAGS) |
|---|
| 402 | fi |
|---|
| 403 | fi |
|---|
| 404 | |
|---|
| 405 | # Enable build using delegate libraries built in subdirectories rather than installed |
|---|
| 406 | # delegate libraries (bzlib fpx jp2 jbig jpeg lcms png tiff ttf wmf xml zlib) |
|---|
| 407 | AC_ARG_ENABLE([delegate-build], |
|---|
| 408 | [AC_HELP_STRING([--enable-delegate-build], |
|---|
| 409 | [look for delegate libraries in build directory])], |
|---|
| 410 | [enable_delegate_build=$enableval], |
|---|
| 411 | [enable_delegate_build='no']) |
|---|
| 412 | |
|---|
| 413 | AC_ARG_ENABLE([deprecated], |
|---|
| 414 | [AC_HELP_STRING([--disable-deprecated], |
|---|
| 415 | [exclude deprecated methods in MagickCore and MagickWand API's])], |
|---|
| 416 | [enable_deprecated=$enableval], |
|---|
| 417 | [enable_deprecated='no']) |
|---|
| 418 | |
|---|
| 419 | if test "$enable_deprecated" = 'yes'; then |
|---|
| 420 | AC_DEFINE(ExcludeMagickDeprecated,1,[exclude deprecated methods in MagickCore API]) |
|---|
| 421 | else |
|---|
| 422 | DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-deprecate " |
|---|
| 423 | fi |
|---|
| 424 | |
|---|
| 425 | # Build a version of ImageMagick which operates uninstalled. |
|---|
| 426 | # Used to build distributions located via MAGICK_HOME / executable path |
|---|
| 427 | AC_ARG_ENABLE([installed], |
|---|
| 428 | [AC_HELP_STRING([--disable-installed], |
|---|
| 429 | [Formally install ImageMagick under PREFIX])], |
|---|
| 430 | [enable_installed=$enableval], |
|---|
| 431 | [enable_installed='yes']) |
|---|
| 432 | |
|---|
| 433 | if test "$enable_installed" = 'yes'; then |
|---|
| 434 | AC_DEFINE(UseInstalledMagick,1,[ImageMagick is formally installed under prefix]) |
|---|
| 435 | else |
|---|
| 436 | DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-installed " |
|---|
| 437 | fi |
|---|
| 438 | |
|---|
| 439 | # Build an embeddable version of ImageMagick. |
|---|
| 440 | AC_ARG_ENABLE([embeddable], |
|---|
| 441 | [AC_HELP_STRING([--enable-embeddable], |
|---|
| 442 | [enable self-contained, embeddable, zero-configuration ImageMagick])], |
|---|
| 443 | [enable_embeddable=$enableval], |
|---|
| 444 | [enable_embeddable='no']) |
|---|
| 445 | |
|---|
| 446 | if test "$enable_embeddable" = 'yes'; then |
|---|
| 447 | AC_DEFINE(UseEmbeddableMagick,1,[Build self-contained, embeddable, zero-configuration ImageMagick (experimental)]) |
|---|
| 448 | fi |
|---|
| 449 | |
|---|
| 450 | # Build a high dynamic range version of ImageMagick. |
|---|
| 451 | AC_ARG_ENABLE([hdri], |
|---|
| 452 | [AC_HELP_STRING([--enable-hdri], |
|---|
| 453 | [accurately represent the wide range of intensity levels found in real scenes])], |
|---|
| 454 | [enable_hdri=$enableval], |
|---|
| 455 | [enable_hdri='no']) |
|---|
| 456 | |
|---|
| 457 | MAGICK_HDRI="" |
|---|
| 458 | if test "$enable_hdri" = 'yes'; then |
|---|
| 459 | MAGICK_HDRI="HDRI" |
|---|
| 460 | AC_DEFINE(UseHDRI,1,[accurately represent the wide range of intensity levels in real scenes]) |
|---|
| 461 | fi |
|---|
| 462 | AC_SUBST(MAGICK_HDRI)dnl |
|---|
| 463 | |
|---|
| 464 | # Enable verbose output from libtool (enable libtool's default) |
|---|
| 465 | AC_ARG_ENABLE([libtool-verbose], |
|---|
| 466 | [AC_HELP_STRING([--enable-libtool-verbose], |
|---|
| 467 | [enable verbose libtool output])], |
|---|
| 468 | [enable_libtool_verbose=$enableval], |
|---|
| 469 | [enable_libtool_verbose='no']) |
|---|
| 470 | |
|---|
| 471 | if test "$enable_libtool_verbose" = 'no'; then |
|---|
| 472 | LIBTOOL="$LIBTOOL --silent" |
|---|
| 473 | fi |
|---|
| 474 | |
|---|
| 475 | # Build a version of ImageMagick with assert statements. |
|---|
| 476 | AC_ARG_ENABLE([assert], |
|---|
| 477 | [AC_HELP_STRING([--disable-assert], |
|---|
| 478 | [disable assert() statements in build])], |
|---|
| 479 | [enable_assert=$enableval], |
|---|
| 480 | [enable_assert='yes']) |
|---|
| 481 | |
|---|
| 482 | if test "$enable_assert" = 'no'; then |
|---|
| 483 | AC_DEFINE(NDEBUG,1,[Turn off assert statements]) |
|---|
| 484 | fi |
|---|
| 485 | |
|---|
| 486 | # Add configure option --enable-maintainer-mode which enables dependency |
|---|
| 487 | # checking and generation useful to package maintainers. This is made an |
|---|
| 488 | # option to avoid confusing end users. |
|---|
| 489 | AM_MAINTAINER_MODE |
|---|
| 490 | |
|---|
| 491 | |
|---|
| 492 | # Enable ccmalloc memory debugging support |
|---|
| 493 | AC_ARG_ENABLE([ccmalloc], |
|---|
| 494 | [AC_HELP_STRING([--enable-ccmalloc], |
|---|
| 495 | [enable 'ccmalloc' memory debug support])], |
|---|
| 496 | [enable_ccmalloc=$enableval], |
|---|
| 497 | [enable_ccmalloc='no']) |
|---|
| 498 | |
|---|
| 499 | # Enable Electric Fence memory debugging support |
|---|
| 500 | AC_ARG_ENABLE([efence], |
|---|
| 501 | [AC_HELP_STRING([--enable-efence], |
|---|
| 502 | [enable 'efence' memory debug support])], |
|---|
| 503 | [enable_efence=$enableval], |
|---|
| 504 | [enable_efence='no']) |
|---|
| 505 | |
|---|
| 506 | # Enable prof-based profiling support |
|---|
| 507 | AC_ARG_ENABLE([prof], |
|---|
| 508 | [AC_HELP_STRING([--enable-prof], |
|---|
| 509 | [enable 'prof' profiling support])], |
|---|
| 510 | [enable_prof=$enableval], |
|---|
| 511 | [enable_prof='no']) |
|---|
| 512 | |
|---|
| 513 | # Enable gprof-based profiling support |
|---|
| 514 | AC_ARG_ENABLE([gprof], |
|---|
| 515 | [AC_HELP_STRING([--enable-gprof], |
|---|
| 516 | [enable 'gprof' profiling support])], |
|---|
| 517 | [enable_gprof=$enableval], |
|---|
| 518 | [enable_gprof='no']) |
|---|
| 519 | |
|---|
| 520 | # Enable gcov-based profiling support |
|---|
| 521 | AC_ARG_ENABLE([gcov], |
|---|
| 522 | [AC_HELP_STRING([--enable-gcov], |
|---|
| 523 | [enable 'gcov' profiling support])], |
|---|
| 524 | [enable_gcov=$enableval], |
|---|
| 525 | [enable_gcov='no']) |
|---|
| 526 | |
|---|
| 527 | enable_profiling='no' |
|---|
| 528 | if test "$enable_prof" = 'yes' || test "$enable_gprof" = 'yes' || test "$enable_gcov" = 'yes'; then |
|---|
| 529 | enable_profiling='yes' |
|---|
| 530 | if test "$libtool_build_shared_libs" = 'yes'; then |
|---|
| 531 | echo "Warning: Can not profile code using shared libraries" |
|---|
| 532 | fi |
|---|
| 533 | fi |
|---|
| 534 | |
|---|
| 535 | # Magick API method prefix |
|---|
| 536 | AC_ARG_WITH([method-prefix], |
|---|
| 537 | [AC_HELP_STRING([--with-method-prefix=PREFIX], |
|---|
| 538 | [prefix MagickCore API methods])], |
|---|
| 539 | [with_method_prefix=$enableval], |
|---|
| 540 | [with_method_prefix='']) |
|---|
| 541 | |
|---|
| 542 | if test "$with_method_prefix" != ''; then |
|---|
| 543 | AC_DEFINE_UNQUOTED(MagickMethodPrefix,$with_method_prefix,[Magick API method prefix]) |
|---|
| 544 | fi |
|---|
| 545 | |
|---|
| 546 | # Number of bits in a Quantum |
|---|
| 547 | AC_ARG_WITH([quantum-depth], |
|---|
| 548 | [AC_HELP_STRING([--with-quantum-depth=DEPTH], |
|---|
| 549 | [number of bits in a pixel quantum (default 16)])], |
|---|
| 550 | [with_quantum_depth=$withval], |
|---|
| 551 | [with_quantum_depth=16]) |
|---|
| 552 | |
|---|
| 553 | if test "$with_quantum_depth" != '8'; then |
|---|
| 554 | DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-quantum-depth=$with_quantum_depth " |
|---|
| 555 | fi |
|---|
| 556 | |
|---|
| 557 | case "${with_quantum_depth}" in |
|---|
| 558 | 8 ) |
|---|
| 559 | ;; |
|---|
| 560 | 16 ) |
|---|
| 561 | ;; |
|---|
| 562 | 32 ) |
|---|
| 563 | ;; |
|---|
| 564 | 64 ) |
|---|
| 565 | ;; |
|---|
| 566 | * ) |
|---|
| 567 | AC_MSG_ERROR("Pixel quantum depth must have value of 8, 16, or 32") |
|---|
| 568 | ;; |
|---|
| 569 | esac |
|---|
| 570 | QuantumDepth="$with_quantum_depth" |
|---|
| 571 | AC_DEFINE_UNQUOTED(QuantumDepth,$QuantumDepth,[Number of bits in a pixel Quantum (8/16/32/64)]) |
|---|
| 572 | AC_SUBST(QuantumDepth)dnl |
|---|
| 573 | |
|---|
| 574 | # Set pixel cache threshold |
|---|
| 575 | AC_ARG_WITH([cache], |
|---|
| 576 | [AC_HELP_STRING([--with-cache=THRESHOLD], |
|---|
| 577 | [set pixel cache threshhold in MB (default available memory)])], |
|---|
| 578 | [with_cache=$withval], |
|---|
| 579 | [with_cache='']) |
|---|
| 580 | |
|---|
| 581 | if test "$with_cache" != ''; then |
|---|
| 582 | AC_DEFINE_UNQUOTED(PixelCacheThreshold,$with_cache,[Pixel cache threshold in MB (defaults to available memory)]) |
|---|
| 583 | DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-cache=$with_cache " |
|---|
| 584 | fi |
|---|
| 585 | |
|---|
| 586 | # Disable/Enable support for full delegate paths |
|---|
| 587 | AC_ARG_WITH([frozenpaths], |
|---|
| 588 | [AC_HELP_STRING([--with-frozenpaths], |
|---|
| 589 | [freeze delegate paths])], |
|---|
| 590 | [with_frozenpaths=$withval], |
|---|
| 591 | [with_frozenpaths='no']) |
|---|
| 592 | |
|---|
| 593 | # Enable build/install of Magick++ |
|---|
| 594 | AC_ARG_WITH([magick-plus-plus], |
|---|
| 595 | [AC_HELP_STRING([--without-magick-plus-plus], |
|---|
| 596 | [disable build/install of Magick++])], |
|---|
| 597 | [with_magick_plus_plus=$withval], |
|---|
| 598 | [with_magick_plus_plus='yes']) |
|---|
| 599 | |
|---|
| 600 | # Disable build/install of PerlMagick. |
|---|
| 601 | AC_ARG_WITH([perl], |
|---|
| 602 | [AC_HELP_STRING([--without-perl], |
|---|
| 603 | [no not build or install of PerlMagick])], |
|---|
| 604 | [with_perl=$withval], |
|---|
| 605 | [with_perl='yes']) |
|---|
| 606 | |
|---|
| 607 | # Options to pass when configuring PerlMagick |
|---|
| 608 | AC_ARG_WITH([perl-options], |
|---|
| 609 | [AC_HELP_STRING([--with-perl-options=OPTIONS], |
|---|
| 610 | [options to pass on command-line when generating PerlMagick's build file])]) |
|---|
| 611 | |
|---|
| 612 | PERL_MAKE_OPTIONS=$with_perl_options |
|---|
| 613 | AC_SUBST(PERL_MAKE_OPTIONS) |
|---|
| 614 | |
|---|
| 615 | |
|---|
| 616 | # Disable BZLIB (bzip2 library) |
|---|
| 617 | AC_ARG_WITH([bzlib], |
|---|
| 618 | [AC_HELP_STRING([--without-bzlib], |
|---|
| 619 | [disable BZLIB support])], |
|---|
| 620 | [with_bzlib=$withval], |
|---|
| 621 | [with_bzlib='yes']) |
|---|
| 622 | |
|---|
| 623 | if test "$with_bzlib" != 'yes'; then |
|---|
| 624 | DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-bzlib=$with_bzlib " |
|---|
| 625 | fi |
|---|
| 626 | |
|---|
| 627 | # Disable Display Postscript. |
|---|
| 628 | AC_ARG_WITH([dps], |
|---|
| 629 | [AC_HELP_STRING([--without-dps], |
|---|
| 630 | [disable Display Postscript support])], |
|---|
| 631 | [with_dps=$withval], |
|---|
| 632 | [with_dps='yes']) |
|---|
| 633 | |
|---|
| 634 | if test "$with_dps" != 'yes'; then |
|---|
| 635 | DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-dps=$with_dps " |
|---|
| 636 | fi |
|---|
| 637 | |
|---|
| 638 | # Disable DJVU. |
|---|
| 639 | AC_ARG_WITH([djvu], |
|---|
| 640 | [AC_HELP_STRING([--with-djvu], |
|---|
| 641 | [enable DjVu support])], |
|---|
| 642 | [with_djvu=$withval], |
|---|
| 643 | [with_djvu='no']) |
|---|
| 644 | |
|---|
| 645 | if test "$with_djvu" != 'yes'; then |
|---|
| 646 | DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-djvu=$with_djvu " |
|---|
| 647 | fi |
|---|
| 648 | |
|---|
| 649 | # Enable FlashPIX. |
|---|
| 650 | AC_ARG_WITH([fpx], |
|---|
| 651 | [AC_HELP_STRING([--without-fpx], |
|---|
| 652 | [disable FlashPIX support])], |
|---|
| 653 | [with_fpx=$withval], |
|---|
| 654 | [with_fpx='yes']) |
|---|
| 655 | |
|---|
| 656 | if test "$with_fpx" != 'yes'; then |
|---|
| 657 | DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fpx=$with_fpx " |
|---|
| 658 | fi |
|---|
| 659 | |
|---|
| 660 | # Enable Ghostscript library support. |
|---|
| 661 | AC_ARG_WITH([gslib], |
|---|
| 662 | [AC_HELP_STRING([--without-gslib], |
|---|
| 663 | [disable Ghostscript library support])], |
|---|
| 664 | [with_gslib=$withval], |
|---|
| 665 | [with_gslib='yes']) |
|---|
| 666 | |
|---|
| 667 | if test "$with_gslib" != 'yes'; then |
|---|
| 668 | DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gslib=$with_gslib " |
|---|
| 669 | fi |
|---|
| 670 | |
|---|
| 671 | # Disable JBIG. |
|---|
| 672 | AC_ARG_WITH([jbig], |
|---|
| 673 | [AC_HELP_STRING([--without-jbig], |
|---|
| 674 | [disable JBIG support])], |
|---|
| 675 | [with_jbig=$withval], |
|---|
| 676 | [with_jbig='yes']) |
|---|
| 677 | |
|---|
| 678 | if test "$with_jbig" != 'yes'; then |
|---|
| 679 | DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jbig=$with_jbig " |
|---|
| 680 | fi |
|---|
| 681 | |
|---|
| 682 | # Disable JPEG. |
|---|
| 683 | AC_ARG_WITH([jpeg], |
|---|
| 684 | [AC_HELP_STRING([--without-jpeg], |
|---|
| 685 | [disable JPEG support])], |
|---|
| 686 | [with_jpeg=$withval], |
|---|
| 687 | [with_jpeg='yes']) |
|---|
| 688 | |
|---|
| 689 | if test "$with_jpeg" != 'yes'; then |
|---|
| 690 | DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jpeg=$with_jpeg " |
|---|
| 691 | fi |
|---|
| 692 | |
|---|
| 693 | # Disable JPEG Version 2. |
|---|
| 694 | AC_ARG_WITH([jp2], |
|---|
| 695 | [AC_HELP_STRING([--without-jp2], |
|---|
| 696 | [disable JPEG-2000 support])], |
|---|
| 697 | [with_jp2=$withval], |
|---|
| 698 | [with_jp2='yes']) |
|---|
| 699 | |
|---|
| 700 | if test "$with_jp2" != 'yes'; then |
|---|
| 701 | DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jp2=$with_jp2 " |
|---|
| 702 | fi |
|---|
| 703 | |
|---|
| 704 | # Disable TIFF. |
|---|
| 705 | AC_ARG_WITH([tiff], |
|---|
| 706 | [AC_HELP_STRING([--without-tiff], |
|---|
| 707 | [disable TIFF support])], |
|---|
| 708 | [with_tiff=$withval], |
|---|
| 709 | [with_tiff='yes']) |
|---|
| 710 | |
|---|
| 711 | if test "$with_tiff" != 'yes'; then |
|---|
| 712 | DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-tiff=$with_tiff " |
|---|
| 713 | fi |
|---|
| 714 | |
|---|
| 715 | # Disable WMF. |
|---|
| 716 | AC_ARG_WITH([wmf], |
|---|
| 717 | [AC_HELP_STRING([--without-wmf], |
|---|
| 718 | [disable WMF support])], |
|---|
| 719 | [with_wmf=$withval], |
|---|
| 720 | [with_wmf=$with_modules]) |
|---|
| 721 | |
|---|
| 722 | if test "$with_wmf" != 'yes'; then |
|---|
| 723 | DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-wmf=$with_wmf " |
|---|
| 724 | fi |
|---|
| 725 | |
|---|
| 726 | # Set default font search path |
|---|
| 727 | AC_ARG_WITH([fontpath], |
|---|
| 728 | [AC_HELP_STRING([--with-fontpath=DIR], |
|---|
| 729 | [prepend to default font search path])], |
|---|
| 730 | [with_fontpath=$withval], |
|---|
| 731 | [with_fontpath='']) |
|---|
| 732 | |
|---|
| 733 | if test "$with_fontpath" != "yes" && test -z "$with_fontpath"; then |
|---|
| 734 | with_fontpath='' |
|---|
| 735 | else |
|---|
| 736 | AC_DEFINE_UNQUOTED(MAGICK_FONT_PATH,"$with_fontpath",Define to prepend to default font search path.) |
|---|
| 737 | fi |
|---|
| 738 | if test "$with_fontpath=" != ''; then |
|---|
| 739 | DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontpath=$with_fontpath " |
|---|
| 740 | fi |
|---|
| 741 | |
|---|
| 742 | # Set Ghostscript font directory |
|---|
| 743 | AC_ARG_WITH([gs-font-dir], |
|---|
| 744 | [AC_HELP_STRING([--with-gs-font-dir=DIR], |
|---|
| 745 | [Ghostscript font directory])], |
|---|
| 746 | [with_gs_font_dir=$withval], |
|---|
| 747 | [with_gs_font_dir='default']) |
|---|
| 748 | |
|---|
| 749 | if test "$with_gs_font_dir" != 'default'; then |
|---|
| 750 | DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gs-font-dir=$with_gs_font_dir " |
|---|
| 751 | fi |
|---|
| 752 | |
|---|
| 753 | # Set Windows font directory |
|---|
| 754 | AC_ARG_WITH([windows-font-dir], |
|---|
| 755 | [AC_HELP_STRING([--with-windows-font-dir=DIR], |
|---|
| 756 | [MS Windows font directory])], |
|---|
| 757 | [with_windows_font_dir=$withval], |
|---|
| 758 | [with_windows_font_dir='']) |
|---|
| 759 | |
|---|
| 760 | if test "x$with_windows_font_dir" = "xno"; then |
|---|
| 761 | with_windows_font_dir= |
|---|
| 762 | fi |
|---|
| 763 | if test "$with_windows_font_dir" != ''; then |
|---|
| 764 | DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-windows-font-dir=$with_windows_font_dir " |
|---|
| 765 | fi |
|---|
| 766 | |
|---|
| 767 | AC_ARG_WITH([zlib], |
|---|
| 768 | [AC_HELP_STRING([--without-zlib], |
|---|
| 769 | [disable ZLIB support])], |
|---|
| 770 | [with_zlib=$withval], |
|---|
| 771 | [with_zlib='yes']) |
|---|
| 772 | |
|---|
| 773 | if test "$with_zlib" != 'yes'; then |
|---|
| 774 | DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-zlib=$with_zlib " |
|---|
| 775 | fi |
|---|
| 776 | |
|---|
| 777 | # |
|---|
| 778 | # Specify path to shared libstdc++ if not in normal location |
|---|
| 779 | # |
|---|
| 780 | AC_ARG_WITH([libstdc], |
|---|
| 781 | [AC_HELP_STRING([--with-libstdc=DIR], |
|---|
| 782 | [ use libstdc++ in DIR (for GNU C++)])], |
|---|
| 783 | [with_libstdc=$withval], |
|---|
| 784 | [with_libstdc='']) |
|---|
| 785 | |
|---|
| 786 | if test "$with_libstdc" != ''; then |
|---|
| 787 | if test -d "$with_libstdc"; then |
|---|
| 788 | LIBSTDCLDFLAGS="-L$with_libstdc" |
|---|
| 789 | fi |
|---|
| 790 | fi |
|---|
| 791 | AC_SUBST(LIBSTDCLDFLAGS) |
|---|
| 792 | |
|---|
| 793 | # Does gcc required -traditional? |
|---|
| 794 | AC_PROG_GCC_TRADITIONAL |
|---|
| 795 | |
|---|
| 796 | ######## |
|---|
| 797 | # |
|---|
| 798 | # Set defines required to build DLLs and modules using MinGW |
|---|
| 799 | # |
|---|
| 800 | ######## |
|---|
| 801 | # These options are set for multi-thread DLL module build |
|---|
| 802 | # libMagick: _DLL _MAGICKMOD_ _MAGICKLIB_ |
|---|
| 803 | # module: _DLL |
|---|
| 804 | # executable/Magick++: _DLL _MAGICKMOD_ |
|---|
| 805 | MODULE_EXTRA_CPPFLAGS='' |
|---|
| 806 | LIBRARY_EXTRA_CPPFLAGS='' |
|---|
| 807 | if test "${native_win32_build}" = 'yes'; then |
|---|
| 808 | if test "${libtool_build_shared_libs}" = 'yes'; then |
|---|
| 809 | CPPFLAGS="$CPPFLAGS -D_DLL" |
|---|
| 810 | MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_DLL" |
|---|
| 811 | MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_DLL" |
|---|
| 812 | LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKLIB_" |
|---|
| 813 | if test "$with_modules" = 'yes'; then |
|---|
| 814 | LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKMOD_" |
|---|
| 815 | else |
|---|
| 816 | MODULE_EXTRA_CPPFLAGS="$MODULE_EXTRA_CPPFLAGS -D_MAGICKLIB_" |
|---|
| 817 | fi |
|---|
| 818 | else |
|---|
| 819 | CPPFLAGS="$CPPFLAGS -D_LIB" |
|---|
| 820 | MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_LIB" |
|---|
| 821 | MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_LIB" |
|---|
| 822 | fi |
|---|
| 823 | if test "$with_threads" = 'yes'; then |
|---|
| 824 | CPPFLAGS="$CPPFLAGS -D_MT" |
|---|
| 825 | MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_MT" |
|---|
| 826 | MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_MT" |
|---|
| 827 | fi |
|---|
| 828 | fi |
|---|
| 829 | AC_SUBST(MODULE_EXTRA_CPPFLAGS) |
|---|
| 830 | AC_SUBST(LIBRARY_EXTRA_CPPFLAGS) |
|---|
| 831 | |
|---|
| 832 | # Check standard headers |
|---|
| 833 | AC_HEADER_STDC |
|---|
| 834 | if ! test x"$ac_cv_header_stdc" = x"yes"; then |
|---|
| 835 | AC_MSG_WARN([configure has detected that you do not have the ANSI standard C |
|---|
| 836 | header files. Compilation cannot proceed. Please install the ANSI C |
|---|
| 837 | headers and rerun this script.]); |
|---|
| 838 | fi |
|---|
| 839 | AC_HEADER_DIRENT |
|---|
| 840 | |
|---|
| 841 | # Check additional headers |
|---|
| 842 | AC_CHECK_HEADERS(errno.h fcntl.h inttypes.h limits.h locale.h machine/param.h mach-o/dyld.h stdarg.h string.h strings.h sys/resource.h sys/time.h sys/timeb.h sys/times.h sys/types.h sys/wait.h unistd.h) |
|---|
| 843 | |
|---|
| 844 | ######## |
|---|
| 845 | # |
|---|
| 846 | # Checks for typedefs, structures, and compiler characteristics. |
|---|
| 847 | # |
|---|
| 848 | ######## |
|---|
| 849 | |
|---|
| 850 | # If the C compiler does not fully support the ANSI C qualifier const, |
|---|
| 851 | # define const to be empty. |
|---|
| 852 | AC_HEADER_STDBOOL |
|---|
| 853 | AC_C_CONST |
|---|
| 854 | AC_C_VOLATILE |
|---|
| 855 | AC_C_STRINGIZE |
|---|
| 856 | AC_TYPE_MODE_T |
|---|
| 857 | AC_TYPE_PID_T |
|---|
| 858 | AC_TYPE_OFF_T |
|---|
| 859 | AC_TYPE_SIZE_T |
|---|
| 860 | AC_HEADER_STAT |
|---|
| 861 | AC_HEADER_TIME |
|---|
| 862 | AC_STRUCT_TM |
|---|
| 863 | |
|---|
| 864 | # If the C compiler supports the keyword inline, do nothing. Otherwise |
|---|
| 865 | # define inline to __inline__ or __inline if it accepts one of those, |
|---|
| 866 | # otherwise define inline to be empty. |
|---|
| 867 | AC_C_INLINE |
|---|
| 868 | |
|---|
| 869 | # If words are stored with the most significant byte first (like |
|---|
| 870 | # Motorola and SPARC CPUs), define `WORDS_BIGENDIAN'. |
|---|
| 871 | AC_C_BIGENDIAN |
|---|
| 872 | |
|---|
| 873 | # If the C compiler supports a working long double type with more range |
|---|
| 874 | # or precision than the double type, define HAVE_LONG_DOUBLE. |
|---|
| 875 | AC_C_LONG_DOUBLE |
|---|
| 876 | |
|---|
| 877 | # If the C type char is unsigned, define __CHAR_UNSIGNED__, unless the |
|---|
| 878 | # C compiler predefines it. |
|---|
| 879 | AC_C_CHAR_UNSIGNED |
|---|
| 880 | |
|---|
| 881 | # Obtain size of an 'short' and define as SIZEOF_SHORT |
|---|
| 882 | AC_CHECK_SIZEOF(short) |
|---|
| 883 | |
|---|
| 884 | # Obtain size of an 'unsigned short' and define as SIZEOF_UNSIGNED_SHORT |
|---|
| 885 | AC_CHECK_SIZEOF(unsigned short) |
|---|
| 886 | |
|---|
| 887 | # Obtain size of an 'int' and define as SIZEOF_INT |
|---|
| 888 | AC_CHECK_SIZEOF(int) |
|---|
| 889 | |
|---|
| 890 | # Obtain size of an 'unsigned int' and define as SIZEOF_UNSIGNED_INT |
|---|
| 891 | AC_CHECK_SIZEOF(unsigned int) |
|---|
| 892 | |
|---|
| 893 | # Obtain size of a 'long' and define as SIZEOF_LONG |
|---|
| 894 | AC_CHECK_SIZEOF(long) |
|---|
| 895 | |
|---|
| 896 | # Obtain size of a 'unsigned long' and define as SIZEOF_UNSIGNED_LONG |
|---|
| 897 | AC_CHECK_SIZEOF(unsigned long) |
|---|
| 898 | |
|---|
| 899 | # Obtain size of off_t and define as SIZEOF_OFF_T |
|---|
| 900 | AC_CHECK_SIZEOF(off_t) |
|---|
| 901 | |
|---|
| 902 | # Obtain size of a 'size_t' and define as SIZEOF_SIZE_T |
|---|
| 903 | AC_CHECK_SIZEOF(size_t) |
|---|
| 904 | |
|---|
| 905 | # Obtain size of a 'ssize_t' and define as SIZEOF_SSIZE_T |
|---|
| 906 | AC_CHECK_SIZEOF(ssize_t) |
|---|
| 907 | |
|---|
| 908 | # Obtain size of a 'double' and define as SIZEOF_DOUBLE |
|---|
| 909 | AC_CHECK_SIZEOF(double) |
|---|
| 910 | |
|---|
| 911 | # Obtain size of a 'long long' and define as SIZEOF_LONG_LONG. If |
|---|
| 912 | # 'long long' is not supported then the value defined is zero. |
|---|
| 913 | AC_CHECK_SIZEOF(long long) |
|---|
| 914 | |
|---|
| 915 | # Obtain size of a 'unsigned long long' and define as |
|---|
| 916 | # SIZEOF_UNSIGNED_LONG_LONG. If 'unsigned long long' is not |
|---|
| 917 | # supported then the value defined is zero. |
|---|
| 918 | AC_CHECK_SIZEOF(unsigned long long) |
|---|
| 919 | |
|---|
| 920 | # Obtain size of a 'unsigned double' and define as SIZEOF_LONG_DOUBLE. If |
|---|
| 921 | # 'long double' is not supported then the value defined is zero. |
|---|
| 922 | AC_CHECK_SIZEOF(long double) |
|---|
| 923 | |
|---|
| 924 | # Obtain size of an 'void *' and define as SIZEOF_VOID |
|---|
| 925 | AC_CHECK_SIZEOF(void *) |
|---|
| 926 | |
|---|
| 927 | # If the system does not provide a 'mode_t' type, use 'int' instead |
|---|
| 928 | AC_CHECK_TYPE(mode_t, unsigned int) |
|---|
| 929 | |
|---|
| 930 | # If the system does not provide a 'off_t' type, use 'long' instead |
|---|
| 931 | AC_CHECK_TYPE(off_t, long) |
|---|
| 932 | |
|---|
| 933 | # If the system does not provide a 'pid_t' type, use 'int' instead |
|---|
| 934 | AC_CHECK_TYPE(pid_t, int) |
|---|
| 935 | |
|---|
| 936 | # If the system does not provide a 'size_t', use 'unsigned long' instead. |
|---|
| 937 | AC_CHECK_TYPE(size_t, unsigned long) |
|---|
| 938 | |
|---|
| 939 | # If the system does not provide a 'ssize_t', use 'long' instead. |
|---|
| 940 | AC_CHECK_TYPE(ssize_t, long) |
|---|
| 941 | |
|---|
| 942 | AC_MSG_CHECKING([whether our compiler supports __func__]) |
|---|
| 943 | AC_TRY_COMPILE([], |
|---|
| 944 | [{ const char *func = __func__; return(func != 0 ? 0 : 1); }], |
|---|
| 945 | AC_MSG_RESULT([yes]), |
|---|
| 946 | AC_MSG_RESULT([no]) |
|---|
| 947 | AC_MSG_CHECKING([whether our compiler supports __FUNCTION__]) |
|---|
| 948 | AC_TRY_COMPILE([], |
|---|
| 949 | [{ const char *func = __FUNCTION__; return(func != 0 ? 0 : 1); }], |
|---|
| 950 | AC_MSG_RESULT([yes]) |
|---|
| 951 | AC_DEFINE(__func__, __FUNCTION__, |
|---|
| 952 | [Define to appropriate substitue if compiler does not have __func__]), |
|---|
| 953 | AC_MSG_RESULT([no]) |
|---|
| 954 | AC_DEFINE(__func__, __FILE__, |
|---|
| 955 | [Define to appropriate substitue if compiler does not have __func__]))) |
|---|
| 956 | |
|---|
| 957 | ######## |
|---|
| 958 | # |
|---|
| 959 | # Check for functions |
|---|
| 960 | # |
|---|
| 961 | ######## |
|---|
| 962 | MAGICK_FUNC_MMAP_FILEIO |
|---|
| 963 | AC_FUNC_CLOSEDIR_VOID |
|---|
| 964 | AC_FUNC_MMAP |
|---|
| 965 | AC_FUNC_MEMCMP |
|---|
| 966 | AC_FUNC_SELECT_ARGTYPES |
|---|
| 967 | AC_FUNC_SETVBUF_REVERSED |
|---|
| 968 | AC_TYPE_SIGNAL |
|---|
| 969 | AC_FUNC_STRTOD |
|---|
| 970 | AC_FUNC_VPRINTF |
|---|
| 971 | |
|---|
| 972 | AC_CHECK_FUNCS([_exit atexit clock_gettime execvp floor fork ftime ftruncate getcwd getpid getexecname getdtablesize getpagesize gettimeofday lstat memset mkstemp munmap _NSGetExecutablePath pclose _pclose poll popen _popen pow pread pwrite raise rand_r readlink realpath select seekdir setlocale sqrt setvbuf stat strcspn strdup strpbrk strspn strstr strtol symlink sysconf sigemptyset sigaction strerror strlcat strlcpy strcasecmp strncasecmp telldir tempnam times usleep vsprintf vsnprintf waitpid]) |
|---|
| 973 | |
|---|
| 974 | ######## |
|---|
| 975 | # |
|---|
| 976 | # Check for function prototypes |
|---|
| 977 | # |
|---|
| 978 | ######## |
|---|
| 979 | |
|---|
| 980 | AC_CHECK_DECLS([pread, pwrite],[],[],[ |
|---|
| 981 | #include <unistd.h>]) |
|---|
| 982 | |
|---|
| 983 | AC_CHECK_DECLS([strlcpy],[],[],[ |
|---|
| 984 | #include <strings.h>]) |
|---|
| 985 | |
|---|
| 986 | AC_CHECK_DECLS([vsnprintf],[],[],[ |
|---|
| 987 | #include <stdio.h> |
|---|
| 988 | #include <stdarg.h>]) |
|---|
| 989 | |
|---|
| 990 | ######## |
|---|
| 991 | # |
|---|
| 992 | # C++ Support Tests (For Magick++) |
|---|
| 993 | # |
|---|
| 994 | ######## |
|---|
| 995 | have_magick_plus_plus='no' |
|---|
| 996 | if test "$with_magick_plus_plus" = 'yes'; then |
|---|
| 997 | OLIBS="$LIBS" |
|---|
| 998 | LIBS='' |
|---|
| 999 | AC_LANG_PUSH(C++) |
|---|
| 1000 | |
|---|
| 1001 | # Full set of headers used ... |
|---|
| 1002 | # algorithm cctype cerrno cmath cstdio cstdlib cstring ctime exception |
|---|
| 1003 | # functional iomanip iosfwd iostream iterator list string strstream utility |
|---|
| 1004 | AC_LANG([C++]) |
|---|
| 1005 | AC_PROG_CXX |
|---|
| 1006 | AC_CXX_HAVE_BOOL |
|---|
| 1007 | AC_CXX_HAVE_NAMESPACES |
|---|
| 1008 | AC_CXX_HAVE_STD_NAMESPACE |
|---|
| 1009 | AC_CXX_HAVE_STD_LIBS |
|---|
| 1010 | AC_CXX_HAVE_LSTRING |
|---|
| 1011 | AC_OPENMP([C++]) |
|---|
| 1012 | CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS" |
|---|
| 1013 | AC_LANG_POP |
|---|
| 1014 | |
|---|
| 1015 | AC_MSG_CHECKING([whether C++ compiler is sufficient for Magick++]) |
|---|
| 1016 | if \ |
|---|
| 1017 | test $ac_cv_cxx_have_bool = 'yes' && \ |
|---|
| 1018 | test $ac_cv_cxx_have_lstring = 'yes' && \ |
|---|
| 1019 | test $ac_cv_cxx_have_namespaces = 'yes' && \ |
|---|
| 1020 | test $ac_cv_cxx_have_std_libs = 'yes' && \ |
|---|
| 1021 | test $ac_cv_cxx_have_std_namespace = 'yes'; then |
|---|
| 1022 | have_magick_plus_plus='yes' |
|---|
| 1023 | else |
|---|
| 1024 | have_magick_plus_plus='no (failed tests)' |
|---|
| 1025 | fi |
|---|
| 1026 | AC_MSG_RESULT([$have_magick_plus_plus]) |
|---|
| 1027 | LIBS="$OLIBS" |
|---|
| 1028 | fi |
|---|
| 1029 | AM_CONDITIONAL(WITH_MAGICK_PLUS_PLUS, test "$have_magick_plus_plus" = 'yes') |
|---|
| 1030 | |
|---|
| 1031 | # Only check for delegate libraries in subdirectories if requested. |
|---|
| 1032 | if test "$enable_delegate_build" != 'no'; then |
|---|
| 1033 | # Check for delegate sub-directories and add -I & -L options as required. |
|---|
| 1034 | # This presumes that delegates are installed as detailed in the ImageMagick |
|---|
| 1035 | # README. If delegates are installed in a standard location where the |
|---|
| 1036 | # compiler will automatically find them then these options should not be |
|---|
| 1037 | # required. |
|---|
| 1038 | |
|---|
| 1039 | # |
|---|
| 1040 | # Most delegates have includes in the same directory as the library, but not all ... |
|---|
| 1041 | # |
|---|
| 1042 | # Includes |
|---|
| 1043 | for dir in bzlib fpx jp2 jp2/src/libjasper/include jbig/libjbig jpeg lcms/include magick png tiff/libtiff ttf/include wand wmf/include xml/include zlib; do |
|---|
| 1044 | if test -d "$builddir/$dir"; then |
|---|
| 1045 | CPPFLAGS="$CPPFLAGS -I$builddir/$dir" |
|---|
| 1046 | else |
|---|
| 1047 | if test -d "$srcdirfull/$dir"; then |
|---|
| 1048 | CPPFLAGS="$CPPFLAGS -I$srcdirfull/$dir" |
|---|
| 1049 | fi |
|---|
| 1050 | fi |
|---|
| 1051 | done |
|---|
| 1052 | |
|---|
| 1053 | # Libraries |
|---|
| 1054 | for dir in bzlib fpx jp2 jp2/src/libjasper jbig/libjbig jpeg lcms/src magick png tiff/libtiff ttf/objs wand wmf/src xml zlib; do |
|---|
| 1055 | if test -d "$builddir/$dir/.libs"; then |
|---|
| 1056 | LDFLAGS="$LDFLAGS -L$builddir/$dir/.libs" |
|---|
| 1057 | else |
|---|
| 1058 | if test -d "$srcdirfull/$dir/.libs"; then |
|---|
| 1059 | LDFLAGS="$LDFLAGS -L$srcdirfull/$dir/.libs" |
|---|
| 1060 | fi |
|---|
| 1061 | fi |
|---|
| 1062 | if test -d "$builddir/$dir"; then |
|---|
| 1063 | LDFLAGS="$LDFLAGS -L$builddir/$dir" |
|---|
| 1064 | else |
|---|
| 1065 | if test -d "$srcdirfull/$dir"; then |
|---|
| 1066 | LDFLAGS="$LDFLAGS -L$srcdirfull/$dir" |
|---|
| 1067 | fi |
|---|
| 1068 | fi |
|---|
| 1069 | done |
|---|
| 1070 | fi |
|---|
| 1071 | |
|---|
| 1072 | # Assume that delegate headers reside under same directory as ImageMagick |
|---|
| 1073 | # installation prefix. |
|---|
| 1074 | MAGICK_CPPFLAGS="-I$INCLUDE_DIR $MAGICK_CPPFLAGS" |
|---|
| 1075 | |
|---|
| 1076 | # |
|---|
| 1077 | # Find the X11 RGB database |
|---|
| 1078 | # |
|---|
| 1079 | AC_CACHE_CHECK(for X11 configure files,im_cv_x_configure, |
|---|
| 1080 | [# Look for the header file in a standard set of common directories. |
|---|
| 1081 | # Check X11 before X11Rn because it is often a symlink to the current release. |
|---|
| 1082 | for ac_dir in \ |
|---|
| 1083 | /lib/usr/lib/X11 \ |
|---|
| 1084 | /usr/X11/lib \ |
|---|
| 1085 | /usr/X11R4/lib \ |
|---|
| 1086 | /usr/X11R5/lib \ |
|---|
| 1087 | /usr/X11R6/lib \ |
|---|
| 1088 | /usr/X386/lib \ |
|---|
| 1089 | /usr/XFree86/lib/X11 \ |
|---|
| 1090 | /usr/athena/lib \ |
|---|
| 1091 | /usr/lib \ |
|---|
| 1092 | /usr/lib/X11 \ |
|---|
| 1093 | /usr/lib/X11R4 \ |
|---|
| 1094 | /usr/lib/X11R5 \ |
|---|
| 1095 | /usr/lib/X11R6 \ |
|---|
| 1096 | /usr/local/X11/lib \ |
|---|
| 1097 | /usr/local/X11R4/lib \ |
|---|
| 1098 | /usr/local/X11R5/lib \ |
|---|
| 1099 | /usr/local/X11R6/lib \ |
|---|
| 1100 | /usr/local/lib \ |
|---|
| 1101 | /usr/local/lib/X11 \ |
|---|
| 1102 | /usr/local/lib/X11R4 \ |
|---|
| 1103 | /usr/local/lib/X11R5 \ |
|---|
| 1104 | /usr/local/lib/X11R6 \ |
|---|
| 1105 | /usr/local/x11r5/lib \ |
|---|
| 1106 | /usr/lpp/Xamples/lib \ |
|---|
| 1107 | /usr/openwin/lib \ |
|---|
| 1108 | /usr/openwin/share/lib \ |
|---|
| 1109 | /usr/unsupported/lib \ |
|---|
| 1110 | /usr/x386/lib \ |
|---|
| 1111 | ; do |
|---|
| 1112 | if test -f "$ac_dir/X11/rgb.txt"; then |
|---|
| 1113 | im_cv_x_configure="$ac_dir/X11/" |
|---|
| 1114 | break |
|---|
| 1115 | elif test -f "$ac_dir/rgb.txt"; then |
|---|
| 1116 | im_cv_x_configure="$ac_dir/" |
|---|
| 1117 | break |
|---|
| 1118 | fi |
|---|
| 1119 | |
|---|
| 1120 | done]) |
|---|
| 1121 | X11ConfigurePath="$im_cv_x_configure" |
|---|
| 1122 | if test "$native_win32_build" = 'yes'; then |
|---|
| 1123 | X11ConfigurePath=`$WinPathScript "$X11ConfigurePath=" 1` |
|---|
| 1124 | fi |
|---|
| 1125 | AC_DEFINE_UNQUOTED(X11ConfigurePath,"X11ConfigurePath",Location of X11 configure files) |
|---|
| 1126 | |
|---|
| 1127 | # |
|---|
| 1128 | # Find OpenMP library |
|---|
| 1129 | # |
|---|
| 1130 | GOMP_LIBS='' |
|---|
| 1131 | if test "$enable_openmp" != 'no'; then |
|---|
| 1132 | AC_CHECK_LIB(gomp,GOMP_parallel_start,GOMP_LIBS="-lgomp",,) |
|---|
| 1133 | LIBS="$GOMP_LIBS $LIBS" |
|---|
| 1134 | fi |
|---|
| 1135 | AC_SUBST(GOMP_LIBS) |
|---|
| 1136 | |
|---|
| 1137 | # |
|---|
| 1138 | # Find Posix threads library |
|---|
| 1139 | # |
|---|
| 1140 | THREAD_LIBS='' |
|---|
| 1141 | if test "$with_threads" != 'no' && test "$have_threads" = 'yes'; then |
|---|
| 1142 | |
|---|
| 1143 | if test "x$PTHREAD_LIBS" = "x"; then |
|---|
| 1144 | case "${host_cpu}-${host_os}" in |
|---|
| 1145 | *-freebsd*) |
|---|
| 1146 | MAGICK_CHECK_PTHREAD_LIB(c_r,PTHREAD_LIBS=-lc_r) ;; |
|---|
| 1147 | esac |
|---|
| 1148 | fi |
|---|
| 1149 | |
|---|
| 1150 | for lib in pthread pthreads; do |
|---|
| 1151 | if test "x$PTHREAD_LIBS" = "x"; then |
|---|
| 1152 | MAGICK_CHECK_PTHREAD_LIB([$lib],[PTHREAD_LIBS=-l$lib]) |
|---|
| 1153 | fi |
|---|
| 1154 | done |
|---|
| 1155 | |
|---|
| 1156 | THREAD_LIBS="$PTHREAD_LIBS" |
|---|
| 1157 | LIBS="$LIBS $THREAD_LIBS" |
|---|
| 1158 | fi |
|---|
| 1159 | AC_SUBST(THREAD_LIBS) |
|---|
| 1160 | |
|---|
| 1161 | # |
|---|
| 1162 | # Add support for ccmalloc memory debugging library if requested |
|---|
| 1163 | # |
|---|
| 1164 | have_ccmalloc='no' |
|---|
| 1165 | CCMALLOC_LIBS='' |
|---|
| 1166 | if test "$enable_ccmalloc" = 'yes'; then |
|---|
| 1167 | AC_PATH_PROG(CCMALLOCDelegate,ccmalloc,) |
|---|
| 1168 | if test -n "$CCMALLOCDelegate"; then |
|---|
| 1169 | eval `grep PREFIX= $CCMALLOCDelegate | sed -e 's/PREFIX/CCMALLOC_PREFIX/'` |
|---|
| 1170 | OLIBS="$LIBS" |
|---|
| 1171 | # Assume that gcc is used with ccmalloc. |
|---|
| 1172 | LIBS="$LIBS $CCMALLOC_PREFIX/lib/ccmalloc-gcc.o" |
|---|
| 1173 | AC_CHECK_LIB(ccmalloc,ccmalloc_malloc,CCMALLOC_LIBS="$CCMALLOC_PREFIX/lib/ccmalloc-gcc.o -lccmalloc -ldl",,-ldl) |
|---|
| 1174 | if test -n "$CCMALLOC_LIBS"; then |
|---|
| 1175 | LIBS="$OLIBS" |
|---|
| 1176 | LIBS="$LIBS $CCMALLOC_LIBS" |
|---|
| 1177 | have_ccmalloc='yes' |
|---|
| 1178 | else |
|---|
| 1179 | LIBS="$OLIBS" |
|---|
| 1180 | fi |
|---|
| 1181 | fi |
|---|
| 1182 | fi |
|---|
| 1183 | |
|---|
| 1184 | # |
|---|
| 1185 | # Add support for efence memory debugging library if requested |
|---|
| 1186 | # |
|---|
| 1187 | if test "$enable_efence" = 'yes'; then |
|---|
| 1188 | EFENCE_LIBS='-lefence' |
|---|
| 1189 | LIBS="$EFENCE_LIBS $LIBS" |
|---|
| 1190 | fi |
|---|
| 1191 | |
|---|
| 1192 | # |
|---|
| 1193 | # Find math library |
|---|
| 1194 | # |
|---|
| 1195 | MATH_LIBS='' |
|---|
| 1196 | AC_CHECK_LIB(m,sqrt,MATH_LIBS="-lm",,) |
|---|
| 1197 | LIBS="$MATH_LIBS $LIBS" |
|---|
| 1198 | AC_SUBST(MATH_LIBS) |
|---|
| 1199 | |
|---|
| 1200 | # |
|---|
| 1201 | # Check for ZLIB |
|---|
| 1202 | # |
|---|
| 1203 | have_zlib='no' |
|---|
| 1204 | ZLIB_LIBS='' |
|---|
| 1205 | dnl PNG requires zlib so enable zlib check if PNG is requested |
|---|
| 1206 | if test "$with_zlib" != 'no' || test "$with_png" != 'no'; then |
|---|
| 1207 | AC_MSG_RESULT([-------------------------------------------------------------]) |
|---|
| 1208 | AC_MSG_RESULT([Checking for ZLIB support]) |
|---|
| 1209 | AC_MSG_RESULT([-------------------------------------------------------------]) |
|---|
| 1210 | ZLIB_LIBS='' |
|---|
| 1211 | failed=0; |
|---|
| 1212 | passed=0; |
|---|
| 1213 | AC_CHECK_HEADER(zconf.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`) |
|---|
| 1214 | AC_CHECK_HEADER(zlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`) |
|---|
| 1215 | AC_CHECK_LIB(z,compress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) |
|---|
| 1216 | AC_CHECK_LIB(z,uncompress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) |
|---|
| 1217 | AC_CHECK_LIB(z,deflate,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) |
|---|
| 1218 | AC_CHECK_LIB(z,inflate,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) |
|---|
| 1219 | AC_CHECK_LIB(z,gzseek,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) |
|---|
| 1220 | AC_CHECK_LIB(z,gztell,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) |
|---|
| 1221 | AC_MSG_CHECKING([if ZLIB package is complete]) |
|---|
| 1222 | if test $passed -gt 0; then |
|---|
| 1223 | if test $failed -gt 0; then |
|---|
| 1224 | AC_MSG_RESULT([no -- some components failed test]) |
|---|
| 1225 | have_zlib='no (failed tests)' |
|---|
| 1226 | else |
|---|
| 1227 | ZLIB_LIBS='-lz' |
|---|
| 1228 | LIBS="$ZLIB_LIBS $LIBS" |
|---|
| 1229 | AC_DEFINE(HasZLIB,1,Define if you have zlib compression library) |
|---|
| 1230 | AC_MSG_RESULT([yes]) |
|---|
| 1231 | have_zlib='yes' |
|---|
| 1232 | fi |
|---|
| 1233 | else |
|---|
| 1234 | AC_MSG_RESULT([no]) |
|---|
| 1235 | fi |
|---|
| 1236 | fi |
|---|
| 1237 | AM_CONDITIONAL(HasZLIB, test "$have_zlib" = 'yes') |
|---|
| 1238 | AC_SUBST(ZLIB_LIBS) |
|---|
| 1239 | |
|---|
| 1240 | # |
|---|
| 1241 | # Check for BZLIB |
|---|
| 1242 | # |
|---|
| 1243 | have_bzlib='no' |
|---|
| 1244 | if test "$with_bzlib" != 'no'; then |
|---|
| 1245 | BZLIB_LIBS='' |
|---|
| 1246 | AC_MSG_RESULT([-------------------------------------------------------------]) |
|---|
| 1247 | AC_MSG_RESULT([Checking for BZLIB support]) |
|---|
| 1248 | AC_MSG_RESULT([-------------------------------------------------------------]) |
|---|
| 1249 | failed=0; |
|---|
| 1250 | passed=0; |
|---|
| 1251 | AC_CHECK_HEADER(bzlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`) |
|---|
| 1252 | AC_CHECK_LIB(bz2,BZ2_bzCompress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) |
|---|
| 1253 | AC_CHECK_LIB(bz2,BZ2_bzDecompress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) |
|---|
| 1254 | AC_MSG_CHECKING([if BZLIB package is complete]) |
|---|
| 1255 | if test $passed -gt 0; then |
|---|
| 1256 | if test $failed -gt 0; then |
|---|
| 1257 | AC_MSG_RESULT([no -- some components failed test]) |
|---|
| 1258 | have_bzlib='no (failed tests)' |
|---|
| 1259 | else |
|---|
| 1260 | BZLIB_LIBS='-lbz2' |
|---|
| 1261 | LIBS="$BZLIB_LIBS $LIBS" |
|---|
| 1262 | AC_DEFINE(HasBZLIB,1,Define if you have the bzip2 library) |
|---|
| 1263 | AC_MSG_RESULT([yes]) |
|---|
| 1264 | have_bzlib='yes' |
|---|
| 1265 | fi |
|---|
| 1266 | else |
|---|
| 1267 | AC_MSG_RESULT([no]) |
|---|
| 1268 | fi |
|---|
| 1269 | fi |
|---|
| 1270 | AM_CONDITIONAL(HasBZLIB, test "$have_bzlib" = 'yes') |
|---|
| 1271 | AC_SUBST(BZLIB_LIBS) |
|---|
| 1272 | |
|---|
| 1273 | # |
|---|
| 1274 | # Find the X11 include and library directories. |
|---|
| 1275 | # |
|---|
| 1276 | IPC_LIBS='' |
|---|
| 1277 | X11_LIBS='' |
|---|
| 1278 | XEXT_LIBS='' |
|---|
| 1279 | XT_LIBS='' |
|---|
| 1280 | AC_PATH_XTRA |
|---|
| 1281 | if test "$no_x" != 'yes'; then |
|---|
| 1282 | AC_MSG_RESULT([-------------------------------------------------------------]) |
|---|
| 1283 | AC_MSG_RESULT([Checking for X11 support]) |
|---|
| 1284 | AC_MSG_RESULT([-------------------------------------------------------------]) |
|---|
| 1285 | LDFLAGS="$LDFLAGS $X_LIBS" |
|---|
| 1286 | X11_LIBS="$X_PRE_LIBS -lX11 $X_EXTRA_LIBS" |
|---|
| 1287 | LIBS="$X11_LIBS $LIBS" |
|---|
| 1288 | CPPFLAGS="$CPPFLAGS $X_CFLAGS" |
|---|
| 1289 | |
|---|
| 1290 | AC_DEFINE(HasX11,1,Define if you have X11 library)dnl |
|---|
| 1291 | |
|---|
| 1292 | # |
|---|
| 1293 | # Check for X11 shared memory extension |
|---|
| 1294 | # |
|---|
| 1295 | # shmctl is required to support the shared memory extension |
|---|
| 1296 | AC_CHECK_FUNC([shmctl],[have_shmctl='yes'],[]) |
|---|
| 1297 | if test "$have_shmctl" != 'yes'; then |
|---|
| 1298 | PERSIST_LIBS=$LIBS |
|---|
| 1299 | LIBS="$LIBS -lcygipc" |
|---|
| 1300 | AC_TRY_LINK_FUNC([shmctl],[have_shmctl='yes'; IPC_LIBS='-lcygipc'],[]) |
|---|
| 1301 | LIBS=$PERSIST_LIBS |
|---|
| 1302 | fi |
|---|
| 1303 | |
|---|
| 1304 | if test "$have_shmctl" = 'yes'; then |
|---|
| 1305 | AC_CHECK_LIB([Xext],[XShmAttach],[XEXT_LIBS='-lXext' ; AC_DEFINE(HasSharedMemory,1,X11 server supports shared memory extension)],[],[]) |
|---|
| 1306 | fi |
|---|
| 1307 | |
|---|
| 1308 | # |
|---|
| 1309 | # Check for X11 shape extension |
|---|
| 1310 | # |
|---|
| 1311 | AC_CHECK_LIB([Xext],[XShapeCombineMask],[XEXT_LIBS='-lXext' ; AC_DEFINE(HasShape,1,X11 server supports shape extension)],[],[]) |
|---|
| 1312 | AC_CHECK_LIB(Xt,XtSetEventDispatcher,XT_LIBS='-lXt',,) |
|---|
| 1313 | LIBS="$XEXT_LIBS $XT_LIBS $LIBS" |
|---|
| 1314 | fi |
|---|
| 1315 | if test "$no_x" != 'yes'; then |
|---|
| 1316 | have_x='yes' |
|---|
| 1317 | else |
|---|
| 1318 | have_x='no' |
|---|
| 1319 | fi |
|---|
| 1320 | AM_CONDITIONAL(HasX11, test "$have_x" = 'yes') |
|---|
| 1321 | AC_SUBST(X11_LIBS) |
|---|
| 1322 | AC_SUBST(XEXT_LIBS) |
|---|
| 1323 | |
|---|
| 1324 | # |
|---|
| 1325 | # If profiling, then check for -ldl and dlopen (required for Solaris & gcc) |
|---|
| 1326 | # |
|---|
| 1327 | LIB_DL='' |
|---|
| 1328 | if test "$enable_profiling" = 'yes'; then |
|---|
| 1329 | AC_CHECK_LIB(dl,dlopen,LIB_DL='-ldl',,) |
|---|
| 1330 | LIBS="$LIB_DL $LIBS" |
|---|
| 1331 | fi |
|---|
| 1332 | AC_SUBST(LIB_DL) |
|---|
| 1333 | |
|---|
| 1334 | # |
|---|
| 1335 | # Check for Display Postscript |
|---|
| 1336 | # |
|---|
| 1337 | have_dps='no' |
|---|
| 1338 | DPS_LIBS='' |
|---|
| 1339 | if test "$with_dps" != 'no' && test "$with_x" != 'no'; then |
|---|
| 1340 | AC_MSG_RESULT([-------------------------------------------------------------]) |
|---|
| 1341 | AC_MSG_RESULT([Checking for Display Postscript support]) |
|---|
| 1342 | AC_MSG_RESULT([-------------------------------------------------------------]) |
|---|
| 1343 | failed=0; |
|---|
| 1344 | passed=0; |
|---|
| 1345 | PERSIST_CPPFLAGS="$CPPFLAGS" |
|---|
| 1346 | CPPFLAGS="$CPPFLAGS -I${ac_x_includes}/X11" |
|---|
| 1347 | AC_CHECK_HEADER(DPS/dpsXclient.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`) |
|---|
| 1348 | # DPS issues: |
|---|
| 1349 | # XFree86-4.x needs -lXt to provide XtMalloc for -ldps. |
|---|
| 1350 | # Cygwin doesn't deliver -lXt as a DLL, which prevents a DLL build. |
|---|
| 1351 | # Adobe DPS (as delivered on Solaris) doesn't require -lXt. |
|---|
| 1352 | # ImageMagick itself doesn't use -lXt. |
|---|
| 1353 | have_libdps='no' |
|---|
| 1354 | LIBDPS_XT='' |
|---|
| 1355 | AC_CHECK_LIB(dps,DPSInitialize,have_libdps='yes',have_libdps='no',) |
|---|
| 1356 | if test "$have_libdps" != 'yes'; then |
|---|
| 1357 | # Unset cache variable so we can try again. |
|---|
| 1358 | unset ac_cv_lib_dps_DPSInitialize |
|---|
| 1359 | AC_CHECK_LIB(dps,DPSInitialize,have_libdps='yes',have_libdps='no',-lXt) |
|---|
| 1360 | if test "$have_libdps" = 'yes'; then |
|---|
| 1361 | LIBDPS_XT='-lXt' |
|---|
| 1362 | fi |
|---|
| 1363 | fi |
|---|
| 1364 | if |
|---|