* gas/v850/basic.exp (jump_tests): Test instruction bit patterns,
[deliverable/binutils-gdb.git] / gas / aclocal.m4
CommitLineData
b11fb939 1dnl
b11fb939
KR
2dnl This ugly hack is needed because the Cygnus configure script won't
3dnl tell us what CC is going to be, and "cc" isn't always right. (The
4dnl top-level Makefile will always override anything we choose here, so
5dnl the usual gcc/cc selection is useless.)
6dnl
7dnl It knows where it is in the tree; don't try using it elsewhere.
8dnl
9undefine([AC_PROG_CC])dnl
bf111c9f 10AC_DEFUN(AC_PROG_CC,
b11fb939 11[AC_BEFORE([$0], [AC_PROG_CPP])dnl
b11fb939
KR
12dnl
13dnl The ugly bit...
14dnl
15AC_MSG_CHECKING([for CC])
16dnl Don't bother with cache.
17test -z "$CC" && CC=`egrep '^CC *=' ../Makefile | tail -1 | sed 's/^CC *= *//'`
18test -z "$CC" && CC=cc
19AC_MSG_RESULT(setting CC to $CC)
20AC_SUBST(CC)
21dnl
22dnl
23# Find out if we are using GNU C, under whatever name.
24cat > conftest.c <<EOF
25#ifdef __GNUC__
26 yes
27#endif
28EOF
29${CC-cc} -E conftest.c > conftest.out 2>&1
30if egrep yes conftest.out >/dev/null 2>&1; then
31 GCC=yes
32else
33 GCC=
34fi
35rm -f conftest*
36])dnl
bf111c9f
KR
37dnl
38dnl GAS_CHECK_DECL_NEEDED(name, typedefname, typedef, headers)
39AC_DEFUN(GAS_CHECK_DECL_NEEDED,[
40AC_MSG_CHECKING(whether declaration is required for $1)
41AC_CACHE_VAL(gas_cv_decl_needed_$1,
42AC_TRY_LINK([$4],
43[
44typedef $3;
45$2 x;
46x = ($2) $1;
47], gas_cv_decl_needed_$1=no, gas_cv_decl_needed_$1=yes))dnl
48AC_MSG_RESULT($gas_cv_decl_needed_$1)
49test $gas_cv_decl_needed_$1 = no || {
50 ifelse(index($1,[$]),-1,
51 [AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]))],
52 [gas_decl_name_upcase=`echo $1 | tr '[a-z]' '[A-Z]'`
53 AC_DEFINE_UNQUOTED(NEED_DECLARATION_$gas_decl_name_upcase)])
54}
55])dnl
56dnl
57dnl Some non-ANSI preprocessors botch requoting inside strings. That's bad
58dnl enough, but on some of those systems, the assert macro relies on requoting
59dnl working properly!
60dnl GAS_WORKING_ASSERT
61AC_DEFUN(GAS_WORKING_ASSERT,
62[AC_MSG_CHECKING([for working assert macro])
63AC_CACHE_VAL(gas_cv_assert_ok,
64AC_TRY_LINK([#include <assert.h>
65#include <stdio.h>], [
66/* check for requoting problems */
67static int a, b, c, d;
68static char *s;
69assert (!strcmp(s, "foo bar baz quux"));
70/* check for newline handling */
71assert (a == b
72 || c == d);
73], gas_cv_assert_ok=yes, gas_cv_assert_ok=no))dnl
74AC_MSG_RESULT($gas_cv_assert_ok)
75test $gas_cv_assert_ok = yes || AC_DEFINE(BROKEN_ASSERT)
76])dnl
e23b25ec
KR
77dnl
78dnl GAS_GDBINIT
79dnl Generates a .gdbinit file in the build directory pointing gdb to
80dnl srcdir, if srcdir != PWD.
81AC_DEFUN(GAS_GDBINIT,
82[if test `cd $srcdir;pwd` = `pwd` ; then
83 rm -f .gdbinit
84 cat > .gdbinit << EOF
85dir $srcdir
86dir .
87source $srcdir/.gdbinit
88EOF
89fi
90])dnl
This page took 0.0800070000000001 seconds and 4 git commands to generate.