SUMMARY: C Compiler Predefined Manifest Definitions
David Brooks
dbrooks at osf.osf.org
Wed Aug 22 13:52:44 AEST 1990
Oops... I posted an older version of the defines-detecting script. It
left out a "tr" command. Here's the right version:
----8<--------
#!/bin/sh
# Change these if appropriate:
CC=/bin/cc
CPP=/lib/cpp
tfile1=/tmp/stra$$
tfile2=/tmp/strb$$.c
# My "strings" will read stdin, but the manpage doesn't guarantee that.
cat $CC $CPP > $tfile1
strings -a -2 $tfile1 |
tr ' ' '\012' |
sed '/^-D.*/s/^-D//' |
sort -u |
awk '/^[a-zA-Z_][a-zA-Z0-9_]*$/ { printf "#ifdef %s\nZ__Z%s\n#endif\n", $0, $0 }' > $tfile2
$CC -E $tfile2 |
sed -n 's/^Z__Z//p' |
pr -i -t
/bin/rm $tfile1 $tfile2
exit
----8<--------
--
David Brooks dbrooks at osf.org
Systems Engineering, OSF uunet!osf.org!dbrooks
More information about the Comp.lang.c
mailing list