hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/scripts/ver_linux
....@@ -13,6 +13,10 @@
1313 system("uname -a")
1414 printf("\n")
1515
16
+ vernum = "[0-9]+([.]?[0-9]+)+"
17
+ libc = "libc[.]so[.][0-9]+$"
18
+ libcpp = "(libg|stdc)[+]+[.]so[.][0-9]+$"
19
+
1620 printversion("GNU C", version("gcc -dumpversion"))
1721 printversion("GNU Make", version("make --version"))
1822 printversion("Binutils", version("ld -v"))
....@@ -30,27 +34,17 @@
3034 printversion("PPP", version("pppd --version"))
3135 printversion("Isdn4k-utils", version("isdnctrl"))
3236 printversion("Nfs-utils", version("showmount --version"))
37
+ printversion("Bison", version("bison --version"))
38
+ printversion("Flex", version("flex --version"))
3339
34
- while (getline <"/proc/self/maps" > 0) {
35
- if (/libc.*\.so$/) {
36
- n = split($0, procmaps, "/")
37
- if (match(procmaps[n], /[0-9]+([.]?[0-9]+)+/)) {
38
- ver = substr(procmaps[n], RSTART, RLENGTH)
39
- printversion("Linux C Library", ver)
40
- break
41
- }
42
- }
40
+ while ("ldconfig -p 2>/dev/null" | getline > 0) {
41
+ if ($NF ~ libc && !seen[ver = version("readlink " $NF)]++)
42
+ printversion("Linux C Library", ver)
43
+ else if ($NF ~ libcpp && !seen[ver = version("readlink " $NF)]++)
44
+ printversion("Linux C++ Library", ver)
4345 }
4446
4547 printversion("Dynamic linker (ldd)", version("ldd --version"))
46
-
47
- while ("ldconfig -p 2>/dev/null" | getline > 0) {
48
- if (/(libg|stdc)[+]+\.so/) {
49
- libcpp = $NF
50
- break
51
- }
52
- }
53
- printversion("Linux C++ Library", version("readlink " libcpp))
5448 printversion("Procps", version("ps --version"))
5549 printversion("Net-tools", version("ifconfig --version"))
5650 printversion("Kbd", version("loadkeys -V"))
....@@ -70,7 +64,7 @@
7064 function version(cmd, ver) {
7165 cmd = cmd " 2>&1"
7266 while (cmd | getline > 0) {
73
- if (match($0, /[0-9]+([.]?[0-9]+)+/)) {
67
+ if (match($0, vernum)) {
7468 ver = substr($0, RSTART, RLENGTH)
7569 break
7670 }