aboutsummaryrefslogtreecommitdiff
path: root/csu/munch.awk
diff options
context:
space:
mode:
Diffstat (limited to 'csu/munch.awk')
-rw-r--r--csu/munch.awk11
1 files changed, 11 insertions, 0 deletions
diff --git a/csu/munch.awk b/csu/munch.awk
new file mode 100644
index 0000000..1ed6868
--- /dev/null
+++ b/csu/munch.awk
@@ -0,0 +1,11 @@
+BEGIN { special = 0 }
+
+/EXTERNS/ { ndirs = split(subdirs, dirs)
+ for (i = 1; i <= ndirs; ++i)
+ printf "extern void __init_%s __P ((int argc, char **argv, char **envp));\n", dirs[i]
+ special = 1 }
+/CALLS/ { ndirs = split(subdirs, dirs)
+ for (i = 1; i <= ndirs; ++i) printf " __init_%s (argc, argv, envp);\n", dirs[i]
+ special = 1 }
+
+{ if (special == 0) print $0; special = 0 }