Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sdd.hp.com!think!paperboy!osf!dbrooks From: dbrooks@osf.osf.org (David Brooks) Newsgroups: comp.lang.c Subject: Re: SUMMARY: C Compiler Predefined Manifest Definitions Message-ID: <12314@paperboy.OSF.ORG> Date: 22 Aug 90 03:52:44 GMT References: <185@n4hgf.Mt-Park.GA.US> <191@n4hgf.Mt-Park.GA.US> <12313@paperboy.OSF.ORG> Sender: news@OSF.ORG Reply-To: dbrooks@osf.org (David Brooks) Organization: Open Software Foundation Lines: 31 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@osf.org Systems Engineering, OSF uunet!osf.org!dbrooks