1 dnl aclocal.m4 generated automatically by aclocal 1.2
3 dnl GAS_CHECK_DECL_NEEDED(name, typedefname, typedef, headers)
4 AC_DEFUN(GAS_CHECK_DECL_NEEDED,[
5 AC_MSG_CHECKING(whether declaration is required for $1)
6 AC_CACHE_VAL(gas_cv_decl_needed_$1,
12 ], gas_cv_decl_needed_$1=no, gas_cv_decl_needed_$1=yes))dnl
13 AC_MSG_RESULT($gas_cv_decl_needed_$1)
14 test $gas_cv_decl_needed_$1 = no || {
15 ifelse(index($1,[$]),-1,
16 [AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]))],
17 [gas_decl_name_upcase=`echo $1 | tr '[a-z]' '[A-Z]'`
18 AC_DEFINE_UNQUOTED(NEED_DECLARATION_$gas_decl_name_upcase)])
22 dnl Some non-ANSI preprocessors botch requoting inside strings. That's bad
23 dnl enough, but on some of those systems, the assert macro relies on requoting
25 dnl GAS_WORKING_ASSERT
26 AC_DEFUN(GAS_WORKING_ASSERT,
27 [AC_MSG_CHECKING([for working assert macro])
28 AC_CACHE_VAL(gas_cv_assert_ok,
29 AC_TRY_LINK([#include <assert.h>
30 #include <stdio.h>], [
31 /* check for requoting problems */
32 static int a, b, c, d;
34 assert (!strcmp(s, "foo bar baz quux"));
35 /* check for newline handling */
38 ], gas_cv_assert_ok=yes, gas_cv_assert_ok=no))dnl
39 AC_MSG_RESULT($gas_cv_assert_ok)
40 test $gas_cv_assert_ok = yes || AC_DEFINE(BROKEN_ASSERT)
43 dnl Since many Bourne shell implementations lack subroutines, use this
44 dnl hack to simplify the code in configure.in.
47 [_gas_uniq_list="[$]$1"
49 dnl Protect against empty input list.
50 for _gas_uniq_i in _gas_uniq_dummy [$]_gas_uniq_list ; do
51 case [$]_gas_uniq_i in
53 *) case " [$]_gas_uniq_newlist " in
54 *" [$]_gas_uniq_i "*) ;;
55 *) _gas_uniq_newlist="[$]_gas_uniq_newlist [$]_gas_uniq_i" ;;
59 $1=[$]_gas_uniq_newlist
62 # Do all the work for Automake. This macro actually does too much --
63 # some checks are only needed if your package does certain things.
64 # But this isn't really a big deal.
69 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
71 AC_DEFUN(AM_INIT_AUTOMAKE,
72 [AC_REQUIRE([AM_PROG_INSTALL])
77 dnl test to see if srcdir already configured
78 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
79 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
82 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
83 AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
86 dnl FIXME This is truly gross.
87 missing_dir=`cd $ac_aux_dir && pwd`
88 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
89 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
90 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
91 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
92 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
98 AC_DEFUN(AM_PROG_INSTALL,
99 [AC_REQUIRE([AC_PROG_INSTALL])
100 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
101 AC_SUBST(INSTALL_SCRIPT)dnl
105 # Check to make sure that the build environment is sane.
108 AC_DEFUN(AM_SANITY_CHECK,
109 [AC_MSG_CHECKING([whether build environment is sane])
112 echo timestamp > conftestfile
113 # Do `set' in a subshell so we don't clobber the current shell's
114 # arguments. Must try -L first in case configure is actually a
115 # symlink; some systems play weird games with the mod time of symlinks
116 # (eg FreeBSD returns the mod time of the symlink's containing
119 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
120 if test "$@" = "X"; then
122 set X `ls -t $srcdir/configure conftestfile`
124 test "[$]2" = conftestfile
130 AC_MSG_ERROR([newly created file is older than distributed files!
131 Check your system clock])
136 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
137 dnl The program must properly implement --version.
138 AC_DEFUN(AM_MISSING_PROG,
139 [AC_MSG_CHECKING(for working $2)
140 # Run test in a subshell; some versions of sh will print an error if
141 # an executable is not found, even if stderr is redirected.
142 # Redirect stdin to placate older versions of autoconf. Sigh.
143 if ($2 --version) < /dev/null > /dev/null 2>&1; then
148 AC_MSG_RESULT(missing)
153 # serial 9 AM_PROG_LIBTOOL
154 AC_DEFUN(AM_PROG_LIBTOOL,
155 [AC_REQUIRE([AC_CANONICAL_HOST])
156 AC_REQUIRE([AC_PROG_CC])
157 AC_REQUIRE([AC_PROG_RANLIB])
158 AC_REQUIRE([AM_PROG_LD])
159 AC_REQUIRE([AC_PROG_LN_S])
161 # Always use our own libtool.
162 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
165 dnl CYGNUS LOCAL arguments to enable-shared
166 dnl Allow the --disable-shared flag to stop us from building shared libs.
167 AC_ARG_ENABLE(shared,
168 [ --enable-shared build shared libraries [default=yes]],
169 [p=${PACKAGE-bogus-package-name}
171 yes) enable_shared=yes ;;
172 no) enable_shared=no ;;
173 # The value of $p (aka $PACKAGE) is assumed to come from AM_INIT_AUTOMAKE.
174 # If it didn't, it'll be `bogus-package-name', thus making this condition
176 *$p*) enable_shared=yes ;;
180 test "$enable_shared" = no && libtool_shared=" --disable-shared"
183 dnl Allow the --disable-static flag to stop us from building static libs.
184 AC_ARG_ENABLE(static,
185 [ --enable-static build static libraries [default=yes]],
186 [if test "$enableval" = no; then
192 test "$enable_static" = no && libtool_static=" --disable-static"
194 libtool_flags="$libtool_shared$libtool_static"
195 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
196 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
197 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
199 # Some flags need to be propagated to the compiler or linker for good
203 ac_save_CFLAGS="$CFLAGS"
204 # -n32 always needs to be added to the linker when using GCC.
205 test "$ac_cv_prog_gcc" = yes && CFLAGS="$CFLAGS -n32"
206 for f in '-32' '-64' '-cckr' '-n32' '-mips1' '-mips2' '-mips3' '-mips4'; do
207 if echo " $CC $CFLAGS " | egrep -e "[ ]$f[ ]" > /dev/null; then
211 CFLAGS="$ac_save_CFLAGS"
215 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
216 CFLAGS="$CFLAGS -belf"
220 # Actually configure libtool. ac_aux_dir is where install-sh is found.
221 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
222 LD="$LD" RANLIB="$RANLIB" LN_S="$LN_S" \
223 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
224 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
225 || AC_MSG_ERROR([libtool configure failed])
228 # AM_PROG_LD - find the path to the GNU or non-GNU linker
231 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
232 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
233 if test "$with_gnu_ld" = yes; then
234 AC_MSG_CHECKING([for GNU ld])
236 AC_MSG_CHECKING([for non-GNU ld])
238 AC_CACHE_VAL(ac_cv_path_LD,
241 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
242 for ac_dir in $PATH; do
243 test -z "$ac_dir" && ac_dir=.
244 if test -f "$ac_dir/ld"; then
245 ac_cv_path_LD="$ac_dir/ld"
246 # Check to see if the program is GNU ld. I'd rather use --version,
247 # but apparently some GNU ld's only accept -v.
248 # Break only if it was the GNU/non-GNU ld that we prefer.
249 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then
250 test "$with_gnu_ld" = yes && break
252 test "$with_gnu_ld" != yes && break
259 ac_cv_path_LD="$LD" # Let the user override the test with a path.
263 if test -n "$LD"; then
268 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
273 AC_DEFUN(AM_PROG_LD_GNU,
274 [AC_CACHE_CHECK([whether we are using GNU ld], ac_cv_prog_gnu_ld,
275 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
276 if $LD -v 2>&1 </dev/null | egrep '(GNU ld|with BFD)' > /dev/null; then
277 ac_cv_prog_gnu_ld=yes
283 # Like AC_CONFIG_HEADER, but automatically create stamp file.
285 AC_DEFUN(AM_CONFIG_HEADER,
287 AC_CONFIG_HEADER([$1])
288 dnl When config.status generates a header, we must update the stamp-h file.
289 dnl This file resides in the same directory as the config header
290 dnl that is generated. We must strip everything past the first ":",
291 dnl and everything past the last "/".
292 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
293 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
294 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
296 for am_file in <<$1>>; do
297 case " <<$>>CONFIG_HEADERS " in
298 *" <<$>>am_file "*<<)>>
299 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
302 am_indx=`expr "<<$>>am_indx" + 1`
306 # Add --enable-maintainer-mode option to configure.
311 AC_DEFUN(AM_MAINTAINER_MODE,
312 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
313 dnl maintainer-mode is disabled by default
314 AC_ARG_ENABLE(maintainer-mode,
315 [ --enable-maintainer-mode enable make rules and dependencies not useful
316 (and sometimes confusing) to the casual installer],
317 USE_MAINTAINER_MODE=$enableval,
318 USE_MAINTAINER_MODE=no)
319 AC_MSG_RESULT($USE_MAINTAINER_MODE)
320 if test $USE_MAINTAINER_MODE = yes; then
329 # Check to see if we're running under Cygwin32, without using
330 # AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes".
331 # Otherwise set it to "no".
334 AC_DEFUN(AM_CYGWIN32,
335 [AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
336 [AC_TRY_COMPILE(,[return __CYGWIN32__;],
337 am_cv_cygwin32=yes, am_cv_cygwin32=no)
340 test "$am_cv_cygwin32" = yes && CYGWIN32=yes])
342 # Check to see if we're running under Win32, without using
343 # AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe".
344 # Otherwise set it to "".
347 dnl This knows we add .exe if we're building in the Cygwin32
348 dnl environment. But if we're not, then it compiles a test program
349 dnl to see if there is a suffix for executables.
351 [AC_REQUIRE([AM_CYGWIN32])
352 AC_REQUIRE([AM_MINGW32])
353 AC_MSG_CHECKING([for executable suffix])
354 AC_CACHE_VAL(am_cv_exeext,[
355 if test "$CYGWIN32" = yes -o "$MINGW32" = yes; then
358 cat > am_c_test.c << 'EOF'
360 /* Nothing needed here */
363 ${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
364 am_cv_exeext=`echo am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
366 test x"${am_cv_exeext}" = x && am_cv_exeext=no
369 test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
370 AC_MSG_RESULT(${am_cv_exeext})
373 # Check to see if we're running under Mingw, without using
374 # AC_CANONICAL_*. If so, set output variable MINGW32 to "yes".
375 # Otherwise set it to "no".
379 [AC_CACHE_CHECK(for Mingw32 environment, am_cv_mingw32,
380 [AC_TRY_COMPILE(,[return __MINGW32__;],
381 am_cv_mingw32=yes, am_cv_mingw32=no)
384 test "$am_cv_mingw32" = yes && MINGW32=yes])