Add missing sanitize markers in last ChangeLog entry.
[deliverable/binutils-gdb.git] / bfd / aclocal.m4
CommitLineData
c0734708
ILT
1dnl aclocal.m4 generated automatically by aclocal 1.2
2
aa13d30d
ILT
3dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
4AC_DEFUN(BFD_BINARY_FOPEN,
5[AC_REQUIRE([AC_CANONICAL_SYSTEM])
6case "${host}" in
7changequote(,)dnl
9a837903 8i[345]86-*-msdos* | i[345]86-*-go32* | i[345]86-*-mingw32* | *-*-cygwin32* | *-*-windows)
aa13d30d
ILT
9changequote([,])dnl
10 AC_DEFINE(USE_BINARY_FOPEN) ;;
11esac])dnl
b1ee3d6a 12
aa13d30d
ILT
13dnl Get a default for CC_FOR_BUILD to put into Makefile.
14AC_DEFUN(BFD_CC_FOR_BUILD,
15[# Put a plausible default for CC_FOR_BUILD in Makefile.
16if 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
22fi
36df40e0
DE
23AC_SUBST(CC_FOR_BUILD)
24# Also set EXEEXT_FOR_BUILD.
25if test "x$cross_compiling" = "xno"; then
26 EXEEXT_FOR_BUILD='$(EXEEXT)'
27else
28 AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
29 [cat > ac_c_test.c << 'EOF'
30int main() {
31/* Nothing needed here */
32}
33EOF
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}
40fi
41AC_SUBST(EXEEXT_FOR_BUILD)])dnl
aa13d30d
ILT
42
43dnl See whether we need a declaration for a function.
44AC_DEFUN(BFD_NEED_DECLARATION,
45[AC_MSG_CHECKING([whether $1 must be declared])
46AC_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],
63bfd_cv_decl_needed_$1=no, bfd_cv_decl_needed_$1=yes)])
64AC_MSG_RESULT($bfd_cv_decl_needed_$1)
65if 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)
68fi
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
77dnl Usage:
78dnl AM_INIT_AUTOMAKE(package,version, [no-define])
79
80AC_DEFUN(AM_INIT_AUTOMAKE,
81[AC_REQUIRE([AM_PROG_INSTALL])
82PACKAGE=[$1]
83AC_SUBST(PACKAGE)
84VERSION=[$2]
85AC_SUBST(VERSION)
86dnl test to see if srcdir already configured
87if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
88 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
89fi
90ifelse([$3],,
91AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
92AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
93AM_SANITY_CHECK
94AC_ARG_PROGRAM
95dnl FIXME This is truly gross.
96missing_dir=`cd $ac_aux_dir && pwd`
97AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
98AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
99AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
100AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
101AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
102AC_PROG_MAKE_SET])
103
104
105# serial 1
106
107AC_DEFUN(AM_PROG_INSTALL,
108[AC_REQUIRE([AC_PROG_INSTALL])
109test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
110AC_SUBST(INSTALL_SCRIPT)dnl
111])
112
113#
114# Check to make sure that the build environment is sane.
115#
116
117AC_DEFUN(AM_SANITY_CHECK,
118[AC_MSG_CHECKING([whether build environment is sane])
119# Just in case
120sleep 1
121echo 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).
127if (
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 )
135then
136 # Ok.
137 :
138else
139 AC_MSG_ERROR([newly created file is older than distributed files!
140Check your system clock])
141fi
142rm -f conftest*
143AC_MSG_RESULT(yes)])
144
145dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
146dnl The program must properly implement --version.
147AC_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.
152if ($2 --version) < /dev/null > /dev/null 2>&1; then
153 $1=$2
154 AC_MSG_RESULT(found)
155else
156 $1="$3/missing $2"
157 AC_MSG_RESULT(missing)
158fi
159AC_SUBST($1)])
160
161
9a837903 162# serial 18 AM_PROG_LIBTOOL
5e377ed2
ILT
163AC_DEFUN(AM_PROG_LIBTOOL,
164[AC_REQUIRE([AC_CANONICAL_HOST])
5e377ed2 165AC_REQUIRE([AC_PROG_RANLIB])
9a837903 166AC_REQUIRE([AC_PROG_CC])
5e377ed2 167AC_REQUIRE([AM_PROG_LD])
9a837903 168AC_REQUIRE([AM_PROG_NM])
5e377ed2
ILT
169AC_REQUIRE([AC_PROG_LN_S])
170
171# Always use our own libtool.
36df40e0 172LIBTOOL='$(SHELL) $(top_builddir)/libtool'
5e377ed2
ILT
173AC_SUBST(LIBTOOL)
174
36df40e0 175dnl CYGNUS LOCAL arguments to enable-shared
5e377ed2
ILT
176dnl Allow the --disable-shared flag to stop us from building shared libs.
177AC_ARG_ENABLE(shared,
178[ --enable-shared build shared libraries [default=yes]],
36df40e0
DE
179[p=${PACKAGE-bogus-package-name}
180 case "$enableval" in
9a837903
ILT
181 yes) libtool_enable_shared=yes ;;
182 no) libtool_enable_shared=no ;;
36df40e0
DE
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.
9a837903
ILT
186 *$p*) libtool_enable_shared=yes ;;
187 *) libtool_enable_shared=no ;;
36df40e0 188esac])
9a837903 189test -n "$libtool_enable_shared" && enable_shared="$libtool_enable_shared"
aa13d30d
ILT
190libtool_shared=
191test "$enable_shared" = no && libtool_shared=" --disable-shared"
36df40e0 192dnl END CYGNUS LOCAL
5e377ed2
ILT
193
194dnl Allow the --disable-static flag to stop us from building static libs.
195AC_ARG_ENABLE(static,
196[ --enable-static build static libraries [default=yes]],
aa13d30d 197[if test "$enableval" = no; then
9a837903 198 libtool_enable_static=no
aa13d30d 199else
9a837903 200 libtool_enable_static=yes
aa13d30d 201fi])
9a837903 202test -n "$libtool_enable_static" && enable_static="$libtool_enable_static"
aa13d30d
ILT
203libtool_static=
204test "$enable_static" = no && libtool_static=" --disable-static"
5e377ed2
ILT
205
206libtool_flags="$libtool_shared$libtool_static"
207test "$silent" = yes && libtool_flags="$libtool_flags --silent"
208test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
209test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
b1ee3d6a 210
5e377ed2
ILT
211# Some flags need to be propagated to the compiler or linker for good
212# libtool support.
213[case "$host" in
214*-*-irix6*)
aa13d30d 215 ac_save_CFLAGS="$CFLAGS"
9a837903
ILT
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
5e377ed2 238 done
aa13d30d 239 CFLAGS="$ac_save_CFLAGS"
5e377ed2
ILT
240 ;;
241
242*-*-sco3.2v5*)
243 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
244 CFLAGS="$CFLAGS -belf"
245 ;;
246esac]
247
248# Actually configure libtool. ac_aux_dir is where install-sh is found.
249CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
9a837903 250LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
5e377ed2
ILT
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
257AC_DEFUN(AM_PROG_LD,
258[AC_ARG_WITH(gnu-ld,
259[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
260test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
9a837903
ILT
261AC_REQUIRE([AC_PROG_CC])
262ac_prog=ld
263if 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
281elif test "$with_gnu_ld" = yes; then
5e377ed2
ILT
282 AC_MSG_CHECKING([for GNU ld])
283else
284 AC_MSG_CHECKING([for non-GNU ld])
b1ee3d6a 285fi
5e377ed2 286AC_CACHE_VAL(ac_cv_path_LD,
9a837903 287[if test -z "$LD"; then
5e377ed2
ILT
288 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
289 for ac_dir in $PATH; do
290 test -z "$ac_dir" && ac_dir=.
9a837903
ILT
291 if test -f "$ac_dir/$ac_prog"; then
292 ac_cv_path_LD="$ac_dir/$ac_prog"
5e377ed2
ILT
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.
9a837903
ILT
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
5e377ed2
ILT
298 else
299 test "$with_gnu_ld" != yes && break
300 fi
301 fi
302 done
303 IFS="$ac_save_ifs"
9a837903 304else
36df40e0 305 ac_cv_path_LD="$LD" # Let the user override the test with a path.
9a837903 306fi])
5e377ed2
ILT
307LD="$ac_cv_path_LD"
308if test -n "$LD"; then
309 AC_MSG_RESULT($LD)
310else
311 AC_MSG_RESULT(no)
312fi
313test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
314AC_SUBST(LD)
315AM_PROG_LD_GNU
316])
317
318AC_DEFUN(AM_PROG_LD_GNU,
9a837903 319[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
5e377ed2 320[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
9a837903 321if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
5e377ed2
ILT
322 ac_cv_prog_gnu_ld=yes
323else
324 ac_cv_prog_gnu_ld=no
325fi])
326])
b1ee3d6a 327
9a837903
ILT
328# AM_PROG_NM - find the path to a BSD-compatible name lister
329AC_DEFUN(AM_PROG_NM,
330[AC_MSG_CHECKING([for BSD-compatible nm])
331AC_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 ;;
357esac])
358NM="$ac_cv_path_NM"
359AC_MSG_RESULT([$NM])
360AC_SUBST(NM)
361])
362
c0734708
ILT
363# Like AC_CONFIG_HEADER, but automatically create stamp file.
364
365AC_DEFUN(AM_CONFIG_HEADER,
366[AC_PREREQ([2.12])
367AC_CONFIG_HEADER([$1])
368dnl When config.status generates a header, we must update the stamp-h file.
369dnl This file resides in the same directory as the config header
370dnl that is generated. We must strip everything past the first ":",
371dnl and everything past the last "/".
372AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
373ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
374<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
375<<am_indx=1
376for 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`
383done<<>>dnl>>)
384changequote([,]))])
385
386# Add --enable-maintainer-mode option to configure.
387# From Jim Meyering
388
389# serial 1
390
391AC_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)
b1ee3d6a
RS
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
c0734708 413dnl AM_CYGWIN32()
c0734708 414AC_DEFUN(AM_CYGWIN32,
b1ee3d6a 415[AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
36df40e0 416[AC_TRY_COMPILE(,[return __CYGWIN32__;],
b1ee3d6a
RS
417am_cv_cygwin32=yes, am_cv_cygwin32=no)
418rm -f conftest*])
419CYGWIN32=
420test "$am_cv_cygwin32" = yes && CYGWIN32=yes])
c0734708 421
b1ee3d6a
RS
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
c0734708 426dnl AM_EXEEXT()
b1ee3d6a
RS
427dnl This knows we add .exe if we're building in the Cygwin32
428dnl environment. But if we're not, then it compiles a test program
429dnl to see if there is a suffix for executables.
c0734708 430AC_DEFUN(AM_EXEEXT,
36df40e0
DE
431[AC_REQUIRE([AM_CYGWIN32])
432AC_REQUIRE([AM_MINGW32])
b1ee3d6a 433AC_MSG_CHECKING([for executable suffix])
36df40e0
DE
434AC_CACHE_VAL(am_cv_exeext,[
435if test "$CYGWIN32" = yes -o "$MINGW32" = yes; then
b1ee3d6a
RS
436am_cv_exeext=.exe
437else
438cat > am_c_test.c << 'EOF'
439int main() {
440/* Nothing needed here */
441}
442EOF
443${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
36df40e0 444am_cv_exeext=`echo am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
b1ee3d6a
RS
445rm -f am_c_test*])
446test x"${am_cv_exeext}" = x && am_cv_exeext=no
447fi
448EXEEXT=""
449test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
450AC_MSG_RESULT(${am_cv_exeext})
451AC_SUBST(EXEEXT)])
c0734708 452
36df40e0
DE
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
457dnl AM_MINGW32()
458AC_DEFUN(AM_MINGW32,
459[AC_CACHE_CHECK(for Mingw32 environment, am_cv_mingw32,
460[AC_TRY_COMPILE(,[return __MINGW32__;],
461am_cv_mingw32=yes, am_cv_mingw32=no)
462rm -f conftest*])
463MINGW32=
464test "$am_cv_mingw32" = yes && MINGW32=yes])
465
This page took 0.056588 seconds and 4 git commands to generate.