This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: cpp doesn't define symbol i386


On Wed, 15 Oct 1997, Jesse Thilo wrote:

> > [regarding using a small shell script wrapper as 'cpp':]
> >  
> > > "gcc -E" is not equivalent to cpp because cpp read from stdin by default
> > > and "gcc -E" needs the parameter "-" to force reading from stdin. But
> > > hardcoding "-" in a shellscript will not be a solution due to cases where
> > > cpp is called with an inputfile. Is it possible to change the behavior of
> > > "gcc -E" so that it reads from stdin by default? 
> > 
> > does this do the trick?
> > 
> >    #!/bin/bash
> >    gcc -E ${*:-'-'}
> 
> Problem: what if there are command line options, like -I/foo/bar or
> -Dfoo=bar?  Here's what I use:
> 
> #!/bin/sh
> exec `gcc -print-prog-name=cpp` -traditional ${1+"$@"}

You call cpp directly which causes problems at least with X under linux
if you try to use xmkmf/imake to generate Makefiles from Imakefiles. cpp
dosn't predefine some symbols (i386, ...) anymore. Now imake can't
determine the correct architecture and will generate the wrong Makefile.
That's why we need to call "gcc -E". The wrapper I posted here will do the
job.

ron

-- 
\ Ronald Wahl --- rwa@informatik.tu-chemnitz.de   \
 \ WWW: http://www.tu-chemnitz.de/~row             \
  \ Talk: rwa@goliath.csn.tu-chemnitz.de            \
   \ PGP key available by finger to my email address \



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]