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