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 # Do all the work for Automake. This macro actually does too much --
14 # some checks are only needed if your package does certain things.
15 # But this isn't really a big deal.
20 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
22 AC_DEFUN(AM_INIT_AUTOMAKE,
23 [AC_REQUIRE([AC_PROG_INSTALL])
28 dnl test to see if srcdir already configured
29 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
30 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
33 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
34 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
35 AC_REQUIRE([AM_SANITY_CHECK])
36 AC_REQUIRE([AC_ARG_PROGRAM])
37 dnl FIXME This is truly gross.
38 missing_dir=`cd $ac_aux_dir && pwd`
39 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
40 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
41 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
42 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
43 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
44 AC_REQUIRE([AC_PROG_MAKE_SET])])
47 # Check to make sure that the build environment is sane.
50 AC_DEFUN(AM_SANITY_CHECK,
51 [AC_MSG_CHECKING([whether build environment is sane])
54 echo timestamp > conftestfile
55 # Do `set' in a subshell so we don't clobber the current shell's
56 # arguments. Must try -L first in case configure is actually a
57 # symlink; some systems play weird games with the mod time of symlinks
58 # (eg FreeBSD returns the mod time of the symlink's containing
61 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
62 if test "[$]*" = "X"; then
64 set X `ls -t $srcdir/configure conftestfile`
66 if test "[$]*" != "X $srcdir/configure conftestfile" \
67 && test "[$]*" != "X conftestfile $srcdir/configure"; then
69 # If neither matched, then we have a broken ls. This can happen
70 # if, for instance, CONFIG_SHELL is bash and it inherits a
71 # broken ls alias from the environment. This has actually
72 # happened. Such a system could not be considered "sane".
73 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
74 alias in your environment])
77 test "[$]2" = conftestfile
83 AC_MSG_ERROR([newly created file is older than distributed files!
84 Check your system clock])
89 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
90 dnl The program must properly implement --version.
91 AC_DEFUN(AM_MISSING_PROG,
92 [AC_MSG_CHECKING(for working $2)
93 # Run test in a subshell; some versions of sh will print an error if
94 # an executable is not found, even if stderr is redirected.
95 # Redirect stdin to placate older versions of autoconf. Sigh.
96 if ($2 --version) < /dev/null > /dev/null 2>&1; then
101 AC_MSG_RESULT(missing)
106 # serial 40 AC_PROG_LIBTOOL
107 AC_DEFUN(AC_PROG_LIBTOOL,
108 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
110 # Save cache, so that ltconfig can load it
113 # Actually configure libtool. ac_aux_dir is where install-sh is found.
114 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
115 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
116 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
117 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
118 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
119 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
120 || AC_MSG_ERROR([libtool configure failed])
122 # Reload cache, that may have been modified by ltconfig
125 # This can be used to rebuild libtool when needed
126 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
128 # Always use our own libtool.
129 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
132 # Redirect the config.log output again, so that the ltconfig log is not
133 # clobbered by the next message.
137 AC_DEFUN(AC_LIBTOOL_SETUP,
139 AC_REQUIRE([AC_ENABLE_SHARED])dnl
140 AC_REQUIRE([AC_ENABLE_STATIC])dnl
141 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
142 AC_REQUIRE([AC_CANONICAL_HOST])dnl
143 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
144 AC_REQUIRE([AC_PROG_RANLIB])dnl
145 AC_REQUIRE([AC_PROG_CC])dnl
146 AC_REQUIRE([AC_PROG_LD])dnl
147 AC_REQUIRE([AC_PROG_NM])dnl
148 AC_REQUIRE([AC_PROG_LN_S])dnl
152 NONE) lt_target="$host" ;;
153 *) lt_target="$target" ;;
156 # Check for any special flags to pass to ltconfig.
158 # the following will cause an existing older ltconfig to fail, so
159 # we ignore this at the expense of the cache file... Checking this
160 # will just take longer ... bummer!
161 #libtool_flags="--cache-file=$cache_file"
163 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
164 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
165 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
166 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
167 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
168 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
169 [libtool_flags="$libtool_flags --enable-dlopen"])
170 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
171 [libtool_flags="$libtool_flags --enable-win32-dll"])
172 AC_ARG_ENABLE(libtool-lock,
173 [ --disable-libtool-lock avoid locking (might break parallel builds)])
174 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
175 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
177 # Some flags need to be propagated to the compiler or linker for good
181 # Find out which ABI we are using.
182 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
183 if AC_TRY_EVAL(ac_compile); then
184 case "`/usr/bin/file conftest.o`" in
200 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
201 SAVE_CFLAGS="$CFLAGS"
202 CFLAGS="$CFLAGS -belf"
203 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
204 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
205 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
206 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
207 CFLAGS="$SAVE_CFLAGS"
211 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
212 [*-*-cygwin* | *-*-mingw*)
213 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
214 AC_CHECK_TOOL(AS, as, false)
215 AC_CHECK_TOOL(OBJDUMP, objdump, false)
221 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
222 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
224 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
225 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
227 # AC_ENABLE_SHARED - implement the --enable-shared flag
228 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
229 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
231 AC_DEFUN(AC_ENABLE_SHARED, [dnl
232 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
233 AC_ARG_ENABLE(shared,
234 changequote(<<, >>)dnl
235 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
237 [p=${PACKAGE-default}
239 yes) enable_shared=yes ;;
240 no) enable_shared=no ;;
243 # Look at the argument we got. We use all the common list separators.
244 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
245 for pkg in $enableval; do
246 if test "X$pkg" = "X$p"; then
253 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
256 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
257 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
258 AC_ENABLE_SHARED(no)])
260 # AC_ENABLE_STATIC - implement the --enable-static flag
261 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
262 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
264 AC_DEFUN(AC_ENABLE_STATIC, [dnl
265 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
266 AC_ARG_ENABLE(static,
267 changequote(<<, >>)dnl
268 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
270 [p=${PACKAGE-default}
272 yes) enable_static=yes ;;
273 no) enable_static=no ;;
276 # Look at the argument we got. We use all the common list separators.
277 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
278 for pkg in $enableval; do
279 if test "X$pkg" = "X$p"; then
286 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
289 # AC_DISABLE_STATIC - set the default static flag to --disable-static
290 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
291 AC_ENABLE_STATIC(no)])
294 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
295 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
296 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
298 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
299 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
300 AC_ARG_ENABLE(fast-install,
301 changequote(<<, >>)dnl
302 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
304 [p=${PACKAGE-default}
306 yes) enable_fast_install=yes ;;
307 no) enable_fast_install=no ;;
309 enable_fast_install=no
310 # Look at the argument we got. We use all the common list separators.
311 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
312 for pkg in $enableval; do
313 if test "X$pkg" = "X$p"; then
314 enable_fast_install=yes
320 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
323 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
324 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
325 AC_ENABLE_FAST_INSTALL(no)])
327 # AC_PROG_LD - find the path to the GNU or non-GNU linker
330 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
331 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
332 AC_REQUIRE([AC_PROG_CC])dnl
333 AC_REQUIRE([AC_CANONICAL_HOST])dnl
334 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
336 if test "$ac_cv_prog_gcc" = yes; then
337 # Check if gcc -print-prog-name=ld gives a path.
338 AC_MSG_CHECKING([for ld used by GCC])
339 ac_prog=`($CC -print-prog-name=ld) 2>&5`
341 # Accept absolute paths.
343 [\\/]* | [A-Za-z]:[\\/]*)
344 re_direlt='/[^/][^/]*/\.\./'
346 # Canonicalize the path of ld
347 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
348 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
349 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
351 test -z "$LD" && LD="$ac_prog"
354 # If it fails, then pretend we aren't using GCC.
358 # If it is relative, then search for the first ld in PATH.
362 elif test "$with_gnu_ld" = yes; then
363 AC_MSG_CHECKING([for GNU ld])
365 AC_MSG_CHECKING([for non-GNU ld])
367 AC_CACHE_VAL(ac_cv_path_LD,
368 [if test -z "$LD"; then
369 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
370 for ac_dir in $PATH; do
371 test -z "$ac_dir" && ac_dir=.
372 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
373 ac_cv_path_LD="$ac_dir/$ac_prog"
374 # Check to see if the program is GNU ld. I'd rather use --version,
375 # but apparently some GNU ld's only accept -v.
376 # Break only if it was the GNU/non-GNU ld that we prefer.
377 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
378 test "$with_gnu_ld" != no && break
380 test "$with_gnu_ld" != yes && break
386 ac_cv_path_LD="$LD" # Let the user override the test with a path.
389 if test -n "$LD"; then
394 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
398 AC_DEFUN(AC_PROG_LD_GNU,
399 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
400 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
401 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
402 ac_cv_prog_gnu_ld=yes
408 # AC_PROG_NM - find the path to a BSD-compatible name lister
410 [AC_MSG_CHECKING([for BSD-compatible nm])
411 AC_CACHE_VAL(ac_cv_path_NM,
412 [if test -n "$NM"; then
413 # Let the user override the test.
416 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
417 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
418 test -z "$ac_dir" && ac_dir=.
419 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
420 # Check to see if the nm accepts a BSD-compat flag.
421 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
422 # nm: unknown option "B" ignored
423 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
424 ac_cv_path_NM="$ac_dir/nm -B"
426 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
427 ac_cv_path_NM="$ac_dir/nm -p"
430 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
431 continue # so that we can try to find one that supports BSD flags
436 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
442 # AC_CHECK_LIBM - check for math library
443 AC_DEFUN(AC_CHECK_LIBM,
444 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
447 *-*-beos* | *-*-cygwin*)
448 # These system don't have libm
451 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
452 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
455 AC_CHECK_LIB(m, main, LIBM="-lm")
460 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
461 # the libltdl convenience library and INCLTDL to the include flags for
462 # the libltdl header and adds --enable-ltdl-convenience to the
463 # configure arguments. Note that LIBLTDL and INCLTDL are not
464 # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
465 # provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
466 # with '${top_builddir}/' and INCLTDL will be prefixed with
467 # '${top_srcdir}/' (note the single quotes!). If your package is not
468 # flat and you're not using automake, define top_builddir and
469 # top_srcdir appropriately in the Makefiles.
470 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
471 case "$enable_ltdl_convenience" in
472 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
473 "") enable_ltdl_convenience=yes
474 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
476 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
477 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
480 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
481 # the libltdl installable library and INCLTDL to the include flags for
482 # the libltdl header and adds --enable-ltdl-install to the configure
483 # arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
484 # AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
485 # libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
486 # be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
487 # with '${top_srcdir}/' (note the single quotes!). If your package is
488 # not flat and you're not using automake, define top_builddir and
489 # top_srcdir appropriately in the Makefiles.
490 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
491 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
492 AC_CHECK_LIB(ltdl, main,
493 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
494 [if test x"$enable_ltdl_install" = xno; then
495 AC_MSG_WARN([libltdl not installed, but installation disabled])
497 enable_ltdl_install=yes
500 if test x"$enable_ltdl_install" = x"yes"; then
501 ac_configure_args="$ac_configure_args --enable-ltdl-install"
502 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
503 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
505 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
512 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
513 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
514 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
515 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
516 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
517 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
518 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
520 dnl This is just to silence aclocal about the macro not being used
521 ifelse([AC_DISABLE_FAST_INSTALL])dnl