| 1 | # Copyright 1999-2009 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.wizards-toolkit.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 | # Configure script for building the Wizard Executable Environment. |
|---|
| 16 | |
|---|
| 17 | AC_PREREQ(2.63) |
|---|
| 18 | AC_INIT([WizardsToolkit],[1.0.7],[http://www.wizards-toolkit.org],[WizardsToolkit]) |
|---|
| 19 | AC_CONFIG_SRCDIR([wizard/WizardsToolkit.h]) |
|---|
| 20 | AC_CONFIG_AUX_DIR([config]) |
|---|
| 21 | AC_CONFIG_MACRO_DIR([m4]) |
|---|
| 22 | AC_CONFIG_LIBOBJ_DIR([wizard]) |
|---|
| 23 | AC_CONFIG_HEADERS([config/config.h]) |
|---|
| 24 | AX_PREFIX_CONFIG_H([wizard/wizard-config.h],[WizardsToolkit]) |
|---|
| 25 | AC_CONFIG_FILES([\ |
|---|
| 26 | config/configure.xml \ |
|---|
| 27 | config/WizardsToolkit.dox \ |
|---|
| 28 | Makefile \ |
|---|
| 29 | wizard.sh \ |
|---|
| 30 | utilities/cipher-info.1 \ |
|---|
| 31 | utilities/decipher.1 \ |
|---|
| 32 | utilities/digest.1 \ |
|---|
| 33 | utilities/encipher.1 \ |
|---|
| 34 | utilities/keyring.1 \ |
|---|
| 35 | windows/WizardsToolkit.bat \ |
|---|
| 36 | wizard/version.h \ |
|---|
| 37 | wizard/WizardsToolkit-config \ |
|---|
| 38 | wizard/WizardsToolkit.pc \ |
|---|
| 39 | WizardsToolkit.spec ]) |
|---|
| 40 | |
|---|
| 41 | # |
|---|
| 42 | # Save initial user-tunable values |
|---|
| 43 | # |
|---|
| 44 | USER_LIBS=$LIBS |
|---|
| 45 | for var in CC CFLAGS CPPFLAGS CXX CXXCPP LDFLAGS LIBS ; do |
|---|
| 46 | eval isset=\${$var+set} |
|---|
| 47 | if test "$isset" = 'set'; then |
|---|
| 48 | eval val=$`echo $var` |
|---|
| 49 | DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS}'${var}=${val}' " |
|---|
| 50 | fi |
|---|
| 51 | done |
|---|
| 52 | AC_SUBST(DISTCHECK_CONFIG_FLAGS) |
|---|
| 53 | |
|---|
| 54 | CONFIGURE_ARGS="$0 ${ac_configure_args}" |
|---|
| 55 | AC_SUBST(CONFIGURE_ARGS) |
|---|
| 56 | |
|---|
| 57 | # Source file containing package/library versioning information. |
|---|
| 58 | . ${srcdir}/version.sh |
|---|
| 59 | |
|---|
| 60 | echo "configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}${PACKAGE_LIB_SUBVERSION}" |
|---|
| 61 | AC_CANONICAL_TARGET([]) |
|---|
| 62 | |
|---|
| 63 | # Substitute library versioning |
|---|
| 64 | AC_SUBST(WIZARD_LIBRARY_CURRENT)dnl |
|---|
| 65 | AC_SUBST(WIZARD_LIBRARY_REVISION)dnl |
|---|
| 66 | AC_SUBST(WIZARD_LIBRARY_AGE)dnl |
|---|
| 67 | |
|---|
| 68 | AC_SUBST(PACKAGE_NAME)dnl |
|---|
| 69 | AC_SUBST(PACKAGE_VERSION)dnl |
|---|
| 70 | AC_SUBST(PACKAGE_RELEASE)dnl |
|---|
| 71 | AC_SUBST(PACKAGE_CHANGE_DATE)dnl |
|---|
| 72 | AC_SUBST(PACKAGE_LIB_VERSION)dnl |
|---|
| 73 | AC_SUBST(PACKAGE_LIB_VERSION_NUMBER)dnl |
|---|
| 74 | AC_SUBST(PACKAGE_RELEASE_DATE)dnl |
|---|
| 75 | AC_SUBST(PACKAGE_LIB_SUBVERSION)dnl |
|---|
| 76 | |
|---|
| 77 | # Substitute CVS branch tag |
|---|
| 78 | AC_SUBST(CVS_BRANCH_TAG)dnl |
|---|
| 79 | |
|---|
| 80 | # Ensure that make can run correctly |
|---|
| 81 | AM_SANITY_CHECK |
|---|
| 82 | |
|---|
| 83 | AM_INIT_AUTOMAKE($PACKAGE_NAME,"${PACKAGE_VERSION}${PACKAGE_LIB_SUBVERSION}", ' ') |
|---|
| 84 | |
|---|
| 85 | # Enable support for silent build rules |
|---|
| 86 | AM_SILENT_RULES([yes]) |
|---|
| 87 | |
|---|
| 88 | WIZARD_LIB_VERSION="0x" |
|---|
| 89 | if test ${WIZARD_LIBRARY_CURRENT} -lt 10 ; then |
|---|
| 90 | WIZARD_LIB_VERSION=${WIZARD_LIB_VERSION}0 |
|---|
| 91 | fi |
|---|
| 92 | WIZARD_LIB_VERSION=${WIZARD_LIB_VERSION}${WIZARD_LIBRARY_CURRENT} |
|---|
| 93 | if test ${WIZARD_LIBRARY_AGE} -lt 10 ; then |
|---|
| 94 | WIZARD_LIB_VERSION=${WIZARD_LIB_VERSION}0 |
|---|
| 95 | fi |
|---|
| 96 | WIZARD_LIB_VERSION=${WIZARD_LIB_VERSION}${WIZARD_LIBRARY_AGE} |
|---|
| 97 | if test ${WIZARD_LIBRARY_REVISION} -lt 10 ; then |
|---|
| 98 | WIZARD_LIB_VERSION=${WIZARD_LIB_VERSION}0 |
|---|
| 99 | fi |
|---|
| 100 | WIZARD_LIB_VERSION=${WIZARD_LIB_VERSION}${WIZARD_LIBRARY_REVISION} |
|---|
| 101 | AC_SUBST(WIZARD_LIB_VERSION) |
|---|
| 102 | |
|---|
| 103 | # Definition used to define MagickLibVersionText in version.h |
|---|
| 104 | WIZARD_LIB_VERSION_TEXT="${PACKAGE_VERSION}" |
|---|
| 105 | AC_SUBST(WIZARD_LIB_VERSION_TEXT) |
|---|
| 106 | |
|---|
| 107 | # Definition used to define MagickLibVersionNumber in version.h |
|---|
| 108 | WIZARD_LIB_VERSION_NUMBER="${WIZARD_LIBRARY_CURRENT},${WIZARD_LIBRARY_AGE},${WIZARD_LIBRARY_REVISION}" |
|---|
| 109 | AC_SUBST(WIZARD_LIB_VERSION_NUMBER) |
|---|
| 110 | |
|---|
| 111 | # Regenerate config.status if ChangeLog or version.sh is updated. |
|---|
| 112 | AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/version.sh']) |
|---|
| 113 | |
|---|
| 114 | PERLMAINCC=$CC |
|---|
| 115 | |
|---|
| 116 | WIZARD_CFLAGS='' |
|---|
| 117 | WIZARD_CPPFLAGS=$CPPFLAGS_USER |
|---|
| 118 | WIZARD_PCFLAGS=$CPPFLAGS_USER |
|---|
| 119 | WIZARD_LDFLAGS='' |
|---|
| 120 | WIZARD_LIBS='' |
|---|
| 121 | |
|---|
| 122 | # |
|---|
| 123 | # Evaluate shell variable equivalents to Makefile directory variables |
|---|
| 124 | # |
|---|
| 125 | if test "x$prefix" = xNONE; then |
|---|
| 126 | prefix=$ac_default_prefix |
|---|
| 127 | fi |
|---|
| 128 | # Let make expand exec_prefix. |
|---|
| 129 | if test "x$exec_prefix" = xNONE; then |
|---|
| 130 | exec_prefix='${prefix}' |
|---|
| 131 | fi |
|---|
| 132 | |
|---|
| 133 | # |
|---|
| 134 | eval "eval PREFIX_DIR=${prefix}" |
|---|
| 135 | AC_SUBST(PREFIX_DIR) |
|---|
| 136 | eval "eval EXEC_PREFIX_DIR=${exec_prefix}" |
|---|
| 137 | AC_SUBST(EXEC_PREFIX_DIR) |
|---|
| 138 | eval "eval BIN_DIR=$bindir" |
|---|
| 139 | AC_SUBST(BIN_DIR) |
|---|
| 140 | eval "eval SBIN_DIR=$sbindir" |
|---|
| 141 | AC_SUBST(SBIN_DIR) |
|---|
| 142 | eval "eval LIBEXEC_DIR=$libexecdir" |
|---|
| 143 | AC_SUBST(LIBEXEC_DIR) |
|---|
| 144 | eval "eval DATA_DIR=$datadir" |
|---|
| 145 | AC_SUBST(DATA_DIR) |
|---|
| 146 | eval "eval SYSCONF_DIR=$sysconfdir" |
|---|
| 147 | AC_SUBST(SYSCONF_DIR) |
|---|
| 148 | eval "eval SHAREDSTATE_DIR=$sharedstatedir" |
|---|
| 149 | AC_SUBST(SHAREDSTATE_DIR) |
|---|
| 150 | eval "eval LOCALSTATE_DIR=$localstatedir" |
|---|
| 151 | AC_SUBST(LOCALSTATE_DIR) |
|---|
| 152 | eval "eval LIB_DIR=$libdir" |
|---|
| 153 | AC_SUBST(LIB_DIR) |
|---|
| 154 | eval "eval INCLUDE_DIR=$includedir" |
|---|
| 155 | AC_SUBST(INCLUDE_DIR) |
|---|
| 156 | eval "eval OLDINCLUDE_DIR=$oldincludedir" |
|---|
| 157 | AC_SUBST(OLDINCLUDE_DIR) |
|---|
| 158 | eval "eval INFO_DIR=$infodir" |
|---|
| 159 | AC_SUBST(INFO_DIR) |
|---|
| 160 | eval "eval MAN_DIR=$mandir" |
|---|
| 161 | AC_SUBST(MAN_DIR) |
|---|
| 162 | |
|---|
| 163 | # Get full paths to source and build directories |
|---|
| 164 | srcdirfull="`cd $srcdir && pwd`" |
|---|
| 165 | builddir="`pwd`" |
|---|
| 166 | |
|---|
| 167 | # |
|---|
| 168 | # Compute variables useful for running uninstalled software. |
|---|
| 169 | # |
|---|
| 170 | WIZARD_CODER_MODULE_PATH="${builddir}/coders" |
|---|
| 171 | WIZARD_CONFIGURE_SRC_PATH="${srcdirfull}/config" |
|---|
| 172 | WIZARD_CONFIGURE_BUILD_PATH="${builddir}/config" |
|---|
| 173 | WIZARD_FILTER_MODULE_PATH="${builddir}/filters" |
|---|
| 174 | DIRSEP=':' |
|---|
| 175 | case "${build_os}" in |
|---|
| 176 | mingw* ) |
|---|
| 177 | WIZARD_CODER_MODULE_PATH=`$WinPathScript "${WIZARD_CODER_MODULE_PATH}" 0` |
|---|
| 178 | WIZARD_CONFIGURE_SRC_PATH=`$WinPathScript "${WIZARD_CONFIGURE_SRC_PATH}" 0` |
|---|
| 179 | WIZARD_CONFIGURE_BUILD_PATH=`$WinPathScript "${WIZARD_CONFIGURE_BUILD_PATH}" 0` |
|---|
| 180 | WIZARD_FILTER_MODULE_PATH=`$WinPathScript "${WIZARD_FILTER_MODULE_PATH}" 0` |
|---|
| 181 | DIRSEP=';' |
|---|
| 182 | ;; |
|---|
| 183 | esac |
|---|
| 184 | case "${host_os}" in |
|---|
| 185 | mingw* ) |
|---|
| 186 | DIRSEP=';' |
|---|
| 187 | ;; |
|---|
| 188 | esac |
|---|
| 189 | AC_SUBST(WIZARD_CODER_MODULE_PATH) |
|---|
| 190 | AC_SUBST(WIZARD_CONFIGURE_SRC_PATH) |
|---|
| 191 | AC_SUBST(WIZARD_CONFIGURE_BUILD_PATH) |
|---|
| 192 | AC_SUBST(WIZARD_FILTER_MODULE_PATH) |
|---|
| 193 | AC_SUBST(DIRSEP) |
|---|
| 194 | |
|---|
| 195 | # Check for programs |
|---|
| 196 | AC_PROG_CC |
|---|
| 197 | AC_PROG_CPP |
|---|
| 198 | AC_PROG_LD |
|---|
| 199 | AC_SUBST(LD) |
|---|
| 200 | AM_PROG_CC_C_O |
|---|
| 201 | AC_PROG_INSTALL |
|---|
| 202 | AC_PROG_MAKE_SET |
|---|
| 203 | AC_PROG_RANLIB |
|---|
| 204 | AC_COMPILE_WARNINGS |
|---|
| 205 | AC_PROG_LN_S |
|---|
| 206 | AM_WITH_DMALLOC |
|---|
| 207 | PKG_PROG_PKG_CONFIG |
|---|
| 208 | |
|---|
| 209 | # |
|---|
| 210 | # Enable OS features. |
|---|
| 211 | # |
|---|
| 212 | AC_GNU_SOURCE |
|---|
| 213 | |
|---|
| 214 | # |
|---|
| 215 | # Tests for Windows |
|---|
| 216 | # |
|---|
| 217 | AC_EXEEXT |
|---|
| 218 | AC_OBJEXT |
|---|
| 219 | |
|---|
| 220 | GDI32_LIBS='' |
|---|
| 221 | StaticCplusPlusLibraries='no' |
|---|
| 222 | native_win32_build='no' |
|---|
| 223 | cygwin_build='no' |
|---|
| 224 | case "${host_os}" in |
|---|
| 225 | cygwin* ) |
|---|
| 226 | StaticCplusPlusLibraries='yes' |
|---|
| 227 | cygwin_build='yes' |
|---|
| 228 | GDI32_LIBS='-lgdi32' |
|---|
| 229 | ;; |
|---|
| 230 | mingw* ) |
|---|
| 231 | StaticCplusPlusLibraries='yes' |
|---|
| 232 | native_win32_build='yes' |
|---|
| 233 | GDI32_LIBS='-lgdi32' |
|---|
| 234 | ;; |
|---|
| 235 | esac |
|---|
| 236 | if test "${GDI32_LIBS}x" != 'x'; then |
|---|
| 237 | AC_DEFINE(HasWINGDI32,1,Define to use the Windows GDI32 library) |
|---|
| 238 | fi |
|---|
| 239 | AC_SUBST(GDI32_LIBS) |
|---|
| 240 | AM_CONDITIONAL(HasWINGDI32, test "${GDI32_LIBS}x" != 'x' ) |
|---|
| 241 | AM_CONDITIONAL(WIN32_NATIVE_BUILD, test "${native_win32_build}" = 'yes' ) |
|---|
| 242 | AM_CONDITIONAL(CYGWIN_BUILD, test "${cygwin_build}" = 'yes' ) |
|---|
| 243 | AM_CONDITIONAL(USING_CL, test "x${CC}" = 'xcl.exe' ) |
|---|
| 244 | |
|---|
| 245 | WinPathScript="${srcdirfull}/winpath.sh" |
|---|
| 246 | AC_SUBST(WinPathScript) |
|---|
| 247 | |
|---|
| 248 | # |
|---|
| 249 | # Compiler flags tweaks |
|---|
| 250 | # |
|---|
| 251 | if test "${GCC}" != "yes"; then |
|---|
| 252 | case "${host}" in |
|---|
| 253 | *-*-hpux* ) |
|---|
| 254 | # aCC: HP ANSI C++ B3910B A.03.34 |
|---|
| 255 | CFLAGS="${CFLAGS} -Wp,-H30000" |
|---|
| 256 | if test -n "${CXXFLAGS}"; then |
|---|
| 257 | CXXFLAGS='-AA' |
|---|
| 258 | else |
|---|
| 259 | CXXFLAGS="${CXXFLAGS} -AA" |
|---|
| 260 | fi |
|---|
| 261 | ;; |
|---|
| 262 | *-dec-osf5.* ) |
|---|
| 263 | # Compaq alphaev68-dec-osf5.1 compiler |
|---|
| 264 | if test -n "${CXXFLAGS}"; then |
|---|
| 265 | CXXFLAGS='-std strict_ansi -noimplicit_include' |
|---|
| 266 | else |
|---|
| 267 | CXXFLAGS="${CXXFLAGS} -std strict_ansi -noimplicit_include" |
|---|
| 268 | fi |
|---|
| 269 | esac |
|---|
| 270 | fi |
|---|
| 271 | |
|---|
| 272 | # Check for lazy-loading. |
|---|
| 273 | AC_CACHE_CHECK([for linker lazyload option],[wt_cv_ld_lazyload], |
|---|
| 274 | [ |
|---|
| 275 | wt_cv_ld_lazyload='none' |
|---|
| 276 | case "${host}" in |
|---|
| 277 | *-*-solaris2.8 | *-*-solaris2.9 | *-*-solaris2.1? ) |
|---|
| 278 | if test "$lt_cv_prog_gnu_ld" != 'yes' ; then |
|---|
| 279 | wt_cv_ld_lazyload='-Wl,-zlazyload' |
|---|
| 280 | fi |
|---|
| 281 | ;; |
|---|
| 282 | esac |
|---|
| 283 | ]) |
|---|
| 284 | if test "${wt_cv_ld_lazyload}" != 'none' ; then |
|---|
| 285 | if test -z "${LDFLAGS}" ; then |
|---|
| 286 | LDFLAGS="${wt_cv_ld_lazyload}" |
|---|
| 287 | else |
|---|
| 288 | LDFLAGS="${wt_cv_ld_lazyload} ${LDFLAGS}" |
|---|
| 289 | fi |
|---|
| 290 | fi |
|---|
| 291 | |
|---|
| 292 | dnl Platform-specific stuff |
|---|
| 293 | case "$host" in |
|---|
| 294 | *-darwin* | *-macos10*) |
|---|
| 295 | if test -d /opt/local ; then |
|---|
| 296 | CPPFLAGS="$CPPFLAGS -I/opt/local/include" |
|---|
| 297 | LDFLAGS="$LDFLAGS -L/opt/local/lib" |
|---|
| 298 | elif test -d /sw ; then |
|---|
| 299 | CPPFLAGS="$CPPFLAGS -I/sw/include" |
|---|
| 300 | LDFLAGS="$LDFLAGS -L/sw/lib" |
|---|
| 301 | fi |
|---|
| 302 | dnl OS X universal binary support, requires --disable-dependency-tracking |
|---|
| 303 | AC_ARG_ENABLE(osx-universal-binary, |
|---|
| 304 | AC_HELP_STRING([--enable-osx-universal-binary], |
|---|
| 305 | [build universal binary on OS X [[default=no]]]), |
|---|
| 306 | [build_osxuniversal="${enableval}"], [build_osxuniversal=no]) |
|---|
| 307 | |
|---|
| 308 | if test "${build_osxuniversal}" != no ; then |
|---|
| 309 | if test "$enable_dependency_tracking" != no ; then |
|---|
| 310 | AC_MSG_ERROR([--enable-osx-universal-binary requires --disable-dependency-tracking. |
|---|
| 311 | Please re-run configure with these options: |
|---|
| 312 | --disable-dependency-tracking --enable-osx-universal-binary |
|---|
| 313 | ]) |
|---|
| 314 | fi |
|---|
| 315 | CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386" |
|---|
| 316 | CXXFLAGS="$CXXFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386" |
|---|
| 317 | LDFLAGS="$LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386" |
|---|
| 318 | fi |
|---|
| 319 | ;; |
|---|
| 320 | esac |
|---|
| 321 | |
|---|
| 322 | # Enable support for threads |
|---|
| 323 | AC_ARG_WITH([threads], |
|---|
| 324 | [AC_HELP_STRING([--without-threads], |
|---|
| 325 | [disable threads support])], |
|---|
| 326 | [with_threads=$withval], |
|---|
| 327 | [with_threads='yes']) |
|---|
| 328 | |
|---|
| 329 | have_threads=no |
|---|
| 330 | if test "$with_threads" != 'no'; then |
|---|
| 331 | ACX_PTHREAD() |
|---|
| 332 | if test "$acx_pthread_ok" = yes; then |
|---|
| 333 | have_threads=yes |
|---|
| 334 | DEF_THREAD="$PTHREAD_CFLAGS" |
|---|
| 335 | CFLAGS="$CFLAGS $DEF_THREAD" |
|---|
| 336 | CXXFLAGS="$CXXFLAGS $DEF_THREAD" |
|---|
| 337 | if test "$CC" != "$PTHREAD_CC"; then |
|---|
| 338 | AC_MSG_WARN([Replacing compiler $CC with compiler $PTHREAD_CC to support pthreads.]) |
|---|
| 339 | CC="$PTHREAD_CC" |
|---|
| 340 | fi |
|---|
| 341 | fi |
|---|
| 342 | fi |
|---|
| 343 | |
|---|
| 344 | # Enable support for OpenMP |
|---|
| 345 | if test "$have_threads" != 'yes'; then |
|---|
| 346 | ac_cv_prog_c_openmp=unsupported |
|---|
| 347 | fi |
|---|
| 348 | AC_OPENMP([C]) |
|---|
| 349 | CFLAGS="$OPENMP_CFLAGS $CFLAGS" |
|---|
| 350 | WIZARD_PCFLAGS="$WIZARD_PCFLAGS $OPENMP_CFLAGS" |
|---|
| 351 | AC_SUBST(OPENMP_CFLAGS) |
|---|
| 352 | |
|---|
| 353 | ######## |
|---|
| 354 | # |
|---|
| 355 | # Check for large file support |
|---|
| 356 | # |
|---|
| 357 | ######## |
|---|
| 358 | AC_SYS_LARGEFILE |
|---|
| 359 | AC_FUNC_FSEEKO |
|---|
| 360 | LFS_CPPFLAGS='' |
|---|
| 361 | if test "$enable_largefile" != no; then |
|---|
| 362 | if test "$ac_cv_sys_file_offset_bits" != 'no'; then |
|---|
| 363 | LFS_CPPFLAGS="$LFS_CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits" |
|---|
| 364 | else |
|---|
| 365 | AC_MSG_CHECKING([for native large file support]) |
|---|
| 366 | AC_RUN_IFELSE([#include <unistd.h> |
|---|
| 367 | main () { |
|---|
| 368 | exit(!(sizeof(off_t) == 8)); |
|---|
| 369 | }], |
|---|
| 370 | [ac_cv_sys_file_offset_bits=64; AC_DEFINE(_FILE_OFFSET_BITS,64) |
|---|
| 371 | AC_MSG_RESULT([yes])], |
|---|
| 372 | [AC_MSG_RESULT([no])]) |
|---|
| 373 | fi |
|---|
| 374 | if test "$ac_cv_sys_large_files" != 'no'; then |
|---|
| 375 | LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGE_FILES=1" |
|---|
| 376 | fi |
|---|
| 377 | if test "$ac_cv_sys_largefile_source" != 'no'; then |
|---|
| 378 | LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGEFILE_SOURCE=1" |
|---|
| 379 | fi |
|---|
| 380 | fi |
|---|
| 381 | AC_SUBST(LFS_CPPFLAGS) |
|---|
| 382 | |
|---|
| 383 | # Configure libtool |
|---|
| 384 | AC_LIBTOOL_DLOPEN |
|---|
| 385 | LT_INIT([disable-shared win32-dll]) |
|---|
| 386 | LT_LANG([C++]) |
|---|
| 387 | AC_SUBST(LIBTOOL_DEPS) |
|---|
| 388 | |
|---|
| 389 | # Check to see if building shared libraries |
|---|
| 390 | libtool_build_shared_libs='no' |
|---|
| 391 | if test "$enable_shared" = 'yes'; then |
|---|
| 392 | libtool_build_shared_libs='yes' |
|---|
| 393 | fi |
|---|
| 394 | |
|---|
| 395 | # Check to see if building static libraries |
|---|
| 396 | libtool_build_static_libs='no' |
|---|
| 397 | if test "$enable_static" = 'yes'; then |
|---|
| 398 | libtool_build_static_libs='yes' |
|---|
| 399 | fi |
|---|
| 400 | |
|---|
| 401 | # MinGW and Cygwin can't build C++ DLLs which support exceptions. |
|---|
| 402 | if test "${StaticCplusPlusLibraries}" = 'yes'; then |
|---|
| 403 | LTCXXLIBOPTS='--static' |
|---|
| 404 | AC_SUBST(LTCXXLIBOPTS) |
|---|
| 405 | fi |
|---|
| 406 | |
|---|
| 407 | # Enable build using delegate libraries built in subdirectories rather than installed |
|---|
| 408 | # delegate libraries (bzlib fpx jasper jbig jpeg lcms png tiff ttf wmf xml zlib) |
|---|
| 409 | AC_ARG_ENABLE([delegate-build], |
|---|
| 410 | [AC_HELP_STRING([--enable-delegate-build], |
|---|
| 411 | [look for delegate libraries in build directory])], |
|---|
| 412 | [enable_delegate_build=$enableval], |
|---|
| 413 | [enable_delegate_build='yes']) |
|---|
| 414 | |
|---|
| 415 | # Build a version of Wizard which operates uninstalled. |
|---|
| 416 | # Used to build distributions located via WIZARD_HOME / executable path |
|---|
| 417 | AC_ARG_ENABLE([installed], |
|---|
| 418 | [AC_HELP_STRING([--disable-installed], [Formally install Wizard's Toolkit under PREFIX])], |
|---|
| 419 | [enable_installed=$enableval], |
|---|
| 420 | [enable_installed='yes']) |
|---|
| 421 | |
|---|
| 422 | if test "$enable_installed" = 'yes'; then |
|---|
| 423 | AC_DEFINE(INSTALLED_SUPPORT,1,[Wizard's Toolkit is formally installed under prefix]) |
|---|
| 424 | else |
|---|
| 425 | DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-installed " |
|---|
| 426 | fi |
|---|
| 427 | |
|---|
| 428 | # Build an embeddable version of Wizard's Toolkit. |
|---|
| 429 | AC_ARG_ENABLE([embeddable], |
|---|
| 430 | [AC_HELP_STRING([--enable-embeddable], |
|---|
| 431 | [enable self-contained, embeddable, zero-configuration Wizard's Toolkit])], |
|---|
| 432 | [enable_embeddable=$enableval], |
|---|
| 433 | [enable_embeddable='no']) |
|---|
| 434 | |
|---|
| 435 | if test "$with_embeddable" = 'yes'; then |
|---|
| 436 | AC_DEFINE(EMBEDDABLE_SUPPORT,1,[Build self-contained, embeddable, zero-configuration Wizard's Toolkit (experimental)]) |
|---|
| 437 | fi |
|---|
| 438 | |
|---|
| 439 | # Build a version of Wizard with assert statements. |
|---|
| 440 | AC_ARG_ENABLE([assert], |
|---|
| 441 | [AC_HELP_STRING([--disable-assert], |
|---|
| 442 | [disable assert() statements in build])], |
|---|
| 443 | [enable_assert=$enableval], |
|---|
| 444 | [enable_assert='yes']) |
|---|
| 445 | |
|---|
| 446 | if test "$enable_assert" = 'no'; then |
|---|
| 447 | AC_DEFINE(NDEBUG,1,[Turn off assert statements]) |
|---|
| 448 | fi |
|---|
| 449 | |
|---|
| 450 | # Add configure option --enable-maintainer-mode which enables dependency |
|---|
| 451 | # checking and generation useful to package maintainers. This is made an |
|---|
| 452 | # option to avoid confusing end users. |
|---|
| 453 | AM_MAINTAINER_MODE |
|---|
| 454 | |
|---|
| 455 | # Enable Wizard Debugging |
|---|
| 456 | AC_ARG_ENABLE([debug], |
|---|
| 457 | [AC_HELP_STRING([--disable-debug], |
|---|
| 458 | [disable Wizard Executable Environment debugging])], |
|---|
| 459 | [enable_debug=$enableval], |
|---|
| 460 | [enable_debug='yes']) |
|---|
| 461 | |
|---|
| 462 | if test "$enable_debug" = 'yes'; then |
|---|
| 463 | AC_DEFINE(Debug,1,[Enable Wizard Executable Environment debugging]) |
|---|
| 464 | fi |
|---|
| 465 | |
|---|
| 466 | # Enable ccmalloc memory debugging support |
|---|
| 467 | AC_ARG_ENABLE([ccmalloc], |
|---|
| 468 | [AC_HELP_STRING([--enable-ccmalloc], |
|---|
| 469 | [enable 'ccmalloc' memory debug support])], |
|---|
| 470 | [enable_ccmalloc=$enableval], |
|---|
| 471 | [enable_ccmalloc='no']) |
|---|
| 472 | |
|---|
| 473 | # Enable Electric Fence memory debugging support |
|---|
| 474 | AC_ARG_ENABLE([efence], |
|---|
| 475 | [AC_HELP_STRING([--enable-efence], |
|---|
| 476 | [enable 'efence' memory debug support])], |
|---|
| 477 | [enable_efence=$enableval], |
|---|
| 478 | [enable_efence='no']) |
|---|
| 479 | |
|---|
| 480 | # Enable prof-based profiling support |
|---|
| 481 | AC_ARG_ENABLE([prof], |
|---|
| 482 | [AC_HELP_STRING([--enable-prof], |
|---|
| 483 | [enable 'prof' profiling support])], |
|---|
| 484 | [enable_prof=$enableval], |
|---|
| 485 | [enable_prof='no']) |
|---|
| 486 | |
|---|
| 487 | # Enable gprof-based profiling support |
|---|
| 488 | AC_ARG_ENABLE([gprof], |
|---|
| 489 | [AC_HELP_STRING([--enable-gprof], |
|---|
| 490 | [enable 'gprof' profiling support])], |
|---|
| 491 | [enable_gprof=$enableval], |
|---|
| 492 | [enable_gprof='no']) |
|---|
| 493 | |
|---|
| 494 | # Enable gcov-based profiling support |
|---|
| 495 | AC_ARG_ENABLE([gcov], |
|---|
| 496 | [AC_HELP_STRING([--enable-gcov], |
|---|
| 497 | [enable 'gcov' profiling support])], |
|---|
| 498 | [enable_gcov=$enableval], |
|---|
| 499 | [enable_gcov='no']) |
|---|
| 500 | |
|---|
| 501 | with_profiling='no' |
|---|
| 502 | if test "$enable_prof" = 'yes' || test "$enable_gprof" = 'yes' || test "$enable_gcov" = 'yes'; then |
|---|
| 503 | with_profiling='yes' |
|---|
| 504 | |
|---|
| 505 | if test "$libtool_build_shared_libs" = 'yes'; then |
|---|
| 506 | echo "Warning: Can not profile code using shared libraries" |
|---|
| 507 | fi |
|---|
| 508 | fi |
|---|
| 509 | |
|---|
| 510 | # Wizard API method prefix |
|---|
| 511 | AC_ARG_WITH([method-prefix], |
|---|
| 512 | [AC_HELP_STRING([--with-method-prefix=PREFIX], |
|---|
| 513 | [prefix Wizard's Toolkit API methods])], |
|---|
| 514 | [with_method_prefix=$enableval], |
|---|
| 515 | [with_method_prefix='']) |
|---|
| 516 | |
|---|
| 517 | if test "$with_method_prefix" != ''; then |
|---|
| 518 | AC_DEFINE_UNQUOTED(WizardMethodPrefix,$with_method_prefix,[Wizard API method prefix]) |
|---|
| 519 | fi |
|---|
| 520 | |
|---|
| 521 | # Disable BZLIB (bzip2 library) |
|---|
| 522 | AC_ARG_WITH([bzlib], |
|---|
| 523 | [AC_HELP_STRING([--without-bzlib], [disable BZLIB support])], |
|---|
| 524 | [with_bzlib=$withval], |
|---|
| 525 | [with_bzlib='yes']) |
|---|
| 526 | |
|---|
| 527 | if test "$with_bzlib" != 'yes'; then |
|---|
| 528 | DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-bzlib=$with_bzlib " |
|---|
| 529 | fi |
|---|
| 530 | |
|---|
| 531 | # Enable umem, object-caching memory allocation library. |
|---|
| 532 | AC_ARG_WITH(umem, |
|---|
| 533 | [ --with-umem enable umem memory allocation library support], |
|---|
| 534 | [with_umem=$withval], |
|---|
| 535 | [with_umem='no']) |
|---|
| 536 | if test "$with_umem" != 'yes' ; then |
|---|
| 537 | DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-umem=$with_umem " |
|---|
| 538 | fi |
|---|
| 539 | |
|---|
| 540 | AC_ARG_WITH([zlib], |
|---|
| 541 | [AC_HELP_STRING([--without-zlib], |
|---|
| 542 | [disable ZLIB support])], |
|---|
| 543 | [with_zlib=$withval], |
|---|
| 544 | [with_zlib='yes']) |
|---|
| 545 | |
|---|
| 546 | if test "$with_zlib" != 'yes'; then |
|---|
| 547 | DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-zlib=$with_zlib " |
|---|
| 548 | fi |
|---|
| 549 | |
|---|
| 550 | # |
|---|
| 551 | # Specify path to shared libstdc++ if not in normal location |
|---|
| 552 | # |
|---|
| 553 | AC_ARG_WITH([libstdc], |
|---|
| 554 | [AC_HELP_STRING([--with-libstdc=DIR], |
|---|
| 555 | [ use libstdc++ in DIR (for GNU C++)])], |
|---|
| 556 | [with_libstdc=$withval], |
|---|
| 557 | [with_libstdc='']) |
|---|
| 558 | |
|---|
| 559 | if test "$with_libstdc" != ''; then |
|---|
| 560 | if test -d "$with_libstdc"; then |
|---|
| 561 | LIBSTDCLDFLAGS="-L$with_libstdc" |
|---|
| 562 | fi |
|---|
| 563 | fi |
|---|
| 564 | AC_SUBST(LIBSTDCLDFLAGS) |
|---|
| 565 | |
|---|
| 566 | # Does gcc required -traditional? |
|---|
| 567 | AC_PROG_GCC_TRADITIONAL |
|---|
| 568 | |
|---|
| 569 | ######## |
|---|
| 570 | # |
|---|
| 571 | # Set defines required to build DLLs and modules using MinGW |
|---|
| 572 | # |
|---|
| 573 | ######## |
|---|
| 574 | # These options are set for multi-thread DLL module build |
|---|
| 575 | # libWizard: _DLL _WIZARDMOD_ _WIZARDLIB_ |
|---|
| 576 | # module: _DLL |
|---|
| 577 | # executable/Wizard++: _DLL _WIZARDMOD_ |
|---|
| 578 | MODULE_EXTRA_CPPFLAGS='' |
|---|
| 579 | LIBRARY_EXTRA_CPPFLAGS='' |
|---|
| 580 | if test "${native_win32_build}" = 'yes'; then |
|---|
| 581 | if test "${libtool_build_shared_libs}" = 'yes'; then |
|---|
| 582 | CPPFLAGS="$CPPFLAGS -D_DLL" |
|---|
| 583 | WIZARD_CPPFLAGS="$WIZARD_CPPFLAGS -D_DLL" |
|---|
| 584 | WIZARD_PCFLAGS="$WIZARD_PCFLAGS -D_DLL" |
|---|
| 585 | LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_WIZARDLIB_" |
|---|
| 586 | |
|---|
| 587 | if test "$with_modules" = 'yes'; then |
|---|
| 588 | LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_WIZARDMOD_" |
|---|
| 589 | else |
|---|
| 590 | MODULE_EXTRA_CPPFLAGS="$MODULE_EXTRA_CPPFLAGS -D_WIZARDLIB_" |
|---|
| 591 | fi |
|---|
| 592 | |
|---|
| 593 | else |
|---|
| 594 | CPPFLAGS="$CPPFLAGS -D_LIB" |
|---|
| 595 | WIZARD_CPPFLAGS="$WIZARD_CPPFLAGS -D_LIB" |
|---|
| 596 | WIZARD_PCFLAGS="$WIZARD_PCFLAGS -D_LIB" |
|---|
| 597 | |
|---|
| 598 | fi |
|---|
| 599 | if test "$with_threads" = 'yes'; then |
|---|
| 600 | CPPFLAGS="$CPPFLAGS -D_MT" |
|---|
| 601 | WIZARD_CPPFLAGS="$WIZARD_CPPFLAGS -D_MT" |
|---|
| 602 | WIZARD_PCFLAGS="$WIZARD_PCFLAGS -D_MT" |
|---|
| 603 | fi |
|---|
| 604 | fi |
|---|
| 605 | AC_SUBST(MODULE_EXTRA_CPPFLAGS) |
|---|
| 606 | AC_SUBST(LIBRARY_EXTRA_CPPFLAGS) |
|---|
| 607 | |
|---|
| 608 | # Check standard headers |
|---|
| 609 | AC_HEADER_STDC |
|---|
| 610 | if ! test x"$ac_cv_header_stdc" = x"yes"; then |
|---|
| 611 | AC_MSG_WARN([configure has detected that you do not have the ANSI standard C |
|---|
| 612 | header files. Compilation cannot proceed. Please install the ANSI C |
|---|
| 613 | headers and rerun this script.]); |
|---|
| 614 | fi |
|---|
| 615 | AC_HEADER_DIRENT |
|---|
| 616 | |
|---|
| 617 | # Check additional headers |
|---|
| 618 | AC_CHECK_HEADERS(argz.h arm/limits.h fcntl.h limits.h linux/unistd.h locale.h mach-o/dyld.h machine/param.h malloc.h stdarg.h sys/syslimits.h sys/resource.h sys/time.h sys/timeb.h sys/times.h sys/types.h sys/utime.h termios.h unistd.h utime.h) |
|---|
| 619 | |
|---|
| 620 | ######## |
|---|
| 621 | # |
|---|
| 622 | # Checks for typedefs, structures, and compiler characteristics. |
|---|
| 623 | # |
|---|
| 624 | ######## |
|---|
| 625 | |
|---|
| 626 | AC_HEADER_STDBOOL |
|---|
| 627 | AC_C_VOLATILE |
|---|
| 628 | AC_C_STRINGIZE |
|---|
| 629 | AC_HEADER_STAT |
|---|
| 630 | AC_HEADER_TIME |
|---|
| 631 | AC_STRUCT_TM |
|---|
| 632 | AC_SYS_INTERPRETER |
|---|
| 633 | |
|---|
| 634 | # If the C compiler does not fully support the ANSI C qualifier const, |
|---|
| 635 | # define const to be empty. |
|---|
| 636 | AC_C_CONST |
|---|
| 637 | |
|---|
| 638 | # If the C compiler supports the keyword inline, do nothing. Otherwise |
|---|
| 639 | # define inline to __inline__ or __inline if it accepts one of those, |
|---|
| 640 | # otherwise define inline to be empty. |
|---|
| 641 | AC_C_INLINE |
|---|
| 642 | |
|---|
| 643 | # If the C compiler supports the keyword restrict, do nothing. Otherwise |
|---|
| 644 | # define restrict to __restrict__ or __restrict if it accepts one of those, |
|---|
| 645 | # otherwise define restrict to be empty. |
|---|
| 646 | AC_C_RESTRICT |
|---|
| 647 | |
|---|
| 648 | # If words are stored with the most significant byte first (like |
|---|
| 649 | # Motorola and SPARC CPUs), define `WORDS_BIGENDIAN'. |
|---|
| 650 | AC_C_BIGENDIAN |
|---|
| 651 | |
|---|
| 652 | # Define mode_t to a suitable type, if standard headers do not define it. |
|---|
| 653 | AC_TYPE_MODE_T |
|---|
| 654 | |
|---|
| 655 | # Define off_t to a suitable type, if standard headers do not define it. |
|---|
| 656 | AC_TYPE_OFF_T |
|---|
| 657 | |
|---|
| 658 | # Define pid_t to a suitable type, if standard headers do not define it. |
|---|
| 659 | AC_TYPE_PID_T |
|---|
| 660 | |
|---|
| 661 | # Define size_t to a suitable type, if standard headers do not define it. |
|---|
| 662 | AC_TYPE_SIZE_T |
|---|
| 663 | |
|---|
| 664 | # Define ssize_t to a suitable type, if standard headers do not define it. |
|---|
| 665 | AC_TYPE_SSIZE_T |
|---|
| 666 | |
|---|
| 667 | # If the C compiler supports a working long double type with more range |
|---|
| 668 | # or precision than the double type, define HAVE_LONG_DOUBLE. |
|---|
| 669 | AC_TYPE_LONG_DOUBLE_WIDER |
|---|
| 670 | |
|---|
| 671 | # If the C type char is unsigned, define __CHAR_UNSIGNED__, unless the |
|---|
| 672 | # C compiler predefines it. |
|---|
| 673 | AC_C_CHAR_UNSIGNED |
|---|
| 674 | |
|---|
| 675 | # Obtain size of an 'signed short' and define as SIZEOF_SIGNED_SHORT |
|---|
| 676 | AC_CHECK_SIZEOF(signed short) |
|---|
| 677 | |
|---|
| 678 | # Obtain size of an 'unsigned short' and define as SIZEOF_UNSIGNED_SHORT |
|---|
| 679 | AC_CHECK_SIZEOF(unsigned short) |
|---|
| 680 | |
|---|
| 681 | # Obtain size of an 'signed int' and define as SIZEOF_SIGNED_INT |
|---|
| 682 | AC_CHECK_SIZEOF(signed int) |
|---|
| 683 | |
|---|
| 684 | # Obtain size of an 'unsigned int' and define as SIZEOF_UNSIGNED_INT |
|---|
| 685 | AC_CHECK_SIZEOF(unsigned int) |
|---|
| 686 | |
|---|
| 687 | # Obtain size of a 'signed long' and define as SIZEOF_SIGNED_LONG |
|---|
| 688 | AC_CHECK_SIZEOF(signed long) |
|---|
| 689 | |
|---|
| 690 | # Obtain size of a 'unsigned long' and define as SIZEOF_UNSIGNED_LONG |
|---|
| 691 | AC_CHECK_SIZEOF(unsigned long) |
|---|
| 692 | |
|---|
| 693 | # Obtain size of a 'long long' and define as SIZEOF_SIGNED_LONG_LONG. If |
|---|
| 694 | # 'signed long long' is not supported then the value defined is zero. |
|---|
| 695 | AC_CHECK_SIZEOF(signed long long) |
|---|
| 696 | |
|---|
| 697 | # Obtain size of a 'unsigned long long' and define as |
|---|
| 698 | # SIZEOF_UNSIGNED_LONG_LONG. If 'unsigned long long' is not |
|---|
| 699 | # supported then the value defined is zero. |
|---|
| 700 | AC_CHECK_SIZEOF(unsigned long long) |
|---|
| 701 | |
|---|
| 702 | # Obtain size of off_t and define as SIZEOF_OFF_T |
|---|
| 703 | AC_CHECK_SIZEOF(off_t) |
|---|
| 704 | |
|---|
| 705 | # Obtain size of size_t and define as SIZEOF_SIZE_T |
|---|
| 706 | AC_CHECK_SIZEOF(size_t) |
|---|
| 707 | |
|---|
| 708 | # Obtain size of an unsigned int pointer and define as SIZEOF_UNSIGNED_INTP |
|---|
| 709 | AC_CHECK_SIZEOF(unsigned int*) |
|---|
| 710 | |
|---|
| 711 | # |
|---|
| 712 | # Compute sized types for current CPU and compiler options. |
|---|
| 713 | # |
|---|
| 714 | AC_MSG_CHECKING(for signed 8-bit type) |
|---|
| 715 | INT8_T='signed char' |
|---|
| 716 | AC_MSG_RESULT($INT8_T) |
|---|
| 717 | AC_SUBST(INT8_T) |
|---|
| 718 | |
|---|
| 719 | AC_MSG_CHECKING(for unsigned 8-bit type) |
|---|
| 720 | UINT8_T='unsigned char' |
|---|
| 721 | AC_MSG_RESULT($UINT8_T) |
|---|
| 722 | AC_SUBST(UINT8_T) |
|---|
| 723 | |
|---|
| 724 | AC_MSG_CHECKING(for signed 16-bit type) |
|---|
| 725 | INT16_T='signed short' |
|---|
| 726 | AC_MSG_RESULT($INT16_T) |
|---|
| 727 | AC_SUBST(INT16_T) |
|---|
| 728 | |
|---|
| 729 | AC_MSG_CHECKING(for unsigned 16-bit type) |
|---|
| 730 | UINT16_T='unsigned short' |
|---|
| 731 | AC_MSG_RESULT($UINT16_T) |
|---|
| 732 | AC_SUBST(UINT16_T) |
|---|
| 733 | |
|---|
| 734 | AC_MSG_CHECKING(for signed 32-bit type) |
|---|
| 735 | INT32_T='none' |
|---|
| 736 | if test $ac_cv_sizeof_signed_int -eq 4; then |
|---|
| 737 | INT32_T='signed int' |
|---|
| 738 | elif test $ac_cv_sizeof_signed_long -eq 4; then |
|---|
| 739 | INT32_T='signed long' |
|---|
| 740 | fi |
|---|
| 741 | AC_MSG_RESULT($INT32_T) |
|---|
| 742 | AC_SUBST(INT32_T) |
|---|
| 743 | |
|---|
| 744 | AC_MSG_CHECKING(for unsigned 32-bit type) |
|---|
| 745 | UINT32_T='none' |
|---|
| 746 | if test $ac_cv_sizeof_unsigned_int -eq 4; then |
|---|
| 747 | UINT32_T='unsigned int' |
|---|
| 748 | elif test $ac_cv_sizeof_unsigned_long -eq 4; then |
|---|
| 749 | UINT32_T='unsigned long' |
|---|
| 750 | fi |
|---|
| 751 | AC_MSG_RESULT($UINT32_T) |
|---|
| 752 | AC_SUBST(UINT32_T) |
|---|
| 753 | |
|---|
| 754 | AC_MSG_CHECKING(for signed 64-bit type) |
|---|
| 755 | INT64_T='none' |
|---|
| 756 | if test $ac_cv_sizeof_signed_long -eq 8; then |
|---|
| 757 | INT64_T='signed long' |
|---|
| 758 | elif test $ac_cv_sizeof_signed_long_long -eq 8; then |
|---|
| 759 | INT64_T='signed long long' |
|---|
| 760 | fi |
|---|
| 761 | AC_MSG_RESULT($INT64_T) |
|---|
| 762 | AC_SUBST(INT64_T) |
|---|
| 763 | |
|---|
| 764 | AC_MSG_CHECKING(for unsigned 64-bit type) |
|---|
| 765 | UINT64_T='none' |
|---|
| 766 | if test $ac_cv_sizeof_unsigned_long -eq 8; then |
|---|
| 767 | UINT64_T='unsigned long' |
|---|
| 768 | elif test $ac_cv_sizeof_unsigned_long_long -eq 8; then |
|---|
| 769 | UINT64_T='unsigned long long' |
|---|
| 770 | fi |
|---|
| 771 | AC_MSG_RESULT($UINT64_T) |
|---|
| 772 | AC_SUBST(UINT64_T) |
|---|
| 773 | |
|---|
| 774 | AC_MSG_CHECKING(for unsigned maximum type) |
|---|
| 775 | UINTMAX_T='none' |
|---|
| 776 | if test "$UINT64_T" != 'none'; then |
|---|
| 777 | UINTMAX_T=$UINT64_T |
|---|
| 778 | elif test "$UINT32_T" != 'none'; then |
|---|
| 779 | UINTMAX_T=$UINT32_T |
|---|
| 780 | fi |
|---|
| 781 | AC_MSG_RESULT($UINTMAX_T) |
|---|
| 782 | AC_SUBST(UINTMAX_T) |
|---|
| 783 | |
|---|
| 784 | AC_MSG_CHECKING(for pointer difference type) |
|---|
| 785 | UINTPTR_T='none' |
|---|
| 786 | if test $ac_cv_sizeof_unsigned_long -eq $ac_cv_sizeof_unsigned_intp; then |
|---|
| 787 | UINTPTR_T='unsigned long' |
|---|
| 788 | elif test $ac_cv_sizeof_unsigned_long_long -eq $ac_cv_sizeof_unsigned_intp; then |
|---|
| 789 | UINTPTR_T='unsigned long long' |
|---|
| 790 | fi |
|---|
| 791 | AC_MSG_RESULT($UINTPTR_T) |
|---|
| 792 | AC_SUBST(UINTPTR_T) |
|---|
| 793 | |
|---|
| 794 | # Test for C compiler __func__ support |
|---|
| 795 | AC_MSG_CHECKING([whether our compiler supports __func__]) |
|---|
| 796 | AC_TRY_COMPILE([], |
|---|
| 797 | [{ const char *func = __func__; return(func != 0 ? 0 : 1); }], |
|---|
| 798 | AC_MSG_RESULT([yes]), |
|---|
| 799 | AC_MSG_RESULT([no]) |
|---|
| 800 | AC_MSG_CHECKING([whether our compiler supports __FUNCTION__]) |
|---|
| 801 | AC_TRY_COMPILE([], |
|---|
| 802 | [{ const char *func = __FUNCTION__; return(func != 0 ? 0 : 1); }], |
|---|
| 803 | AC_MSG_RESULT([yes]) |
|---|
| 804 | AC_DEFINE(__func__, __FUNCTION__, |
|---|
| 805 | [Define to appropriate substitue if compiler does not have __func__]), |
|---|
| 806 | AC_MSG_RESULT([no]) |
|---|
| 807 | AC_DEFINE(__func__, __FILE__, |
|---|
| 808 | [Define to appropriate substitue if compiler does not have __func__]))) |
|---|
| 809 | |
|---|
| 810 | ######## |
|---|
| 811 | # |
|---|
| 812 | # Check for functions |
|---|
| 813 | # |
|---|
| 814 | ######## |
|---|
| 815 | WIZARD_FUNC_MMAP_FILEIO |
|---|
| 816 | AC_FUNC_VPRINTF |
|---|
| 817 | AC_FUNC_STRTOD |
|---|
| 818 | AC_FUNC_MMAP |
|---|
| 819 | AC_FUNC_MEMCMP |
|---|
| 820 | AC_FUNC_MKTIME |
|---|
| 821 | AC_FUNC_CLOSEDIR_VOID |
|---|
| 822 | AC_FUNC_STAT |
|---|
| 823 | AC_CHECK_FUNCS([atexit clock ftime getcwd getexecname getdtablesize getpid getpagesize getrusage gettimeofday gmtime_r isascii localtime_r lstat madvise memmove memset mkdir munmap mkstemp _NSGetExecutablePath pclose poll popen posix_fallocate posix_memalign pow pread pwrite raise readdir_r readlink realpath sbrk select strerror_r setvbuf sysconf sigemptyset sigaction strlcat strlcpy strcasecmp strncasecmp setlocale strchr strcspn strdup strrchr strspn strstr strtol times usleep utime vsprintf vsnprintf _wfopen]) |
|---|
| 824 | |
|---|
| 825 | # |
|---|
| 826 | # Check for clock_gettime(). |
|---|
| 827 | # |
|---|
| 828 | AC_SEARCH_LIBS(clock_gettime, rt, |
|---|
| 829 | [ |
|---|
| 830 | AC_DEFINE([HAVE_CLOCK_GETTIME],[1],[Define to 1 if you have clock_gettime.]) |
|---|
| 831 | AC_MSG_CHECKING([whether clock_gettime supports CLOCK_REALTIME]) |
|---|
| 832 | AC_COMPILE_IFELSE( |
|---|
| 833 | AC_LANG_PROGRAM( |
|---|
| 834 | [[#include <time.h>]], |
|---|
| 835 | [[clockid_t clockType = CLOCK_REALTIME;]]), |
|---|
| 836 | [ |
|---|
| 837 | AC_MSG_RESULT(yes) |
|---|
| 838 | AC_DEFINE([HAVE_CLOCK_REALTIME],[1], |
|---|
| 839 | [Define to 1 if clock_gettime supports CLOCK_REALTIME.]) |
|---|
| 840 | ], |
|---|
| 841 | AC_MSG_RESULT(no) |
|---|
| 842 | ) |
|---|
| 843 | ], |
|---|
| 844 | [ |
|---|
| 845 | AC_CHECK_FUNCS([gettimeofday ftime], [break]) |
|---|
| 846 | ] |
|---|
| 847 | ) |
|---|
| 848 | ######## |
|---|
| 849 | # |
|---|
| 850 | # Check for function prototypes |
|---|
| 851 | # |
|---|
| 852 | ######## |
|---|
| 853 | |
|---|
| 854 | AC_CHECK_DECLS([pread, pwrite],[],[],[ |
|---|
| 855 | #include <unistd.h>]) |
|---|
| 856 | |
|---|
| 857 | AC_CHECK_DECLS([strlcpy],[],[],[ |
|---|
| 858 | #include <strings.h>]) |
|---|
| 859 | |
|---|
| 860 | AC_CHECK_DECLS([vsnprintf],[],[],[ |
|---|
| 861 | #include <stdio.h> |
|---|
| 862 | #include <stdarg.h>]) |
|---|
| 863 | |
|---|
| 864 | ######## |
|---|
| 865 | # |
|---|
| 866 | # C++ Support Tests (For Wizard++) |
|---|
| 867 | # |
|---|
| 868 | ######## |
|---|
| 869 | have_wizard_plus_plus='no' |
|---|
| 870 | if test "$with_wizard_plus_plus" = 'yes'; then |
|---|
| 871 | OLIBS="$LIBS" |
|---|
| 872 | LIBS='' |
|---|
| 873 | AC_LANG_PUSH(C++) |
|---|
| 874 | |
|---|
| 875 | # Full set of headers used ... |
|---|
| 876 | # algorithm cctype cerrno cmath cstdio cstdlib cstring ctime exception |
|---|
| 877 | # functional iomanip iosfwd iostream iterator list string strstream utility |
|---|
| 878 | AC_LANG([C++]) |
|---|
| 879 | AC_PROG_CXX |
|---|
| 880 | AC_CXX_HAVE_BOOL |
|---|
| 881 | AC_CXX_HAVE_NAMESPACES |
|---|
| 882 | AC_CXX_HAVE_STD_NAMESPACE |
|---|
| 883 | AC_CXX_HAVE_STD_LIBS |
|---|
| 884 | AC_CXX_HAVE_LSTRING |
|---|
| 885 | AC_LANG_POP |
|---|
| 886 | |
|---|
| 887 | AC_MSG_CHECKING([whether C++ compiler is sufficient for the Wizard's Toolkit]) |
|---|
| 888 | if \ |
|---|
| 889 | test $ac_cv_cxx_have_bool = 'yes' && \ |
|---|
| 890 | test $ac_cv_cxx_have_lstring = 'yes' && \ |
|---|
| 891 | test $ac_cv_cxx_have_namespaces = 'yes' && \ |
|---|
| 892 | test $ac_cv_cxx_have_std_libs = 'yes' && \ |
|---|
| 893 | test $ac_cv_cxx_have_std_namespace = 'yes'; then |
|---|
| 894 | have_wizard_plus_plus='yes' |
|---|
| 895 | else |
|---|
| 896 | have_wizard_plus_plus='no (failed tests)' |
|---|
| 897 | fi |
|---|
| 898 | AC_MSG_RESULT([$have_wizard_plus_plus]) |
|---|
| 899 | LIBS="$OLIBS" |
|---|
| 900 | fi |
|---|
| 901 | AM_CONDITIONAL(WITH_WIZARD_PLUS_PLUS, test "$have_wizard_plus_plus" = 'yes') |
|---|
| 902 | |
|---|
| 903 | # Only check for delegate libraries in subdirectories if requested. |
|---|
| 904 | if test "$with_delegate_build" != 'no'; then |
|---|
| 905 | # Check for delegate sub-directories and add -I & -L options as required. |
|---|
| 906 | # This presumes that delegates are installed as detailed in the ImageMagick |
|---|
| 907 | # README. If delegates are installed in a standard location where the |
|---|
| 908 | # compiler will automatically find them then these options should not be |
|---|
| 909 | # required. |
|---|
| 910 | |
|---|
| 911 | # |
|---|
| 912 | # Most delegates have includes in the same directory as the library, but not all ... |
|---|
| 913 | # |
|---|
| 914 | # Includes |
|---|
| 915 | for dir in bzlib zlib |
|---|
| 916 | do |
|---|
| 917 | if test -d "$builddir/$dir"; then |
|---|
| 918 | CPPFLAGS="$CPPFLAGS -I$builddir/$dir" |
|---|
| 919 | else |
|---|
| 920 | if test -d "$srcdirfull/$dir"; then |
|---|
| 921 | CPPFLAGS="$CPPFLAGS -I$srcdirfull/$dir" |
|---|
| 922 | fi |
|---|
| 923 | fi |
|---|
| 924 | done |
|---|
| 925 | |
|---|
| 926 | # Libraries |
|---|
| 927 | for dir in bzlib zlib |
|---|
| 928 | do |
|---|
| 929 | if test -d "$builddir/$dir/.libs"; then |
|---|
| 930 | LDFLAGS="$LDFLAGS -L$builddir/$dir/.libs" |
|---|
| 931 | else |
|---|
| 932 | if test -d "$srcdirfull/$dir/.libs"; then |
|---|
| 933 | LDFLAGS="$LDFLAGS -L$srcdirfull/$dir/.libs" |
|---|
| 934 | fi |
|---|
| 935 | fi |
|---|
| 936 | if test -d "$builddir/$dir"; then |
|---|
| 937 | LDFLAGS="$LDFLAGS -L$builddir/$dir" |
|---|
| 938 | else |
|---|
| 939 | if test -d "$srcdirfull/$dir"; then |
|---|
| 940 | LDFLAGS="$LDFLAGS -L$srcdirfull/$dir" |
|---|
| 941 | fi |
|---|
| 942 | fi |
|---|
| 943 | done |
|---|
| 944 | fi |
|---|
| 945 | |
|---|
| 946 | # Assume that delegate headers reside under same directory as Wizard's |
|---|
| 947 | # Toolkit installation prefix. |
|---|
| 948 | WIZARD_CPPFLAGS="-I$INCLUDE_DIR/WizardsToolkit $WIZARD_CPPFLAGS" |
|---|
| 949 | |
|---|
| 950 | # |
|---|
| 951 | # Find OpenMP library |
|---|
| 952 | # |
|---|
| 953 | GOMP_LIBS='' |
|---|
| 954 | if test "$enable_openmp" != 'no'; then |
|---|
| 955 | if test "${GCC}" = "yes"; then |
|---|
| 956 | AC_CHECK_LIB(gomp,GOMP_parallel_start,GOMP_LIBS="-lgomp",,) # gcc |
|---|
| 957 | else |
|---|
| 958 | AC_CHECK_LIB(mtsk,sunw_mp_register_warn,GOMP_LIBS="-lmtsk",,) # solaris cc |
|---|
| 959 | AC_CHECK_LIB(xlsmp,_xlsmpFlush,GOMP_LIBS="-lxlsmp",,) # AIX xlc |
|---|
| 960 | AC_CHECK_LIB(mp,mp_destroy,GOMP_LIBS="-lmp",,) # SGI IRIX 6.5 MIPSpro C/C++ |
|---|
| 961 | fi |
|---|
| 962 | LIBS="$GOMP_LIBS $LIBS" |
|---|
| 963 | fi |
|---|
| 964 | AC_SUBST(GOMP_LIBS) |
|---|
| 965 | |
|---|
| 966 | # |
|---|
| 967 | # Find Posix threads library |
|---|
| 968 | # |
|---|
| 969 | THREAD_LIBS='' |
|---|
| 970 | if test "$with_threads" != 'no' && test "$have_threads" = 'yes'; then |
|---|
| 971 | |
|---|
| 972 | if test "x$PTHREAD_LIBS" = "x"; then |
|---|
| 973 | case "${host_cpu}-${host_os}" in |
|---|
| 974 | *-freebsd*) |
|---|
| 975 | WIZARD_CHECK_PTHREAD_LIB(c_r,PTHREAD_LIBS=-lc_r) ;; |
|---|
| 976 | esac |
|---|
| 977 | fi |
|---|
| 978 | |
|---|
| 979 | for lib in pthread pthreads |
|---|
| 980 | do |
|---|
| 981 | if test "x$PTHREAD_LIBS" = "x"; then |
|---|
| 982 | WIZARD_CHECK_PTHREAD_LIB([$lib],[PTHREAD_LIBS=-l$lib]) |
|---|
| 983 | fi |
|---|
| 984 | done |
|---|
| 985 | |
|---|
| 986 | THREAD_LIBS="$PTHREAD_LIBS" |
|---|
| 987 | LIBS="$LIBS $THREAD_LIBS" |
|---|
| 988 | fi |
|---|
| 989 | AC_SUBST(THREAD_LIBS) |
|---|
| 990 | |
|---|
| 991 | # |
|---|
| 992 | # Check for umem. |
|---|
| 993 | # |
|---|
| 994 | have_umem='no' |
|---|
| 995 | UMEM_LIBS='' |
|---|
| 996 | if test "$with_umem" != 'no'; then |
|---|
| 997 | AC_MSG_CHECKING(for UMEM support ) |
|---|
| 998 | AC_MSG_RESULT() |
|---|
| 999 | failed=0 |
|---|
| 1000 | passed=0 |
|---|
| 1001 | AC_CHECK_HEADER(umem.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`) |
|---|
| 1002 | AC_CHECK_LIB(umem,umem_alloc,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) |
|---|
| 1003 | AC_CHECK_LIB(umem,umem_free,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) |
|---|
| 1004 | AC_MSG_CHECKING(if umem memory allocation library is complete) |
|---|
| 1005 | if test $passed -gt 0; then |
|---|
| 1006 | if test $failed -gt 0; then |
|---|
| 1007 | AC_MSG_RESULT(no -- some components failed test) |
|---|
| 1008 | have_umem='no (failed tests)' |
|---|
| 1009 | else |
|---|
| 1010 | UMEM_LIBS='-lumem' |
|---|
| 1011 | LIBS="$UMEM_LIBS $LIBS" |
|---|
| 1012 | AC_DEFINE(HasUMEM,1,Define if you have umem memory allocation library) |
|---|
| 1013 | AC_MSG_RESULT(yes) |
|---|
| 1014 | have_umem='yes' |
|---|
| 1015 | fi |
|---|
| 1016 | else |
|---|
| 1017 | AC_MSG_RESULT(no) |
|---|
| 1018 | fi |
|---|
| 1019 | fi |
|---|
| 1020 | AM_CONDITIONAL(HasUMEM, test "$have_umem" = 'yes') |
|---|
| 1021 | AC_SUBST(UMEM_LIBS) |
|---|
| 1022 | |
|---|
| 1023 | # |
|---|
| 1024 | # Add support for ccmalloc memory debugging library if requested |
|---|
| 1025 | # |
|---|
| 1026 | have_ccmalloc='no' |
|---|
| 1027 | CCMALLOC_LIBS='' |
|---|
| 1028 | if test "$enable_ccmalloc" = 'yes'; then |
|---|
| 1029 | AC_PATH_PROG(CCMALLOCDelegate,ccmalloc,) |
|---|
| 1030 | if test -n "$CCMALLOCDelegate"; then |
|---|
| 1031 | eval `grep PREFIX= $CCMALLOCDelegate | sed -e 's/PREFIX/CCMALLOC_PREFIX/'` |
|---|
| 1032 | OLIBS="$LIBS" |
|---|
| 1033 | # Assume that gcc is used with ccmalloc. |
|---|
| 1034 | LIBS="$LIBS $CCMALLOC_PREFIX/lib/ccmalloc-gcc.o" |
|---|
| 1035 | AC_CHECK_LIB(ccmalloc,ccmalloc_malloc,CCMALLOC_LIBS="$CCMALLOC_PREFIX/lib/ccmalloc-gcc.o -lccmalloc -ldl",,-ldl) |
|---|
| 1036 | if test -n "$CCMALLOC_LIBS"; then |
|---|
| 1037 | LIBS="$OLIBS" |
|---|
| 1038 | LIBS="$LIBS $CCMALLOC_LIBS" |
|---|
| 1039 | have_ccmalloc='yes' |
|---|
| 1040 | else |
|---|
| 1041 | LIBS="$OLIBS" |
|---|
| 1042 | fi |
|---|
| 1043 | fi |
|---|
| 1044 | fi |
|---|
| 1045 | |
|---|
| 1046 | # |
|---|
| 1047 | # Add support for efence memory debugging library if requested |
|---|
| 1048 | # |
|---|
| 1049 | if test "$enable_efence" = 'yes'; then |
|---|
| 1050 | EFENCE_LIBS='-lefence' |
|---|
| 1051 | LIBS="$EFENCE_LIBS $LIBS" |
|---|
| 1052 | fi |
|---|
| 1053 | |
|---|
| 1054 | # |
|---|
| 1055 | # Find math library |
|---|
| 1056 | # |
|---|
| 1057 | MATH_LIBS='' |
|---|
| 1058 | AC_CHECK_LIB(m,sqrt,MATH_LIBS="-lm",,) |
|---|
| 1059 | LIBS="$MATH_LIBS $LIBS" |
|---|
| 1060 | AC_SUBST(MATH_LIBS) |
|---|
| 1061 | |
|---|
| 1062 | # |
|---|
| 1063 | # Check for ZLIB |
|---|
| 1064 | # |
|---|
| 1065 | have_zlib='no' |
|---|
| 1066 | ZLIB_LIBS='' |
|---|
| 1067 | dnl PNG requires zlib so enable zlib check if PNG is requested |
|---|
| 1068 | if test "$with_zlib" != 'no' || test "$with_png" != 'no'; then |
|---|
| 1069 | AC_MSG_RESULT([-------------------------------------------------------------]) |
|---|
| 1070 | AC_MSG_CHECKING(for ZLIB) |
|---|
| 1071 | AC_MSG_RESULT([]) |
|---|
| 1072 | failed=0 |
|---|
| 1073 | passed=0 |
|---|
| 1074 | AC_CHECK_HEADER(zconf.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`) |
|---|
| 1075 | AC_CHECK_HEADER(zlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`) |
|---|
| 1076 | AC_CHECK_LIB(z,compress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) |
|---|
| 1077 | AC_CHECK_LIB(z,uncompress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) |
|---|
| 1078 | AC_CHECK_LIB(z,deflate,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) |
|---|
| 1079 | AC_CHECK_LIB(z,deflateBound,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) |
|---|
| 1080 | AC_CHECK_LIB(z,inflate,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) |
|---|
| 1081 | AC_CHECK_LIB(z,gzseek,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) |
|---|
| 1082 | AC_CHECK_LIB(z,gztell,passed=`expr $passed + 1`,failed=`expr $failed + 1`,) |
|---|
| 1083 | AC_MSG_CHECKING([if ZLIB package is complete]) |
|---|
| 1084 | if test $passed -gt 0; then |
|---|
| 1085 | if test $failed -gt 0; then |
|---|
| 1086 | AC_MSG_RESULT([no -- some components failed test]) |
|---|
| 1087 | have_zlib='no (failed tests)' |
|---|
| 1088 | else |
|---|
| 1089 | ZLIB_LIBS='-lz' |
|---|
| 1090 | LIBS="$ZLIB_LIBS $LIBS" |
|---|
| 1091 | AC_DEFINE(ZLIB_DELEGATE,1,Define if you have zlib compression library) |
|---|
| 1092 | AC_MSG_RESULT([yes]) |
|---|
| 1093 | have_zlib='yes' |
|---|
| 1094 | fi |
|---|
| 1095 | else |
|---|
| 1096 | AC_MSG_RESULT([no]) |
|---|
| 1097 | fi |
|---|
| 1098 | fi |
|---|
| 1099 | AM_CONDITIONAL(ZLIB_DELEGATE, test "$have_zlib" = 'yes') |
|---|
| 1100 | AC_SUBST(ZLIB_LIBS) |
|---|
| 1101 | |
|---|
| 1102 | # |
|---|
| 1103 | # Check for BZLIB |
|---|
| 1104 | # |
|---|
| 1105 | have_bzlib='no' |
|---|
| 1106 | if test "$with_bzlib" != 'no'; then |
|---|
| 1107 | BZLIB_LIBS='' |
|---|
| 1108 | AC_MSG_RESULT([-------------------------------------------------------------]) |
|---|
| 1109 | AC_MSG_CHECKING(for BZLIB) |
|---|
| 1110 | AC_MSG_RESULT([]) |
|---|
| 1111 | failed=0 |
|---|
| 1112 | passed=0 |
|---|
| 1113 | found_libbz=0 |
|---|
| 1114 | AC_CHECK_HEADER(bzlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`) |
|---|
| 1115 | AC_CHECK_LIB(bz2,BZ2_bzDecompress,found_libbz=`expr $found_libbz + 1`,,) |
|---|
| 1116 | if test "$native_win32_build" = 'yes'; then |
|---|
| 1117 | AC_CHECK_LIB(bz2,_imp__BZ2_decompress,found_libbz=`expr $found_libbz + 1`,,) |
|---|
| 1118 | fi |
|---|
| 1119 | if test $found_libbz -gt 0; then |
|---|
| 1120 | passed=`expr $passed + 1` |
|---|
| 1121 | else |
|---|
| 1122 | failed=`expr $failed + 1` |
|---|
| 1123 | fi |
|---|
| 1124 | AC_MSG_CHECKING(if BZLIB package is complete) |
|---|
| 1125 | if test $passed -gt 0; then |
|---|
| 1126 | if test $failed -gt 0; then |
|---|
| 1127 | AC_MSG_RESULT(no -- some components failed test) |
|---|
| 1128 | have_bzlib='no (failed tests)' |
|---|
| 1129 | else |
|---|
| 1130 | BZLIB_LIBS='-lbz2' |
|---|
| 1131 | LIBS="$BZLIB_LIBS $LIBS" |
|---|
| 1132 | AC_DEFINE(BZLIB_DELEGATE,1,Define if you have the bzip2 library) |
|---|
| 1133 | AC_MSG_RESULT(yes) |
|---|
| 1134 | have_bzlib='yes' |
|---|
| 1135 | fi |
|---|
| 1136 | else |
|---|
| 1137 | AC_MSG_RESULT(no) |
|---|
| 1138 | fi |
|---|
| 1139 | fi |
|---|
| 1140 | AM_CONDITIONAL(BZLIB_DELEGATE, test "$have_bzlib" = 'yes') |
|---|
| 1141 | AC_SUBST(BZLIB_LIBS) |
|---|
| 1142 | |
|---|
| 1143 | # |
|---|
| 1144 | # If profiling, then check for -ldl and dlopen (required for Solaris & gcc) |
|---|
| 1145 | # |
|---|
| 1146 | LIB_DL='' |
|---|
| 1147 | if test "$with_profiling" = 'yes'; then |
|---|
| 1148 | AC_CHECK_LIB(dl,dlopen,LIB_DL='-ldl',,) |
|---|
| 1149 | LIBS="$LIB_DL $LIBS" |
|---|
| 1150 | fi |
|---|
| 1151 | AC_SUBST(LIB_DL) |
|---|
| 1152 | |
|---|
| 1153 | # |
|---|
| 1154 | # Find per;. |
|---|
| 1155 | # |
|---|
| 1156 | AC_CACHE_CHECK(for perl,ac_cv_path_PERL,ac_cv_path_PERL="$with_perl"); |
|---|
| 1157 | PERL=$ac_cv_path_PERL |
|---|
| 1158 | AC_SUBST(PERL)dnl |
|---|
| 1159 | |
|---|
| 1160 | # |
|---|
| 1161 | # Configure install Paths |
|---|
| 1162 | # |
|---|
| 1163 | |
|---|
| 1164 | # Subdirectory under lib to place Wizard lib files |
|---|
| 1165 | LIBRARY_RELATIVE_PATH="${PACKAGE_NAME}-${PACKAGE_VERSION}" |
|---|
| 1166 | AC_DEFINE_UNQUOTED(LIBRARY_RELATIVE_PATH,"$LIBRARY_RELATIVE_PATH",Subdirectory of lib where Wizard architecture dependent files are installed) |
|---|
| 1167 | |
|---|
| 1168 | # Path to Wizard bin directory |
|---|
| 1169 | EXECUTABLE_PATH="${BIN_DIR}" |
|---|
| 1170 | DEFINE_EXECUTABLE_PATH="${BIN_DIR}/" |
|---|
| 1171 | case "${build_os}" in |
|---|
| 1172 | mingw* ) |
|---|
| 1173 | DEFINE_EXECUTABLE_PATH=`$WinPathScript "$DEFINE_EXECUTABLE_PATH" 1` |
|---|
| 1174 | ;; |
|---|
| 1175 | esac |
|---|
| 1176 | AC_DEFINE_UNQUOTED(EXECUTABLE_PATH,"$DEFINE_EXECUTABLE_PATH",Directory where executables are installed.) |
|---|
| 1177 | AC_SUBST(EXECUTABLE_PATH) |
|---|
| 1178 | |
|---|
| 1179 | # Path to Wizard lib |
|---|
| 1180 | LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}" |
|---|
| 1181 | DEFINE_LIBRARY_PATH="${LIB_DIR}/${LIBRARY_RELATIVE_PATH}/" |
|---|
| 1182 | case "${build_os}" in |
|---|
| 1183 | mingw* ) |
|---|
| 1184 | DEFINE_LIBRARY_PATH=`$WinPathScript "$DEFINE_LIBRARY_PATH" 1` |
|---|
| 1185 | ;; |
|---|
| 1186 | esac |
|---|
| 1187 | AC_DEFINE_UNQUOTED(LIBRARY_PATH,"$DEFINE_LIBRARY_PATH",Directory where architecture-dependent files live.) |
|---|
| 1188 | AC_SUBST(LIBRARY_PATH) |
|---|
| 1189 | |
|---|
| 1190 | # Subdirectory under lib to place Wizard configuration files |
|---|
| 1191 | CONFIGURE_RELATIVE_PATH="${LIBRARY_RELATIVE_PATH}/config" |
|---|
| 1192 | AC_DEFINE_UNQUOTED(CONFIGURE_RELATIVE_PATH,"$CONFIGURE_RELATIVE_PATH",Subdirectory of lib where architecture-dependent configuration files live.) |
|---|
| 1193 | CONFIGURE_PATH="${LIB_DIR}/${CONFIGURE_RELATIVE_PATH}" |
|---|
| 1194 | DEFINE_CONFIGURE_PATH="${LIB_DIR}/${CONFIGURE_RELATIVE_PATH}/" |
|---|
| 1195 | case "${build_os}" in |
|---|
| 1196 | mingw* ) |
|---|
| 1197 | DEFINE_CONFIGURE_PATH=`$WinPathScript "$DEFINE_CONFIGURE_PATH" 1` |
|---|
| 1198 | ;; |
|---|
| 1199 | esac |
|---|
| 1200 | AC_DEFINE_UNQUOTED(CONFIGURE_PATH,"$DEFINE_CONFIGURE_PATH",Directory where architecture-dependent configuration files live.) |
|---|
| 1201 | AC_SUBST(CONFIGURE_PATH) |
|---|
| 1202 | |
|---|
| 1203 | # |
|---|
| 1204 | # Path to Wizard document files |
|---|
| 1205 | DOCUMENTATION_RELATIVE_PATH="${PACKAGE_NAME}-${PACKAGE_VERSION}" |
|---|
| 1206 | DOCUMENTATION_PATH="${DATA_DIR}/doc/${DOCUMENTATION_RELATIVE_PATH}" |
|---|
| 1207 | DEFINE_DOCUMENTATION_PATH="${DATA_DIR}/doc/${DOCUMENTATION_RELATIVE_PATH}/" |
|---|
| 1208 | case "${build_os}" in |
|---|
| 1209 | mingw* ) |
|---|
| 1210 | DEFINE_DOCUMENTATION_PATH=`$WinPathScript "$DEFINE_DOCUMENTATION_PATH" 1` |
|---|
| 1211 | ;; |
|---|
| 1212 | esac |
|---|
| 1213 | AC_DEFINE_UNQUOTED(DOCUMENTATION_PATH,"$DEFINE_DOCUMENTATION_PATH",Directory where the Wizard's Toolkit documents live.) |
|---|
| 1214 | AC_SUBST(DOCUMENTATION_PATH) |
|---|
| 1215 | |
|---|
| 1216 | # Path to Wizard share files |
|---|
| 1217 | SHARE_RELATIVE_PATH="${PACKAGE_NAME}-${PACKAGE_VERSION}" |
|---|
| 1218 | SHARE_PATH="${DATA_DIR}/${SHARE_RELATIVE_PATH}" |
|---|
| 1219 | DEFINE_SHARE_PATH="${DATA_DIR}/${SHARE_RELATIVE_PATH}/" |
|---|
| 1220 | case "${build_os}" in |
|---|
| 1221 | mingw* ) |
|---|
| 1222 | DEFINE_SHARE_PATH=`$WinPathScript "$DEFINE_SHARE_PATH" 1` |
|---|
| 1223 | ;; |
|---|
| 1224 | esac |
|---|
| 1225 | AC_DEFINE_UNQUOTED(SHARE_PATH,"$DEFINE_SHARE_PATH",Directory where architecture-independent files live.) |
|---|
| 1226 | AC_SUBST(SHARE_PATH) |
|---|
| 1227 | |
|---|
| 1228 | # Subdirectory under share to place Wizard configuration files |
|---|
| 1229 | SHARE_CONFIGURE_RELATIVE_PATH="${LIBRARY_RELATIVE_PATH}/config" |
|---|
| 1230 | AC_DEFINE_UNQUOTED(SHARE_CONFIGURE_RELATIVE_PATH,"$SHARE_CONFIGURE_RELATIVE_PATH",Subdirectory of lib where architecture-independent configuration files live.) |
|---|
| 1231 | SHARE_CONFIGURE_PATH="${DATA_DIR}/${SHARE_CONFIGURE_RELATIVE_PATH}" |
|---|
| 1232 | DEFINE_SHARE_CONFIGURE_PATH="${DATA_DIR}/${SHARE_CONFIGURE_RELATIVE_PATH}/" |
|---|
| 1233 | case "${build_os}" in |
|---|
| 1234 | mingw* ) |
|---|
| 1235 | DEFINE_SHARE_CONFIGURE_PATH=`$WinPathScript "$DEFINE_SHARE_CONFIGURE_PATH" 1` |
|---|
| 1236 | ;; |
|---|
| 1237 | esac |
|---|
| 1238 | AC_DEFINE_UNQUOTED(SHARE_CONFIGURE_PATH,"$DEFINE_SHARE_CONFIGURE_PATH",Directory where architecture-independent configuration files live.) |
|---|
| 1239 | AC_SUBST(SHARE_CONFIGURE_PATH) |
|---|
| 1240 | |
|---|
| 1241 | # |
|---|
| 1242 | # program_transform_name is formed for use in a Makefile, so create a |
|---|
| 1243 | # modified version for use in a shell script. |
|---|
| 1244 | configure_transform_name=`echo ${program_transform_name} | sed 's,\\$\\$,$,'` |
|---|
| 1245 | |
|---|
| 1246 | # Default delegate definitions |
|---|
| 1247 | BrowseDelegateDefault='mozilla' |
|---|
| 1248 | EchoDelegateDefault='echo' |
|---|
| 1249 | LPDelegateDefault='lp' |
|---|
| 1250 | LPRDelegateDefault='lpr' |
|---|
| 1251 | LZWDecodeDelegateDefault='uncompress' |
|---|
| 1252 | LZWEncodeDelegateDefault='compress' |
|---|
| 1253 | MANDelegateDefault='groff' |
|---|
| 1254 | MVDelegateDefault='mv' |
|---|
| 1255 | RMDelegateDefault='rm' |
|---|
| 1256 | TXTDelegateDefault='enscript' |
|---|
| 1257 | WWWDecodeDelegateDefault='wget' |
|---|
| 1258 | ZipDelegateDefault='gzip' |
|---|
| 1259 | |
|---|
| 1260 | # |
|---|
| 1261 | # Test for font directories |
|---|
| 1262 | # |
|---|
| 1263 | type_include_files='' |
|---|
| 1264 | |
|---|
| 1265 | # Windows |
|---|
| 1266 | windows_font_dir='' |
|---|
| 1267 | if test "$with_windows_font_dir" != "yes" && test -n "$with_windows_font_dir"; then |
|---|
| 1268 | windows_font_dir="${with_windows_font_dir}/" |
|---|
| 1269 | fi |
|---|
| 1270 | if test -n "$windows_font_dir"; then |
|---|
| 1271 | if test -f '/usr/X11R6/lib/X11/fonts/truetype/arial.ttf'; then |
|---|
| 1272 | windows_font_dir='/usr/X11R6/lib/X11/fonts/truetype/' |
|---|
| 1273 | fi |
|---|
| 1274 | if test -f '/usr/X11R7/lib/X11/fonts/truetype/arial.ttf'; then |
|---|
| 1275 | windows_font_dir='/usr/X11R7/lib/X11/fonts/truetype/' |
|---|
| 1276 | fi |
|---|
| 1277 | if test -f '/usr/share/fonts/msttcore/arial.ttf'; then |
|---|
| 1278 | windows_font_dir='/usr/share/fonts/msttcore/truetype/' |
|---|
| 1279 | fi |
|---|
| 1280 | fi |
|---|
| 1281 | if test -n "$windows_font_dir"; then |
|---|
| 1282 | type_include_files="$type_include_files "'<include file="type-windows.mgk" />' |
|---|
| 1283 | fi |
|---|
| 1284 | AC_SUBST(windows_font_dir) |
|---|
| 1285 | |
|---|
| 1286 | # Adobe Postscript fonts on various systems |
|---|
| 1287 | case $host_os in |
|---|
| 1288 | solaris*) type_include_files="$type_include_files "'<include file="type-solaris.mgk" />';; |
|---|
| 1289 | esac |
|---|
| 1290 | |
|---|
| 1291 | # |
|---|
| 1292 | # RPM support. |
|---|
| 1293 | # |
|---|
| 1294 | RPM='' |
|---|
| 1295 | AC_CHECK_PROGS(TAR,gnutar gtar tar) |
|---|
| 1296 | AC_CHECK_PROGS(PERL,perl) |
|---|
| 1297 | AC_CHECK_PROGS(RPM,rpmbuild rpm) |
|---|
| 1298 | AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) |
|---|
| 1299 | AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) |
|---|
| 1300 | AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) |
|---|
| 1301 | AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) |
|---|
| 1302 | AC_SUBST(RPM) |
|---|
| 1303 | AM_CONDITIONAL(RPM_DELEGATE, test "x$RPM" != "x" ) |
|---|
| 1304 | |
|---|
| 1305 | # |
|---|
| 1306 | # 7ZIP support (http://p7zip.sourceforge.net/) |
|---|
| 1307 | # |
|---|
| 1308 | P7ZIP='' |
|---|
| 1309 | AC_CHECK_PROGS(P7ZIP,[7za]) |
|---|
| 1310 | AC_SUBST(P7ZIP) |
|---|
| 1311 | AM_CONDITIONAL(P7ZIP_DELEGATE, test "x$P7ZIP" != "x" ) |
|---|
| 1312 | |
|---|
| 1313 | # |
|---|
| 1314 | # ZIP support (http://www.info-zip.org/Zip.html) |
|---|
| 1315 | # |
|---|
| 1316 | ZIP='' |
|---|
| 1317 | AC_CHECK_PROGS(ZIP,[zip]) |
|---|
| 1318 | AC_SUBST(ZIP) |
|---|
| 1319 | AM_CONDITIONAL(ZIP_DELEGATE, test "x$ZIP" != "x" ) |
|---|
| 1320 | |
|---|
| 1321 | # |
|---|
| 1322 | # Handle special compiler flags |
|---|
| 1323 | # |
|---|
| 1324 | |
|---|
| 1325 | # Add '-p' if prof source profiling support enabled |
|---|
| 1326 | if test "$enable_prof" = 'yes'; then |
|---|
| 1327 | CFLAGS="-p $CFLAGS" |
|---|
| 1328 | CXXFLAGS="-p $CXXFLAGS" |
|---|
| 1329 | LDFLAGS="-p $LDFLAGS" |
|---|
| 1330 | fi |
|---|
| 1331 | |
|---|
| 1332 | # Add '-pg' if gprof source profiling support enabled |
|---|
| 1333 | if test "$enable_gprof" = 'yes'; then |
|---|
| 1334 | CFLAGS="-pg $CFLAGS" |
|---|
| 1335 | CXXFLAGS="-pg $CXXFLAGS" |
|---|
| 1336 | LDFLAGS="-pg $LDFLAGS" |
|---|
| 1337 | fi |
|---|
| 1338 | |
|---|
| 1339 | # Add '-ftest-coverage -fprofile-arcs' if gcov source profiling support enabled |
|---|
| 1340 | # This is a gcc-specific feature |
|---|
| 1341 | if test "$enable_gcov" = 'yes'; then |
|---|
| 1342 | CFLAGS="-ftest-coverage -fprofile-arcs $CFLAGS" |
|---|
| 1343 | CXXFLAGS="-ftest-coverage -fprofile-arcs $CXXFLAGS" |
|---|
| 1344 | LDFLAGS="-ftest-coverage -fprofile-arcs $LDFLAGS" |
|---|
| 1345 | fi |
|---|
| 1346 | |
|---|
| 1347 | # |
|---|
| 1348 | # Build library dependency list for libWizard |
|---|
| 1349 | # |
|---|
| 1350 | |
|---|
| 1351 | if test "$with_modules" != 'no'; then |
|---|
| 1352 | WIZARD_DEP_LIBS="$IPC_LIBS $BZLIB_LIBS $ZLIB_LIBS $GDI32_LIBS $MATH_LIBS $CCMALLOC_LIBS $EFENCE_LIBS $UMEM_LIBS $GOMP_LIBS $THREAD_LIBS" |
|---|
| 1353 | else |
|---|
| 1354 | WIZARD_DEP_LIBS="$IPC_LIBS $BZLIB_LIBS $ZLIB_LIBS $GDI32_LIBS $MATH_LIBS $CCMALLOC_LIBS $EFENCE_LIBS $UMEM_LIBS $GOMP_LIBS $THREAD_LIBS" |
|---|
| 1355 | fi |
|---|
| 1356 | AC_SUBST(WIZARD_DEP_LIBS) |
|---|
| 1357 | |
|---|
| 1358 | # |
|---|
| 1359 | # Remove extraneous spaces from output variables (asthetic) |
|---|
| 1360 | # |
|---|
| 1361 | X_CFLAGS=`echo $X_CFLAGS | sed -e 's/ */ /g'` |
|---|
| 1362 | X_PRE_LIBS=`echo $X_PRE_LIBS | sed -e 's/ */ /g'` |
|---|
| 1363 | X_LIBS=`echo $X_LIBS | sed -e 's/ */ /g'` |
|---|
| 1364 | X_EXTRA_LIBS=`echo $X_EXTRA_LIBS | sed -e 's/ */ /g'` |
|---|
| 1365 | |
|---|
| 1366 | CC=`echo $CC | sed -e 's/ */ /g'` |
|---|
| 1367 | CFLAGS=`echo $CFLAGS | sed -e 's/ */ /g'` |
|---|
| 1368 | CPPFLAGS=`echo $CPPFLAGS | sed -e 's/ */ /g'` |
|---|
| 1369 | CXXFLAGS=`echo $CXXFLAGS | sed -e 's/ */ /g'` |
|---|
| 1370 | LDFLAGS=`echo $LDFLAGS | sed -e 's/ */ /g'` |
|---|
| 1371 | TESTED_LIBS=`echo $LIBS | sed -e 's/ */ /g'` |
|---|
| 1372 | WIZARD_DEP_LIBS=`echo $WIZARD_DEP_LIBS | sed -e 's/ */ /g'` |
|---|
| 1373 | #LIBS=`echo $LIBS | sed -e 's/ */ /g'` |
|---|
| 1374 | |
|---|
| 1375 | # Pass only user-provided LIBS as "global" libraries |
|---|
| 1376 | LIBS=$USER_LIBS |
|---|
| 1377 | |
|---|
| 1378 | #AC_SUBST(CPPFLAGS) |
|---|
| 1379 | AC_SUBST(X_CFLAGS) |
|---|
| 1380 | #AC_SUBST(LDFLAGS) |
|---|
| 1381 | #AC_SUBST(X_PRE_LIBS) |
|---|
| 1382 | #AC_SUBST(X_LIBS) |
|---|
| 1383 | #AC_SUBST(X_EXTRA_LIBS) |
|---|
| 1384 | |
|---|
| 1385 | WIZARD_CFLAGS=$CFLAGS |
|---|
| 1386 | WIZARD_CPPFLAGS=`echo $WIZARD_CPPFLAGS | sed -e 's/ */ /g'` |
|---|
| 1387 | WIZARD_PCFLAGS=`echo $WIZARD_PCFLAGS | sed -e 's/ */ /g'` |
|---|
| 1388 | WIZARD_LDFLAGS="-L$LIB_DIR $LDFLAGS" |
|---|
| 1389 | WIZARD_LIBS="-lWizardsToolkit $WIZARD_DEP_LIBS" |
|---|
| 1390 | |
|---|
| 1391 | AC_SUBST(WIZARD_CFLAGS) |
|---|
| 1392 | AC_SUBST(WIZARD_CPPFLAGS) |
|---|
| 1393 | AC_SUBST(WIZARD_PCFLAGS) |
|---|
| 1394 | AC_SUBST(WIZARD_LDFLAGS) |
|---|
| 1395 | AC_SUBST(WIZARD_LIBS) |
|---|
| 1396 | |
|---|
| 1397 | # Set configured scripts to executable. |
|---|
| 1398 | AC_CONFIG_COMMANDS([WizardsToolkit-config.in],[chmod +x wizard/WizardsToolkit-config]) |
|---|
| 1399 | |
|---|
| 1400 | AC_OUTPUT |
|---|
| 1401 | |
|---|
| 1402 | rm -f wizard-version |
|---|
| 1403 | |
|---|
| 1404 | AC_MSG_RESULT([ |
|---|
| 1405 | The Wizard's Toolkit is configured as follows. Please verify that |
|---|
| 1406 | this configuration matches your expectations. |
|---|
| 1407 | |
|---|
| 1408 | Host system type: $host |
|---|
| 1409 | Build system type: $build |
|---|
| 1410 | |
|---|
| 1411 | Option Value |
|---|
| 1412 | ------------------------------------------------------------------------- |
|---|
| 1413 | Shared libraries --enable-shared=$enable_shared $libtool_build_shared_libs |
|---|
| 1414 | Static libraries --enable-static=$enable_static $libtool_build_static_libs |
|---|
| 1415 | GNU ld --with-gnu-ld=$with_gnu_ld $lt_cv_prog_gnu_ld |
|---|
| 1416 | |
|---|
| 1417 | Options used to compile and link: |
|---|
| 1418 | PREFIX = $PREFIX_DIR |
|---|
| 1419 | EXEC-PREFIX = $EXEC_PREFIX_DIR |
|---|
| 1420 | VERSION = $PACKAGE_VERSION |
|---|
| 1421 | CC = $CC |
|---|
| 1422 | CFLAGS = $WIZARD_CFLAGS |
|---|
| 1423 | CPPFLAGS = $WIZARD_CPPFLAGS |
|---|
| 1424 | PCFLAGS = $WIZARD_PCFLAGS |
|---|
| 1425 | DEFS = $DEFS |
|---|
| 1426 | LDFLAGS = $WIZARD_LDFLAGS |
|---|
| 1427 | LIBS = $WIZARD_LIBS |
|---|
| 1428 | CXX = $CXX |
|---|
| 1429 | CXXFLAGS = $CXXFLAGS |
|---|
| 1430 | ]) |
|---|