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