1 dnl aclocal.m4 generated automatically by aclocal 1.2
3 dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
4 AC_DEFUN(BFD_BINARY_FOPEN,
5 [AC_REQUIRE([AC_CANONICAL_SYSTEM])
8 i[345]86-*-msdos* | i[345]86-*-go32* | i[345]86-*-mingw32* | *-*-cygwin32* | *-*-windows)
10 AC_DEFINE(USE_BINARY_FOPEN) ;;
13 dnl Get a default for CC_FOR_BUILD to put into Makefile.
14 AC_DEFUN(BFD_CC_FOR_BUILD,
15 [# Put a plausible default for CC_FOR_BUILD in Makefile.
16 if test -z "$CC_FOR_BUILD"; then
17 if test "x$cross_compiling" = "xno"; then
23 AC_SUBST(CC_FOR_BUILD)
24 # Also set EXEEXT_FOR_BUILD.
25 if test "x$cross_compiling" = "xno"; then
26 EXEEXT_FOR_BUILD='$(EXEEXT)'
28 AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
29 [cat > ac_c_test.c << 'EOF'
31 /* Nothing needed here */
34 ${CC_FOR_BUILD} -o ac_c_test am_c_test.c 1>&5 2>&5
35 bfd_cv_build_exeext=`echo ac_c_test.* | grep -v ac_c_test.c | sed -e s/ac_c_test//`
37 test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
39 test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
41 AC_SUBST(EXEEXT_FOR_BUILD)])dnl
43 dnl See whether we need a declaration for a function.
44 AC_DEFUN(BFD_NEED_DECLARATION,
45 [AC_MSG_CHECKING([whether $1 must be declared])
46 AC_CACHE_VAL(bfd_cv_decl_needed_$1,
62 [char *(*pfn) = (char *(*)) $1],
63 bfd_cv_decl_needed_$1=no, bfd_cv_decl_needed_$1=yes)])
64 AC_MSG_RESULT($bfd_cv_decl_needed_$1)
65 if test $bfd_cv_decl_needed_$1 = yes; then
66 bfd_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
67 AC_DEFINE_UNQUOTED($bfd_tr_decl)
71 # Do all the work for Automake. This macro actually does too much --
72 # some checks are only needed if your package does certain things.
73 # But this isn't really a big deal.
78 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
80 AC_DEFUN(AM_INIT_AUTOMAKE,
81 [AC_REQUIRE([AM_PROG_INSTALL])
86 dnl test to see if srcdir already configured
87 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
88 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
91 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
92 AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
95 dnl FIXME This is truly gross.
96 missing_dir=`cd $ac_aux_dir && pwd`
97 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
98 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
99 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
100 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
101 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
107 AC_DEFUN(AM_PROG_INSTALL,
108 [AC_REQUIRE([AC_PROG_INSTALL])
109 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
110 AC_SUBST(INSTALL_SCRIPT)dnl
114 # Check to make sure that the build environment is sane.
117 AC_DEFUN(AM_SANITY_CHECK,
118 [AC_MSG_CHECKING([whether build environment is sane])
121 echo timestamp > conftestfile
122 # Do `set' in a subshell so we don't clobber the current shell's
123 # arguments. Must try -L first in case configure is actually a
124 # symlink; some systems play weird games with the mod time of symlinks
125 # (eg FreeBSD returns the mod time of the symlink's containing
128 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
129 if test "$@" = "X"; then
131 set X `ls -t $srcdir/configure conftestfile`
133 test "[$]2" = conftestfile
139 AC_MSG_ERROR([newly created file is older than distributed files!
140 Check your system clock])
145 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
146 dnl The program must properly implement --version.
147 AC_DEFUN(AM_MISSING_PROG,
148 [AC_MSG_CHECKING(for working $2)
149 # Run test in a subshell; some versions of sh will print an error if
150 # an executable is not found, even if stderr is redirected.
151 # Redirect stdin to placate older versions of autoconf. Sigh.
152 if ($2 --version) < /dev/null > /dev/null 2>&1; then
157 AC_MSG_RESULT(missing)
162 # serial 18 AM_PROG_LIBTOOL
163 AC_DEFUN(AM_PROG_LIBTOOL,
164 [AC_REQUIRE([AC_CANONICAL_HOST])
165 AC_REQUIRE([AC_PROG_RANLIB])
166 AC_REQUIRE([AC_PROG_CC])
167 AC_REQUIRE([AM_PROG_LD])
168 AC_REQUIRE([AM_PROG_NM])
169 AC_REQUIRE([AC_PROG_LN_S])
171 # Always use our own libtool.
172 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
175 dnl CYGNUS LOCAL arguments to enable-shared
176 dnl Allow the --disable-shared flag to stop us from building shared libs.
177 AC_ARG_ENABLE(shared,
178 [ --enable-shared build shared libraries [default=yes]],
179 [p=${PACKAGE-bogus-package-name}
181 yes) libtool_enable_shared=yes ;;
182 no) libtool_enable_shared=no ;;
183 # The value of $p (aka $PACKAGE) is assumed to come from AM_INIT_AUTOMAKE.
184 # If it didn't, it'll be `bogus-package-name', thus making this condition
186 *$p*) libtool_enable_shared=yes ;;
187 *) libtool_enable_shared=no ;;
189 test -n "$libtool_enable_shared" && enable_shared="$libtool_enable_shared"
191 test "$enable_shared" = no && libtool_shared=" --disable-shared"
194 dnl Allow the --disable-static flag to stop us from building static libs.
195 AC_ARG_ENABLE(static,
196 [ --enable-static build static libraries [default=yes]],
197 [if test "$enableval" = no; then
198 libtool_enable_static=no
200 libtool_enable_static=yes
202 test -n "$libtool_enable_static" && enable_static="$libtool_enable_static"
204 test "$enable_static" = no && libtool_static=" --disable-static"
206 libtool_flags="$libtool_shared$libtool_static"
207 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
208 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
209 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
211 # Some flags need to be propagated to the compiler or linker for good
215 ac_save_CFLAGS="$CFLAGS"
217 for f in -32 -64 -n32 ABI -cckr -mips1 -mips2 -mips3 -mips4; do
220 test -n "$SGI_ABI" && flag_passed=yes
221 if test "$flag_passed" = no && test "$ac_cv_prog_gcc" = yes; then
222 # Choose the ABI flag according to GCC's specs.
223 if $CC -dumpspecs 2>&1 | sed '/^\*link:$/,/^$/!d' | egrep -e '[ ]-32' >/dev/null; then
232 if echo " $CC $CFLAGS " | egrep -e "[ ]$f[ ]" > /dev/null; then
239 CFLAGS="$ac_save_CFLAGS"
243 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
244 CFLAGS="$CFLAGS -belf"
248 # Actually configure libtool. ac_aux_dir is where install-sh is found.
249 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
250 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
251 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
252 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
253 || AC_MSG_ERROR([libtool configure failed])
256 # AM_PROG_LD - find the path to the GNU or non-GNU linker
259 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
260 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
261 AC_REQUIRE([AC_PROG_CC])
263 if test "$ac_cv_prog_gcc" = yes; then
264 # Check if gcc -print-prog-name=ld gives a path.
265 AC_MSG_CHECKING([for ld used by GCC])
266 ac_prog=`($CC -print-prog-name=ld) 2>&5`
268 # Accept absolute paths.
270 test -z "$LD" && LD="$ac_prog"
273 # If it fails, then pretend we aren't using GCC.
277 # If it is relative, then search for the first ld in PATH.
281 elif test "$with_gnu_ld" = yes; then
282 AC_MSG_CHECKING([for GNU ld])
284 AC_MSG_CHECKING([for non-GNU ld])
286 AC_CACHE_VAL(ac_cv_path_LD,
287 [if test -z "$LD"; then
288 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
289 for ac_dir in $PATH; do
290 test -z "$ac_dir" && ac_dir=.
291 if test -f "$ac_dir/$ac_prog"; then
292 ac_cv_path_LD="$ac_dir/$ac_prog"
293 # Check to see if the program is GNU ld. I'd rather use --version,
294 # but apparently some GNU ld's only accept -v.
295 # Break only if it was the GNU/non-GNU ld that we prefer.
296 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
297 test "$with_gnu_ld" != no && break
299 test "$with_gnu_ld" != yes && break
305 ac_cv_path_LD="$LD" # Let the user override the test with a path.
308 if test -n "$LD"; then
313 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
318 AC_DEFUN(AM_PROG_LD_GNU,
319 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
320 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
321 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
322 ac_cv_prog_gnu_ld=yes
328 # AM_PROG_NM - find the path to a BSD-compatible name lister
330 [AC_MSG_CHECKING([for BSD-compatible nm])
331 AC_CACHE_VAL(ac_cv_path_NM,
334 ac_cv_path_NM="$NM" # Let the user override the test with a path.
337 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
338 for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
339 test -z "$ac_dir" && dir=.
340 if test -f $ac_dir/nm; then
341 # Check to see if the nm accepts a BSD-compat flag.
342 # Adding the `sed 1!d' prevents false positives on HP-UX, which says:
343 # nm: unknown option "B" ignored
344 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1!d'; exit 0) | egrep /dev/null >/dev/null; then
345 ac_cv_path_NM="$ac_dir/nm -B"
346 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1!d'; exit 0) | egrep /dev/null >/dev/null; then
347 ac_cv_path_NM="$ac_dir/nm -p"
349 ac_cv_path_NM="$ac_dir/nm"
355 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
363 # Like AC_CONFIG_HEADER, but automatically create stamp file.
365 AC_DEFUN(AM_CONFIG_HEADER,
367 AC_CONFIG_HEADER([$1])
368 dnl When config.status generates a header, we must update the stamp-h file.
369 dnl This file resides in the same directory as the config header
370 dnl that is generated. We must strip everything past the first ":",
371 dnl and everything past the last "/".
372 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
373 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
374 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
376 for am_file in <<$1>>; do
377 case " <<$>>CONFIG_HEADERS " in
378 *" <<$>>am_file "*<<)>>
379 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
382 am_indx=`expr "<<$>>am_indx" + 1`
386 # Add --enable-maintainer-mode option to configure.
391 AC_DEFUN(AM_MAINTAINER_MODE,
392 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
393 dnl maintainer-mode is disabled by default
394 AC_ARG_ENABLE(maintainer-mode,
395 [ --enable-maintainer-mode enable make rules and dependencies not useful
396 (and sometimes confusing) to the casual installer],
397 USE_MAINTAINER_MODE=$enableval,
398 USE_MAINTAINER_MODE=no)
399 AC_MSG_RESULT($USE_MAINTAINER_MODE)
400 if test $USE_MAINTAINER_MODE = yes; then
409 # Check to see if we're running under Cygwin32, without using
410 # AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes".
411 # Otherwise set it to "no".
414 AC_DEFUN(AM_CYGWIN32,
415 [AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
416 [AC_TRY_COMPILE(,[return __CYGWIN32__;],
417 am_cv_cygwin32=yes, am_cv_cygwin32=no)
420 test "$am_cv_cygwin32" = yes && CYGWIN32=yes])
422 # Check to see if we're running under Win32, without using
423 # AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe".
424 # Otherwise set it to "".
427 dnl This knows we add .exe if we're building in the Cygwin32
428 dnl environment. But if we're not, then it compiles a test program
429 dnl to see if there is a suffix for executables.
431 [AC_REQUIRE([AM_CYGWIN32])
432 AC_REQUIRE([AM_MINGW32])
433 AC_MSG_CHECKING([for executable suffix])
434 AC_CACHE_VAL(am_cv_exeext,[
435 if test "$CYGWIN32" = yes -o "$MINGW32" = yes; then
438 cat > am_c_test.c << 'EOF'
440 /* Nothing needed here */
443 ${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
444 am_cv_exeext=`echo am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
446 test x"${am_cv_exeext}" = x && am_cv_exeext=no
449 test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
450 AC_MSG_RESULT(${am_cv_exeext})
453 # Check to see if we're running under Mingw, without using
454 # AC_CANONICAL_*. If so, set output variable MINGW32 to "yes".
455 # Otherwise set it to "no".
459 [AC_CACHE_CHECK(for Mingw32 environment, am_cv_mingw32,
460 [AC_TRY_COMPILE(,[return __MINGW32__;],
461 am_cv_mingw32=yes, am_cv_mingw32=no)
464 test "$am_cv_mingw32" = yes && MINGW32=yes])