diff options
author | Mike Frysinger <vapier@gentoo.org> | 2008-11-29 03:27:55 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2008-11-29 03:27:55 -0500 |
commit | dc9432c7a5ed8a098a9724c0b7f83ea1f8fc7b31 (patch) | |
tree | d2b2ed7904fa86607a41d99c527c0a1027d3f3bb /scripts/gen_symbol_version_map.awk | |
parent | bump to sandbox-1.3.2 (diff) | |
download | sandbox-dc9432c7a5ed8a098a9724c0b7f83ea1f8fc7b31.tar.gz sandbox-dc9432c7a5ed8a098a9724c0b7f83ea1f8fc7b31.tar.bz2 sandbox-dc9432c7a5ed8a098a9724c0b7f83ea1f8fc7b31.zip |
simplify awk scripts
Simplify the generation of libsandbox.map and symbols.h and the associated
awk scripts. Now we don't have to rely on arbitrary whitespace in the
symbols.h.in file.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'scripts/gen_symbol_version_map.awk')
-rw-r--r-- | scripts/gen_symbol_version_map.awk | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/scripts/gen_symbol_version_map.awk b/scripts/gen_symbol_version_map.awk index 78ffa3c..e8fbf47 100644 --- a/scripts/gen_symbol_version_map.awk +++ b/scripts/gen_symbol_version_map.awk @@ -1,5 +1,5 @@ BEGIN { - split(ENVIRON["SYMBOLS"], SYMBOLS); + split(" " SYMBOLS_LIST, SYMBOLS); } /^ OS\/ABI:/ { @@ -86,21 +86,20 @@ BEGIN { } END { - for (sym_version in SYMBOL_LIST) { + COUNT = 0; + delete VERSION_LIST + for (sym_version in SYMBOL_LIST) if (sym_version) - VERSIONS = VERSIONS " " sym_version; - } + VERSION_LIST[COUNT++] = sym_version; # We need the symbol versions sorted alphabetically ... - if (VERSIONS) { - split(VERSIONS, VERSION_LIST); - COUNT = asort(VERSION_LIST); - } else { + if (COUNT) + asort(VERSION_LIST); + else # Handle non-versioned libc's like uClibc ... COUNT = 1; - } - for (i = 1; i <= COUNT; i++) { + for (i = 1; i <= COUNT; ++i) { if (VERSION_LIST[i]) { sym_version = VERSION_LIST[i]; printf("%s {\n", sym_version); |