mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] update ver_linux script to work with gcc 3.2.
@ 2002-08-28 21:18 Steven Cole
  2002-08-28 21:30 ` Thunder from the hill
  2002-08-28 21:32 ` Christoph Hellwig
  0 siblings, 2 replies; 3+ messages in thread
From: Steven Cole @ 2002-08-28 21:18 UTC (permalink / raw)
  To: Alan Cox, Marcelo Tosatti, Linus Torvalds; +Cc: Linux Kernel

A commonly used gcc reports its version number thusly:
[steven@spc5 steven]$ gcc --version
2.96

But the new gcc 3.2 reports its version number thusly:
[steven@spc1 scripts]$ gcc --version
gcc (GCC) 3.2 (Mandrake Linux 9.0 3.2-1mdk)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

This causes the current ver_linux script to produce less
than readable output for the gcc version when using gcc 3.2.

Here is a patch to the ver_linux script which allows it
to work both with the new gcc and the old gcc. 

The patch was made against 2.4.20-pre4-ac2, but also applies to 
2.4.20-pre4 and to 2.5.32 as well.

This was tested for the gcc 3.2 on Mandrake 9.0 beta4, but
will probably work for Red Hat Limbo or (null).  Testing is
always welcomed.  Backward compatibility with gcc 2.96 was
tested with Red Hat 7.3 and Mandrake 8.2.

Steven

--- linux-2.4.20-pre4-ac2/scripts/ver_linux.orig	Wed Aug 28 14:37:39 2002
+++ linux-2.4.20-pre4-ac2/scripts/ver_linux	Wed Aug 28 14:37:51 2002
@@ -12,7 +12,11 @@
 uname -a
 echo ' '

-echo "Gnu C                 " `gcc --version`
+gcc --version 2>&1| head -n 1 | grep -v gcc | awk \
+'NR==1{print "Gnu C                 ", $1}'
+
+gcc --version 2>&1| grep gcc | awk \
+'NR==1{print "Gnu C                 ", $3}'

 make --version 2>&1 | awk -F, '{print $1}' | awk \
       '/GNU Make/{print "Gnu make              ",$NF}'





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] update ver_linux script to work with gcc 3.2.
  2002-08-28 21:18 [PATCH] update ver_linux script to work with gcc 3.2 Steven Cole
@ 2002-08-28 21:30 ` Thunder from the hill
  2002-08-28 21:32 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Thunder from the hill @ 2002-08-28 21:30 UTC (permalink / raw)
  To: Steven Cole; +Cc: Alan Cox, Marcelo Tosatti, Linus Torvalds, Linux Kernel

Hi,

On 28 Aug 2002, Steven Cole wrote:
> A commonly used gcc reports its version number thusly:
> [steven@spc5 steven]$ gcc --version
> 2.96
> 
> But the new gcc 3.2 reports its version number thusly:
> [steven@spc1 scripts]$ gcc --version
> gcc (GCC) 3.2 (Mandrake Linux 9.0 3.2-1mdk)
> Copyright (C) 2002 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[thunder@hawkeye.luckynet.adm ~] (1) gcc --version
gcc (GCC) 3.2
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[thunder@bluemoon.luckynet.adm ~] (1) gcc --version
gcc (GCC) 3.1.1
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR 
PURPOSE.

Your guess seems right, but don't rely on the rest!

			Thunder
-- 
--./../...-/. -.--/---/..-/.-./..././.-../..-. .---/..-/.../- .-
--/../-./..-/-/./--..-- ../.----./.-../.-.. --./../...-/. -.--/---/..-
.- -/---/--/---/.-./.-./---/.--/.-.-.-
--./.-/-.../.-./.././.-../.-.-.-


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] update ver_linux script to work with gcc 3.2.
  2002-08-28 21:18 [PATCH] update ver_linux script to work with gcc 3.2 Steven Cole
  2002-08-28 21:30 ` Thunder from the hill
@ 2002-08-28 21:32 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2002-08-28 21:32 UTC (permalink / raw)
  To: Steven Cole; +Cc: Alan Cox, Marcelo Tosatti, Linus Torvalds, Linux Kernel

On Wed, Aug 28, 2002 at 03:18:09PM -0600, Steven Cole wrote:
> --- linux-2.4.20-pre4-ac2/scripts/ver_linux.orig	Wed Aug 28 14:37:39 2002
> +++ linux-2.4.20-pre4-ac2/scripts/ver_linux	Wed Aug 28 14:37:51 2002
> @@ -12,7 +12,11 @@
>  uname -a
>  echo ' '
> 
> -echo "Gnu C                 " `gcc --version`
> +gcc --version 2>&1| head -n 1 | grep -v gcc | awk \
> +'NR==1{print "Gnu C                 ", $1}'
> +
> +gcc --version 2>&1| grep gcc | awk \
> +'NR==1{print "Gnu C                 ", $3}'

Btw, both old and new versions are buggy here, as they should check $(CC).

My system compiler here is 2.95 but I compile with 3.2 from
/opt/gcc-3.2/bin/gcc


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-08-28 21:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-28 21:18 [PATCH] update ver_linux script to work with gcc 3.2 Steven Cole
2002-08-28 21:30 ` Thunder from the hill
2002-08-28 21:32 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®