changeset 26636:d3ce3939637a

Rewrite (gcc) compiler check to default to enabling compilation and not set gcc-specific variables before the compiler is confirmed to be gcc.
author diego
date Sun, 04 May 2008 11:35:07 +0000
parents 540968176bbf
children e3fd577a9573
files configure
diffstat 1 files changed, 8 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Sat May 03 20:14:50 2008 +0000
+++ b/configure	Sun May 04 11:35:07 2008 +0000
@@ -1419,7 +1419,6 @@
       ;;
     10.1)
       cc_version="$cc_version, ok"
-      cc_fail=no
       ;;
     *)
       cc_version="$cc_version, bad"
@@ -1428,36 +1427,26 @@
   esac
   echores "$cc_version"
 else
-  for _cc in "$_cc" gcc cc ; do
+  for _cc in "$_cc" cc gcc ; do
+    cc_name_tmp=`$_cc -v 2>&1 | _tail 1 | cut -d ' ' -f 1`
+    if test "$cc_name_tmp" = "gcc"; then
+    cc_name=$cc_name_tmp
     echocheck "$_cc version"
     cc_vendor=gnu
-    cc_name=`$_cc -v 2>&1 | _tail 1 | cut -d ' ' -f 1`
     cc_version=`$_cc -dumpversion 2>&1`
-    if test "$?" -gt 0; then
-      cc_version="not found"
-    fi
     case $cc_version in
-      '')
-        cc_version="v. ?.??, bad"
+      2.96*)
         cc_fail=yes
         ;;
-      2.95.[2-9]|2.95.[2-9][-.]*|[3-4].*)
+      *)
         _cc_major=`echo $cc_version | cut -d '.' -f 1`
         _cc_minor=`echo $cc_version | cut -d '.' -f 2`
         _cc_mini=`echo $cc_version | cut -d '.' -f 3`
-        cc_version="$cc_version, ok"
-        cc_fail=no
-        ;;
-      'not found')
-        cc_fail=yes
-        ;;
-      *)
-        cc_version="$cc_version, bad"
-        cc_fail=yes
         ;;
     esac
     echores "$cc_version"
-    test "$cc_fail" = "no" && break
+    break
+    fi
   done
 fi # icc
 test "$cc_fail" = yes && die "unsupported compiler version"