]> sourceware.org Git - glibc.git/blame - scripts/firstversions.awk
PowerPC: Update powerpc-fpu ULPs.
[glibc.git] / scripts / firstversions.awk
CommitLineData
361742ed
RM
1# Script to preprocess Versions.all lists based on "earliest version"
2# specifications in the shlib-versions file.
3
8680179f
UD
4# Return -1, 0 or 1 according to whether v1 is less than, equal to or
5# greater than v2 as a version string. Simplified from GNU Autoconf
6# version; this one does not need to handle .0x fraction-style versions.
7function vers_compare (v1, v2)
8{
9 while (length(v1) && length(v2)) {
10 if (v1 ~ /^[0-9]/ && v2 ~ /^[0-9]/) {
11 for (len1 = 1; substr(v1, len1 + 1) ~ /^[0-9]/; len1++) continue;
12 for (len2 = 1; substr(v2, len2 + 1) ~ /^[0-9]/; len2++) continue;
13 d1 = substr(v1, 1, len1); v1 = substr(v1, len1 + 1);
14 d2 = substr(v2, 1, len2); v2 = substr(v2, len2 + 1);
15 d1 += 0;
16 d2 += 0;
17 } else {
18 d1 = substr(v1, 1, 1); v1 = substr(v1, 2);
19 d2 = substr(v2, 1, 1); v2 = substr(v2, 2);
20 }
21 if (d1 < d2) return -1;
22 if (d1 > d2) return 1;
23 }
24 if (length(v2)) return -1;
25 if (length(v1)) return 1;
26 return 0;
27}
28
733af7d6
RM
29NF > 2 && $2 == ":" {
30 for (i = 0; i <= NF - 3; ++i)
31 firstversion[$1, i] = $(3 + i);
32 idx[$1] = 0;
33 next;
34}
361742ed
RM
35
36NF == 2 && $2 == "{" { thislib = $1; print; next }
37
38$1 == "}" {
48a5e010 39 if ((thislib, idx[thislib]) in firstversion) {
361742ed
RM
40 # We haven't seen the stated version, but have produced
41 # others pointing to it, so we synthesize it now.
733af7d6
RM
42 printf " %s\n", firstversion[thislib, idx[thislib]];
43 idx[thislib]++;
361742ed
RM
44 }
45 print;
46 next;
47}
48
e7a2d9c0 49/GLIBC_PRIVATE/ { print; next }
733af7d6 50
e7a2d9c0
RM
51{
52 if ((thislib, idx[thislib]) in firstversion) {
5015cde4 53 f = v = firstversion[thislib, idx[thislib]];
8680179f 54 while (vers_compare($1, v) >= 0) {
5015cde4 55 delete firstversion[thislib, idx[thislib]];
e7a2d9c0 56 idx[thislib]++;
e034841e
CM
57 if ((thislib, idx[thislib]) in firstversion) {
58 # If we're skipping a referenced version to jump ahead to a
59 # later version, synthesize the earlier referenced version now.
60 if (v != $1 && (thislib, v) in usedversion)
61 print " " v;
48a5e010 62 v = firstversion[thislib, idx[thislib]];
e034841e 63 } else
48a5e010 64 break;
e7a2d9c0 65 }
5015cde4
RM
66 if ($1 == v || $1 == f)
67 # This version was the specified earliest version itself.
48a5e010 68 print;
8680179f 69 else if (vers_compare($1, v) < 0) {
5015cde4
RM
70 # This version is older than the specified earliest version.
71 print " " $1, "=", v;
72 # Record that V has been referred to, so we will be sure to emit it
73 # if we hit a later one without hitting V itself.
74 usedversion[thislib, v] = 1;
75 }
76 else {
77 # This version is newer than the specified earliest version.
78 # We haven't seen that version itself or else we wouldn't be here
79 # because we would have removed it from the firstversion array.
80 # If there were any earlier versions that used that one, emit it now.
81 if ((thislib, v) in usedversion) {
82 print " " v;
83 }
84 print " " $1;
85 }
361742ed
RM
86 }
87 else
e7a2d9c0 88 print;
361742ed 89}
This page took 0.35346 seconds and 5 git commands to generate.