rebuild
[deliverable/binutils-gdb.git] / gas / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.2
2
3 dnl GAS_CHECK_DECL_NEEDED(name, typedefname, typedef, headers)
4 AC_DEFUN(GAS_CHECK_DECL_NEEDED,[
5 AC_MSG_CHECKING(whether declaration is required for $1)
6 AC_CACHE_VAL(gas_cv_decl_needed_$1,
7 AC_TRY_LINK([$4],
8 [
9 typedef $3;
10 $2 x;
11 x = ($2) $1;
12 ], gas_cv_decl_needed_$1=no, gas_cv_decl_needed_$1=yes))dnl
13 AC_MSG_RESULT($gas_cv_decl_needed_$1)
14 test $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
21 dnl
22 dnl Some non-ANSI preprocessors botch requoting inside strings. That's bad
23 dnl enough, but on some of those systems, the assert macro relies on requoting
24 dnl working properly!
25 dnl GAS_WORKING_ASSERT
26 AC_DEFUN(GAS_WORKING_ASSERT,
27 [AC_MSG_CHECKING([for working assert macro])
28 AC_CACHE_VAL(gas_cv_assert_ok,
29 AC_TRY_LINK([#include <assert.h>
30 #include <stdio.h>], [
31 /* check for requoting problems */
32 static int a, b, c, d;
33 static char *s;
34 assert (!strcmp(s, "foo bar baz quux"));
35 /* check for newline handling */
36 assert (a == b
37 || c == d);
38 ], gas_cv_assert_ok=yes, gas_cv_assert_ok=no))dnl
39 AC_MSG_RESULT($gas_cv_assert_ok)
40 test $gas_cv_assert_ok = yes || AC_DEFINE(BROKEN_ASSERT)
41 ])dnl
42 dnl
43 dnl Since many Bourne shell implementations lack subroutines, use this
44 dnl hack to simplify the code in configure.in.
45 dnl GAS_UNIQ(listvar)
46 AC_DEFUN(GAS_UNIQ,
47 [_gas_uniq_list="[$]$1"
48 _gas_uniq_newlist=""
49 dnl Protect against empty input list.
50 for _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
58 done
59 $1=[$]_gas_uniq_newlist
60 ])dnl
61
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
68 dnl Usage:
69 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
70
71 AC_DEFUN(AM_INIT_AUTOMAKE,
72 [AC_REQUIRE([AM_PROG_INSTALL])
73 PACKAGE=[$1]
74 AC_SUBST(PACKAGE)
75 VERSION=[$2]
76 AC_SUBST(VERSION)
77 dnl test to see if srcdir already configured
78 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
79 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
80 fi
81 ifelse([$3],,
82 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
83 AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
84 AM_SANITY_CHECK
85 AC_ARG_PROGRAM
86 dnl FIXME This is truly gross.
87 missing_dir=`cd $ac_aux_dir && pwd`
88 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
89 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
90 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
91 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
92 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
93 AC_PROG_MAKE_SET])
94
95
96 # serial 1
97
98 AC_DEFUN(AM_PROG_INSTALL,
99 [AC_REQUIRE([AC_PROG_INSTALL])
100 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
101 AC_SUBST(INSTALL_SCRIPT)dnl
102 ])
103
104 #
105 # Check to make sure that the build environment is sane.
106 #
107
108 AC_DEFUN(AM_SANITY_CHECK,
109 [AC_MSG_CHECKING([whether build environment is sane])
110 # Just in case
111 sleep 1
112 echo 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).
118 if (
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 )
126 then
127 # Ok.
128 :
129 else
130 AC_MSG_ERROR([newly created file is older than distributed files!
131 Check your system clock])
132 fi
133 rm -f conftest*
134 AC_MSG_RESULT(yes)])
135
136 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
137 dnl The program must properly implement --version.
138 AC_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.
143 if ($2 --version) < /dev/null > /dev/null 2>&1; then
144 $1=$2
145 AC_MSG_RESULT(found)
146 else
147 $1="$3/missing $2"
148 AC_MSG_RESULT(missing)
149 fi
150 AC_SUBST($1)])
151
152
153 # serial 9 AM_PROG_LIBTOOL
154 AC_DEFUN(AM_PROG_LIBTOOL,
155 [AC_REQUIRE([AC_CANONICAL_HOST])
156 AC_REQUIRE([AC_PROG_CC])
157 AC_REQUIRE([AC_PROG_RANLIB])
158 AC_REQUIRE([AM_PROG_LD])
159 AC_REQUIRE([AC_PROG_LN_S])
160
161 # Always use our own libtool.
162 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
163 AC_SUBST(LIBTOOL)
164
165 dnl CYGNUS LOCAL arguments to enable-shared
166 dnl Allow the --disable-shared flag to stop us from building shared libs.
167 AC_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 ;;
178 esac])
179 libtool_shared=
180 test "$enable_shared" = no && libtool_shared=" --disable-shared"
181 dnl END CYGNUS LOCAL
182
183 dnl Allow the --disable-static flag to stop us from building static libs.
184 AC_ARG_ENABLE(static,
185 [ --enable-static build static libraries [default=yes]],
186 [if test "$enableval" = no; then
187 enable_static=no
188 else
189 enable_static=yes
190 fi])
191 libtool_static=
192 test "$enable_static" = no && libtool_static=" --disable-static"
193
194 libtool_flags="$libtool_shared$libtool_static"
195 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
196 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
197 test "$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 ;;
218 esac]
219
220 # Actually configure libtool. ac_aux_dir is where install-sh is found.
221 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
222 LD="$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
229 AC_DEFUN(AM_PROG_LD,
230 [AC_ARG_WITH(gnu-ld,
231 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
232 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
233 if test "$with_gnu_ld" = yes; then
234 AC_MSG_CHECKING([for GNU ld])
235 else
236 AC_MSG_CHECKING([for non-GNU ld])
237 fi
238 AC_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 ;;
261 esac])
262 LD="$ac_cv_path_LD"
263 if test -n "$LD"; then
264 AC_MSG_RESULT($LD)
265 else
266 AC_MSG_RESULT(no)
267 fi
268 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
269 AC_SUBST(LD)
270 AM_PROG_LD_GNU
271 ])
272
273 AC_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.
276 if $LD -v 2>&1 </dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then
277 ac_cv_prog_gnu_ld=yes
278 else
279 ac_cv_prog_gnu_ld=no
280 fi])
281 ])
282
283 # Like AC_CONFIG_HEADER, but automatically create stamp file.
284
285 AC_DEFUN(AM_CONFIG_HEADER,
286 [AC_PREREQ([2.12])
287 AC_CONFIG_HEADER([$1])
288 dnl When config.status generates a header, we must update the stamp-h file.
289 dnl This file resides in the same directory as the config header
290 dnl that is generated. We must strip everything past the first ":",
291 dnl and everything past the last "/".
292 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
293 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
294 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
295 <<am_indx=1
296 for 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`
303 done<<>>dnl>>)
304 changequote([,]))])
305
306 # Add --enable-maintainer-mode option to configure.
307 # From Jim Meyering
308
309 # serial 1
310
311 AC_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
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
333 dnl AM_CYGWIN32()
334 AC_DEFUN(AM_CYGWIN32,
335 [AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
336 [AC_TRY_COMPILE(,[return __CYGWIN32__;],
337 am_cv_cygwin32=yes, am_cv_cygwin32=no)
338 rm -f conftest*])
339 CYGWIN32=
340 test "$am_cv_cygwin32" = yes && CYGWIN32=yes])
341
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
346 dnl AM_EXEEXT()
347 dnl This knows we add .exe if we're building in the Cygwin32
348 dnl environment. But if we're not, then it compiles a test program
349 dnl to see if there is a suffix for executables.
350 AC_DEFUN(AM_EXEEXT,
351 [AC_REQUIRE([AM_CYGWIN32])
352 AC_REQUIRE([AM_MINGW32])
353 AC_MSG_CHECKING([for executable suffix])
354 AC_CACHE_VAL(am_cv_exeext,[
355 if test "$CYGWIN32" = yes -o "$MINGW32" = yes; then
356 am_cv_exeext=.exe
357 else
358 cat > am_c_test.c << 'EOF'
359 int main() {
360 /* Nothing needed here */
361 }
362 EOF
363 ${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
364 am_cv_exeext=`echo am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
365 rm -f am_c_test*])
366 test x"${am_cv_exeext}" = x && am_cv_exeext=no
367 fi
368 EXEEXT=""
369 test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
370 AC_MSG_RESULT(${am_cv_exeext})
371 AC_SUBST(EXEEXT)])
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
377 dnl AM_MINGW32()
378 AC_DEFUN(AM_MINGW32,
379 [AC_CACHE_CHECK(for Mingw32 environment, am_cv_mingw32,
380 [AC_TRY_COMPILE(,[return __MINGW32__;],
381 am_cv_mingw32=yes, am_cv_mingw32=no)
382 rm -f conftest*])
383 MINGW32=
384 test "$am_cv_mingw32" = yes && MINGW32=yes])
385
This page took 0.047537 seconds and 4 git commands to generate.