login
Header Space

 
 

[PATCH] scripts/ver_linux use 'gcc -dumpversion'

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linux Kernel list <linux-kernel@...>
Cc: Andrew Morton <akpm@...>
Date: Wednesday, May 21, 2008 - 2:36 pm

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}'
 



--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] scripts/ver_linux use 'gcc -dumpversion', Gabriel C, (Wed May 21, 2:36 pm)
Re: [PATCH] scripts/ver_linux use 'gcc -dumpversion', Andrew Morton, (Thu May 22, 2:29 am)
speck-geostationary