]> git.ipfire.org Git - thirdparty/glibc.git/blame - scripts/abi-versions.awk
Update miscellaneous files from upstream sources.
[thirdparty/glibc.git] / scripts / abi-versions.awk
CommitLineData
361742ed
RM
1# Script to generate <abi-versions.h> header file from Versions.all list.
2# See include/shlib-compat.h comments for explanation.
3
4BEGIN {
5 print "/* This file is automatically generated by abi-versions.awk.";
6 print " It defines symbols used by shlib-compat.h, which see. */";
7 print "\n#ifndef _ABI_VERSIONS_H\n#define _ABI_VERSIONS_H";
8}
9
10NF == 2 && $2 == "{" {
11 thislib = $1;
12 gsub(/[^A-Za-z0-9_ ]/, "_"); libid = $1;
13 printf "\n/* start %s */\n", thislib;
cb832354 14 n = 0;
deb7f0b4 15 start = 0;
361742ed
RM
16 next;
17}
18$1 == "}" {
19 printf "/* end %s */\n", thislib;
20 next;
21}
22
23$2 == "=" {
cb832354
RM
24 old = $1; new = $3;
25 gsub(/[^A-Za-z0-9_ ]/, "_");
26 oldid = $1; newid = $3;
27
28 printf "#define ABI_%s_%s\tABI_%s_%s\n", libid, oldid, libid, newid;
29 printf "#define VERSION_%s_%s\t%s\n", libid, oldid, new;
c2a684a4 30
361742ed
RM
31 next;
32}
33
34{
35 vers = $1;
cb832354
RM
36 gsub(/[^A-Za-z0-9_ ]/, "_");
37 versid = $1;
38
39 printf "#define ABI_%s_%s\t%d\t/* support %s */\n", libid, versid, ++n, vers;
40 printf "#define VERSION_%s_%s\t%s\n", libid, versid, vers;
361742ed
RM
41 next;
42}
43
44END {
45 print "\n#endif /* abi-versions.h */";
46}