about summary refs log tree commit diff
path: root/REORG.TODO/scripts/lib-names.awk
diff options
context:
space:
mode:
Diffstat (limited to 'REORG.TODO/scripts/lib-names.awk')
-rw-r--r--REORG.TODO/scripts/lib-names.awk32
1 files changed, 32 insertions, 0 deletions
diff --git a/REORG.TODO/scripts/lib-names.awk b/REORG.TODO/scripts/lib-names.awk
new file mode 100644
index 0000000000..a9e018bba1
--- /dev/null
+++ b/REORG.TODO/scripts/lib-names.awk
@@ -0,0 +1,32 @@
+# awk script for soversions.i -> gnu/lib-names.h; see Makeconfig.
+
+#
+{
+  split($1, fields, "=")
+  lib = fields[1];
+  soname = version = fields[2];
+  sub(/^.*=/, "", soname);
+  sub(/^lib.*\.so\./, "", version);
+  if ($soname !~ /^lib/) {
+    extra = soname;
+    sub(/\.so.*$/, "", extra);
+  }
+  else {
+    extra = "";
+  }
+  soname = "\"" soname "\"";
+  lib = toupper(lib);
+  extra = toupper(extra);
+  gsub(/-/, "_", lib);
+  gsub(/-/, "_", extra);
+  macros[$1 FS lib "_SO"] = soname;
+  if (extra)
+    macros[$1 FS extra "_SO"] = soname;
+}
+
+END {
+  for (elt in macros) {
+    split(elt, x);
+    printf("%-40s%s\n", "#define " x[2], macros[elt]);
+  }
+}