aboutsummaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1996-01-12 20:26:05 +0000
committerIan Lance Taylor <ian@airs.com>1996-01-12 20:26:05 +0000
commitb5ae84191310fad7720453da41fa86ec21590004 (patch)
treeb7ebd853fde77e45e162933c8433537fe05b072e /configure.in
parent23cb3b650466e01046357408bb097e2e33132b41 (diff)
downloadgdb-b5ae84191310fad7720453da41fa86ec21590004.zip
gdb-b5ae84191310fad7720453da41fa86ec21590004.tar.gz
gdb-b5ae84191310fad7720453da41fa86ec21590004.tar.bz2
* configure.in: Make sure that ${CC} can be used to compile an
executable.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in16
1 files changed, 16 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index fdfeab6..7913e4a 100644
--- a/configure.in
+++ b/configure.in
@@ -672,6 +672,22 @@ fi
# post-target:
+# Make sure that the compiler is able to generate an executable. If it
+# can't, we are probably in trouble. We don't care whether we can run the
+# executable--we might be using a cross compiler--we only care whether it
+# can be created. At this point the main configure script has set CC.
+echo "int main () { return 0; }" > conftest.c
+${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c
+if [ $? = 0 ] && [ -s conftest ]; then
+ :
+else
+ echo 1>&2 "*** The command '${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c' failed."
+ echo 1>&2 "*** You must set the environment variable CC to a working compiler."
+ rm -f conftest*
+ exit 1
+fi
+rm -f conftest*
+
# Record target_configdirs and the configure arguments in Makefile.
target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
targargs=`echo "${arguments}" | \