aclocal.m4 revision 38889
1dnl aclocal.m4 generated automatically by aclocal 1.2e
2
3dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
4dnl This Makefile.in is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8dnl This program is distributed in the hope that it will be useful,
9dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11dnl PARTICULAR PURPOSE.
12
13dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
14AC_DEFUN(BFD_BINARY_FOPEN,
15[AC_REQUIRE([AC_CANONICAL_SYSTEM])
16case "${host}" in
17changequote(,)dnl
18i[345]86-*-msdos* | i[345]86-*-go32* | i[345]86-*-mingw32* | *-*-cygwin32* | *-*-windows)
19changequote([,])dnl
20  AC_DEFINE(USE_BINARY_FOPEN) ;;
21esac])dnl
22
23dnl Get a default for CC_FOR_BUILD to put into Makefile.
24AC_DEFUN(BFD_CC_FOR_BUILD,
25[# Put a plausible default for CC_FOR_BUILD in Makefile.
26if test -z "$CC_FOR_BUILD"; then
27  if test "x$cross_compiling" = "xno"; then
28    CC_FOR_BUILD='$(CC)'
29  else
30    CC_FOR_BUILD=gcc
31  fi
32fi
33AC_SUBST(CC_FOR_BUILD)
34# Also set EXEEXT_FOR_BUILD.
35if test "x$cross_compiling" = "xno"; then
36  EXEEXT_FOR_BUILD='$(EXEEXT)'
37else
38  AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
39    [cat > ac_c_test.c << 'EOF'
40int main() {
41/* Nothing needed here */
42}
43EOF
44    ${CC_FOR_BUILD} -o ac_c_test am_c_test.c 1>&5 2>&5
45    bfd_cv_build_exeext=`echo ac_c_test.* | grep -v ac_c_test.c | sed -e s/ac_c_test//`
46    rm -f ac_c_test*
47    test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
48  EXEEXT_FOR_BUILD=""
49  test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
50fi
51AC_SUBST(EXEEXT_FOR_BUILD)])dnl
52
53dnl See whether we need a declaration for a function.
54AC_DEFUN(BFD_NEED_DECLARATION,
55[AC_MSG_CHECKING([whether $1 must be declared])
56AC_CACHE_VAL(bfd_cv_decl_needed_$1,
57[AC_TRY_COMPILE([
58#include <stdio.h>
59#ifdef HAVE_STRING_H
60#include <string.h>
61#else
62#ifdef HAVE_STRINGS_H
63#include <strings.h>
64#endif
65#endif
66#ifdef HAVE_STDLIB_H
67#include <stdlib.h>
68#endif
69#ifdef HAVE_UNISTD_H
70#include <unistd.h>
71#endif],
72[char *(*pfn) = (char *(*)) $1],
73bfd_cv_decl_needed_$1=no, bfd_cv_decl_needed_$1=yes)])
74AC_MSG_RESULT($bfd_cv_decl_needed_$1)
75if test $bfd_cv_decl_needed_$1 = yes; then
76  bfd_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
77  AC_DEFINE_UNQUOTED($bfd_tr_decl)
78fi
79])dnl
80
81# Do all the work for Automake.  This macro actually does too much --
82# some checks are only needed if your package does certain things.
83# But this isn't really a big deal.
84
85# serial 1
86
87dnl Usage:
88dnl AM_INIT_AUTOMAKE(package,version, [no-define])
89
90AC_DEFUN(AM_INIT_AUTOMAKE,
91[AC_REQUIRE([AM_PROG_INSTALL])
92PACKAGE=[$1]
93AC_SUBST(PACKAGE)
94VERSION=[$2]
95AC_SUBST(VERSION)
96dnl test to see if srcdir already configured
97if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
98  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
99fi
100ifelse([$3],,
101AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
102AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
103AC_REQUIRE([AM_SANITY_CHECK])
104AC_REQUIRE([AC_ARG_PROGRAM])
105dnl FIXME This is truly gross.
106missing_dir=`cd $ac_aux_dir && pwd`
107AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
108AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
109AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
110AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
111AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
112AC_REQUIRE([AC_PROG_MAKE_SET])])
113
114
115# serial 1
116
117AC_DEFUN(AM_PROG_INSTALL,
118[AC_REQUIRE([AC_PROG_INSTALL])
119test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
120AC_SUBST(INSTALL_SCRIPT)dnl
121])
122
123#
124# Check to make sure that the build environment is sane.
125#
126
127AC_DEFUN(AM_SANITY_CHECK,
128[AC_MSG_CHECKING([whether build environment is sane])
129# Just in case
130sleep 1
131echo timestamp > conftestfile
132# Do `set' in a subshell so we don't clobber the current shell's
133# arguments.  Must try -L first in case configure is actually a
134# symlink; some systems play weird games with the mod time of symlinks
135# (eg FreeBSD returns the mod time of the symlink's containing
136# directory).
137if (
138   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
139   if test "[$]*" = "X"; then
140      # -L didn't work.
141      set X `ls -t $srcdir/configure conftestfile`
142   fi
143   if test "[$]*" != "X $srcdir/configure conftestfile" \
144      && test "[$]*" != "X conftestfile $srcdir/configure"; then
145
146      # If neither matched, then we have a broken ls.  This can happen
147      # if, for instance, CONFIG_SHELL is bash and it inherits a
148      # broken ls alias from the environment.  This has actually
149      # happened.  Such a system could not be considered "sane".
150      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
151alias in your environment])
152   fi
153
154   test "[$]2" = conftestfile
155   )
156then
157   # Ok.
158   :
159else
160   AC_MSG_ERROR([newly created file is older than distributed files!
161Check your system clock])
162fi
163rm -f conftest*
164AC_MSG_RESULT(yes)])
165
166dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
167dnl The program must properly implement --version.
168AC_DEFUN(AM_MISSING_PROG,
169[AC_MSG_CHECKING(for working $2)
170# Run test in a subshell; some versions of sh will print an error if
171# an executable is not found, even if stderr is redirected.
172# Redirect stdin to placate older versions of autoconf.  Sigh.
173if ($2 --version) < /dev/null > /dev/null 2>&1; then
174   $1=$2
175   AC_MSG_RESULT(found)
176else
177   $1="$3/missing $2"
178   AC_MSG_RESULT(missing)
179fi
180AC_SUBST($1)])
181
182
183# serial 24 AM_PROG_LIBTOOL
184AC_DEFUN(AM_PROG_LIBTOOL,
185[AC_REQUIRE([AM_ENABLE_SHARED])dnl
186AC_REQUIRE([AM_ENABLE_STATIC])dnl
187AC_REQUIRE([AC_CANONICAL_HOST])dnl
188AC_REQUIRE([AC_PROG_RANLIB])dnl
189AC_REQUIRE([AC_PROG_CC])dnl
190AC_REQUIRE([AM_PROG_LD])dnl
191AC_REQUIRE([AM_PROG_NM])dnl
192AC_REQUIRE([AC_PROG_LN_S])dnl
193dnl
194# Always use our own libtool.
195LIBTOOL='$(SHELL) $(top_builddir)/libtool'
196AC_SUBST(LIBTOOL)dnl
197
198# Check for any special flags to pass to ltconfig.
199libtool_flags=
200test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
201test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
202test "$silent" = yes && libtool_flags="$libtool_flags --silent"
203test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
204test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
205
206# Some flags need to be propagated to the compiler or linker for good
207# libtool support.
208case "$host" in
209*-*-irix6*)
210  # Find out which ABI we are using.
211  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
212  if AC_TRY_EVAL(ac_compile); then
213    case "`/usr/bin/file conftest.o`" in
214    *32-bit*)
215      LD="${LD-ld} -32"
216      ;;
217    *N32*)
218      LD="${LD-ld} -n32"
219      ;;
220    *64-bit*)
221      LD="${LD-ld} -64"
222      ;;
223    esac
224  fi
225  rm -rf conftest*
226  ;;
227
228*-*-sco3.2v5*)
229  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
230  CFLAGS="$CFLAGS -belf"
231  ;;
232esac
233
234# Actually configure libtool.  ac_aux_dir is where install-sh is found.
235CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
236LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
237${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
238$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
239|| AC_MSG_ERROR([libtool configure failed])
240])
241
242# AM_ENABLE_SHARED - implement the --enable-shared flag
243# Usage: AM_ENABLE_SHARED[(DEFAULT)]
244#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
245#   `yes'.
246AC_DEFUN(AM_ENABLE_SHARED,
247[define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
248AC_ARG_ENABLE(shared,
249changequote(<<, >>)dnl
250<<  --enable-shared         build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT]
251changequote([, ])dnl
252[  --enable-shared=PKGS    only build shared libraries if the current package
253                          appears as an element in the PKGS list],
254[p=${PACKAGE-default}
255case "$enableval" in
256yes) enable_shared=yes ;;
257no) enable_shared=no ;;
258*)
259  enable_shared=no
260  # Look at the argument we got.  We use all the common list separators.
261  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
262  for pkg in $enableval; do
263    if test "X$pkg" = "X$p"; then
264      enable_shared=yes
265    fi
266  done
267  IFS="$ac_save_ifs"
268  ;;
269esac],
270enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
271])
272
273# AM_DISABLE_SHARED - set the default shared flag to --disable-shared
274AC_DEFUN(AM_DISABLE_SHARED,
275[AM_ENABLE_SHARED(no)])
276
277# AM_DISABLE_STATIC - set the default static flag to --disable-static
278AC_DEFUN(AM_DISABLE_STATIC,
279[AM_ENABLE_STATIC(no)])
280
281# AM_ENABLE_STATIC - implement the --enable-static flag
282# Usage: AM_ENABLE_STATIC[(DEFAULT)]
283#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
284#   `yes'.
285AC_DEFUN(AM_ENABLE_STATIC,
286[define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
287AC_ARG_ENABLE(static,
288changequote(<<, >>)dnl
289<<  --enable-static         build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT]
290changequote([, ])dnl
291[  --enable-static=PKGS    only build shared libraries if the current package
292                          appears as an element in the PKGS list],
293[p=${PACKAGE-default}
294case "$enableval" in
295yes) enable_static=yes ;;
296no) enable_static=no ;;
297*)
298  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
303      enable_static=yes
304    fi
305  done
306  IFS="$ac_save_ifs"
307  ;;
308esac],
309enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
310])
311
312
313# AM_PROG_LD - find the path to the GNU or non-GNU linker
314AC_DEFUN(AM_PROG_LD,
315[AC_ARG_WITH(gnu-ld,
316[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
317test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
318AC_REQUIRE([AC_PROG_CC])
319ac_prog=ld
320if test "$ac_cv_prog_gcc" = yes; then
321  # Check if gcc -print-prog-name=ld gives a path.
322  AC_MSG_CHECKING([for ld used by GCC])
323  ac_prog=`($CC -print-prog-name=ld) 2>&5`
324  case "$ac_prog" in
325  # Accept absolute paths.
326changequote(,)dnl
327  /* | [A-Za-z]:\\*)
328changequote([,])dnl
329    test -z "$LD" && LD="$ac_prog"
330    ;;
331  "")
332    # If it fails, then pretend we aren't using GCC.
333    ac_prog=ld
334    ;;
335  *)
336    # If it is relative, then search for the first ld in PATH.
337    with_gnu_ld=unknown
338    ;;
339  esac
340elif test "$with_gnu_ld" = yes; then
341  AC_MSG_CHECKING([for GNU ld])
342else
343  AC_MSG_CHECKING([for non-GNU ld])
344fi
345AC_CACHE_VAL(ac_cv_path_LD,
346[if test -z "$LD"; then
347  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
348  for ac_dir in $PATH; do
349    test -z "$ac_dir" && ac_dir=.
350    if test -f "$ac_dir/$ac_prog"; then
351      ac_cv_path_LD="$ac_dir/$ac_prog"
352      # Check to see if the program is GNU ld.  I'd rather use --version,
353      # but apparently some GNU ld's only accept -v.
354      # Break only if it was the GNU/non-GNU ld that we prefer.
355      if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
356	test "$with_gnu_ld" != no && break
357      else
358        test "$with_gnu_ld" != yes && break
359      fi
360    fi
361  done
362  IFS="$ac_save_ifs"
363else
364  ac_cv_path_LD="$LD" # Let the user override the test with a path.
365fi])
366LD="$ac_cv_path_LD"
367if test -n "$LD"; then
368  AC_MSG_RESULT($LD)
369else
370  AC_MSG_RESULT(no)
371fi
372test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
373AC_SUBST(LD)
374AM_PROG_LD_GNU
375])
376
377AC_DEFUN(AM_PROG_LD_GNU,
378[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
379[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
380if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
381  ac_cv_prog_gnu_ld=yes
382else
383  ac_cv_prog_gnu_ld=no
384fi])
385])
386
387# AM_PROG_NM - find the path to a BSD-compatible name lister
388AC_DEFUN(AM_PROG_NM,
389[AC_MSG_CHECKING([for BSD-compatible nm])
390AC_CACHE_VAL(ac_cv_path_NM,
391[case "$NM" in
392changequote(,)dnl
393/* | [A-Za-z]:\\*)
394changequote([,])dnl
395  ac_cv_path_NM="$NM" # Let the user override the test with a path.
396  ;;
397*)
398  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
399  for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
400    test -z "$ac_dir" && ac_dir=.
401    if test -f $ac_dir/nm; then
402      # Check to see if the nm accepts a BSD-compat flag.
403      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
404      #   nm: unknown option "B" ignored
405      if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
406        ac_cv_path_NM="$ac_dir/nm -B"
407      elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
408        ac_cv_path_NM="$ac_dir/nm -p"
409      else
410        ac_cv_path_NM="$ac_dir/nm"
411      fi
412      break
413    fi
414  done
415  IFS="$ac_save_ifs"
416  test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
417  ;;
418esac])
419NM="$ac_cv_path_NM"
420AC_MSG_RESULT([$NM])
421AC_SUBST(NM)
422])
423
424# Like AC_CONFIG_HEADER, but automatically create stamp file.
425
426AC_DEFUN(AM_CONFIG_HEADER,
427[AC_PREREQ([2.12])
428AC_CONFIG_HEADER([$1])
429dnl When config.status generates a header, we must update the stamp-h file.
430dnl This file resides in the same directory as the config header
431dnl that is generated.  We must strip everything past the first ":",
432dnl and everything past the last "/".
433AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
434ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
435<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
436<<am_indx=1
437for am_file in <<$1>>; do
438  case " <<$>>CONFIG_HEADERS " in
439  *" <<$>>am_file "*<<)>>
440    echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
441    ;;
442  esac
443  am_indx=`expr "<<$>>am_indx" + 1`
444done<<>>dnl>>)
445changequote([,]))])
446
447# Add --enable-maintainer-mode option to configure.
448# From Jim Meyering
449
450# serial 1
451
452AC_DEFUN(AM_MAINTAINER_MODE,
453[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
454  dnl maintainer-mode is disabled by default
455  AC_ARG_ENABLE(maintainer-mode,
456[  --enable-maintainer-mode enable make rules and dependencies not useful
457                          (and sometimes confusing) to the casual installer],
458      USE_MAINTAINER_MODE=$enableval,
459      USE_MAINTAINER_MODE=no)
460  AC_MSG_RESULT($USE_MAINTAINER_MODE)
461  if test $USE_MAINTAINER_MODE = yes; then
462    MAINT=
463  else
464    MAINT='#M#'
465  fi
466  AC_SUBST(MAINT)dnl
467]
468)
469
470# Check to see if we're running under Cygwin32, without using
471# AC_CANONICAL_*.  If so, set output variable CYGWIN32 to "yes".
472# Otherwise set it to "no".
473
474dnl AM_CYGWIN32()
475AC_DEFUN(AM_CYGWIN32,
476[AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
477[AC_TRY_COMPILE(,[return __CYGWIN32__;],
478am_cv_cygwin32=yes, am_cv_cygwin32=no)
479rm -f conftest*])
480CYGWIN32=
481test "$am_cv_cygwin32" = yes && CYGWIN32=yes])
482
483# Check to see if we're running under Win32, without using
484# AC_CANONICAL_*.  If so, set output variable EXEEXT to ".exe".
485# Otherwise set it to "".
486
487dnl AM_EXEEXT()
488dnl This knows we add .exe if we're building in the Cygwin32
489dnl environment. But if we're not, then it compiles a test program
490dnl to see if there is a suffix for executables.
491AC_DEFUN(AM_EXEEXT,
492[AC_REQUIRE([AM_CYGWIN32])
493AC_REQUIRE([AM_MINGW32])
494AC_MSG_CHECKING([for executable suffix])
495AC_CACHE_VAL(am_cv_exeext,
496[if test "$CYGWIN32" = yes || test "$MINGW32" = yes; then
497am_cv_exeext=.exe
498else
499cat > am_c_test.c << 'EOF'
500int main() {
501/* Nothing needed here */
502}
503EOF
504${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
505am_cv_exeext=`echo am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
506rm -f am_c_test*])
507test x"${am_cv_exeext}" = x && am_cv_exeext=no
508fi
509EXEEXT=""
510test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
511AC_MSG_RESULT(${am_cv_exeext})
512AC_SUBST(EXEEXT)])
513
514# Check to see if we're running under Mingw, without using
515# AC_CANONICAL_*.  If so, set output variable MINGW32 to "yes".
516# Otherwise set it to "no".
517
518dnl AM_MINGW32()
519AC_DEFUN(AM_MINGW32,
520[AC_CACHE_CHECK(for Mingw32 environment, am_cv_mingw32,
521[AC_TRY_COMPILE(,[return __MINGW32__;],
522am_cv_mingw32=yes, am_cv_mingw32=no)
523rm -f conftest*])
524MINGW32=
525test "$am_cv_mingw32" = yes && MINGW32=yes])
526
527