1 dnl aclocal.m4 generated automatically by aclocal 1.2e
3 dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
4 dnl This Makefile.in 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 sinclude(../bfd/acinclude.m4)
15 # Do all the work for Automake. This macro actually does too much --
16 # some checks are only needed if your package does certain things.
17 # But this isn't really a big deal.
22 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
24 AC_DEFUN(AM_INIT_AUTOMAKE,
25 [AC_REQUIRE([AM_PROG_INSTALL])
30 dnl test to see if srcdir already configured
31 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
32 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
35 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
36 AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
37 AC_REQUIRE([AM_SANITY_CHECK])
38 AC_REQUIRE([AC_ARG_PROGRAM])
39 dnl FIXME This is truly gross.
40 missing_dir=`cd $ac_aux_dir && pwd`
41 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
42 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
43 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
44 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
45 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
46 AC_REQUIRE([AC_PROG_MAKE_SET])])
51 AC_DEFUN(AM_PROG_INSTALL,
52 [AC_REQUIRE([AC_PROG_INSTALL])
53 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
54 AC_SUBST(INSTALL_SCRIPT)dnl
58 # Check to make sure that the build environment is sane.
61 AC_DEFUN(AM_SANITY_CHECK,
62 [AC_MSG_CHECKING([whether build environment is sane])
65 echo timestamp > conftestfile
66 # Do `set' in a subshell so we don't clobber the current shell's
67 # arguments. Must try -L first in case configure is actually a
68 # symlink; some systems play weird games with the mod time of symlinks
69 # (eg FreeBSD returns the mod time of the symlink's containing
72 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
73 if test "[$]*" = "X"; then
75 set X `ls -t $srcdir/configure conftestfile`
77 if test "[$]*" != "X $srcdir/configure conftestfile" \
78 && test "[$]*" != "X conftestfile $srcdir/configure"; then
80 # If neither matched, then we have a broken ls. This can happen
81 # if, for instance, CONFIG_SHELL is bash and it inherits a
82 # broken ls alias from the environment. This has actually
83 # happened. Such a system could not be considered "sane".
84 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
85 alias in your environment])
88 test "[$]2" = conftestfile
94 AC_MSG_ERROR([newly created file is older than distributed files!
95 Check your system clock])
100 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
101 dnl The program must properly implement --version.
102 AC_DEFUN(AM_MISSING_PROG,
103 [AC_MSG_CHECKING(for working $2)
104 # Run test in a subshell; some versions of sh will print an error if
105 # an executable is not found, even if stderr is redirected.
106 # Redirect stdin to placate older versions of autoconf. Sigh.
107 if ($2 --version) < /dev/null > /dev/null 2>&1; then
112 AC_MSG_RESULT(missing)
117 # serial 24 AM_PROG_LIBTOOL
118 AC_DEFUN(AM_PROG_LIBTOOL,
119 [AC_REQUIRE([AM_ENABLE_SHARED])dnl
120 AC_REQUIRE([AM_ENABLE_STATIC])dnl
121 AC_REQUIRE([AC_CANONICAL_HOST])dnl
122 AC_REQUIRE([AC_PROG_RANLIB])dnl
123 AC_REQUIRE([AC_PROG_CC])dnl
124 AC_REQUIRE([AM_PROG_LD])dnl
125 AC_REQUIRE([AM_PROG_NM])dnl
126 AC_REQUIRE([AC_PROG_LN_S])dnl
128 # Always use our own libtool.
129 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
132 # Check for any special flags to pass to ltconfig.
134 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
135 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
136 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
137 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
138 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
140 # Some flags need to be propagated to the compiler or linker for good
144 # Find out which ABI we are using.
145 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
146 if AC_TRY_EVAL(ac_compile); then
147 case "`/usr/bin/file conftest.o`" in
163 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
164 CFLAGS="$CFLAGS -belf"
168 # Actually configure libtool. ac_aux_dir is where install-sh is found.
169 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
170 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
171 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
172 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
173 || AC_MSG_ERROR([libtool configure failed])
176 # AM_ENABLE_SHARED - implement the --enable-shared flag
177 # Usage: AM_ENABLE_SHARED[(DEFAULT)]
178 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
180 AC_DEFUN(AM_ENABLE_SHARED,
181 [define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
182 AC_ARG_ENABLE(shared,
183 changequote(<<, >>)dnl
184 << --enable-shared build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT]
186 [ --enable-shared=PKGS only build shared libraries if the current package
187 appears as an element in the PKGS list],
188 [p=${PACKAGE-default}
190 yes) enable_shared=yes ;;
191 no) enable_shared=no ;;
194 # Look at the argument we got. We use all the common list separators.
195 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
196 for pkg in $enableval; do
197 if test "X$pkg" = "X$p"; then
204 enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
207 # AM_DISABLE_SHARED - set the default shared flag to --disable-shared
208 AC_DEFUN(AM_DISABLE_SHARED,
209 [AM_ENABLE_SHARED(no)])
211 # AM_DISABLE_STATIC - set the default static flag to --disable-static
212 AC_DEFUN(AM_DISABLE_STATIC,
213 [AM_ENABLE_STATIC(no)])
215 # AM_ENABLE_STATIC - implement the --enable-static flag
216 # Usage: AM_ENABLE_STATIC[(DEFAULT)]
217 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
219 AC_DEFUN(AM_ENABLE_STATIC,
220 [define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
221 AC_ARG_ENABLE(static,
222 changequote(<<, >>)dnl
223 << --enable-static build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT]
225 [ --enable-static=PKGS only build shared libraries if the current package
226 appears as an element in the PKGS list],
227 [p=${PACKAGE-default}
229 yes) enable_static=yes ;;
230 no) enable_static=no ;;
233 # Look at the argument we got. We use all the common list separators.
234 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
235 for pkg in $enableval; do
236 if test "X$pkg" = "X$p"; then
243 enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
247 # AM_PROG_LD - find the path to the GNU or non-GNU linker
250 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
251 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
252 AC_REQUIRE([AC_PROG_CC])
254 if test "$ac_cv_prog_gcc" = yes; then
255 # Check if gcc -print-prog-name=ld gives a path.
256 AC_MSG_CHECKING([for ld used by GCC])
257 ac_prog=`($CC -print-prog-name=ld) 2>&5`
259 # Accept absolute paths.
261 test -z "$LD" && LD="$ac_prog"
264 # If it fails, then pretend we aren't using GCC.
268 # If it is relative, then search for the first ld in PATH.
272 elif test "$with_gnu_ld" = yes; then
273 AC_MSG_CHECKING([for GNU ld])
275 AC_MSG_CHECKING([for non-GNU ld])
277 AC_CACHE_VAL(ac_cv_path_LD,
278 [if test -z "$LD"; then
279 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
280 for ac_dir in $PATH; do
281 test -z "$ac_dir" && ac_dir=.
282 if test -f "$ac_dir/$ac_prog"; then
283 ac_cv_path_LD="$ac_dir/$ac_prog"
284 # Check to see if the program is GNU ld. I'd rather use --version,
285 # but apparently some GNU ld's only accept -v.
286 # Break only if it was the GNU/non-GNU ld that we prefer.
287 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
288 test "$with_gnu_ld" != no && break
290 test "$with_gnu_ld" != yes && break
296 ac_cv_path_LD="$LD" # Let the user override the test with a path.
299 if test -n "$LD"; then
304 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
309 AC_DEFUN(AM_PROG_LD_GNU,
310 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
311 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
312 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
313 ac_cv_prog_gnu_ld=yes
319 # AM_PROG_NM - find the path to a BSD-compatible name lister
321 [AC_MSG_CHECKING([for BSD-compatible nm])
322 AC_CACHE_VAL(ac_cv_path_NM,
325 ac_cv_path_NM="$NM" # Let the user override the test with a path.
328 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
329 for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
330 test -z "$ac_dir" && ac_dir=.
331 if test -f $ac_dir/nm; then
332 # Check to see if the nm accepts a BSD-compat flag.
333 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
334 # nm: unknown option "B" ignored
335 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
336 ac_cv_path_NM="$ac_dir/nm -B"
337 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
338 ac_cv_path_NM="$ac_dir/nm -p"
340 ac_cv_path_NM="$ac_dir/nm"
346 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
354 # Like AC_CONFIG_HEADER, but automatically create stamp file.
356 AC_DEFUN(AM_CONFIG_HEADER,
358 AC_CONFIG_HEADER([$1])
359 dnl When config.status generates a header, we must update the stamp-h file.
360 dnl This file resides in the same directory as the config header
361 dnl that is generated. We must strip everything past the first ":",
362 dnl and everything past the last "/".
363 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
364 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
365 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
367 for am_file in <<$1>>; do
368 case " <<$>>CONFIG_HEADERS " in
369 *" <<$>>am_file "*<<)>>
370 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
373 am_indx=`expr "<<$>>am_indx" + 1`
377 # Add --enable-maintainer-mode option to configure.
382 AC_DEFUN(AM_MAINTAINER_MODE,
383 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
384 dnl maintainer-mode is disabled by default
385 AC_ARG_ENABLE(maintainer-mode,
386 [ --enable-maintainer-mode enable make rules and dependencies not useful
387 (and sometimes confusing) to the casual installer],
388 USE_MAINTAINER_MODE=$enableval,
389 USE_MAINTAINER_MODE=no)
390 AC_MSG_RESULT($USE_MAINTAINER_MODE)
391 if test $USE_MAINTAINER_MODE = yes; then
400 # Check to see if we're running under Cygwin32, without using
401 # AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes".
402 # Otherwise set it to "no".
405 AC_DEFUN(AM_CYGWIN32,
406 [AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
407 [AC_TRY_COMPILE(,[return __CYGWIN32__;],
408 am_cv_cygwin32=yes, am_cv_cygwin32=no)
411 test "$am_cv_cygwin32" = yes && CYGWIN32=yes])
413 # Check to see if we're running under Win32, without using
414 # AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe".
415 # Otherwise set it to "".
418 dnl This knows we add .exe if we're building in the Cygwin32
419 dnl environment. But if we're not, then it compiles a test program
420 dnl to see if there is a suffix for executables.
422 [AC_REQUIRE([AM_CYGWIN32])
423 AC_REQUIRE([AM_MINGW32])
424 AC_MSG_CHECKING([for executable suffix])
425 AC_CACHE_VAL(am_cv_exeext,
426 [if test "$CYGWIN32" = yes || test "$MINGW32" = yes; then
429 cat > am_c_test.c << 'EOF'
431 /* Nothing needed here */
434 ${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
435 am_cv_exeext=`echo am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
437 test x"${am_cv_exeext}" = x && am_cv_exeext=no
440 test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
441 AC_MSG_RESULT(${am_cv_exeext})
444 # Check to see if we're running under Mingw, without using
445 # AC_CANONICAL_*. If so, set output variable MINGW32 to "yes".
446 # Otherwise set it to "no".
450 [AC_CACHE_CHECK(for Mingw32 environment, am_cv_mingw32,
451 [AC_TRY_COMPILE(,[return __MINGW32__;],
452 am_cv_mingw32=yes, am_cv_mingw32=no)
455 test "$am_cv_mingw32" = yes && MINGW32=yes])