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