This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch, 4.1/4.2/4.3] fix GNU as version detection
- From: Matthias Klose <doko at cs dot tu-berlin dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 3 May 2007 12:59:40 +0200
- Subject: [patch, 4.1/4.2/4.3] fix GNU as version detection
Building GCC with recent binutils versions, I see a test failure
configuring in gcc/:
.../gcc/configure: line 14758: test: too many arguments
due to the version detection failing in the test for .[us]leb128.
if test $as_major -eq 2 && test $as_minor -lt 11
then :
else gcc_cv_as_leb128=yes
fi
The test does the right thing for binutils 2.11 or newer anyway, and
older binutils versions work as well. To fix the configure error, I
copied the version extraction code from the .hidden check a few lines
above.
Checked with configuring in the gcc/ subdirectory and inspecting the
files generated by configure. Version extraction for the following
version styles works:
GNU assembler 2.17.50 20070103
GNU assembler (GNU Binutils) 2.17.50.20070426
GNU assembler 2.11
Ok for the trunk, 4.2 when it's open, and 4.1?
Matthias
2007-05-03 Matthias Klose <doko@debian.org>
* configure.ac: Adjust GNU as version detection.
* configure: Regenerate.
Index: gcc/configure.ac
===================================================================
--- gcc/configure.ac (revision 124373)
+++ gcc/configure.ac (working copy)
@@ -2179,7 +2179,14 @@
as_ver=`$gcc_cv_as --version 2>/dev/null | sed 1q`
if echo "$as_ver" | grep GNU > /dev/null; then
changequote(,)dnl
- as_ver=`echo $as_ver | sed -e 's/GNU assembler \([0-9.][0-9.]*\).*/\1/'`
+ as_ver=`echo $as_ver | sed -n \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ -].*$,\1,p'`
as_major=`echo $as_ver | sed 's/\..*//'`
as_minor=`echo $as_ver | sed 's/[^.]*\.\([0-9]*\).*/\1/'`
changequote([,])dnl