This is the mail archive of the
mailing list for the GCC project.
Re: Changes to gcc 3.x to invoke an external cpp (updated patch 2)
- From: Bernd Schmidt <bernds at redhat dot com>
- To: "Ashif S. Harji" <asharji at plg2 dot math dot uwaterloo dot ca>
- Cc: <gcc-patches at gcc dot gnu dot org>, Neil Booth <neil at daikokuya dot demon dot co dot uk>, "Peter A. Buhr" <pabuhr at plg2 dot math dot uwaterloo dot ca>, Zack Weinberg <zack at codesourcery dot com>
- Date: Mon, 24 Dec 2001 21:22:34 +0000 (GMT)
- Subject: Re: Changes to gcc 3.x to invoke an external cpp (updated patch 2)
On Mon, 24 Dec 2001, Ashif S. Harji wrote:
> For the past 10 years, we have
> been developing concurrency software (uC++) that piggy-backs on g++. This
> software uses an additional preprocessor to change the source text *after*
> being processed by cpp. For the past 10 years, we have used the -B flag to
> supply our own cpp driver that first invokes the standard cpp and then our cpp.
> However, with the integrated cpp, we can no longer use this
> mechanism as our user-supplied cpp in the -B directory is no longer invoked
> unless the -save-temps flag is used, which produces unnecessary files so this
> is not a clean solution.
Seems to me that this would be most cleanly done in your Makefiles without
relying on gcc internals. Pick a new filename extension (e.g. ".x"), then:
$(CC) -E $< -o tmp1
my-preprocess tmp1 >tmp2.i
$(CC) tmp2.i -o $@
rm tmp1 tmp2.i