aboutsummaryrefslogtreecommitdiff
path: root/bfd/aclocal.m4
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1995-09-04 21:13:51 +0000
committerIan Lance Taylor <ian@airs.com>1995-09-04 21:13:51 +0000
commitf515fb2f93d81fb401d86f9db2bf3c96cd659737 (patch)
tree372f7048995be9ae5056735a4d09396e09ebac23 /bfd/aclocal.m4
parent9b65d5229b483563ad484fb890f07524fcc86f05 (diff)
downloadgdb-f515fb2f93d81fb401d86f9db2bf3c96cd659737.zip
gdb-f515fb2f93d81fb401d86f9db2bf3c96cd659737.tar.gz
gdb-f515fb2f93d81fb401d86f9db2bf3c96cd659737.tar.bz2
* configure.host: Incorporate host Makefile fragments by setting
shell variables. * configure.in: Call AC_PROG_CC. Substitute CFLAGS, HDEFINES and AR. Call AC_PROG_INSTALL. Substitute CC_FOR_BUILD, choosing a value based on whether the code is being compiled by a cross compiler. Don't substitute host_makefile_frag or frags. * aclocal.m4: New file to define local AC_PROG_CC. * configure: Rebuild. * Makefile.in (INSTALL): Set to @INSTALL@. (INSTALL_PROGRAM): Set to @INSTALL_PROGRAM@. (INSTALL_DATA): Set to @INSTALL_DATA@. (AR): Set to @AR@. (CC): Define as @CC@. (CFLAGS): Set to @CFLAGS@. (CC_FOR_BUILD): Set to @CC_FOR_BUILD@. (@host_makefile_frag@): Remove. (ALL_CFLAGS): Change $(HDEFINES) to @HDEFINES@. Move $(CFLAGS) after other options. (config.status): Remove dependency upon @frags@. * config/*.mh, config/README: Remove.
Diffstat (limited to 'bfd/aclocal.m4')
-rw-r--r--bfd/aclocal.m445
1 files changed, 45 insertions, 0 deletions
diff --git a/bfd/aclocal.m4 b/bfd/aclocal.m4
new file mode 100644
index 0000000..dabc963
--- /dev/null
+++ b/bfd/aclocal.m4
@@ -0,0 +1,45 @@
+dnl
+dnl This ugly hack is needed because the Cygnus configure script won't
+dnl tell us what CC is going to be, and "cc" isn't always right. (The
+dnl top-level Makefile will always override anything we choose here, so
+dnl the usual gcc/cc selection is useless.)
+dnl
+dnl It knows where it is in the tree; don't try using it elsewhere.
+dnl
+undefine([AC_PROG_CC])dnl
+AC_DEFUN(AC_PROG_CC,
+[AC_BEFORE([$0], [AC_PROG_CPP])dnl
+dnl
+dnl The ugly bit...
+dnl
+AC_MSG_CHECKING([for CC])
+dnl Don't bother with cache.
+test -z "$CC" && CC=`egrep '^CC *=' ../Makefile | tail -1 | sed 's/^CC *= *//'`
+test -z "$CC" && CC=cc
+AC_MSG_RESULT(setting CC to $CC)
+AC_SUBST(CC)
+dnl
+dnl Find out if we are using GNU C, under whatever name.
+dnl The semicolon is to pacify NeXT's syntax-checking cpp.
+cat > conftest.c <<EOF
+#ifdef __GNUC__
+ yes;
+#endif
+EOF
+if ${CC-cc} -E conftest.c 2>&AC_FD_CC | egrep yes >/dev/null 2>&1; then
+ GCC=yes
+ if test "${CFLAGS+set}" != set; then
+ echo 'void f(){}' > conftest.c
+ if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+ CFLAGS="-g -O"
+ else
+ CFLAGS="-O"
+ fi
+ fi
+else
+ GCC=
+ test "${CFLAGS+set}" = set || CFLAGS="-g"
+fi
+rm -f conftest*
+])dnl
+dnl