blob: 951704505a7af614e339e10c256c9dde8e0ca89e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
|