autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch to record GCC revision in config.log


From: Mo DeJong
Subject: Patch to record GCC revision in config.log
Date: Wed, 28 Mar 2001 10:58:18 -0800 (PST)

Hello.

Here is a little patch that will record the revision
of a GNU compiler if one is detected in
_AC_LANG_COMPILER_GNU. It is common for a user
to report a build problem and not include the
rev of the compiler they are using. By recording
this info in config.log, we save ourselves the
hassle of tracking the user down and having them
run "gcc -v" at the command line.

Here is what shows up in config.log after this
patch has been applied:

configure:1606: checking whether we are using the GNU C++ compiler
configure:1627: g++ -c   conftest.cc >&5
configure:1630: $? = 0
configure:1633: test -s conftest.o
configure:1636: $? = 0
Gnu Compiler Revision:
egcs-2.91.66

Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
...



2001-03-28  Mo DeJong  <address@hidden>

        * aclang.m4 (_AC_LANG_COMPILER_GNU): Record
        the compiler revision and the spec file
        location when the GNU compiler is detected.


diff -u -r1.124 aclang.m4
--- aclang.m4   2001/03/13 12:28:19     1.124
+++ aclang.m4   2001/03/28 18:51:33
@@ -550,6 +550,19 @@
                    [ac_compiler_gnu=yes],
                    [ac_compiler_gnu=no])
 ac_cv_[]_AC_LANG_ABBREV[]_compiler_gnu=$ac_compiler_gnu
+# Add the GNU compiler revision to the log file
+if test "x$ac_compiler_gnu" = "xyes" ; then
+    # This is kind of nasty, but I could not find
+    # any other way to get the name of the compiler
+    # that would work for both CC and CXX.
+    for compiler in $ac_compile ; do
+        break
+    done
+    echo "Gnu Compiler Revision:" >&AS_MESSAGE_LOG_FD
+    eval "$compiler --version >&AS_MESSAGE_LOG_FD"
+    echo "" >&AS_MESSAGE_LOG_FD
+    eval "$compiler -v 2>&AS_MESSAGE_LOG_FD"
+fi
 ])])# _AC_LANG_COMPILER_GNU

Mo DeJong
Red Hat Inc




reply via email to

[Prev in Thread] Current Thread [Next in Thread]