This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: configure failure on sparc-sun-solaris2.7


On Tue, Oct 30, 2001 at 11:46:13AM +0100, Wolfgang Bangerth wrote:

>   checking assembler leb128 support... ../../gcc/gcc/configure: test:
>   unknown operator assembler
...
>   gcc3.1/sun-bin> echo "x`/usr/local/bin/as --version | head -1`x"
>   xGNU assembler 2.11.2x
> this has to fail, since there is no space, so the regexp does not match
> and therefore does not extract the version number.

Thanks for finding this problem.

Unfortunately your proposed solution fails to handle a third possible
format correctly:

$ echo "GNU assembler 2.11.92 20011030" | sed 's/.* \([0-9.][0-9.]*\).*/\1/'
20011030

Since we know at this point that as is GAS, I think it's reasonable to
assume that the first two words of the --version output are going to
be "GNU assembler".  Therefore, I'm going to put in this regexp
instead:

$ echo "GNU assembler 2.11.2" | sed 's/GNU assembler \([0-9.][0-9.]*\).*/\1/'
2.11.2

$ echo "GNU assembler 2.11.92 20011030" | sed 's/GNU assembler \([0-9.][0-9.]*\).*/\1/'
2.11.92

$ echo "GNU assembler 2.11.92.0.10 Debian/GNU Linux" | sed 's/GNU assembler \([0-9.][0-9.]*\).*/\1/'
2.11.92.0.10

zw

	* configure.in: Correct previous change: don't assume that
	gas's version number _isn't_ the last thing on the line, or
	isn't the only number on the line, either.
	* configure: Regenerate.

===================================================================
Index: configure.in
--- configure.in	2001/10/30 04:57:40	1.549
+++ configure.in	2001/10/30 16:43:16
@@ -1383,7 +1383,7 @@ EOF
 		as_ver=`$gcc_cv_as --version 2>/dev/null | head -1`
 		if echo "$as_ver" | grep GNU > /dev/null; then
 changequote(,)dnl
-			as_ver=`echo $as_ver | sed -e 's/.* \([0-9.][0-9.]*\) .*/\1/'`
+			as_ver=`echo $as_ver | sed -e 's/GNU assembler \([0-9.][0-9.]*\).*/\1/'`
 			as_major=`echo $as_ver | sed 's/\..*//'`
 			as_minor=`echo $as_ver | sed 's/[^.]*\.\([0-9]*\).*/\1/'`
 changequote([,])dnl


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]