Seems like -fpph doesn't work on the pph branch anymore, and instead -fpph-gen/-fpph-map/-fpph-hdr are used.
The thing is, how are these flags used? unhelpful wiki page: http://gcc.gnu.org/wiki/pph Based on invoke.texi, I'm expecting something like this: 1. generate g++ -fpph-gen all.h; // generates all.pph 2. use g++ -fpph-hdr=all.h foo.cc // like -include=all.h, but works with pph files Is this right? -benjamin 2012-03-22 Benjamin Kosnik <b...@redhat.com> * include/Makefile.am (allcreated): Add pph build rule. (pch1_source): ... to pre_1_source. (pch2_source): ... to pre_2_source. (pch3_source): ... to pre_3_source. (pph_output): New. (PPH_GEN_FLAGS): New. * include/Makefile.in: Regenerate. Index: include/Makefile.am =================================================================== --- include/Makefile.am (revision 185703) +++ include/Makefile.am (working copy) @@ -858,7 +858,7 @@ ${host_builddir}/gthr-default.h -pch1_source = ${glibcxx_srcdir}/include/precompiled/stdc++.h +pre_1_source = ${glibcxx_srcdir}/include/precompiled/stdc++.h pch1_output_builddir = ${host_builddir}/stdc++.h.gch pch1_output_anchor = ${host_builddir}/stdc++.h pch1_output_installdir = ${host_installdir}/stdc++.h.gch @@ -866,19 +866,18 @@ pch1b_output = ${pch1_output_builddir}/O2g.gch pch1_output = ${pch1a_output} ${pch1b_output} -pch2_source = ${glibcxx_srcdir}/include/precompiled/stdtr1c++.h +pre_2_source = ${glibcxx_srcdir}/include/precompiled/stdtr1c++.h pch2_output_builddir = ${host_builddir}/stdtr1c++.h.gch pch2_output_anchor = ${host_builddir}/stdtr1c++.h pch2_output_installdir = ${host_installdir}/stdtr1c++.h.gch pch2_output = ${pch2_output_builddir}/O2g.gch -pch3_source = ${glibcxx_srcdir}/include/precompiled/extc++.h +pre_3_source = ${glibcxx_srcdir}/include/precompiled/extc++.h pch3_output_builddir = ${host_builddir}/extc++.h.gch pch3_output_anchor = ${host_builddir}/extc++.h pch3_output_installdir = ${host_installdir}/extc++.h.gch pch3_output = ${pch3_output_builddir}/O2g.gch - pch_output = ${pch1_output} ${pch2_output} ${pch3_output} pch_output_dirs = \ ${pch1_output_builddir} ${pch2_output_builddir} ${pch3_output_builddir} @@ -891,6 +890,9 @@ pch_build = endif +pph_output = ${host_builddir}/stdc++.h.pph +PPH_GEN_FLAGS = -x c++-header -nostdinc++ -fpph-gen + # List of all timestamp files. By keeping only one copy of this list, both # CLEANFILES and all-local are kept up-to-date. allstamped = \ @@ -904,7 +906,8 @@ allcreated = \ ${host_builddir}/c++config.h \ ${thread_host_headers} \ - ${pch_build} + ${pch_build} \ + ${pph_output} # Here are the rules for building the headers all-local: ${allstamped} ${allcreated} @@ -1153,25 +1156,30 @@ < $< > $@ # Build two precompiled C++ includes, stdc++.h.gch/*.gch -${pch1a_output}: ${allstamped} ${host_builddir}/c++config.h ${pch1_source} +${pch1a_output}: ${allstamped} ${host_builddir}/c++config.h ${pre_1_source} -mkdir -p ${pch1_output_builddir} - $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g -std=gnu++0x ${pch1_source} \ + $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g -std=gnu++0x ${pre_1_source} \ -o $@ -${pch1b_output}: ${allstamped} ${host_builddir}/c++config.h ${pch1_source} +${pch1b_output}: ${allstamped} ${host_builddir}/c++config.h ${pre_1_source} -mkdir -p ${pch1_output_builddir} - $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g ${pch1_source} -o $@ + $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g ${pre_1_source} -o $@ # Build a precompiled TR1 include, stdtr1c++.h.gch/O2.gch -${pch2_output}: ${pch2_source} ${pch1_output} +${pch2_output}: ${pre_2_source} ${pch1_output} -mkdir -p ${pch2_output_builddir} - $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g ${pch2_source} -o $@ + $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g ${pre_2_source} -o $@ # Build a precompiled extension include, extc++.h.gch/O2.gch -${pch3_output}: ${pch3_source} ${pch2_output} +${pch3_output}: ${pre_3_source} ${pch2_output} -mkdir -p ${pch3_output_builddir} - $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g ${pch3_source} -o $@ + $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g ${pre_3_source} -o $@ +# Build a preprocessed C++ include stdc++.h.pph +pph: ${pph_output} +${pph_output}: ${allstamped} ${host_builddir}/c++config.h ${pre_1_source} + $(CXX) $(PPH_GEN_FLAGS) $(AM_CPPFLAGS) -O2 -g ${pre_1_source} -o $@ + # For robustness sake (in light of junk files or in-source # configuration), copy from the build or source tree to the install # tree using only the human-maintained file lists and directory @@ -1291,7 +1299,7 @@ $(INSTALL_DATA) $${file} $(DESTDIR)${host_installdir}; done # By adding these files here, automake will remove them for 'make clean' -CLEANFILES = ${pch_output} ${pch_output_anchors} stamp-host +CLEANFILES = ${pch_output} ${pch_output_anchors} ${pph_output} stamp-host # To remove directories. clean-local:
2012-03-22 Benjamin Kosnik <b...@redhat.com> * include/Makefile.am (allcreated): Add pph build rule. (pch1_source): ... to pre_1_source. (pch2_source): ... to pre_2_source. (pch3_source): ... to pre_3_source. (pph_output): New. (PPH_GEN_FLAGS): New. * include/Makefile.in: Regenerate. Index: include/Makefile.am =================================================================== --- include/Makefile.am (revision 185703) +++ include/Makefile.am (working copy) @@ -858,7 +858,7 @@ ${host_builddir}/gthr-default.h -pch1_source = ${glibcxx_srcdir}/include/precompiled/stdc++.h +pre_1_source = ${glibcxx_srcdir}/include/precompiled/stdc++.h pch1_output_builddir = ${host_builddir}/stdc++.h.gch pch1_output_anchor = ${host_builddir}/stdc++.h pch1_output_installdir = ${host_installdir}/stdc++.h.gch @@ -866,19 +866,18 @@ pch1b_output = ${pch1_output_builddir}/O2g.gch pch1_output = ${pch1a_output} ${pch1b_output} -pch2_source = ${glibcxx_srcdir}/include/precompiled/stdtr1c++.h +pre_2_source = ${glibcxx_srcdir}/include/precompiled/stdtr1c++.h pch2_output_builddir = ${host_builddir}/stdtr1c++.h.gch pch2_output_anchor = ${host_builddir}/stdtr1c++.h pch2_output_installdir = ${host_installdir}/stdtr1c++.h.gch pch2_output = ${pch2_output_builddir}/O2g.gch -pch3_source = ${glibcxx_srcdir}/include/precompiled/extc++.h +pre_3_source = ${glibcxx_srcdir}/include/precompiled/extc++.h pch3_output_builddir = ${host_builddir}/extc++.h.gch pch3_output_anchor = ${host_builddir}/extc++.h pch3_output_installdir = ${host_installdir}/extc++.h.gch pch3_output = ${pch3_output_builddir}/O2g.gch - pch_output = ${pch1_output} ${pch2_output} ${pch3_output} pch_output_dirs = \ ${pch1_output_builddir} ${pch2_output_builddir} ${pch3_output_builddir} @@ -891,6 +890,9 @@ pch_build = endif +pph_output = ${host_builddir}/stdc++.h.pph +PPH_GEN_FLAGS = -x c++-header -nostdinc++ -fpph-gen + # List of all timestamp files. By keeping only one copy of this list, both # CLEANFILES and all-local are kept up-to-date. allstamped = \ @@ -904,7 +906,8 @@ allcreated = \ ${host_builddir}/c++config.h \ ${thread_host_headers} \ - ${pch_build} + ${pch_build} \ + ${pph_output} # Here are the rules for building the headers all-local: ${allstamped} ${allcreated} @@ -1153,25 +1156,30 @@ < $< > $@ # Build two precompiled C++ includes, stdc++.h.gch/*.gch -${pch1a_output}: ${allstamped} ${host_builddir}/c++config.h ${pch1_source} +${pch1a_output}: ${allstamped} ${host_builddir}/c++config.h ${pre_1_source} -mkdir -p ${pch1_output_builddir} - $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g -std=gnu++0x ${pch1_source} \ + $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g -std=gnu++0x ${pre_1_source} \ -o $@ -${pch1b_output}: ${allstamped} ${host_builddir}/c++config.h ${pch1_source} +${pch1b_output}: ${allstamped} ${host_builddir}/c++config.h ${pre_1_source} -mkdir -p ${pch1_output_builddir} - $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g ${pch1_source} -o $@ + $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g ${pre_1_source} -o $@ # Build a precompiled TR1 include, stdtr1c++.h.gch/O2.gch -${pch2_output}: ${pch2_source} ${pch1_output} +${pch2_output}: ${pre_2_source} ${pch1_output} -mkdir -p ${pch2_output_builddir} - $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g ${pch2_source} -o $@ + $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g ${pre_2_source} -o $@ # Build a precompiled extension include, extc++.h.gch/O2.gch -${pch3_output}: ${pch3_source} ${pch2_output} +${pch3_output}: ${pre_3_source} ${pch2_output} -mkdir -p ${pch3_output_builddir} - $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g ${pch3_source} -o $@ + $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g ${pre_3_source} -o $@ +# Build a preprocessed C++ include stdc++.h.pph +pph: ${pph_output} +${pph_output}: ${allstamped} ${host_builddir}/c++config.h ${pre_1_source} + $(CXX) $(PPH_GEN_FLAGS) $(AM_CPPFLAGS) -O2 -g ${pre_1_source} -o $@ + # For robustness sake (in light of junk files or in-source # configuration), copy from the build or source tree to the install # tree using only the human-maintained file lists and directory @@ -1291,7 +1299,7 @@ $(INSTALL_DATA) $${file} $(DESTDIR)${host_installdir}; done # By adding these files here, automake will remove them for 'make clean' -CLEANFILES = ${pch_output} ${pch_output_anchors} stamp-host +CLEANFILES = ${pch_output} ${pch_output_anchors} ${pph_output} stamp-host # To remove directories. clean-local: