From: H.Merijn Brand <h.m.brand@xs4all.nl>
Date: Fri, 12 Jan 2007 15:15:13 +0000 (+0000)
Subject: gcc -dumpversion is at least supported back to 2.7.x and
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0baa094867867dae4d06080810389e0a395c66b9;p=p5sagit%2Fp5-mst-13.2.git

gcc -dumpversion is at least supported back to 2.7.x and
thus seems to be much more defensive against upcoming version
reporting format changes.

p4raw-id: //depot/perl@29777
---

diff --git a/hints/aix.sh b/hints/aix.sh
index 835d23b..a9d0715 100644
--- a/hints/aix.sh
+++ b/hints/aix.sh
@@ -109,7 +109,7 @@ case "$cc" in
 	ccdlflags='-Xlinker'
 	if [ "X$gccversion" = "X" ]; then
 	    # Done too late in Configure if hinted
-	    gccversion=`$cc --version | sed 's/.*(GCC) *//'`
+	    gccversion=`$cc -dumpversion`
 	    fi
 	;;
 
diff --git a/hints/aix_3.sh b/hints/aix_3.sh
index e24e105..6a7a3c1 100644
--- a/hints/aix_3.sh
+++ b/hints/aix_3.sh
@@ -91,7 +91,7 @@ case "$cc" in
         ccdlflags='-Xlinker'
         if [ "X$gccversion" = "X" ]; then
 	    # Done too late in Configure if hinted
-	    gccversion=`$cc --version | sed 's/.*(GCC) *//'`
+	    gccversion=`$cc -dumpversion`
 	    fi
         ;;
 
diff --git a/hints/aix_4.sh b/hints/aix_4.sh
index 489ce89..46e8d25 100755
--- a/hints/aix_4.sh
+++ b/hints/aix_4.sh
@@ -130,7 +130,7 @@ case "$cc" in
 	ccdlflags='-Xlinker'
 	if [ "X$gccversion" = "X" ]; then
 	    # Done too late in Configure if hinted
-	    gccversion=`$cc --version | sed 's/.*(GCC) *//'`
+	    gccversion=`$cc -dumpversion`
 	    fi
 	;;
 
diff --git a/hints/dec_osf.sh b/hints/dec_osf.sh
index 336e0ef..cf557ea 100644
--- a/hints/dec_osf.sh
+++ b/hints/dec_osf.sh
@@ -71,7 +71,7 @@ esac
 case "$isgcc" in
 gcc)	if [ "X$gccversion" = "X" ]; then
 	    # Done too late in Configure if hinted
-	    gccversion=`$cc --version | sed 's/.*(GCC) *//'`
+	    gccversion=`$cc -dumpversion`
 	fi
 	set $gccversion
 	if test "$1" -lt 2 -o \( "$1" -eq 2 -a \( "$2" -lt 95 -o \( "$2" -eq 95 -a "$3" -lt 3 \) \) \); then
diff --git a/hints/hpux.sh b/hints/hpux.sh
index df677ff..762afe7 100644
--- a/hints/hpux.sh
+++ b/hints/hpux.sh
@@ -78,7 +78,7 @@ case `$cc -v 2>&1`"" in
 	    ccflags="$cc_cppflags"
 	    if [ "X$gccversion" = "X" ]; then
 		# Done too late in Configure if hinted
-		gccversion=`$cc --version | sed 's/.*(GCC) *//'`
+		gccversion=`$cc -dumpversion`
 		fi
 	    case "$gccversion" in
 		[012]*) # HP-UX and gcc-2.* break UINT32_MAX :-(
diff --git a/hints/svr5.sh b/hints/svr5.sh
index ff08fcc..ef1d7d5 100644
--- a/hints/svr5.sh
+++ b/hints/svr5.sh
@@ -12,7 +12,7 @@ case "$cc" in
     #  "$gccversion" not set yet
     if [ "X$gccversion" = "X" ]; then
 	# Done too late in Configure if hinted
-	gccversion=`$cc --version | sed 's/.*(GCC) *//'`
+	gccversion=`$cc -dumpversion`
     fi
     case $gccversion in
     *2.95*)
diff --git a/hints/vos.sh b/hints/vos.sh
index a5bf337..d32f7e6 100644
--- a/hints/vos.sh
+++ b/hints/vos.sh
@@ -110,7 +110,7 @@ if $cc -o t001 -O $ccflags $ldflags ../hints/t001.c; then
 	gccbug=`$run ./t001`
 	if [ "X$gccversion" = "X" ]; then
 		# Done too late in Configure if hinted
-		gccversion=`$cc --version | sed 's/.*(GCC) *//'`
+		gccversion=`$cc -dumpversion`
 	fi
 	case "$gccbug" in
 	*fails*)	cat >&4 <<EOF