Update.
[glibc.git] / scripts / firstversions.awk
blob7f1c2edf52821ebb29c6b3dd14837704ec9e1701
1 # Script to preprocess Versions.all lists based on "earliest version"
2 # specifications in the shlib-versions file.
4 NF > 2 && $2 == ":" {
5 for (i = 0; i <= NF - 3; ++i)
6 firstversion[$1, i] = $(3 + i);
7 idx[$1] = 0;
8 next;
11 NF == 2 && $2 == "{" { thislib = $1; print; next }
13 $1 == "}" {
14 if (firstversion[thislib, idx[thislib]]) {
15 # We haven't seen the stated version, but have produced
16 # others pointing to it, so we synthesize it now.
17 printf " %s\n", firstversion[thislib, idx[thislib]];
18 idx[thislib]++;
20 print;
21 next;
25 v = firstversion[thislib, idx[thislib]];
27 if (! v)
28 print;
29 else if ($1 == v) {
30 print;
31 firstversion[thislib, idx[thislib]] = 0;
32 idx[thislib]++;
34 else
35 print $1, "=", v;