glibc/versions.awk

106 lines
2.2 KiB
Awk
Raw Normal View History

Update. 1998-07-02 21:51 Ulrich Drepper <drepper@cygnus.com> * Makeconfig: Define list of subdirs as all-subdirs and make subdirs a copy. * Makefile: Add rules to generate map files. (distribute): Remove libc.map, add Versions.def and versions.awk. * Makerules: Change rules to find map files on common-objpfx. * elf/Makefile: Likewise. * md5-crypt/Makefile: Likewise. * nis/Makefile (libnsl-map): Remove. * Versions.def: New file. * versions.awk: New file. * argp/Versions: New file. * assert/Versions: New file. * catgets/Versions: New file. * csu/Versions: New file. * ctype/Versions: New file. * db/Versions: New file. * debug/Versions: New file. * dirent/Versions: New file. * elf/Versions: New file. * gmon/Versions: New file. * grp/Versions: New file. * hesiod/Versions: New file. * hurd/Versions: New file. * iconv/Versions: New file. * inet/Versions: New file. * intl/Versions: New file. * io/Versions: New file. * libio/Versions: New file. * linuxthreads/Versions: New file. * locale/Versions: New file. * login/Versions: New file. * malloc/Versions: New file. * math/Versions: New file. * md5-crypt/Versions: New file. * misc/Versions: New file. * nis/Versions: New file. * nss/Versions: New file. * posix/Versions: New file. * pwd/Versions: New file. * resolv/Versions: New file. * resource/Versions: New file. * rt/Versions: New file. * setjmp/Versions: New file. * shadow/Versions: New file. * signal/Versions: New file. * socket/Versions: New file. * stdio/Versions: New file. * stdio-common/Versions: New file. * stdlib/Versions: New file. * streams/Versions: New file. * string/Versions: New file. * sunrpc/Versions: New file. * sysdeps/alpha/Versions: New file. * sysdeps/alpha/fpu/Versions: New file. * sysdeps/i386/Versions: New file. * sysdeps/sparc/Versions: New file. * sysdeps/unix/sysv/Versions: New file. * sysdeps/unix/sysv/linux/Versions: New file. * sysdeps/unix/sysv/linux/alpha/Versions: New file. * sysdeps/unix/sysv/linux/i386/Versions: New file. * sysdeps/unix/sysv/linux/mips/Versions: New file. * sysvipc/Versions: New file. * termios/Versions: New file. * time/Versions: New file. * wcsmbs/Versions: New file. * wctype/Versions: New file. * libc.map: Removed. * db/libdb.map: Removed. * elf/libdl.map: Removed. * hesiod/libnss_hesiod.map: Removed. * hurd/libhurduser.map: Removed. * hurd/libmachuser.map: Removed. * linuxthreads/libpthread.map: Removed. * locale/libBrokenLocale.map: Removed. * login/libutil.map: Removed. * math/libm.map: Removed. * md5-crypt/libcrypt.map: Removed. * nis/libnsl.map: Removed. * nis/libnsl_compat.map: Removed. * nis/libnss_nis.map: Removed. * nis/libnss_nisplus.map: Removed. * nss/libnss_db.map: Removed. * nss/libnss_files.map: Removed. * resolv/libnss_dns.map: Removed. * resolv/libresolv.map: Removed. * rt/librt.map: Removed. * elf/dl-load.c (fillin_rpath): Fix test for trusted directory. Fix typos. * elf/rtld.c (process_dl_debug): Recognize 'all'. (process_envvars): LD_BIND_NOW must be followed by y, Y, or 1. * sysdeps/generic/elf/backtracesyms.c: Allocate string memory of correct size. * sysdeps/unix/sysv/linux/getsysstats.c (get_proc_path): Fix typo in comment.
1998-07-03 00:51:40 +02:00
# 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 < "Versions.def") {
if (/^[a-zA-Z_]+ {/) {
libs[$1] = 1;
curlib = $1;
while (getline < "Versions.def" && ! /^}/) {
if (NF > 1) {
versions[$1] = 1;
derived[curlib, $1] = (" " $2);
for (n = 3; n <= NF; ++n) {
derived[curlib, $1] = sprintf("%s, %s", derived[curlib, $1], $n);
}
} else {
versions[$1] = 1;
}
}
}
}
close("Versions.def");
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] != 1) {
printf("no versions defined for %s\n", $1);
exit 1;
}
next;
}
# This matches the beginning of a new version for the current library.
/^ [A-Za-z_]/ {
actver = $1;
if (versions[$1] != 1) {
printf("version %s not defined\n", $1);
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="";
while(getline < tmpfile) {
if ($1 != oldlib) {
if (oldlib != "") {
closeversion(oldver);
oldver = "";
close(outfile);
}
oldlib = $1;
outfile = (buildroot oldlib ".map");
firstinfile = 1;
}
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;
}
closeversion(oldver);
close(outfile);
rm tmpfile;
}