tweaks
[deliverable/binutils-gdb.git] / opcodes / aclocal.m4
CommitLineData
9b65d522
ILT
1dnl
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
10AC_DEFUN(AC_PROG_CC,
11[AC_BEFORE([$0], [AC_PROG_CPP])dnl
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 Find out if we are using GNU C, under whatever name.
23dnl The semicolon is to pacify NeXT's syntax-checking cpp.
24cat > conftest.c <<EOF
25#ifdef __GNUC__
26 yes;
27#endif
28EOF
29if ${CC-cc} -E conftest.c 2>&AC_FD_CC | egrep yes >/dev/null 2>&1; then
30 GCC=yes
31 if test "${CFLAGS+set}" != set; then
32 echo 'void f(){}' > conftest.c
33 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
34 CFLAGS="-g -O"
35 else
36 CFLAGS="-O"
37 fi
38 fi
39else
40 GCC=
41 test "${CFLAGS+set}" = set || CFLAGS="-g"
42fi
43rm -f conftest*
44])dnl
45dnl
This page took 0.11851 seconds and 4 git commands to generate.