> After reading
> http://gcc.gnu.org/onlinedocs/gcc-4.0.2/gcc/Precompiled-Headers.html
> I get the impression that, to start using precompiled headers, the procedure 
> is:
>1) create a single all.h that includes all the needed .h's
>2) precompile all.h

Correct.

> 3) edit all your app's sources to include all instead of the individual .h's

No.

Use "-include all.h" on the compile line. 

>That sounds like a source change to me.  Or am I misunderstanding
>how precompiled headers are usually used?

Using PCH is not as difficult as you are making it out to be. See the
libstdc++ build process, and the way --cxxpchflags are used in the
libstdc++ testsuite (from scripts/testsuite_flags).

>From that:

/mnt/hd/bld/gcc/./gcc/g++ -shared-libgcc -B/mnt/hd/bld/gcc/./gcc -nostdinc++ 
-L/mnt/hd/bld/gcc/i686-pc-linux-gnu/libstdc++-v3/src 
-L/mnt/hd/bld/gcc/i686-pc-linux-gnu/libstdc++-v3/src/.libs 
-B/mnt/hd/bld/H-x86-gcc/i686-pc-linux-gnu/bin/ 
-B/mnt/hd/bld/H-x86-gcc/i686-pc-linux-gnu/lib/ -isystem 
/mnt/hd/bld/H-x86-gcc/i686-pc-linux-gnu/include -isystem 
/mnt/hd/bld/H-x86-gcc/i686-pc-linux-gnu/sys-include -g -O2 -D_GLIBCXX_ASSERT 
-ffunction-sections -fdata-sections -fmessage-length=0 
-DLOCALEDIR="/mnt/hd/bld/gcc/i686-pc-linux-gnu/libstdc++-v3/po/share/locale" 
-nostdinc++ 
-I/mnt/hd/bld/gcc/i686-pc-linux-gnu/libstdc++-v3/include/i686-pc-linux-gnu 
-I/mnt/hd/bld/gcc/i686-pc-linux-gnu/libstdc++-v3/include 
-I/mnt/hd/src/gcc/libstdc++-v3/libsupc++ 
-I/mnt/hd/src/gcc/libstdc++-v3/include/backward 
-I/mnt/hd/src/gcc/libstdc++-v3/testsuite testsuite_abi.o testsuite_allocator.o 
testsuite_character.o testsuite_hooks.o 
/mnt/hd/src/gcc/libstdc++-v3/testsuite/18_support/numeric_limits/epsilon.cc    !
-include bits/stdc++.h  -lm   -o ./epsilon.exe

-benjamin

Reply via email to