This is the mail archive of the
mailing list for the GCC project.
Re: RedHat precompiled-header code branch created
- To: Devang Patel <dpatel at apple dot com>
- Subject: Re: RedHat precompiled-header code branch created
- From: Geoff Keating <geoffk at geoffk dot org>
- Date: 03 Oct 2001 17:27:18 -0700
- CC: gcc at gcc dot gnu dot org
- References: <3F1BCE29-B85A-11D5-8AE1-00306558FC20@apple.com>
Here's the README we originally sent to the customer; I think it still
describes the software from a user level. For keeping the PCH files
up-to-date, the recommended software is make(1).
A header 'foo.h' can be precompiled as follows:
gcc -c foo.h
This creates a file 'foo.h.pch'. This file represents the effect
of including foo.h as the first thing in a compilation.
You can use
gcc -c -x c-header foo.h
to override the usual GCC filetype-guessing mechanism based on suffixes;
you would want to do this if the header does not end in .h.
You should supply exactly the same options to this compilation as
you expect to use in the final build, except that you may omit
-D options for tokens that do not occur anywhere in foo.h.
This includes code generation and optimization options.
The compiler will search for 'foo.h.pch' when it sees
or similar in a compilation. It will use whichever of foo.h or
foo.h.pch it finds first along the usual search path. The precompiled
header name is generated by appending `.pch' to the original header
name. Generally, a precompiled header can only be used if the
#include is the first non-whitespace token in a compilation.
- Geoffrey Keating <email@example.com>