From 361742eda986901daf75169faaf648d4d132ccfb Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sun, 19 Mar 2000 20:36:44 +0000 Subject: * shlib-versions [USE_IN_LIBIO] (.*-.*-gnu-gnu*): Set earliest supported version for libc 0.2.90.libio to GLIBC_2.2. * Makeconfig (soversions.mk): Grok new third column in shlib-versions, and use it to emit new variable `map-firstversions'. * scripts/firstversions.awk: New file. * Makerules (Versions.all): Use scripts/firstversions.awk and the $(map-firstversions) value to generate a modified versions list that includes renames in "A = B" syntax for each version set earlier than the "earliest symbol version" named in shlib-versions. * scripts/versions.awk: Recognize "A = B" lines in the input to mean rename version set A to B in the output to the intermediate file. * scripts/abi-versions.awk: New file. * Makerules (abi-versions.h): New target, generated by that script. [$(versioning) = yes] (before-compile): Prepend abi-versions.h. * include/shlib-compat.h: New file, uses that generated header. --- scripts/abi-versions.awk | 39 +++++++++++++++++++++++++++++++++++++++ scripts/firstversions.awk | 27 +++++++++++++++++++++++++++ scripts/versions.awk | 13 ++++++++++--- 3 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 scripts/abi-versions.awk create mode 100644 scripts/firstversions.awk (limited to 'scripts') diff --git a/scripts/abi-versions.awk b/scripts/abi-versions.awk new file mode 100644 index 0000000000..0cceaad66a --- /dev/null +++ b/scripts/abi-versions.awk @@ -0,0 +1,39 @@ +# Script to generate header file from Versions.all list. +# See include/shlib-compat.h comments for explanation. + +BEGIN { + print "/* This file is automatically generated by abi-versions.awk."; + print " It defines symbols used by shlib-compat.h, which see. */"; + print "\n#ifndef _ABI_VERSIONS_H\n#define _ABI_VERSIONS_H"; +} + +NF == 2 && $2 == "{" { + thislib = $1; + gsub(/[^A-Za-z0-9_ ]/, "_"); libid = $1; + printf "\n/* start %s */\n", thislib; + next; +} +$1 == "}" { + printf "/* end %s */\n", thislib; + next; +} + +$2 == "=" { + new = $3; + gsub(/[^A-Za-z0-9_ ]/, "_"); id = $1; + printf "#define ABI_%s_%s\t0\t/* earliest supported %s */\n", libid, id, new; + printf "#define VERSION_%s_%s\t%s\n", libid, id, new; + next; +} + +{ + vers = $1; + gsub(/[^A-Za-z0-9_ ]/, "_"); id = $1; + printf "#define ABI_%s_%s\t1\t/* support %s */\n", libid, id, vers; + printf "#define VERSION_%s_%s\t%s\n", libid, id, vers; + next; +} + +END { + print "\n#endif /* abi-versions.h */"; +} diff --git a/scripts/firstversions.awk b/scripts/firstversions.awk new file mode 100644 index 0000000000..236d90ec97 --- /dev/null +++ b/scripts/firstversions.awk @@ -0,0 +1,27 @@ +# Script to preprocess Versions.all lists based on "earliest version" +# specifications in the shlib-versions file. + +NF == 3 && $2 == ":" { firstversion[$1] = $3; next } + +NF == 2 && $2 == "{" { thislib = $1; print; next } + +$1 == "}" { + if (firstversion[thislib]) { + # We haven't seen the stated version, but have produced + # others pointing to it, so we synthesize it now. + printf " %s\n", firstversion[thislib]; + } + print; + next; +} + +{ + if (! firstversion[thislib]) + print; + else if ($1 == firstversion[thislib]) { + print; + firstversion[thislib] = 0; + } + else + print $1, "=", firstversion[thislib]; +} diff --git a/scripts/versions.awk b/scripts/versions.awk index 78ed73914b..086a963b25 100644 --- a/scripts/versions.awk +++ b/scripts/versions.awk @@ -16,7 +16,10 @@ BEGIN { libs[$1] = 1; curlib = $1; while (getline < defsfile && ! /^}/) { - versions[$1] = 1; + if ($2 == "=") + renamed[$1] = $3; + else + versions[$1] = 1; } } } @@ -33,6 +36,7 @@ BEGIN { # This matches the beginning of the version information for a new library. /^[a-zA-Z0-9_.]+/ { + delete renamed; actlib = $1; if (!libs[$1]) { printf("no versions defined for %s\n", $1) > "/dev/stderr"; @@ -43,11 +47,14 @@ BEGIN { # This matches the beginning of a new version for the current library. /^ [A-Za-z_]/ { - actver = $1; - if (!versions[$1]) { + if (renamed[$1]) + actver = renamed[$1]; + else if (!versions[$1]) { printf("version %s not defined\n", $1) > "/dev/stderr"; exit 1; } + else + actver = $1; next; } -- cgit 1.4.1