root/WizardsToolkit/branches/WizardsToolkit-1.0.6/configure.ac

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