* configure.in: Set libtool_enable_shared rather than
[deliverable/binutils-gdb.git] / opcodes / aclocal.m4
CommitLineData
1daed53f
ILT
1dnl aclocal.m4 generated automatically by aclocal 1.2
2
2f403ada 3sinclude(../bfd/acinclude.m4)
1daed53f 4
2f403ada
ILT
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
96# serial 9 AM_PROG_LIBTOOL
1daed53f
ILT
97AC_DEFUN(AM_PROG_LIBTOOL,
98[AC_REQUIRE([AC_CANONICAL_HOST])
99AC_REQUIRE([AC_PROG_CC])
100AC_REQUIRE([AC_PROG_RANLIB])
101AC_REQUIRE([AM_PROG_LD])
102AC_REQUIRE([AC_PROG_LN_S])
103
104# Always use our own libtool.
bfc10abe 105LIBTOOL='$(SHELL) $(top_builddir)/libtool'
1daed53f
ILT
106AC_SUBST(LIBTOOL)
107
108dnl Allow the --disable-shared flag to stop us from building shared libs.
109AC_ARG_ENABLE(shared,
110[ --enable-shared build shared libraries [default=yes]],
bfc10abe
DE
111[if test "$enableval" = no; then
112 enable_shared=no
113else
114 enable_shared=yes
115fi])
2f403ada
ILT
116libtool_shared=
117test "$enable_shared" = no && libtool_shared=" --disable-shared"
1daed53f
ILT
118
119dnl Allow the --disable-static flag to stop us from building static libs.
120AC_ARG_ENABLE(static,
121[ --enable-static build static libraries [default=yes]],
2f403ada
ILT
122[if test "$enableval" = no; then
123 enable_static=no
124else
125 enable_static=yes
126fi])
127libtool_static=
128test "$enable_static" = no && libtool_static=" --disable-static"
1daed53f
ILT
129
130libtool_flags="$libtool_shared$libtool_static"
131test "$silent" = yes && libtool_flags="$libtool_flags --silent"
132test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
133test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
134
135# Some flags need to be propagated to the compiler or linker for good
136# libtool support.
137[case "$host" in
138*-*-irix6*)
2f403ada
ILT
139 ac_save_CFLAGS="$CFLAGS"
140 # -n32 always needs to be added to the linker when using GCC.
141 test "$ac_cv_prog_gcc" = yes && CFLAGS="$CFLAGS -n32"
1daed53f
ILT
142 for f in '-32' '-64' '-cckr' '-n32' '-mips1' '-mips2' '-mips3' '-mips4'; do
143 if echo " $CC $CFLAGS " | egrep -e "[ ]$f[ ]" > /dev/null; then
144 LD="${LD-ld} $f"
9b65d522 145 fi
1daed53f 146 done
2f403ada 147 CFLAGS="$ac_save_CFLAGS"
1daed53f
ILT
148 ;;
149
150*-*-sco3.2v5*)
151 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
152 CFLAGS="$CFLAGS -belf"
153 ;;
154esac]
155
156# Actually configure libtool. ac_aux_dir is where install-sh is found.
157CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
158LD="$LD" RANLIB="$RANLIB" LN_S="$LN_S" \
159${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
160$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
161|| AC_MSG_ERROR([libtool configure failed])
162])
163
164# AM_PROG_LD - find the path to the GNU or non-GNU linker
165AC_DEFUN(AM_PROG_LD,
166[AC_ARG_WITH(gnu-ld,
167[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
168test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
169if test "$with_gnu_ld" = yes; then
170 AC_MSG_CHECKING([for GNU ld])
171else
172 AC_MSG_CHECKING([for non-GNU ld])
173fi
174AC_CACHE_VAL(ac_cv_path_LD,
175[case "$LD" in
3b1e6264 176 "")
1daed53f
ILT
177 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
178 for ac_dir in $PATH; do
179 test -z "$ac_dir" && ac_dir=.
180 if test -f "$ac_dir/ld"; then
181 ac_cv_path_LD="$ac_dir/ld"
182 # Check to see if the program is GNU ld. I'd rather use --version,
183 # but apparently some GNU ld's only accept -v.
184 # Break only if it was the GNU/non-GNU ld that we prefer.
185 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then
186 test "$with_gnu_ld" = yes && break
187 else
188 test "$with_gnu_ld" != yes && break
189 fi
190 fi
191 done
192 IFS="$ac_save_ifs"
193 ;;
3b1e6264
ILT
194 *)
195 ac_cv_path_LD="$LD" # Let the user override the test with a path.
196 ;;
1daed53f
ILT
197esac])
198LD="$ac_cv_path_LD"
199if test -n "$LD"; then
200 AC_MSG_RESULT($LD)
201else
202 AC_MSG_RESULT(no)
203fi
204test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
205AC_SUBST(LD)
206AM_PROG_LD_GNU
207])
208
209AC_DEFUN(AM_PROG_LD_GNU,
210[AC_CACHE_CHECK([whether we are using GNU ld], ac_cv_prog_gnu_ld,
211[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
212if $LD -v 2>&1 </dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then
213 ac_cv_prog_gnu_ld=yes
9b65d522 214else
1daed53f
ILT
215 ac_cv_prog_gnu_ld=no
216fi])
217])
218
1daed53f
ILT
219# Like AC_CONFIG_HEADER, but automatically create stamp file.
220
221AC_DEFUN(AM_CONFIG_HEADER,
222[AC_PREREQ([2.12])
223AC_CONFIG_HEADER([$1])
224dnl When config.status generates a header, we must update the stamp-h file.
225dnl This file resides in the same directory as the config header
226dnl that is generated. We must strip everything past the first ":",
227dnl and everything past the last "/".
228AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
229ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
230<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
231<<am_indx=1
232for am_file in <<$1>>; do
233 case " <<$>>CONFIG_HEADERS " in
234 *" <<$>>am_file "*<<)>>
235 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
236 ;;
237 esac
238 am_indx=`expr "<<$>>am_indx" + 1`
239done<<>>dnl>>)
240changequote([,]))])
241
242# Add --enable-maintainer-mode option to configure.
243# From Jim Meyering
244
245# serial 1
246
247AC_DEFUN(AM_MAINTAINER_MODE,
248[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
249 dnl maintainer-mode is disabled by default
250 AC_ARG_ENABLE(maintainer-mode,
251[ --enable-maintainer-mode enable make rules and dependencies not useful
252 (and sometimes confusing) to the casual installer],
253 USE_MAINTAINER_MODE=$enableval,
254 USE_MAINTAINER_MODE=no)
255 AC_MSG_RESULT($USE_MAINTAINER_MODE)
256 if test $USE_MAINTAINER_MODE = yes; then
257 MAINT=
258 else
259 MAINT='#M#'
260 fi
261 AC_SUBST(MAINT)dnl
262]
263)
264
265# Check to see if we're running under Cygwin32, without using
266# AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes".
267# Otherwise set it to "no".
268
269dnl AM_CYGWIN32()
1daed53f
ILT
270AC_DEFUN(AM_CYGWIN32,
271[AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
3b1e6264 272[AC_TRY_COMPILE(,[return __CYGWIN32__;],
1daed53f
ILT
273am_cv_cygwin32=yes, am_cv_cygwin32=no)
274rm -f conftest*])
275CYGWIN32=
276test "$am_cv_cygwin32" = yes && CYGWIN32=yes])
277
278# Check to see if we're running under Win32, without using
279# AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe".
280# Otherwise set it to "".
281
282dnl AM_EXEEXT()
283dnl This knows we add .exe if we're building in the Cygwin32
284dnl environment. But if we're not, then it compiles a test program
285dnl to see if there is a suffix for executables.
286AC_DEFUN(AM_EXEEXT,
3b1e6264
ILT
287[AC_REQUIRE([AM_CYGWIN32])
288AC_REQUIRE([AM_MINGW32])
1daed53f 289AC_MSG_CHECKING([for executable suffix])
3b1e6264
ILT
290AC_CACHE_VAL(am_cv_exeext,[
291if test "$CYGWIN32" = yes -o "$MINGW32" = yes; then
1daed53f
ILT
292am_cv_exeext=.exe
293else
294cat > am_c_test.c << 'EOF'
295int main() {
296/* Nothing needed here */
297}
298EOF
299${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
3b1e6264 300am_cv_exeext=`echo am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
1daed53f
ILT
301rm -f am_c_test*])
302test x"${am_cv_exeext}" = x && am_cv_exeext=no
303fi
304EXEEXT=""
305test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
306AC_MSG_RESULT(${am_cv_exeext})
307AC_SUBST(EXEEXT)])
308
3b1e6264
ILT
309# Check to see if we're running under Mingw, without using
310# AC_CANONICAL_*. If so, set output variable MINGW32 to "yes".
311# Otherwise set it to "no".
312
313dnl AM_MINGW32()
314AC_DEFUN(AM_MINGW32,
315[AC_CACHE_CHECK(for Mingw32 environment, am_cv_mingw32,
316[AC_TRY_COMPILE(,[return __MINGW32__;],
317am_cv_mingw32=yes, am_cv_mingw32=no)
318rm -f conftest*])
319MINGW32=
320test "$am_cv_mingw32" = yes && MINGW32=yes])
321
bfc10abe
DE
322
323# serial 1
324
325# @defmac AC_PROG_CC_STDC
326# @maindex PROG_CC_STDC
327# @ovindex CC
328# If the C compiler in not in ANSI C mode by default, try to add an option
329# to output variable @code{CC} to make it so. This macro tries various
330# options that select ANSI C on some system or another. It considers the
331# compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and
332# handles function prototypes correctly.
333#
334# If you use this macro, you should check after calling it whether the C
335# compiler has been set to accept ANSI C; if not, the shell variable
336# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
337# code in ANSI C, you can make an un-ANSIfied copy of it by using the
338# program @code{ansi2knr}, which comes with Ghostscript.
339# @end defmac
340
341AC_DEFUN(AM_PROG_CC_STDC,
342[AC_REQUIRE([AC_PROG_CC])
343AC_BEFORE([$0], [AC_C_INLINE])
344AC_BEFORE([$0], [AC_C_CONST])
345AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
346AC_CACHE_VAL(am_cv_prog_cc_stdc,
347[am_cv_prog_cc_stdc=no
348ac_save_CC="$CC"
349# Don't try gcc -ansi; that turns off useful extensions and
350# breaks some systems' header files.
351# AIX -qlanglvl=ansi
352# Ultrix and OSF/1 -std1
353# HP-UX -Aa -D_HPUX_SOURCE
354# SVR4 -Xc -D__EXTENSIONS__
355for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
356do
357 CC="$ac_save_CC $ac_arg"
358 AC_TRY_COMPILE(
359[#if !defined(__STDC__) || __STDC__ != 1
360choke me
361#endif
362/* DYNIX/ptx V4.1.3 can't compile sys/stat.h with -Xc -D__EXTENSIONS__. */
363#ifdef _SEQUENT_
364# include <sys/types.h>
365# include <sys/stat.h>
366#endif
367], [
368int test (int i, double x);
369struct s1 {int (*f) (int a);};
370struct s2 {int (*f) (double a);};],
371[am_cv_prog_cc_stdc="$ac_arg"; break])
372done
373CC="$ac_save_CC"
374])
375if test -z "$am_cv_prog_cc_stdc"; then
376 AC_MSG_RESULT([none needed])
377else
378 AC_MSG_RESULT($am_cv_prog_cc_stdc)
379fi
380case "x$am_cv_prog_cc_stdc" in
381 x|xno) ;;
382 *) CC="$CC $am_cv_prog_cc_stdc" ;;
383esac
384])
385
This page took 0.164432 seconds and 4 git commands to generate.