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