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)
105 # Like AC_CONFIG_HEADER, but automatically create stamp file.
107 AC_DEFUN(AM_CONFIG_HEADER,
109 AC_CONFIG_HEADER([$1])
110 dnl When config.status generates a header, we must update the stamp-h file.
111 dnl This file resides in the same directory as the config header
112 dnl that is generated. We must strip everything past the first ":",
113 dnl and everything past the last "/".
114 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
115 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
116 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
118 for am_file in <<$1>>; do
119 case " <<$>>CONFIG_HEADERS " in
120 *" <<$>>am_file "*<<)>>
121 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
124 am_indx=`expr "<<$>>am_indx" + 1`
129 # serial 40 AC_PROG_LIBTOOL
130 AC_DEFUN(AC_PROG_LIBTOOL,
131 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
133 # Save cache, so that ltconfig can load it
136 # Actually configure libtool. ac_aux_dir is where install-sh is found.
137 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
138 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
139 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
140 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
141 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
142 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
143 || AC_MSG_ERROR([libtool configure failed])
145 # Reload cache, that may have been modified by ltconfig
148 # This can be used to rebuild libtool when needed
149 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
151 # Always use our own libtool.
152 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
155 # Redirect the config.log output again, so that the ltconfig log is not
156 # clobbered by the next message.
160 AC_DEFUN(AC_LIBTOOL_SETUP,
162 AC_REQUIRE([AC_ENABLE_SHARED])dnl
163 AC_REQUIRE([AC_ENABLE_STATIC])dnl
164 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
165 AC_REQUIRE([AC_CANONICAL_HOST])dnl
166 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
167 AC_REQUIRE([AC_PROG_RANLIB])dnl
168 AC_REQUIRE([AC_PROG_CC])dnl
169 AC_REQUIRE([AC_PROG_LD])dnl
170 AC_REQUIRE([AC_PROG_NM])dnl
171 AC_REQUIRE([AC_PROG_LN_S])dnl
175 NONE) lt_target="$host" ;;
176 *) lt_target="$target" ;;
179 # Check for any special flags to pass to ltconfig.
181 # the following will cause an existing older ltconfig to fail, so
182 # we ignore this at the expense of the cache file... Checking this
183 # will just take longer ... bummer!
184 #libtool_flags="--cache-file=$cache_file"
186 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
187 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
188 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
189 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
190 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
191 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
192 [libtool_flags="$libtool_flags --enable-dlopen"])
193 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
194 [libtool_flags="$libtool_flags --enable-win32-dll"])
195 AC_ARG_ENABLE(libtool-lock,
196 [ --disable-libtool-lock avoid locking (might break parallel builds)])
197 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
198 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
200 # Some flags need to be propagated to the compiler or linker for good
204 # Find out which ABI we are using.
205 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
206 if AC_TRY_EVAL(ac_compile); then
207 case "`/usr/bin/file conftest.o`" in
223 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
224 SAVE_CFLAGS="$CFLAGS"
225 CFLAGS="$CFLAGS -belf"
226 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
227 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
228 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
229 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
230 CFLAGS="$SAVE_CFLAGS"
234 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
235 [*-*-cygwin* | *-*-mingw*)
236 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
237 AC_CHECK_TOOL(AS, as, false)
238 AC_CHECK_TOOL(OBJDUMP, objdump, false)
244 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
245 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
247 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
248 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
250 # AC_ENABLE_SHARED - implement the --enable-shared flag
251 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
252 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
254 AC_DEFUN(AC_ENABLE_SHARED, [dnl
255 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
256 AC_ARG_ENABLE(shared,
257 changequote(<<, >>)dnl
258 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
260 [p=${PACKAGE-default}
262 yes) enable_shared=yes ;;
263 no) enable_shared=no ;;
266 # Look at the argument we got. We use all the common list separators.
267 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
268 for pkg in $enableval; do
269 if test "X$pkg" = "X$p"; then
276 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
279 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
280 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
281 AC_ENABLE_SHARED(no)])
283 # AC_ENABLE_STATIC - implement the --enable-static flag
284 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
285 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
287 AC_DEFUN(AC_ENABLE_STATIC, [dnl
288 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
289 AC_ARG_ENABLE(static,
290 changequote(<<, >>)dnl
291 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
293 [p=${PACKAGE-default}
295 yes) enable_static=yes ;;
296 no) enable_static=no ;;
299 # Look at the argument we got. We use all the common list separators.
300 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
301 for pkg in $enableval; do
302 if test "X$pkg" = "X$p"; then
309 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
312 # AC_DISABLE_STATIC - set the default static flag to --disable-static
313 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
314 AC_ENABLE_STATIC(no)])
317 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
318 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
319 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
321 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
322 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
323 AC_ARG_ENABLE(fast-install,
324 changequote(<<, >>)dnl
325 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
327 [p=${PACKAGE-default}
329 yes) enable_fast_install=yes ;;
330 no) enable_fast_install=no ;;
332 enable_fast_install=no
333 # Look at the argument we got. We use all the common list separators.
334 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
335 for pkg in $enableval; do
336 if test "X$pkg" = "X$p"; then
337 enable_fast_install=yes
343 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
346 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
347 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
348 AC_ENABLE_FAST_INSTALL(no)])
350 # AC_PROG_LD - find the path to the GNU or non-GNU linker
353 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
354 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
355 AC_REQUIRE([AC_PROG_CC])dnl
356 AC_REQUIRE([AC_CANONICAL_HOST])dnl
357 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
359 if test "$ac_cv_prog_gcc" = yes; then
360 # Check if gcc -print-prog-name=ld gives a path.
361 AC_MSG_CHECKING([for ld used by GCC])
362 ac_prog=`($CC -print-prog-name=ld) 2>&5`
364 # Accept absolute paths.
366 [\\/]* | [A-Za-z]:[\\/]*)
367 re_direlt='/[^/][^/]*/\.\./'
369 # Canonicalize the path of ld
370 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
371 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
372 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
374 test -z "$LD" && LD="$ac_prog"
377 # If it fails, then pretend we aren't using GCC.
381 # If it is relative, then search for the first ld in PATH.
385 elif test "$with_gnu_ld" = yes; then
386 AC_MSG_CHECKING([for GNU ld])
388 AC_MSG_CHECKING([for non-GNU ld])
390 AC_CACHE_VAL(ac_cv_path_LD,
391 [if test -z "$LD"; then
392 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
393 for ac_dir in $PATH; do
394 test -z "$ac_dir" && ac_dir=.
395 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
396 ac_cv_path_LD="$ac_dir/$ac_prog"
397 # Check to see if the program is GNU ld. I'd rather use --version,
398 # but apparently some GNU ld's only accept -v.
399 # Break only if it was the GNU/non-GNU ld that we prefer.
400 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
401 test "$with_gnu_ld" != no && break
403 test "$with_gnu_ld" != yes && break
409 ac_cv_path_LD="$LD" # Let the user override the test with a path.
412 if test -n "$LD"; then
417 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
421 AC_DEFUN(AC_PROG_LD_GNU,
422 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
423 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
424 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
425 ac_cv_prog_gnu_ld=yes
431 # AC_PROG_NM - find the path to a BSD-compatible name lister
433 [AC_MSG_CHECKING([for BSD-compatible nm])
434 AC_CACHE_VAL(ac_cv_path_NM,
435 [if test -n "$NM"; then
436 # Let the user override the test.
439 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
440 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
441 test -z "$ac_dir" && ac_dir=.
442 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
443 # Check to see if the nm accepts a BSD-compat flag.
444 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
445 # nm: unknown option "B" ignored
446 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
447 ac_cv_path_NM="$ac_dir/nm -B"
449 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
450 ac_cv_path_NM="$ac_dir/nm -p"
453 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
454 continue # so that we can try to find one that supports BSD flags
459 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
465 # AC_CHECK_LIBM - check for math library
466 AC_DEFUN(AC_CHECK_LIBM,
467 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
470 *-*-beos* | *-*-cygwin*)
471 # These system don't have libm
474 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
475 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
478 AC_CHECK_LIB(m, main, LIBM="-lm")
483 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
484 # the libltdl convenience library, adds --enable-ltdl-convenience to
485 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
486 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
487 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
488 # '${top_builddir}/' (note the single quotes!) if your package is not
489 # flat, and, if you're not using automake, define top_builddir as
490 # appropriate in the Makefiles.
491 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
492 case "$enable_ltdl_convenience" in
493 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
494 "") enable_ltdl_convenience=yes
495 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
497 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
498 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
501 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
502 # the libltdl installable library, and adds --enable-ltdl-install to
503 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
504 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
505 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
506 # '${top_builddir}/' (note the single quotes!) if your package is not
507 # flat, and, if you're not using automake, define top_builddir as
508 # appropriate in the Makefiles.
509 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
510 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
511 AC_CHECK_LIB(ltdl, main,
512 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
513 [if test x"$enable_ltdl_install" = xno; then
514 AC_MSG_WARN([libltdl not installed, but installation disabled])
516 enable_ltdl_install=yes
519 if test x"$enable_ltdl_install" = x"yes"; then
520 ac_configure_args="$ac_configure_args --enable-ltdl-install"
521 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
522 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
524 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
531 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
532 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
533 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
534 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
535 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
536 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
537 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
539 dnl This is just to silence aclocal about the macro not being used
540 ifelse([AC_DISABLE_FAST_INSTALL])dnl