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