diff mbox

RFA: PATCH to acinclude.m4 to fix gas version detection

Message ID 5072E5FF.9020608@redhat.com
State New
Headers show

Commit Message

Jason Merrill Oct. 8, 2012, 2:41 p.m. UTC
On 10/04/2012 11:40 AM, Jason Merrill wrote:
> Recent versions of binutils seem to have started putting ' around the
> version number in bfd/configure.in, which was confusing gcc configure.

When this change was made to binutils, the other directories changed to 
using bfd/configure --version to get the version number, so this version 
of my patch uses that instead of changing the regexp.  This patch also 
fixes another issue I noticed with AIX configury.

OK for trunk?

Jason
diff mbox

Patch

commit 94d42e379702606ec09b241d54ed7ad72cfaff99
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Oct 5 18:59:08 2012 -0400

    	* acinclude.m4 (gcc_cv_gas_version): Try bfd/configure --version first.
    	* configure.ac (gcc_cv_gld_version): Likewise.
    	(gcc_cv_as_aix_ref): Fix typo.
    	* configure: Regenerate.

diff --git a/gcc/acinclude.m4 b/gcc/acinclude.m4
index c24464b..f7699ea 100644
--- a/gcc/acinclude.m4
+++ b/gcc/acinclude.m4
@@ -389,6 +389,8 @@  dnl # gcc_cv_as_gas_srcdir must be defined before this.
 dnl # This gross requirement will go away eventually.
 AC_DEFUN([_gcc_COMPUTE_GAS_VERSION],
 [gcc_cv_as_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd
+gcc_cv_gas_version=`$gcc_cv_as_bfd_srcdir/configure --version | sed -n -e '1s,.* ,VERSION=,p'`
+if test x$gcc_cv_gas_version != x; then true; else
 for f in $gcc_cv_as_bfd_srcdir/configure \
          $gcc_cv_as_gas_srcdir/configure \
          $gcc_cv_as_gas_srcdir/configure.in \
@@ -397,7 +399,7 @@  for f in $gcc_cv_as_bfd_srcdir/configure \
   if test x$gcc_cv_gas_version != x; then
     break
   fi
-done
+done; fi
 gcc_cv_gas_major_version=`expr "$gcc_cv_gas_version" : "VERSION=\([[0-9]]*\)"`
 gcc_cv_gas_minor_version=`expr "$gcc_cv_gas_version" : "VERSION=[[0-9]]*\.\([[0-9]]*\)"`
 gcc_cv_gas_patch_version=`expr "$gcc_cv_gas_version" : "VERSION=[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)"`
diff --git a/gcc/configure b/gcc/configure
index 45bba8e..fe4f3c7 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -21233,6 +21233,8 @@  if test "$gcc_cv_as" = ../gas/as-new$build_exeext; then
 $as_echo "newly built gas" >&6; }
   in_tree_gas=yes
   gcc_cv_as_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd
+gcc_cv_gas_version=`$gcc_cv_as_bfd_srcdir/configure --version | sed -n -e '1s,.* ,VERSION=,p'`
+if test x$gcc_cv_gas_version != x; then true; else
 for f in $gcc_cv_as_bfd_srcdir/configure \
          $gcc_cv_as_gas_srcdir/configure \
          $gcc_cv_as_gas_srcdir/configure.in \
@@ -21241,7 +21243,7 @@  for f in $gcc_cv_as_bfd_srcdir/configure \
   if test x$gcc_cv_gas_version != x; then
     break
   fi
-done
+done; fi
 gcc_cv_gas_major_version=`expr "$gcc_cv_gas_version" : "VERSION=\([0-9]*\)"`
 gcc_cv_gas_minor_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.\([0-9]*\)"`
 gcc_cv_gas_patch_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.[0-9]*\.\([0-9]*\)"`
@@ -21393,13 +21395,15 @@  $as_echo "newly built ld" >&6; }
 	elif test "$ld_is_gold" = yes; then
 	  in_tree_ld_is_elf=yes
 	fi
+	gcc_cv_gld_version=`$gcc_cv_ld_bfd_srcdir/configure --version | sed -n -e '1s,.* ,VERSION=,p'`
+	if test x$gcc_cv_gld_version != x; then true; else
 	for f in $gcc_cv_ld_bfd_srcdir/configure $gcc_cv_ld_gld_srcdir/configure $gcc_cv_ld_gld_srcdir/configure.in $gcc_cv_ld_gld_srcdir/Makefile.in
 	do
 		gcc_cv_gld_version=`sed -n -e 's/^[ 	]*\(VERSION=[0-9]*\.[0-9]*.*\)/\1/p' < $f`
 		if test x$gcc_cv_gld_version != x; then
 			break
 		fi
-	done
+	done; fi
 	gcc_cv_gld_major_version=`expr "$gcc_cv_gld_version" : "VERSION=\([0-9]*\)"`
 	gcc_cv_gld_minor_version=`expr "$gcc_cv_gld_version" : "VERSION=[0-9]*\.\([0-9]*\)"`
 else
@@ -25346,8 +25350,8 @@  if test "${gcc_cv_as_aix_ref+set}" = set; then :
 else
   gcc_cv_as_aix_ref=no
     if test $in_tree_gas = yes; then
-    if test $gcc_cv_gas_vers -ge `expr \( \( 2.21.0 \* 1000 \) + gcc_cv_as_aix_ref=yes \) \* 1000 + `
-  then :
+    if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 21 \) \* 1000 + 0`
+  then gcc_cv_as_aix_ref=yes
 fi
   elif test x$gcc_cv_as != x; then
     $as_echo '	.csect stuff[rw]
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 6ad6d19..3013555 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -2046,6 +2046,8 @@  if test "$gcc_cv_ld" = ../ld/ld-new$build_exeext \
 	elif test "$ld_is_gold" = yes; then
 	  in_tree_ld_is_elf=yes
 	fi
+	gcc_cv_gld_version=`$gcc_cv_ld_bfd_srcdir/configure --version | sed -n -e '1s,.* ,VERSION=,p'`
+	if test x$gcc_cv_gld_version != x; then true; else
 	for f in $gcc_cv_ld_bfd_srcdir/configure $gcc_cv_ld_gld_srcdir/configure $gcc_cv_ld_gld_srcdir/configure.in $gcc_cv_ld_gld_srcdir/Makefile.in
 	do
 changequote(,)dnl
@@ -2053,7 +2055,7 @@  changequote(,)dnl
 		if test x$gcc_cv_gld_version != x; then
 			break
 		fi
-	done
+	done; fi
 	gcc_cv_gld_major_version=`expr "$gcc_cv_gld_version" : "VERSION=\([0-9]*\)"`
 	gcc_cv_gld_minor_version=`expr "$gcc_cv_gld_version" : "VERSION=[0-9]*\.\([0-9]*\)"`
 changequote([,])dnl
@@ -3878,7 +3880,7 @@  LCF0:
     case $target in
       *-*-aix*)
 	gcc_GAS_CHECK_FEATURE([.ref support],
-	  gcc_cv_as_aix_ref, [2.21.0],,
+	  gcc_cv_as_aix_ref, [2,21,0],,
 	  [	.csect stuff[[rw]]
 	     stuff:
 		.long 1