1 dnl aclocal.m4 generated automatically by aclocal 1.4
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
13 # FIXME: We temporarily define our own version of AC_PROG_CC. This is
14 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
15 # are probably using a cross compiler, which will not be able to fully
16 # link an executable. This should really be fixed in autoconf
19 AC_DEFUN(LIB_AC_PROG_CC,
20 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
21 AC_CHECK_PROG(CC, gcc, gcc)
22 if test -z "$CC"; then
23 AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
24 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
29 if test $ac_cv_prog_gcc = yes; then
31 dnl Check whether -g works, even if CFLAGS is set, in case the package
32 dnl plays around with CFLAGS (such as to build both debugging and
33 dnl normal versions of a library), tasteless as that idea is.
34 ac_test_CFLAGS="${CFLAGS+set}"
35 ac_save_CFLAGS="$CFLAGS"
38 if test "$ac_test_CFLAGS" = set; then
39 CFLAGS="$ac_save_CFLAGS"
40 elif test $ac_cv_prog_cc_g = yes; then
47 test "${CFLAGS+set}" = set || CFLAGS="-g"
51 # Do all the work for Automake. This macro actually does too much --
52 # some checks are only needed if your package does certain things.
53 # But this isn't really a big deal.
58 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
60 AC_DEFUN(AM_INIT_AUTOMAKE,
61 [AC_REQUIRE([AC_PROG_INSTALL])
66 dnl test to see if srcdir already configured
67 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
68 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
71 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
72 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
73 AC_REQUIRE([AM_SANITY_CHECK])
74 AC_REQUIRE([AC_ARG_PROGRAM])
75 dnl FIXME This is truly gross.
76 missing_dir=`cd $ac_aux_dir && pwd`
77 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
78 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
79 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
80 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
81 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
82 AC_REQUIRE([AC_PROG_MAKE_SET])])
85 # Check to make sure that the build environment is sane.
88 AC_DEFUN(AM_SANITY_CHECK,
89 [AC_MSG_CHECKING([whether build environment is sane])
92 echo timestamp > conftestfile
93 # Do `set' in a subshell so we don't clobber the current shell's
94 # arguments. Must try -L first in case configure is actually a
95 # symlink; some systems play weird games with the mod time of symlinks
96 # (eg FreeBSD returns the mod time of the symlink's containing
99 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
100 if test "[$]*" = "X"; then
102 set X `ls -t $srcdir/configure conftestfile`
104 if test "[$]*" != "X $srcdir/configure conftestfile" \
105 && test "[$]*" != "X conftestfile $srcdir/configure"; then
107 # If neither matched, then we have a broken ls. This can happen
108 # if, for instance, CONFIG_SHELL is bash and it inherits a
109 # broken ls alias from the environment. This has actually
110 # happened. Such a system could not be considered "sane".
111 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
112 alias in your environment])
115 test "[$]2" = conftestfile
121 AC_MSG_ERROR([newly created file is older than distributed files!
122 Check your system clock])
127 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
128 dnl The program must properly implement --version.
129 AC_DEFUN(AM_MISSING_PROG,
130 [AC_MSG_CHECKING(for working $2)
131 # Run test in a subshell; some versions of sh will print an error if
132 # an executable is not found, even if stderr is redirected.
133 # Redirect stdin to placate older versions of autoconf. Sigh.
134 if ($2 --version) < /dev/null > /dev/null 2>&1; then
139 AC_MSG_RESULT(missing)
143 # Add --enable-maintainer-mode option to configure.
148 AC_DEFUN(AM_MAINTAINER_MODE,
149 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
150 dnl maintainer-mode is disabled by default
151 AC_ARG_ENABLE(maintainer-mode,
152 [ --enable-maintainer-mode enable make rules and dependencies not useful
153 (and sometimes confusing) to the casual installer],
154 USE_MAINTAINER_MODE=$enableval,
155 USE_MAINTAINER_MODE=no)
156 AC_MSG_RESULT($USE_MAINTAINER_MODE)
157 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
158 MAINT=$MAINTAINER_MODE_TRUE
163 # Define a conditional.
165 AC_DEFUN(AM_CONDITIONAL,
177 # serial 40 AC_PROG_LIBTOOL
178 AC_DEFUN(AC_PROG_LIBTOOL,
179 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
181 # Save cache, so that ltconfig can load it
184 # Actually configure libtool. ac_aux_dir is where install-sh is found.
185 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
186 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
187 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
188 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
189 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
190 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
191 || AC_MSG_ERROR([libtool configure failed])
193 # Reload cache, that may have been modified by ltconfig
196 # This can be used to rebuild libtool when needed
197 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
199 # Always use our own libtool.
200 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
203 # Redirect the config.log output again, so that the ltconfig log is not
204 # clobbered by the next message.
208 AC_DEFUN(AC_LIBTOOL_SETUP,
210 AC_REQUIRE([AC_ENABLE_SHARED])dnl
211 AC_REQUIRE([AC_ENABLE_STATIC])dnl
212 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
213 AC_REQUIRE([AC_CANONICAL_HOST])dnl
214 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
215 AC_REQUIRE([AC_PROG_RANLIB])dnl
216 AC_REQUIRE([AC_PROG_CC])dnl
217 AC_REQUIRE([AC_PROG_LD])dnl
218 AC_REQUIRE([AC_PROG_NM])dnl
219 AC_REQUIRE([AC_PROG_LN_S])dnl
222 # Check for any special flags to pass to ltconfig.
223 libtool_flags="--cache-file=$cache_file"
224 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
225 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
226 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
227 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
228 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
229 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
230 [libtool_flags="$libtool_flags --enable-dlopen"])
231 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
232 [libtool_flags="$libtool_flags --enable-win32-dll"])
233 AC_ARG_ENABLE(libtool-lock,
234 [ --disable-libtool-lock avoid locking (might break parallel builds)])
235 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
236 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
238 # Some flags need to be propagated to the compiler or linker for good
242 # Find out which ABI we are using.
243 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
244 if AC_TRY_EVAL(ac_compile); then
245 case "`/usr/bin/file conftest.o`" in
261 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
262 SAVE_CFLAGS="$CFLAGS"
263 CFLAGS="$CFLAGS -belf"
264 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
265 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
266 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
267 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
268 CFLAGS="$SAVE_CFLAGS"
272 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
273 [*-*-cygwin* | *-*-mingw*)
274 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
275 AC_CHECK_TOOL(AS, as, false)
276 AC_CHECK_TOOL(OBJDUMP, objdump, false)
282 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
283 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
285 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
286 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
288 # AC_ENABLE_SHARED - implement the --enable-shared flag
289 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
290 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
292 AC_DEFUN(AC_ENABLE_SHARED, [dnl
293 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
294 AC_ARG_ENABLE(shared,
295 changequote(<<, >>)dnl
296 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
298 [p=${PACKAGE-default}
300 yes) enable_shared=yes ;;
301 no) enable_shared=no ;;
304 # Look at the argument we got. We use all the common list separators.
305 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
306 for pkg in $enableval; do
307 if test "X$pkg" = "X$p"; then
314 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
317 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
318 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
319 AC_ENABLE_SHARED(no)])
321 # AC_ENABLE_STATIC - implement the --enable-static flag
322 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
323 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
325 AC_DEFUN(AC_ENABLE_STATIC, [dnl
326 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
327 AC_ARG_ENABLE(static,
328 changequote(<<, >>)dnl
329 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
331 [p=${PACKAGE-default}
333 yes) enable_static=yes ;;
334 no) enable_static=no ;;
337 # Look at the argument we got. We use all the common list separators.
338 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
339 for pkg in $enableval; do
340 if test "X$pkg" = "X$p"; then
347 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
350 # AC_DISABLE_STATIC - set the default static flag to --disable-static
351 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
352 AC_ENABLE_STATIC(no)])
355 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
356 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
357 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
359 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
360 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
361 AC_ARG_ENABLE(fast-install,
362 changequote(<<, >>)dnl
363 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
365 [p=${PACKAGE-default}
367 yes) enable_fast_install=yes ;;
368 no) enable_fast_install=no ;;
370 enable_fast_install=no
371 # Look at the argument we got. We use all the common list separators.
372 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
373 for pkg in $enableval; do
374 if test "X$pkg" = "X$p"; then
375 enable_fast_install=yes
381 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
384 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
385 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
386 AC_ENABLE_FAST_INSTALL(no)])
388 # AC_PROG_LD - find the path to the GNU or non-GNU linker
391 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
392 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
393 AC_REQUIRE([AC_PROG_CC])dnl
394 AC_REQUIRE([AC_CANONICAL_HOST])dnl
395 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
397 if test "$ac_cv_prog_gcc" = yes; then
398 # Check if gcc -print-prog-name=ld gives a path.
399 AC_MSG_CHECKING([for ld used by GCC])
400 ac_prog=`($CC -print-prog-name=ld) 2>&5`
402 # Accept absolute paths.
404 [\\/]* | [A-Za-z]:[\\/]*)
405 re_direlt='/[^/][^/]*/\.\./'
407 # Canonicalize the path of ld
408 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
409 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
410 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
412 test -z "$LD" && LD="$ac_prog"
415 # If it fails, then pretend we aren't using GCC.
419 # If it is relative, then search for the first ld in PATH.
423 elif test "$with_gnu_ld" = yes; then
424 AC_MSG_CHECKING([for GNU ld])
426 AC_MSG_CHECKING([for non-GNU ld])
428 AC_CACHE_VAL(ac_cv_path_LD,
429 [if test -z "$LD"; then
430 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
431 for ac_dir in $PATH; do
432 test -z "$ac_dir" && ac_dir=.
433 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
434 ac_cv_path_LD="$ac_dir/$ac_prog"
435 # Check to see if the program is GNU ld. I'd rather use --version,
436 # but apparently some GNU ld's only accept -v.
437 # Break only if it was the GNU/non-GNU ld that we prefer.
438 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
439 test "$with_gnu_ld" != no && break
441 test "$with_gnu_ld" != yes && break
447 ac_cv_path_LD="$LD" # Let the user override the test with a path.
450 if test -n "$LD"; then
455 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
460 AC_DEFUN(AC_PROG_LD_GNU,
461 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
462 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
463 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
464 ac_cv_prog_gnu_ld=yes
470 # AC_PROG_NM - find the path to a BSD-compatible name lister
472 [AC_MSG_CHECKING([for BSD-compatible nm])
473 AC_CACHE_VAL(ac_cv_path_NM,
474 [if test -n "$NM"; then
475 # Let the user override the test.
478 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
479 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
480 test -z "$ac_dir" && ac_dir=.
481 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
482 # Check to see if the nm accepts a BSD-compat flag.
483 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
484 # nm: unknown option "B" ignored
485 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
486 ac_cv_path_NM="$ac_dir/nm -B"
488 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
489 ac_cv_path_NM="$ac_dir/nm -p"
492 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
493 continue # so that we can try to find one that supports BSD flags
498 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
505 # AC_CHECK_LIBM - check for math library
506 AC_DEFUN(AC_CHECK_LIBM,
507 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
510 *-*-beos* | *-*-cygwin*)
511 # These system don't have libm
514 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
515 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
518 AC_CHECK_LIB(m, main, LIBM="-lm")
523 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
524 # the libltdl convenience library, adds --enable-ltdl-convenience to
525 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
526 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
527 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
528 # '${top_builddir}/' (note the single quotes!) if your package is not
529 # flat, and, if you're not using automake, define top_builddir as
530 # appropriate in the Makefiles.
531 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
532 case "$enable_ltdl_convenience" in
533 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
534 "") enable_ltdl_convenience=yes
535 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
537 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
538 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
541 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
542 # the libltdl installable library, and adds --enable-ltdl-install to
543 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
544 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
545 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
546 # '${top_builddir}/' (note the single quotes!) if your package is not
547 # flat, and, if you're not using automake, define top_builddir as
548 # appropriate in the Makefiles.
549 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
550 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
551 AC_CHECK_LIB(ltdl, main,
552 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
553 [if test x"$enable_ltdl_install" = xno; then
554 AC_MSG_WARN([libltdl not installed, but installation disabled])
556 enable_ltdl_install=yes
559 if test x"$enable_ltdl_install" = x"yes"; then
560 ac_configure_args="$ac_configure_args --enable-ltdl-install"
561 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
562 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
564 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
571 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
572 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
573 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
574 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
575 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
576 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
577 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
579 dnl This is just to silence aclocal about the macro not being used
580 ifelse([AC_DISABLE_FAST_INSTALL])dnl