1 # awk script for shlib-versions.v -> soversions.i; see Makeconfig.
4 config = cpu "-" vendor "-" os;
5 configs[config] = "DEFAULT";
10 $2 ~ /WORDSIZE[3264]/ {
11 if ((config ~ thiscf) && !othercf) {
13 sub(/@CPU@/, cpu, othercf);
14 sub(/@VENDOR@/, vendor, othercf);
15 sub(/@OS@/, os, othercf);
16 configs[othercf] = $2;
22 if ((config ~ thiscf) && !abiname) {
24 sub(/@CPU@/, cpu, abiname);
25 sub(/@VENDOR@/, vendor, abiname);
26 sub(/@OS@/, os, abiname);
31 # Obey the first matching DEFAULT line.
34 default_set[++ndefault_set] = thiscf "\n" $0;
38 # Collect all lib lines before emitting anything, so DEFAULT
39 # can be interspersed.
43 sub(/^.*=/, "", number);
44 if ((thiscf FS lib) in numbers) next;
45 numbers[thiscf FS lib] = number;
46 order[thiscf FS lib] = ++order_n;
49 versions[thiscf FS lib] = $0
54 for (elt in numbers) {
63 set = (c == config) ? default_setname : "";
64 for (i = 1; i <= ndefault_set; ++i) {
65 split(default_set[i], x, "\n");
72 line = set ? (lib FS numbers[elt] FS set) : (lib FS numbers[elt]);
73 if (!((c FS lib) in lineorder) || order[elt] < lineorder[c FS lib]) {
74 lineorder[c FS lib] = order[elt];
75 lines[c FS lib] = configs[c] FS line;