Improve compiler string shown in version()
authorPeter Eisentraut <peter_e@gmx.net>
Fri, 6 May 2011 19:14:53 +0000 (22:14 +0300)
committerPeter Eisentraut <peter_e@gmx.net>
Fri, 6 May 2011 20:01:50 +0000 (23:01 +0300)
With some compilers such as Clang and ICC emulating GCC, using a
version string of the form "GCC $version" can be quite misleading.
Also, a great while ago, the version output from gcc --version started
including the string "gcc", so it is redundant to repeat that.  In
order to support ancient GCC versions, we now prefix the result with
"GCC " only if the version output does not start with a letter.

configure
configure.in

index 3819732ca056e15ccbbc2430e351565d64590567..fc37715cd0eb8abc28f3bc292785cf75ba28168e 100755 (executable)
--- a/configure
+++ b/configure
@@ -29704,7 +29704,8 @@ $as_echo "$as_me: using LDFLAGS=$LDFLAGS" >&6;}
 
 # Create compiler version string
 if test x"$GCC" = x"yes" ; then
-  cc_string="GCC `${CC} --version | sed q`"
+  cc_string=`${CC} --version | sed q`
+  case $cc_string in [A-Za-z]*) ;; *) cc_string="GCC $cc_string";; esac
 elif test x"$SUN_STUDIO_CC" = x"yes" ; then
   cc_string=`${CC} -V 2>&1 | sed q`
 else
index fa6d9e5d7c66c027234cc4fb1ad9d8e248818cc4..0a85a05641fa236d342858d7a84118e0eb48f016 100644 (file)
@@ -1849,7 +1849,8 @@ AC_MSG_NOTICE([using LDFLAGS=$LDFLAGS])
 
 # Create compiler version string
 if test x"$GCC" = x"yes" ; then
-  cc_string="GCC `${CC} --version | sed q`"
+  cc_string=`${CC} --version | sed q`
+  case $cc_string in [[A-Za-z]]*) ;; *) cc_string="GCC $cc_string";; esac
 elif test x"$SUN_STUDIO_CC" = x"yes" ; then
   cc_string=`${CC} -V 2>&1 | sed q`
 else