1 # Combine version map fragments into version files for the generated
3 # (C) Copyright 1998 Free Software Foundation, Inc.
4 # Written by Ulrich Drepper <drepper@cygnus.com>, 1998.
6 # Read definitions for the versions.
9 while (getline < "Versions.def") {
10 if (/^
[a
-zA
-Z_
]+ {/) {
13 while (getline < "Versions.def" && !
/^
}/) {
16 derived
[curlib
, $
1] =
(" " $
2);
17 for (n =
3; n
<=
NF; ++n
) {
18 derived
[curlib
, $
1] =
sprintf("%s, %s", derived
[curlib
, $
1], $n
);
26 close("Versions.def");
28 tmpfile =
(buildroot
"/Versions.tmp");
29 sort =
("sort -n >" tmpfile
);
32 # Remove comment lines.
37 # This matches the beginning of the version information for a new library.
41 printf("no versions defined for %s\n", $
1);
47 # This matches the beginning of a new version for the current library.
50 if (versions
[$
1] != 1) {
51 printf("version %s not defined\n", $
1);
57 # This matches lines with names to be added to the current version in the
58 # current library. This is the only place where we print something to
59 # the intermediate file.
61 printf("%s %s %s\n", actlib
, actver
, $
0) | sort
;
65 function closeversion
(name
) {
67 printf(" local:\n *;\n") > outfile
;
70 printf("}%s;\n", derived
[oldlib
, name
]) > outfile
;
73 # Now print the accumulated information.
78 while(getline < tmpfile
) {
86 outfile =
(buildroot oldlib
".map");
93 printf("%s {\n global:\n", $
2) > outfile
;
96 printf(" ") > outfile
;
97 for (n =
3; n
<=
NF; ++n
) {
98 printf(" %s", $n
) > outfile
;
100 printf("\n") > outfile
;
102 closeversion
(oldver
);