glibc/versions.awk
Ulrich Drepper 8eaaffdeed Update.
1998-07-06 14:36  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* posix/Makefile (generated): Remove $(objpfx) from the names.

1998-07-05  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* stdio-common/test_rdwr.c: Use %Zu for size_t in printf
	format string.

	* libio/iofread_u.c: Include <stdio.h> for prototype.
	* libio/iofwrite_u.c: Likewise.

1998-07-06  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* db2/Versions: New file.

1998-07-04  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* Makefile (lib-noranlib): Don't depend on sysd-versions.
	($(common-objpfx)sysd-versions): Remove rule.
	* Makerules ($(common-objpfx)sysd-versions): Define here instead.
	Pass name of Versions.def file to script and redirect output to
	target.  Include it and make all generated version maps depend on
	it.
	* versions.awk: Print out variable definition containing all
	generated version maps.  Print error messages to stderr.  Remove
	temp file.

1998-07-04  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* posix/annexc.c (check_header): Terminate macro name before
	comparing.
	(get_null_defines): Allow builtin macros with parameters.
	(fmt, testfmt): Add -D_LIBC.
	* posix/Makefile: Remove bogus duplicate include directories from
	annexc test command.

1998-07-06 12:04  Ulrich Drepper  <drepper@cygnus.com>

	* nis/nss_nis/nis-pwd.c (internal_nis_getpwent_r): Handle adjunct
	password scheme.
	(_nss_nis_getpwnam_r): Likewise.
	(_nss_nis_getpwuid_r): Likewise.

1998-07-05  Mark Kettenis  <kettenis@phys.uva.nl>

	* libio/Versions: Move symbols whose source lives in
	stdio-common to ...
	* stdio-common/Versions: ... here.
	* stdio/Versions: Add missing symbols.
1998-07-06 17:09:00 +00:00

107 lines
2.3 KiB
Awk

# Combine version map fragments into version files for the generated
# shared object.
# (C) Copyright 1998 Free Software Foundation, Inc.
# Written by Ulrich Drepper <drepper@cygnus.com>, 1998.
# Read definitions for the versions.
BEGIN {
nlibs=0;
while (getline < defsfile) {
if (/^[a-zA-Z_]+ {/) {
libs[$1] = 1;
curlib = $1;
while (getline < defsfile && ! /^}/) {
versions[$1] = 1;
if (NF > 1) {
derived[curlib, $1] = " " $2;
for (n = 3; n <= NF; ++n) {
derived[curlib, $1] = derived[curlib, $1] ", " $n;
}
}
}
}
}
close(defsfile);
tmpfile = (buildroot "Versions.tmp");
sort = ("sort -n >" tmpfile);
}
# Remove comment lines.
/^ *#/ {
next;
}
# This matches the beginning of the version information for a new library.
/^[a-zA-Z_]+/ {
actlib = $1;
if (!libs[$1]) {
printf("no versions defined for %s\n", $1) > "/dev/stderr";
exit 1;
}
next;
}
# This matches the beginning of a new version for the current library.
/^ [A-Za-z_]/ {
actver = $1;
if (!versions[$1]) {
printf("version %s not defined\n", $1) > "/dev/stderr";
exit 1;
}
next;
}
# This matches lines with names to be added to the current version in the
# current library. This is the only place where we print something to
# the intermediate file.
/^ / {
printf("%s %s %s\n", actlib, actver, $0) | sort;
}
function closeversion(name) {
if (firstinfile) {
printf(" local:\n *;\n") > outfile;
firstinfile = 0;
}
printf("}%s;\n", derived[oldlib, name]) > outfile;
}
# Now print the accumulated information.
END {
close(sort);
oldlib="";
oldver="";
printf("all-version-maps =");
while(getline < tmpfile) {
if ($1 != oldlib) {
if (oldlib != "") {
closeversion(oldver);
oldver = "";
close(outfile);
}
oldlib = $1;
outfile = (buildroot oldlib ".map");
firstinfile = 1;
printf(" $(common-objpfx)%s.map", oldlib);
}
if ($2 != oldver) {
if (oldver != "") {
closeversion(oldver);
}
printf("%s {\n global:\n", $2) > outfile;
oldver = $2;
}
printf(" ") > outfile;
for (n = 3; n <= NF; ++n) {
printf(" %s", $n) > outfile;
}
printf("\n") > outfile;
}
printf("\n");
closeversion(oldver);
close(outfile);
system("rm " tmpfile);
}