aboutsummaryrefslogtreecommitdiffstats
path: root/mungeconf
diff options
context:
space:
mode:
Diffstat (limited to 'mungeconf')
-rwxr-xr-xmungeconf20
1 files changed, 20 insertions, 0 deletions
diff --git a/mungeconf b/mungeconf
new file mode 100755
index 00000000..95170450
--- /dev/null
+++ b/mungeconf
@@ -0,0 +1,20 @@
+#! /bin/sh
+
+# stdout is normally config.h
+
+case $# in
+2) ;;
+*) echo "Usage: mungeconf sysfile distfile" >&2 ; exit 2 ;;
+esac
+
+sed '/^#/d; /^MAKE_*/d' $1 | # strip comments and Makefile stuff
+sed '1s:.*:s~__SYSTEM__~&~:
+2,$s:^\([^ ]*\)[ ].*:s~^/\\* #define[ ]*\1.*~#define &~:' >sedscr
+
+sed -f sedscr $2
+
+echo
+echo '/* anything that follows is for system-specific short-term kludges */'
+grep '^#define' $1 # for system-specific short-term kludges
+
+rm -f sedscr