aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2008-11-29 03:27:55 -0500
committerMike Frysinger <vapier@gentoo.org>2008-11-29 03:27:55 -0500
commitdc9432c7a5ed8a098a9724c0b7f83ea1f8fc7b31 (patch)
treed2b2ed7904fa86607a41d99c527c0a1027d3f3bb /scripts
parentbump to sandbox-1.3.2 (diff)
downloadsandbox-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')
-rw-r--r--scripts/gen_symbol_header.awk4
-rw-r--r--scripts/gen_symbol_version_map.awk19
2 files changed, 11 insertions, 12 deletions
diff --git a/scripts/gen_symbol_header.awk b/scripts/gen_symbol_header.awk
index df3b3e5..7b72f10 100644
--- a/scripts/gen_symbol_header.awk
+++ b/scripts/gen_symbol_header.awk
@@ -1,5 +1,5 @@
BEGIN {
- COUNT = split(ENVIRON["SYMBOLS"], SYMBOLS);
+ COUNT = split(" " SYMBOLS_LIST, SYMBOLS);
}
/^ OS\/ABI:/ {
@@ -82,7 +82,7 @@ END {
printf("#define __symbols_h\n\n");
# We use the order in SYMBOLS, as some wrappers depends on others ...
- for (i = 1; i <= COUNT; i++) {
+ for (i = 1; i <= COUNT; ++i) {
sym_index = SYMBOLS[i];
split(SYMBOL_LIST[sym_index], sym_full_names);
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);