Commit | Line | Data |
---|---|---|
0831d892 C |
1 | #! /bin/sh |
2 | ||
3 | # stdout is normally config.h | |
4 | ||
5 | case $# in | |
6 | 2) ;; | |
7 | *) echo "Usage: mungeconf sysfile distfile" >&2 ; exit 2 ;; | |
8 | esac | |
9 | ||
10 | sed '/^#/d; /^MAKE_*/d' $1 | # strip comments and Makefile stuff | |
11 | sed '1s:.*:s~__SYSTEM__~&~: | |
12 | 2,$s:^\([^ ]*\)[ ].*:s~^/\\* #define[ ]*\1.*~#define &~:' >sedscr | |
13 | ||
14 | sed -f sedscr $2 | |
15 | ||
16 | echo | |
17 | echo '/* anything that follows is for system-specific short-term kludges */' | |
18 | grep '^#define' $1 # for system-specific short-term kludges | |
19 | ||
20 | rm -f sedscr |