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
13sinclude(../bfd/acinclude.m4)
14
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.
18
19# serial 1
20
21dnl Usage:
22dnl AM_INIT_AUTOMAKE(package,version, [no-define])
23
24AC_DEFUN(AM_INIT_AUTOMAKE,
25[AC_REQUIRE([AM_PROG_INSTALL])
26PACKAGE=[$1]
27AC_SUBST(PACKAGE)
28VERSION=[$2]
29AC_SUBST(VERSION)
30dnl test to see if srcdir already configured
31if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
32  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
33fi
34ifelse([$3],,
35AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
36AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
37AC_REQUIRE([AM_SANITY_CHECK])
38AC_REQUIRE([AC_ARG_PROGRAM])
39dnl FIXME This is truly gross.
40missing_dir=`cd $ac_aux_dir && pwd`
41AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
42AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
43AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
44AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
45AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
46AC_REQUIRE([AC_PROG_MAKE_SET])])
47
48
49# serial 1
50
51AC_DEFUN(AM_PROG_INSTALL,
52[AC_REQUIRE([AC_PROG_INSTALL])
53test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
54AC_SUBST(INSTALL_SCRIPT)dnl
55])
56
57#
58# Check to make sure that the build environment is sane.
59#
60
61AC_DEFUN(AM_SANITY_CHECK,
62[AC_MSG_CHECKING([whether build environment is sane])
63# Just in case
64sleep 1
65echo 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
70# directory).
71if (
72   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
73   if test "[$]*" = "X"; then
74      # -L didn't work.
75      set X `ls -t $srcdir/configure conftestfile`
76   fi
77   if test "[$]*" != "X $srcdir/configure conftestfile" \
78      && test "[$]*" != "X conftestfile $srcdir/configure"; then
79
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
85alias in your environment])
86   fi
87
88   test "[$]2" = conftestfile
89   )
90then
91   # Ok.
92   :
93else
94   AC_MSG_ERROR([newly created file is older than distributed files!
95Check your system clock])
96fi
97rm -f conftest*
98AC_MSG_RESULT(yes)])
99
100dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
101dnl The program must properly implement --version.
102AC_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.
107if ($2 --version) < /dev/null > /dev/null 2>&1; then
108   $1=$2
109   AC_MSG_RESULT(found)
110else
111   $1="$3/missing $2"
112   AC_MSG_RESULT(missing)
113fi
114AC_SUBST($1)])
115
116
117# serial 24 AM_PROG_LIBTOOL
118AC_DEFUN(AM_PROG_LIBTOOL,
119[AC_REQUIRE([AM_ENABLE_SHARED])dnl
120AC_REQUIRE([AM_ENABLE_STATIC])dnl
121AC_REQUIRE([AC_CANONICAL_HOST])dnl
122AC_REQUIRE([AC_PROG_RANLIB])dnl
123AC_REQUIRE([AC_PROG_CC])dnl
124AC_REQUIRE([AM_PROG_LD])dnl
125AC_REQUIRE([AM_PROG_NM])dnl
126AC_REQUIRE([AC_PROG_LN_S])dnl
127dnl
128# Always use our own libtool.
129LIBTOOL='$(SHELL) $(top_builddir)/libtool'
130AC_SUBST(LIBTOOL)dnl
131
132# Check for any special flags to pass to ltconfig.
133libtool_flags=
134test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
135test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
136test "$silent" = yes && libtool_flags="$libtool_flags --silent"
137test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
138test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
139
140# Some flags need to be propagated to the compiler or linker for good
141# libtool support.
142case "$host" in
143*-*-irix6*)
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
148    *32-bit*)
149      LD="${LD-ld} -32"
150      ;;
151    *N32*)
152      LD="${LD-ld} -n32"
153      ;;
154    *64-bit*)
155      LD="${LD-ld} -64"
156      ;;
157    esac
158  fi
159  rm -rf conftest*
160  ;;
161
162*-*-sco3.2v5*)
163  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
164  CFLAGS="$CFLAGS -belf"
165  ;;
166esac
167
168# Actually configure libtool.  ac_aux_dir is where install-sh is found.
169CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
170LD="$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])
174])
175
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
179#   `yes'.
180AC_DEFUN(AM_ENABLE_SHARED,
181[define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
182AC_ARG_ENABLE(shared,
183changequote(<<, >>)dnl
184<<  --enable-shared         build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT]
185changequote([, ])dnl
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}
189case "$enableval" in
190yes) enable_shared=yes ;;
191no) enable_shared=no ;;
192*)
193  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
198      enable_shared=yes
199    fi
200  done
201  IFS="$ac_save_ifs"
202  ;;
203esac],
204enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
205])
206
207# AM_DISABLE_SHARED - set the default shared flag to --disable-shared
208AC_DEFUN(AM_DISABLE_SHARED,
209[AM_ENABLE_SHARED(no)])
210
211# AM_DISABLE_STATIC - set the default static flag to --disable-static
212AC_DEFUN(AM_DISABLE_STATIC,
213[AM_ENABLE_STATIC(no)])
214
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
218#   `yes'.
219AC_DEFUN(AM_ENABLE_STATIC,
220[define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
221AC_ARG_ENABLE(static,
222changequote(<<, >>)dnl
223<<  --enable-static         build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT]
224changequote([, ])dnl
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}
228case "$enableval" in
229yes) enable_static=yes ;;
230no) enable_static=no ;;
231*)
232  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
237      enable_static=yes
238    fi
239  done
240  IFS="$ac_save_ifs"
241  ;;
242esac],
243enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
244])
245
246
247# AM_PROG_LD - find the path to the GNU or non-GNU linker
248AC_DEFUN(AM_PROG_LD,
249[AC_ARG_WITH(gnu-ld,
250[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
251test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
252AC_REQUIRE([AC_PROG_CC])
253ac_prog=ld
254if 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`
258  case "$ac_prog" in
259  # Accept absolute paths.
260changequote(,)dnl
261  /* | [A-Za-z]:\\*)
262changequote([,])dnl
263    test -z "$LD" && LD="$ac_prog"
264    ;;
265  "")
266    # If it fails, then pretend we aren't using GCC.
267    ac_prog=ld
268    ;;
269  *)
270    # If it is relative, then search for the first ld in PATH.
271    with_gnu_ld=unknown
272    ;;
273  esac
274elif test "$with_gnu_ld" = yes; then
275  AC_MSG_CHECKING([for GNU ld])
276else
277  AC_MSG_CHECKING([for non-GNU ld])
278fi
279AC_CACHE_VAL(ac_cv_path_LD,
280[if test -z "$LD"; then
281  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
282  for ac_dir in $PATH; do
283    test -z "$ac_dir" && ac_dir=.
284    if test -f "$ac_dir/$ac_prog"; then
285      ac_cv_path_LD="$ac_dir/$ac_prog"
286      # Check to see if the program is GNU ld.  I'd rather use --version,
287      # but apparently some GNU ld's only accept -v.
288      # Break only if it was the GNU/non-GNU ld that we prefer.
289      if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
290	test "$with_gnu_ld" != no && break
291      else
292        test "$with_gnu_ld" != yes && break
293      fi
294    fi
295  done
296  IFS="$ac_save_ifs"
297else
298  ac_cv_path_LD="$LD" # Let the user override the test with a path.
299fi])
300LD="$ac_cv_path_LD"
301if test -n "$LD"; then
302  AC_MSG_RESULT($LD)
303else
304  AC_MSG_RESULT(no)
305fi
306test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
307AC_SUBST(LD)
308AM_PROG_LD_GNU
309])
310
311AC_DEFUN(AM_PROG_LD_GNU,
312[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
313[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
314if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
315  ac_cv_prog_gnu_ld=yes
316else
317  ac_cv_prog_gnu_ld=no
318fi])
319])
320
321# AM_PROG_NM - find the path to a BSD-compatible name lister
322AC_DEFUN(AM_PROG_NM,
323[AC_MSG_CHECKING([for BSD-compatible nm])
324AC_CACHE_VAL(ac_cv_path_NM,
325[case "$NM" in
326changequote(,)dnl
327/* | [A-Za-z]:\\*)
328changequote([,])dnl
329  ac_cv_path_NM="$NM" # Let the user override the test with a path.
330  ;;
331*)
332  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
333  for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
334    test -z "$ac_dir" && ac_dir=.
335    if test -f $ac_dir/nm; then
336      # Check to see if the nm accepts a BSD-compat flag.
337      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
338      #   nm: unknown option "B" ignored
339      if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
340        ac_cv_path_NM="$ac_dir/nm -B"
341      elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
342        ac_cv_path_NM="$ac_dir/nm -p"
343      else
344        ac_cv_path_NM="$ac_dir/nm"
345      fi
346      break
347    fi
348  done
349  IFS="$ac_save_ifs"
350  test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
351  ;;
352esac])
353NM="$ac_cv_path_NM"
354AC_MSG_RESULT([$NM])
355AC_SUBST(NM)
356])
357
358# Like AC_CONFIG_HEADER, but automatically create stamp file.
359
360AC_DEFUN(AM_CONFIG_HEADER,
361[AC_PREREQ([2.12])
362AC_CONFIG_HEADER([$1])
363dnl When config.status generates a header, we must update the stamp-h file.
364dnl This file resides in the same directory as the config header
365dnl that is generated.  We must strip everything past the first ":",
366dnl and everything past the last "/".
367AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
368ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
369<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
370<<am_indx=1
371for am_file in <<$1>>; do
372  case " <<$>>CONFIG_HEADERS " in
373  *" <<$>>am_file "*<<)>>
374    echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
375    ;;
376  esac
377  am_indx=`expr "<<$>>am_indx" + 1`
378done<<>>dnl>>)
379changequote([,]))])
380
381# Check to see if we're running under Cygwin32, without using
382# AC_CANONICAL_*.  If so, set output variable CYGWIN32 to "yes".
383# Otherwise set it to "no".
384
385dnl AM_CYGWIN32()
386AC_DEFUN(AM_CYGWIN32,
387[AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
388[AC_TRY_COMPILE(,[return __CYGWIN32__;],
389am_cv_cygwin32=yes, am_cv_cygwin32=no)
390rm -f conftest*])
391CYGWIN32=
392test "$am_cv_cygwin32" = yes && CYGWIN32=yes])
393
394# Check to see if we're running under Win32, without using
395# AC_CANONICAL_*.  If so, set output variable EXEEXT to ".exe".
396# Otherwise set it to "".
397
398dnl AM_EXEEXT()
399dnl This knows we add .exe if we're building in the Cygwin32
400dnl environment. But if we're not, then it compiles a test program
401dnl to see if there is a suffix for executables.
402AC_DEFUN(AM_EXEEXT,
403[AC_REQUIRE([AM_CYGWIN32])
404AC_REQUIRE([AM_MINGW32])
405AC_MSG_CHECKING([for executable suffix])
406AC_CACHE_VAL(am_cv_exeext,
407[if test "$CYGWIN32" = yes || test "$MINGW32" = yes; then
408am_cv_exeext=.exe
409else
410cat > am_c_test.c << 'EOF'
411int main() {
412/* Nothing needed here */
413}
414EOF
415${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
416am_cv_exeext=`echo am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
417rm -f am_c_test*])
418test x"${am_cv_exeext}" = x && am_cv_exeext=no
419fi
420EXEEXT=""
421test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
422AC_MSG_RESULT(${am_cv_exeext})
423AC_SUBST(EXEEXT)])
424
425# Check to see if we're running under Mingw, without using
426# AC_CANONICAL_*.  If so, set output variable MINGW32 to "yes".
427# Otherwise set it to "no".
428
429dnl AM_MINGW32()
430AC_DEFUN(AM_MINGW32,
431[AC_CACHE_CHECK(for Mingw32 environment, am_cv_mingw32,
432[AC_TRY_COMPILE(,[return __MINGW32__;],
433am_cv_mingw32=yes, am_cv_mingw32=no)
434rm -f conftest*])
435MINGW32=
436test "$am_cv_mingw32" = yes && MINGW32=yes])
437
438# Add --enable-maintainer-mode option to configure.
439# From Jim Meyering
440
441# serial 1
442
443AC_DEFUN(AM_MAINTAINER_MODE,
444[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
445  dnl maintainer-mode is disabled by default
446  AC_ARG_ENABLE(maintainer-mode,
447[  --enable-maintainer-mode enable make rules and dependencies not useful
448                          (and sometimes confusing) to the casual installer],
449      USE_MAINTAINER_MODE=$enableval,
450      USE_MAINTAINER_MODE=no)
451  AC_MSG_RESULT($USE_MAINTAINER_MODE)
452  if test $USE_MAINTAINER_MODE = yes; then
453    MAINT=
454  else
455    MAINT='#M#'
456  fi
457  AC_SUBST(MAINT)dnl
458]
459)
460
461