* locales/hy_AM: Remove special collation rules. Fix yesexpr, noexpr,
[glibc.git] / scripts / soversions.awk
blob32ce076ba999a79078684468019f0971495c567b
1 # awk script for shlib-versions.v -> soversions.i; see Makeconfig.
3 BEGIN {
4 config = cpu "-" vendor "-" os;
5 configs[config] = "DEFAULT";
8 { thiscf = $1 }
10 $2 ~ /WORDSIZE[3264]/ {
11 if ((config ~ thiscf) && !othercf) {
12 othercf = $3;
13 sub(/@CPU@/, cpu, othercf);
14 sub(/@VENDOR@/, vendor, othercf);
15 sub(/@OS@/, os, othercf);
16 configs[othercf] = $2;
18 next;
21 # Obey the first matching DEFAULT line.
22 $2 == "DEFAULT" {
23 $1 = $2 = "";
24 default_set[++ndefault_set] = thiscf "\n" $0;
25 next
28 # Collect all lib lines before emitting anything, so DEFAULT
29 # can be interspersed.
31 lib = number = $2;
32 sub(/=.*$/, "", lib);
33 sub(/^.*=/, "", number);
34 if ((thiscf FS lib) in numbers) next;
35 numbers[thiscf FS lib] = number;
36 order[thiscf FS lib] = ++order_n;
37 if (NF > 2) {
38 $1 = $2 = "";
39 versions[thiscf FS lib] = $0
43 END {
44 for (elt in numbers) {
45 split(elt, x);
46 cf = x[1];
47 lib = x[2];
48 for (c in configs)
49 if (c ~ cf) {
50 if (elt in versions)
51 set = versions[elt];
52 else {
53 set = (c == config) ? default_setname : "";
54 for (i = 1; i <= ndefault_set; ++i) {
55 split(default_set[i], x, "\n");
56 if (c ~ x[1]) {
57 set = x[2];
58 break;
62 line = set ? (lib FS numbers[elt] FS set) : (lib FS numbers[elt]);
63 if (!((c FS lib) in lineorder) || order[elt] < lineorder[c FS lib]) {
64 lineorder[c FS lib] = order[elt];
65 lines[c FS lib] = configs[c] FS line;
69 for (c in lines) {
70 print lines[c]