It seems like sun4u doesn't always have a sparcv9 inside. Trust isalist.
[openssl.git] / config
diff --git a/config b/config
index 8c80670a087942ebcaf25d7d8784cc0d742f47b2..7cfc4f93306154536d03ee3813e8bd686fcefd2d 100755 (executable)
--- a/config
+++ b/config
@@ -390,13 +390,15 @@ exit 0
 
 # figure out if gcc is available and if so we use it otherwise
 # we fallback to whatever cc does on the system
-GCCVER=`(gcc --version) 2>/dev/null | head -1`
+GCCVER=`(gcc -dumpversion) 2>/dev/null`
 if [ "$GCCVER" != "" ]; then
   CC=gcc
-  # then strip off whatever prefix Cygnus as well as GCC 3.1 prepends
-  # the number with...  Hopefully, this will work for any future prefixes
-  # as well.
-  GCCVER=`echo $GCCVER | sed 's/^[a-zA-Z ()---]*//'`
+  # then strip off whatever prefix egcs prepends the number with...
+  # Hopefully, this will work for any future prefixes as well.
+  GCCVER=`echo $GCCVER | sed 's/^[a-zA-Z]*\-//'`
+  # Since gcc 3.1 gcc --version behaviour has changed.  gcc -dumpversion
+  # does give us what we want though, so we use that.  We just just the
+  # major and minor version numbers.
   # peak single digit before and after first dot, e.g. 2.95.1 gives 29
   GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'`
 else
@@ -593,8 +595,10 @@ EOF
         fi ;;
   *-*-linux1) OUT="linux-aout" ;;
   sun4u*-*-solaris2)
-       OUT="solaris-sparcv9-$CC"
-       ISA64=`(isalist) 2>/dev/null | grep sparcv9`
+       ISA=`(isalist) 2>/dev/null`
+       ISA64=`echo $ISA | grep sparcv9`
+       ISA=`set $ISA; echo $1`
+       OUT="solaris-$ISA-$CC" ;;
        if [ "$ISA64" != "" ]; then
            if [ "$CC" = "cc" -a $CCVER -ge 50 ]; then
                echo "WARNING! If you wish to build 64-bit library, then you have to"