175584Sru#
275584Sru# gendef filename var=val var=val ...
375584Sru#
475584Sru# This script is used to generate src/include/defs.h
575584Sru#
618099Spst
718099Spstfile=$1
818099Spstshift
918099Spst
1018099Spstdefs="#define $1"
1118099Spstshift
1218099Spstfor def
1318099Spstdo
1418099Spst	defs="$defs
1518099Spst#define $def"
1618099Spstdone
1718099Spst
1869626Sru# Use $TMPDIR if defined.  Default to cwd, for non-Unix systems
1969626Sru# which don't have /tmp on each drive (we are going to remove
2069626Sru# the file before we exit anyway).  Put the PID in the basename,
2169626Sru# since the extension can only hold 3 characters on MS-DOS.
2269626Srut=${TMPDIR-.}/gro$$.tmp
2318099Spst
2418099Spstsed -e 's/=/ /' >$t <<EOF
2518099Spst$defs
2618099SpstEOF
2718099Spst
2818099Spsttest -r $file && cmp -s $t $file || cp $t $file
2918099Spst
3018099Spstrm -f $t
3118099Spst
3218099Spstexit 0
3375584Sru
3475584Sru# eof
35