aboutsummaryrefslogtreecommitdiff
path: root/gas/aclocal.m4
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@cygnus>1994-09-07 23:34:23 +0000
committerKen Raeburn <raeburn@cygnus>1994-09-07 23:34:23 +0000
commitbf111c9f7dabd9b0268ab8399e4af804d1267f9b (patch)
tree8f31d91d7075eec1336f6b07a96357e974d83a48 /gas/aclocal.m4
parentdc5fff10ddef27925f050618d92912b8b76643ce (diff)
downloadgdb-bf111c9f7dabd9b0268ab8399e4af804d1267f9b.zip
gdb-bf111c9f7dabd9b0268ab8399e4af804d1267f9b.tar.gz
gdb-bf111c9f7dabd9b0268ab8399e4af804d1267f9b.tar.bz2
Update for autoconf beta 1.112:
* aclocal.m4 (GAS_CHECK_DECL_NEEDED, GAS_WORKING_ASSERT): New macros. * configure.in: Use them. Use AC_ARG_PROGRAM (now provided by autoconf) instead of my hacked-up AC_PROGRAM_TRANSFORM_NAME. Move test for CROSS_COMPILE just before AC_FUNC_ALLOCA, and emit a message to try to ease confusion about autoconf's "cross-compiling" message. * acconfig.h (NEED_DECLARATION_MALLOC, NEED_DECLARATION_FREE, NEED_DECLARATION_ERRNO): Renamed from NEED_*_DECLARATION. * configure, conf.in: Regenerated.
Diffstat (limited to 'gas/aclocal.m4')
-rw-r--r--gas/aclocal.m443
1 files changed, 41 insertions, 2 deletions
diff --git a/gas/aclocal.m4 b/gas/aclocal.m4
index bc7455d..d9d03c7 100644
--- a/gas/aclocal.m4
+++ b/gas/aclocal.m4
@@ -7,9 +7,8 @@ dnl
dnl It knows where it is in the tree; don't try using it elsewhere.
dnl
undefine([AC_PROG_CC])dnl
-define(AC_PROG_CC,
+AC_DEFUN(AC_PROG_CC,
[AC_BEFORE([$0], [AC_PROG_CPP])dnl
-AC_PROVIDE([$0])dnl
dnl
dnl The ugly bit...
dnl
@@ -35,3 +34,43 @@ else
fi
rm -f conftest*
])dnl
+dnl
+dnl GAS_CHECK_DECL_NEEDED(name, typedefname, typedef, headers)
+AC_DEFUN(GAS_CHECK_DECL_NEEDED,[
+AC_MSG_CHECKING(whether declaration is required for $1)
+AC_CACHE_VAL(gas_cv_decl_needed_$1,
+AC_TRY_LINK([$4],
+[
+typedef $3;
+$2 x;
+x = ($2) $1;
+], gas_cv_decl_needed_$1=no, gas_cv_decl_needed_$1=yes))dnl
+AC_MSG_RESULT($gas_cv_decl_needed_$1)
+test $gas_cv_decl_needed_$1 = no || {
+ ifelse(index($1,[$]),-1,
+ [AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]))],
+ [gas_decl_name_upcase=`echo $1 | tr '[a-z]' '[A-Z]'`
+ AC_DEFINE_UNQUOTED(NEED_DECLARATION_$gas_decl_name_upcase)])
+}
+])dnl
+dnl
+dnl Some non-ANSI preprocessors botch requoting inside strings. That's bad
+dnl enough, but on some of those systems, the assert macro relies on requoting
+dnl working properly!
+dnl GAS_WORKING_ASSERT
+AC_DEFUN(GAS_WORKING_ASSERT,
+[AC_MSG_CHECKING([for working assert macro])
+AC_CACHE_VAL(gas_cv_assert_ok,
+AC_TRY_LINK([#include <assert.h>
+#include <stdio.h>], [
+/* check for requoting problems */
+static int a, b, c, d;
+static char *s;
+assert (!strcmp(s, "foo bar baz quux"));
+/* check for newline handling */
+assert (a == b
+ || c == d);
+], gas_cv_assert_ok=yes, gas_cv_assert_ok=no))dnl
+AC_MSG_RESULT($gas_cv_assert_ok)
+test $gas_cv_assert_ok = yes || AC_DEFINE(BROKEN_ASSERT)
+])dnl