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 24 AM_PROG_LIBTOOL
107 AC_DEFUN(AM_PROG_LIBTOOL,
108 [AC_REQUIRE([AM_ENABLE_SHARED])dnl
109 AC_REQUIRE([AM_ENABLE_STATIC])dnl
110 AC_REQUIRE([AC_CANONICAL_HOST])dnl
111 AC_REQUIRE([AC_PROG_RANLIB])dnl
112 AC_REQUIRE([AC_PROG_CC])dnl
113 AC_REQUIRE([AM_PROG_LD])dnl
114 AC_REQUIRE([AM_PROG_NM])dnl
115 AC_REQUIRE([AC_PROG_LN_S])dnl
117 # Always use our own libtool.
118 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
121 # Check for any special flags to pass to ltconfig.
123 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
124 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
125 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
126 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
127 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
129 # Some flags need to be propagated to the compiler or linker for good
133 # Find out which ABI we are using.
134 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
135 if AC_TRY_EVAL(ac_compile); then
136 case "`/usr/bin/file conftest.o`" in
152 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
153 CFLAGS="$CFLAGS -belf"
157 # Actually configure libtool. ac_aux_dir is where install-sh is found.
158 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
159 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
160 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
161 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
162 || AC_MSG_ERROR([libtool configure failed])
165 # AM_ENABLE_SHARED - implement the --enable-shared flag
166 # Usage: AM_ENABLE_SHARED[(DEFAULT)]
167 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
169 AC_DEFUN(AM_ENABLE_SHARED,
170 [define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
171 AC_ARG_ENABLE(shared,
172 changequote(<<, >>)dnl
173 << --enable-shared build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT]
175 [ --enable-shared=PKGS only build shared libraries if the current package
176 appears as an element in the PKGS list],
177 [p=${PACKAGE-default}
179 yes) enable_shared=yes ;;
180 no) enable_shared=no ;;
183 # Look at the argument we got. We use all the common list separators.
184 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
185 for pkg in $enableval; do
186 if test "X$pkg" = "X$p"; then
193 enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
196 # AM_DISABLE_SHARED - set the default shared flag to --disable-shared
197 AC_DEFUN(AM_DISABLE_SHARED,
198 [AM_ENABLE_SHARED(no)])
200 # AM_DISABLE_STATIC - set the default static flag to --disable-static
201 AC_DEFUN(AM_DISABLE_STATIC,
202 [AM_ENABLE_STATIC(no)])
204 # AM_ENABLE_STATIC - implement the --enable-static flag
205 # Usage: AM_ENABLE_STATIC[(DEFAULT)]
206 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
208 AC_DEFUN(AM_ENABLE_STATIC,
209 [define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
210 AC_ARG_ENABLE(static,
211 changequote(<<, >>)dnl
212 << --enable-static build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT]
214 [ --enable-static=PKGS only build shared libraries if the current package
215 appears as an element in the PKGS list],
216 [p=${PACKAGE-default}
218 yes) enable_static=yes ;;
219 no) enable_static=no ;;
222 # Look at the argument we got. We use all the common list separators.
223 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
224 for pkg in $enableval; do
225 if test "X$pkg" = "X$p"; then
232 enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
236 # AM_PROG_LD - find the path to the GNU or non-GNU linker
239 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
240 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
241 AC_REQUIRE([AC_PROG_CC])
243 if test "$ac_cv_prog_gcc" = yes; then
244 # Check if gcc -print-prog-name=ld gives a path.
245 AC_MSG_CHECKING([for ld used by GCC])
246 ac_prog=`($CC -print-prog-name=ld) 2>&5`
248 # Accept absolute paths.
250 test -z "$LD" && LD="$ac_prog"
253 # If it fails, then pretend we aren't using GCC.
257 # If it is relative, then search for the first ld in PATH.
261 elif test "$with_gnu_ld" = yes; then
262 AC_MSG_CHECKING([for GNU ld])
264 AC_MSG_CHECKING([for non-GNU ld])
266 AC_CACHE_VAL(ac_cv_path_LD,
267 [if test -z "$LD"; then
268 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
269 for ac_dir in $PATH; do
270 test -z "$ac_dir" && ac_dir=.
271 if test -f "$ac_dir/$ac_prog"; then
272 ac_cv_path_LD="$ac_dir/$ac_prog"
273 # Check to see if the program is GNU ld. I'd rather use --version,
274 # but apparently some GNU ld's only accept -v.
275 # Break only if it was the GNU/non-GNU ld that we prefer.
276 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
277 test "$with_gnu_ld" != no && break
279 test "$with_gnu_ld" != yes && break
285 ac_cv_path_LD="$LD" # Let the user override the test with a path.
288 if test -n "$LD"; then
293 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
298 AC_DEFUN(AM_PROG_LD_GNU,
299 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
300 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
301 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
302 ac_cv_prog_gnu_ld=yes
308 # AM_PROG_NM - find the path to a BSD-compatible name lister
310 [AC_MSG_CHECKING([for BSD-compatible nm])
311 AC_CACHE_VAL(ac_cv_path_NM,
314 ac_cv_path_NM="$NM" # Let the user override the test with a path.
317 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
318 for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
319 test -z "$ac_dir" && ac_dir=.
320 if test -f $ac_dir/nm; then
321 # Check to see if the nm accepts a BSD-compat flag.
322 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
323 # nm: unknown option "B" ignored
324 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
325 ac_cv_path_NM="$ac_dir/nm -B"
326 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
327 ac_cv_path_NM="$ac_dir/nm -p"
329 ac_cv_path_NM="$ac_dir/nm"
335 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
343 # Like AC_CONFIG_HEADER, but automatically create stamp file.
345 AC_DEFUN(AM_CONFIG_HEADER,
347 AC_CONFIG_HEADER([$1])
348 dnl When config.status generates a header, we must update the stamp-h file.
349 dnl This file resides in the same directory as the config header
350 dnl that is generated. We must strip everything past the first ":",
351 dnl and everything past the last "/".
352 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
353 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
354 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
356 for am_file in <<$1>>; do
357 case " <<$>>CONFIG_HEADERS " in
358 *" <<$>>am_file "*<<)>>
359 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
362 am_indx=`expr "<<$>>am_indx" + 1`