diff options
Diffstat (limited to 'scripts/ver_linux')
| -rwxr-xr-x | scripts/ver_linux | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/ver_linux b/scripts/ver_linux index a6c728db05ce..810e608baa24 100755 --- a/scripts/ver_linux +++ b/scripts/ver_linux | |||
| @@ -13,6 +13,8 @@ BEGIN { | |||
| 13 | system("uname -a") | 13 | system("uname -a") |
| 14 | printf("\n") | 14 | printf("\n") |
| 15 | 15 | ||
| 16 | vernum = "[0-9]+([.]?[0-9]+)+" | ||
| 17 | |||
| 16 | printversion("GNU C", version("gcc -dumpversion")) | 18 | printversion("GNU C", version("gcc -dumpversion")) |
| 17 | printversion("GNU Make", version("make --version")) | 19 | printversion("GNU Make", version("make --version")) |
| 18 | printversion("Binutils", version("ld -v")) | 20 | printversion("Binutils", version("ld -v")) |
| @@ -34,7 +36,7 @@ BEGIN { | |||
| 34 | while (getline <"/proc/self/maps" > 0) { | 36 | while (getline <"/proc/self/maps" > 0) { |
| 35 | if (/libc.*\.so$/) { | 37 | if (/libc.*\.so$/) { |
| 36 | n = split($0, procmaps, "/") | 38 | n = split($0, procmaps, "/") |
| 37 | if (match(procmaps[n], /[0-9]+([.]?[0-9]+)+/)) { | 39 | if (match(procmaps[n], vernum)) { |
| 38 | ver = substr(procmaps[n], RSTART, RLENGTH) | 40 | ver = substr(procmaps[n], RSTART, RLENGTH) |
| 39 | printversion("Linux C Library", ver) | 41 | printversion("Linux C Library", ver) |
| 40 | break | 42 | break |
| @@ -70,7 +72,7 @@ BEGIN { | |||
| 70 | function version(cmd, ver) { | 72 | function version(cmd, ver) { |
| 71 | cmd = cmd " 2>&1" | 73 | cmd = cmd " 2>&1" |
| 72 | while (cmd | getline > 0) { | 74 | while (cmd | getline > 0) { |
| 73 | if (match($0, /[0-9]+([.]?[0-9]+)+/)) { | 75 | if (match($0, vernum)) { |
| 74 | ver = substr($0, RSTART, RLENGTH) | 76 | ver = substr($0, RSTART, RLENGTH) |
| 75 | break | 77 | break |
| 76 | } | 78 | } |
