bug-gmp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GMP and gcc 3.1 (unrecognized compiler version)


From: Jim . Fougeron
Subject: Re: GMP and gcc 3.1 (unrecognized compiler version)
Date: Wed, 12 Jun 2002 10:46:36 -0500

Kevin Ryde <address@hidden> writes:

>Jim Fougeron <address@hidden> writes:
>>
>> Now with 3.1 this is returned:
>> gcc.exe (GCC) 3.1
>> Copyright (C) 2002 ......

>Grr.  Thanks.

>> and two, does anyone have a correct patch to configure ?

>Possibility below.  Alternately it's just as easy to add
>"gmp_cv_gcc_march_pentiumpro=yes" to the configure line, or set CFLAGS
>yourself.

>PS. Bug reports to address@hidden please.

Sorry, it is here now.


>--=-=-=
>Content-Type: application/x-patch
>Content-Disposition: attachment; filename=configure.gcc31-mingw.diff
>Content-Transfer-Encoding: 8bit
>
>--- configure.old        Wed Jun 12 00:06:14 2002
>+++ configure       Wed Jun 12 00:07:34 2002
>@@ -2937,13 +2937,13 @@
> tmp_version=`($cc --version) 2>&5`
> echo "$cc --version '$tmp_version'" >&5
>
>-major=`(echo "$tmp_version" | sed -n 's/^[a-z-]*\([0-9][0-9]*\).*/\1/p')
2>&5`
>+major=`(echo "$tmp_version" | sed -n 's/^[a-zA-Z(). -]*\([0-9][0-9]*\).
*/\1/p') 2>&5`
> echo "    major '$major'" >&5

--- Clip ----

The patch Kevin provided still does not work on 3.1.  I had already tried
something similar (with the same results) prior to simply hard coding
gmp_cv_gcc_march_pentiumpro=true.   Now I have a patch below which will
work correctly.

Here is the full patch, I hope that Notes does not trash it.  I have tested
it on gcc 3.1 and gcc 2.95.3-6  (both mingw ports), and it works fine.
What I have done is simply used awk to trim just the first line (since the
3.1 gcc --version is multi line).  The sed was nabbing the 2002 from the
date (or nothing), and the unrecognised compiler version message was shown.
This patch fixes that behavior, while still compatible with the 2.xx.xx
--version format:

--- configure.old   Fri May 24 05:54:44 2002
+++ configure   Wed Jun 12 08:38:22 2002
@@ -2937,13 +2937,13 @@
 tmp_version=`($cc --version) 2>&5`
 echo "$cc --version '$tmp_version'" >&5

-major=`(echo "$tmp_version" | sed -n 's/^[a-z-]*\([0-9][0-9]*\).*/\1/p')
2>&5`
+major=`(echo "$tmp_version" | awk '{print;exit}' | sed -n 's/^[a-zA-Z().
-]*\([0-9][0-9]*\).*/\1/p') 2>&5`
 echo "    major '$major'" >&5

-minor=`(echo "$tmp_version" | sed -n 's/^[a-z-]*[0-9][0-9]*\.\([0-9][0-9]
*\).*/\1/p') 2>&5`
+minor=`(echo "$tmp_version" | awk '{print;exit}' | sed -n 's/^[a-zA-Z().
-]*[0-9][0-9]*\.\([0-9][0-9]*\).*/\1/p') 2>&5`
 echo "    minor '$minor'" >&5

-subminor=`(echo "$tmp_version" | sed -n 's/^[a-z-]*[0-9][0-9]*\.[0-9][0-9]
*\.\([0-9][0-9]*\).*/\1/p') 2>&5`
+subminor=`(echo "$tmp_version" | awk '{print;exit}' | sed -n 's/^[a-zA_Z
(). -]*[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\).*/\1/p') 2>&5`
 echo "    subminor '$subminor'" >&5

 if test -z "$major"; then
@@ -3075,13 +3075,13 @@
   tmp_version=`($cc --version) 2>&5`
 echo "$cc --version '$tmp_version'" >&5

-major=`(echo "$tmp_version" | sed -n 's/^[a-z-]*\([0-9][0-9]*\).*/\1/p')
2>&5`
+major=`(echo "$tmp_version" | awk '{print;exit}' | sed -n 's/^[a-zA-Z().
-]*\([0-9][0-9]*\).*/\1/p') 2>&5`
 echo "    major '$major'" >&5

-minor=`(echo "$tmp_version" | sed -n 's/^[a-z-]*[0-9][0-9]*\.\([0-9][0-9]
*\).*/\1/p') 2>&5`
+minor=`(echo "$tmp_version" | awk '{print;exit}' | sed -n 's/^[a-zA-Z().
-]*[0-9][0-9]*\.\([0-9][0-9]*\).*/\1/p') 2>&5`
 echo "    minor '$minor'" >&5

-subminor=`(echo "$tmp_version" | sed -n 's/^[a-z-]*[0-9][0-9]*\.[0-9][0-9]
*\.\([0-9][0-9]*\).*/\1/p') 2>&5`
+subminor=`(echo "$tmp_version" | awk '{print;exit}' | sed -n 's/^[a-zA_Z
(). -]*[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\).*/\1/p') 2>&5`
 echo "    subminor '$subminor'" >&5

 if test -z "$major"; then





reply via email to

[Prev in Thread] Current Thread [Next in Thread]