From 68927d3670b01fdc1487f2d6dc3df1ed1f3d43be Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Wed, 5 Jun 2002 05:00:30 +0000 Subject: [PATCH] Update the recognision of GCC version numbers to handle the prefix text that GCC 3.1 adds to the --version output --- config | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/config b/config index cbda6ac1f4..b24c231a9c 100755 --- a/config +++ b/config @@ -381,11 +381,13 @@ done # 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` +GCCVER=`(gcc --version) 2>/dev/null | head -1` if [ "$GCCVER" != "" ]; then CC=gcc - # then strip off whatever prefix Cygnus prepends the number with... - GCCVER=`echo $GCCVER | sed 's/^[a-z]*\-//'` + # 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 ()]*\-//'` # 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 -- 2.25.1