linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scripts/ver_linux use 'gcc -dumpversion'
@ 2008-05-21 18:36 Gabriel C
  2008-05-22  6:29 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Gabriel C @ 2008-05-21 18:36 UTC (permalink / raw)
  To: Linux Kernel list; +Cc: Andrew Morton


These magic greps and hacks in ver_linux to get the gcc version always break after some gcc releases.

Since now gcc >4.3 allows compiling with '--with-pkgversion' ( which can be everything 'My Cool Gcc' or something )
ver_linux will report random junk for these.

Simply use 'gcc -dumpversion' to get the gcc version which should always work.

Signed-off-by: Gabriel C <nix.or.die@googlemail.com>
---

Andrew sorry to bug you about that but
I have no clue how is maintaining scripts/*

 scripts/ver_linux |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/scripts/ver_linux b/scripts/ver_linux
index ab69ece..7ac0e30 100755
--- a/scripts/ver_linux
+++ b/scripts/ver_linux
@@ -12,12 +12,9 @@ echo ' '
 uname -a
 echo ' '
 
-gcc --version 2>&1| head -n 1 | grep -v gcc | awk \
+gcc -dumpversion 2>&1| 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 related	[flat|nested] 2+ messages in thread

* Re: [PATCH] scripts/ver_linux use 'gcc -dumpversion'
  2008-05-21 18:36 [PATCH] scripts/ver_linux use 'gcc -dumpversion' Gabriel C
@ 2008-05-22  6:29 ` Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2008-05-22  6:29 UTC (permalink / raw)
  To: Gabriel C; +Cc: Linux Kernel list

On Wed, 21 May 2008 20:36:19 +0200 Gabriel C <nix.or.die@googlemail.com> wrote:

> 
> These magic greps and hacks in ver_linux to get the gcc version always break after some gcc releases.
> 
> Since now gcc >4.3 allows compiling with '--with-pkgversion' ( which can be everything 'My Cool Gcc' or something )
> ver_linux will report random junk for these.

gcc sometimes looks like an anti-Linux plot.

> Simply use 'gcc -dumpversion' to get the gcc version which should always work.
> 
> Signed-off-by: Gabriel C <nix.or.die@googlemail.com>
> ---
> 
> Andrew sorry to bug you about that but
> I have no clue how is maintaining scripts/*

Depends on the script, really.  Most of them are Sam stuff.

>  scripts/ver_linux |    5 +----
>  1 files changed, 1 insertions(+), 4 deletions(-)
> 
> diff --git a/scripts/ver_linux b/scripts/ver_linux
> index ab69ece..7ac0e30 100755
> --- a/scripts/ver_linux
> +++ b/scripts/ver_linux
> @@ -12,12 +12,9 @@ echo ' '
>  uname -a
>  echo ' '
>  
> -gcc --version 2>&1| head -n 1 | grep -v gcc | awk \
> +gcc -dumpversion 2>&1| 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}'

including this one, I believe.

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

end of thread, other threads:[~2008-05-22  6:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-21 18:36 [PATCH] scripts/ver_linux use 'gcc -dumpversion' Gabriel C
2008-05-22  6:29 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).