about summary refs log tree commit diff
path: root/scripts/extract-abilist.awk
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-12-23 11:17:18 +0000
committerRoland McGrath <roland@gnu.org>2002-12-23 11:17:18 +0000
commitc823a4d21b76fbc6cf86503d23e3cd55384644ce (patch)
tree6a61fb4da98c47f12d37455776b30543b51d9a3e /scripts/extract-abilist.awk
parentb27b002d5b85b8628f19f65886d25a342c6cbc18 (diff)
downloadglibc-c823a4d21b76fbc6cf86503d23e3cd55384644ce.tar.gz
glibc-c823a4d21b76fbc6cf86503d23e3cd55384644ce.tar.xz
glibc-c823a4d21b76fbc6cf86503d23e3cd55384644ce.zip
* scripts/abilist.awk: Produce a more compact format, divided into
	stanzas for each version set, the set name listed only once.
	* scripts/extract-abilist.awk: New file.
	* scripts/merge-abilist.awk: New file.
	* Makerules (check-abi-%, update-abi-%): New pattern rules.
	(update-abi, check-abi): New targets.
	* Makefile (+subdir_targets): Add subdir_{check,update}-abi.

	* Makerules (%.symlist): Use LC_ALL=C when running awk script.
Diffstat (limited to 'scripts/extract-abilist.awk')
-rw-r--r--scripts/extract-abilist.awk44
1 files changed, 44 insertions, 0 deletions
diff --git a/scripts/extract-abilist.awk b/scripts/extract-abilist.awk
new file mode 100644
index 0000000000..c5b76e1309
--- /dev/null
+++ b/scripts/extract-abilist.awk
@@ -0,0 +1,44 @@
+# awk script to extract a config-specific .symlist file from a merged file.
+# This must be passed run with awk -v config=TUPLE to specify the configuration
+# tuple we will match.  The merged file contains stanzas in the form:
+#	GLIBC_x.y regexp...
+#	 function F
+#	 variable D 0x4
+# Each regexp is matched against TUPLE, and only matching stanzas go
+# into the output, with the regexp list removed.  The result matches the
+# original .symlist file from abilist.awk that was fed into merge-abilist.awk.
+
+BEGIN {
+  outpipe = "";
+}
+
+/^ / { if (!ignore) print | outpipe; next; }
+
+{
+  for (i = 2; i <= NF; ++i) {
+    regex = "^" $i "$";
+    if (match(config, regex) != 0) {
+      if ($1 != version) {
+	if (outpipe != "") {
+	  close(outpipe);
+	}
+	version = $1;
+	print version;
+	outpipe = "sort";
+      }
+      ignore = 0;
+      next;
+    }
+  }
+  ignore = 1;
+  next;
+}
+
+END {
+  if (outpipe == "") {
+    print "No stanza matched", config > "/dev/stderr";
+    exit 2;
+  }
+  else
+    close(outpipe);
+}