rebuild
[deliverable/binutils-gdb.git] / gas / aclocal.m4
CommitLineData
620cdab2
ILT
1dnl aclocal.m4 generated automatically by aclocal 1.2
2
bf111c9f
KR
3dnl GAS_CHECK_DECL_NEEDED(name, typedefname, typedef, headers)
4AC_DEFUN(GAS_CHECK_DECL_NEEDED,[
5AC_MSG_CHECKING(whether declaration is required for $1)
6AC_CACHE_VAL(gas_cv_decl_needed_$1,
7AC_TRY_LINK([$4],
8[
9typedef $3;
10$2 x;
11x = ($2) $1;
12], gas_cv_decl_needed_$1=no, gas_cv_decl_needed_$1=yes))dnl
13AC_MSG_RESULT($gas_cv_decl_needed_$1)
14test $gas_cv_decl_needed_$1 = no || {
15 ifelse(index($1,[$]),-1,
16 [AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]))],
17 [gas_decl_name_upcase=`echo $1 | tr '[a-z]' '[A-Z]'`
18 AC_DEFINE_UNQUOTED(NEED_DECLARATION_$gas_decl_name_upcase)])
19}
20])dnl
21dnl
22dnl Some non-ANSI preprocessors botch requoting inside strings. That's bad
23dnl enough, but on some of those systems, the assert macro relies on requoting
24dnl working properly!
25dnl GAS_WORKING_ASSERT
26AC_DEFUN(GAS_WORKING_ASSERT,
27[AC_MSG_CHECKING([for working assert macro])
28AC_CACHE_VAL(gas_cv_assert_ok,
29AC_TRY_LINK([#include <assert.h>
30#include <stdio.h>], [
31/* check for requoting problems */
32static int a, b, c, d;
33static char *s;
34assert (!strcmp(s, "foo bar baz quux"));
35/* check for newline handling */
36assert (a == b
37 || c == d);
38], gas_cv_assert_ok=yes, gas_cv_assert_ok=no))dnl
39AC_MSG_RESULT($gas_cv_assert_ok)
40test $gas_cv_assert_ok = yes || AC_DEFINE(BROKEN_ASSERT)
41])dnl
e23b25ec 42dnl
293bc1d5
RS
43dnl Since many Bourne shell implementations lack subroutines, use this
44dnl hack to simplify the code in configure.in.
45dnl GAS_UNIQ(listvar)
46AC_DEFUN(GAS_UNIQ,
47[_gas_uniq_list="[$]$1"
48_gas_uniq_newlist=""
49dnl Protect against empty input list.
50for _gas_uniq_i in _gas_uniq_dummy [$]_gas_uniq_list ; do
51 case [$]_gas_uniq_i in
52 _gas_uniq_dummy) ;;
53 *) case " [$]_gas_uniq_newlist " in
54 *" [$]_gas_uniq_i "*) ;;
55 *) _gas_uniq_newlist="[$]_gas_uniq_newlist [$]_gas_uniq_i" ;;
56 esac ;;
57 esac
58done
59$1=[$]_gas_uniq_newlist
60])dnl
61
620cdab2
ILT
62# Do all the work for Automake. This macro actually does too much --
63# some checks are only needed if your package does certain things.
64# But this isn't really a big deal.
65
66# serial 1
67
68dnl Usage:
69dnl AM_INIT_AUTOMAKE(package,version, [no-define])
70
71AC_DEFUN(AM_INIT_AUTOMAKE,
72[AC_REQUIRE([AM_PROG_INSTALL])
73PACKAGE=[$1]
74AC_SUBST(PACKAGE)
75VERSION=[$2]
76AC_SUBST(VERSION)
77dnl test to see if srcdir already configured
78if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
79 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
80fi
81ifelse([$3],,
82AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
83AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
84AM_SANITY_CHECK
85AC_ARG_PROGRAM
86dnl FIXME This is truly gross.
87missing_dir=`cd $ac_aux_dir && pwd`
88AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
89AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
90AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
91AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
92AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
93AC_PROG_MAKE_SET])
94
95
96# serial 1
97
98AC_DEFUN(AM_PROG_INSTALL,
99[AC_REQUIRE([AC_PROG_INSTALL])
100test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
101AC_SUBST(INSTALL_SCRIPT)dnl
102])
103
104#
105# Check to make sure that the build environment is sane.
106#
107
108AC_DEFUN(AM_SANITY_CHECK,
109[AC_MSG_CHECKING([whether build environment is sane])
110# Just in case
111sleep 1
112echo timestamp > conftestfile
113# Do `set' in a subshell so we don't clobber the current shell's
114# arguments. Must try -L first in case configure is actually a
115# symlink; some systems play weird games with the mod time of symlinks
116# (eg FreeBSD returns the mod time of the symlink's containing
117# directory).
118if (
119 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
120 if test "$@" = "X"; then
121 # -L didn't work.
122 set X `ls -t $srcdir/configure conftestfile`
123 fi
124 test "[$]2" = conftestfile
125 )
126then
127 # Ok.
128 :
129else
130 AC_MSG_ERROR([newly created file is older than distributed files!
131Check your system clock])
132fi
133rm -f conftest*
134AC_MSG_RESULT(yes)])
135
136dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
137dnl The program must properly implement --version.
138AC_DEFUN(AM_MISSING_PROG,
139[AC_MSG_CHECKING(for working $2)
140# Run test in a subshell; some versions of sh will print an error if
141# an executable is not found, even if stderr is redirected.
142# Redirect stdin to placate older versions of autoconf. Sigh.
143if ($2 --version) < /dev/null > /dev/null 2>&1; then
144 $1=$2
145 AC_MSG_RESULT(found)
146else
147 $1="$3/missing $2"
148 AC_MSG_RESULT(missing)
149fi
150AC_SUBST($1)])
151
152
153# serial 9 AM_PROG_LIBTOOL
154AC_DEFUN(AM_PROG_LIBTOOL,
155[AC_REQUIRE([AC_CANONICAL_HOST])
156AC_REQUIRE([AC_PROG_CC])
157AC_REQUIRE([AC_PROG_RANLIB])
158AC_REQUIRE([AM_PROG_LD])
159AC_REQUIRE([AC_PROG_LN_S])
160
161# Always use our own libtool.
162LIBTOOL='$(SHELL) $(top_builddir)/libtool'
163AC_SUBST(LIBTOOL)
164
165dnl CYGNUS LOCAL arguments to enable-shared
166dnl Allow the --disable-shared flag to stop us from building shared libs.
167AC_ARG_ENABLE(shared,
168[ --enable-shared build shared libraries [default=yes]],
169[p=${PACKAGE-bogus-package-name}
170 case "$enableval" in
171 yes) enable_shared=yes ;;
172 no) enable_shared=no ;;
173 # The value of $p (aka $PACKAGE) is assumed to come from AM_INIT_AUTOMAKE.
174 # If it didn't, it'll be `bogus-package-name', thus making this condition
175 # not be used.
176 *$p*) enable_shared=yes ;;
177 *) shared=no ;;
178esac])
179libtool_shared=
180test "$enable_shared" = no && libtool_shared=" --disable-shared"
181dnl END CYGNUS LOCAL
182
183dnl Allow the --disable-static flag to stop us from building static libs.
184AC_ARG_ENABLE(static,
185[ --enable-static build static libraries [default=yes]],
186[if test "$enableval" = no; then
187 enable_static=no
188else
189 enable_static=yes
190fi])
191libtool_static=
192test "$enable_static" = no && libtool_static=" --disable-static"
193
194libtool_flags="$libtool_shared$libtool_static"
195test "$silent" = yes && libtool_flags="$libtool_flags --silent"
196test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
197test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
198
199# Some flags need to be propagated to the compiler or linker for good
200# libtool support.
201[case "$host" in
202*-*-irix6*)
203 ac_save_CFLAGS="$CFLAGS"
204 # -n32 always needs to be added to the linker when using GCC.
205 test "$ac_cv_prog_gcc" = yes && CFLAGS="$CFLAGS -n32"
206 for f in '-32' '-64' '-cckr' '-n32' '-mips1' '-mips2' '-mips3' '-mips4'; do
207 if echo " $CC $CFLAGS " | egrep -e "[ ]$f[ ]" > /dev/null; then
208 LD="${LD-ld} $f"
209 fi
210 done
211 CFLAGS="$ac_save_CFLAGS"
212 ;;
213
214*-*-sco3.2v5*)
215 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
216 CFLAGS="$CFLAGS -belf"
217 ;;
218esac]
219
220# Actually configure libtool. ac_aux_dir is where install-sh is found.
221CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
222LD="$LD" RANLIB="$RANLIB" LN_S="$LN_S" \
223${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
224$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
225|| AC_MSG_ERROR([libtool configure failed])
226])
227
228# AM_PROG_LD - find the path to the GNU or non-GNU linker
229AC_DEFUN(AM_PROG_LD,
230[AC_ARG_WITH(gnu-ld,
231[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
232test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
233if test "$with_gnu_ld" = yes; then
234 AC_MSG_CHECKING([for GNU ld])
235else
236 AC_MSG_CHECKING([for non-GNU ld])
237fi
238AC_CACHE_VAL(ac_cv_path_LD,
239[case "$LD" in
240 "")
241 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
242 for ac_dir in $PATH; do
243 test -z "$ac_dir" && ac_dir=.
244 if test -f "$ac_dir/ld"; then
245 ac_cv_path_LD="$ac_dir/ld"
246 # Check to see if the program is GNU ld. I'd rather use --version,
247 # but apparently some GNU ld's only accept -v.
248 # Break only if it was the GNU/non-GNU ld that we prefer.
249 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then
250 test "$with_gnu_ld" = yes && break
251 else
252 test "$with_gnu_ld" != yes && break
253 fi
254 fi
255 done
256 IFS="$ac_save_ifs"
257 ;;
258 *)
259 ac_cv_path_LD="$LD" # Let the user override the test with a path.
260 ;;
261esac])
262LD="$ac_cv_path_LD"
263if test -n "$LD"; then
264 AC_MSG_RESULT($LD)
265else
266 AC_MSG_RESULT(no)
267fi
268test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
269AC_SUBST(LD)
270AM_PROG_LD_GNU
271])
272
273AC_DEFUN(AM_PROG_LD_GNU,
274[AC_CACHE_CHECK([whether we are using GNU ld], ac_cv_prog_gnu_ld,
275[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
276if $LD -v 2>&1 </dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then
277 ac_cv_prog_gnu_ld=yes
278else
279 ac_cv_prog_gnu_ld=no
280fi])
281])
282
283# Like AC_CONFIG_HEADER, but automatically create stamp file.
284
285AC_DEFUN(AM_CONFIG_HEADER,
286[AC_PREREQ([2.12])
287AC_CONFIG_HEADER([$1])
288dnl When config.status generates a header, we must update the stamp-h file.
289dnl This file resides in the same directory as the config header
290dnl that is generated. We must strip everything past the first ":",
291dnl and everything past the last "/".
292AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
293ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
294<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
295<<am_indx=1
296for am_file in <<$1>>; do
297 case " <<$>>CONFIG_HEADERS " in
298 *" <<$>>am_file "*<<)>>
299 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
300 ;;
301 esac
302 am_indx=`expr "<<$>>am_indx" + 1`
303done<<>>dnl>>)
304changequote([,]))])
305
306# Add --enable-maintainer-mode option to configure.
307# From Jim Meyering
308
309# serial 1
310
311AC_DEFUN(AM_MAINTAINER_MODE,
312[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
313 dnl maintainer-mode is disabled by default
314 AC_ARG_ENABLE(maintainer-mode,
315[ --enable-maintainer-mode enable make rules and dependencies not useful
316 (and sometimes confusing) to the casual installer],
317 USE_MAINTAINER_MODE=$enableval,
318 USE_MAINTAINER_MODE=no)
319 AC_MSG_RESULT($USE_MAINTAINER_MODE)
320 if test $USE_MAINTAINER_MODE = yes; then
321 MAINT=
322 else
323 MAINT='#M#'
324 fi
325 AC_SUBST(MAINT)dnl
326]
327)
328
293bc1d5
RS
329# Check to see if we're running under Cygwin32, without using
330# AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes".
331# Otherwise set it to "no".
332
620cdab2
ILT
333dnl AM_CYGWIN32()
334AC_DEFUN(AM_CYGWIN32,
293bc1d5 335[AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
620cdab2 336[AC_TRY_COMPILE(,[return __CYGWIN32__;],
293bc1d5
RS
337am_cv_cygwin32=yes, am_cv_cygwin32=no)
338rm -f conftest*])
339CYGWIN32=
340test "$am_cv_cygwin32" = yes && CYGWIN32=yes])
620cdab2 341
293bc1d5
RS
342# Check to see if we're running under Win32, without using
343# AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe".
344# Otherwise set it to "".
345
620cdab2 346dnl AM_EXEEXT()
293bc1d5
RS
347dnl This knows we add .exe if we're building in the Cygwin32
348dnl environment. But if we're not, then it compiles a test program
349dnl to see if there is a suffix for executables.
620cdab2
ILT
350AC_DEFUN(AM_EXEEXT,
351[AC_REQUIRE([AM_CYGWIN32])
352AC_REQUIRE([AM_MINGW32])
293bc1d5 353AC_MSG_CHECKING([for executable suffix])
620cdab2
ILT
354AC_CACHE_VAL(am_cv_exeext,[
355if test "$CYGWIN32" = yes -o "$MINGW32" = yes; then
293bc1d5
RS
356am_cv_exeext=.exe
357else
358cat > am_c_test.c << 'EOF'
359int main() {
360/* Nothing needed here */
361}
e23b25ec 362EOF
293bc1d5 363${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
620cdab2 364am_cv_exeext=`echo am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
293bc1d5
RS
365rm -f am_c_test*])
366test x"${am_cv_exeext}" = x && am_cv_exeext=no
e23b25ec 367fi
293bc1d5
RS
368EXEEXT=""
369test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
370AC_MSG_RESULT(${am_cv_exeext})
371AC_SUBST(EXEEXT)])
620cdab2
ILT
372
373# Check to see if we're running under Mingw, without using
374# AC_CANONICAL_*. If so, set output variable MINGW32 to "yes".
375# Otherwise set it to "no".
376
377dnl AM_MINGW32()
378AC_DEFUN(AM_MINGW32,
379[AC_CACHE_CHECK(for Mingw32 environment, am_cv_mingw32,
380[AC_TRY_COMPILE(,[return __MINGW32__;],
381am_cv_mingw32=yes, am_cv_mingw32=no)
382rm -f conftest*])
383MINGW32=
384test "$am_cv_mingw32" = yes && MINGW32=yes])
385
This page took 0.128491 seconds and 4 git commands to generate.