Commit e5706ccb authored by Lutz Jänicke's avatar Lutz Jänicke
Browse files

Use -dumpversion to obtain gcc's version.

Submitted by: ross.alexander@uk.neceur.com, allenh@eecs.berkeley.edu
Reviewed by:
PR: 96
parent 9a82ef52
Loading
Loading
Loading
Loading
+4 −5
Original line number Original line Diff line number Diff line
@@ -390,13 +390,12 @@ exit 0


# figure out if gcc is available and if so we use it otherwise
# figure out if gcc is available and if so we use it otherwise
# we fallback to whatever cc does on the system
# 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
if [ "$GCCVER" != "" ]; then
  CC=gcc
  CC=gcc
  # then strip off whatever prefix Cygnus as well as GCC 3.1 prepends
  # Since gcc 3.1 gcc --version behaviour has changed.  gcc -dumpversion
  # the number with...  Hopefully, this will work for any future prefixes
  # does give us what we want though, so we use that.  We just just the
  # as well.
  # major and minor version numbers.
  GCCVER=`echo $GCCVER | sed 's/^[a-zA-Z ()---]*//'`
  # peak single digit before and after first dot, e.g. 2.95.1 gives 29
  # 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/'`
  GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'`
else
else