This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
PATCH: Install four PCH files instead of one
- From: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- To: libstdc++ at gcc dot gnu dot org
- Cc: bkoz at redhat dot com
- Date: Wed, 16 Apr 2003 18:45:58 -0500 (CDT)
- Subject: PATCH: Install four PCH files instead of one
- Reply-to: rittle at labs dot mot dot com
Benjamin, this patch replaces a piece of the first patch you posted to
enable PCH. Sorry, I just noticed that you made changes (because you
had to) when you made it respect configure-time checks in the second
version.
Although, I'm afraid of installing ~50MB of PCH files, I think
creating ~four PCH files is better than just one. This set will cover
most user options provided (and indeed all situations I found while
first working with the PCH stuff, running make check from top-level
vs. within libstdc++-v3, rebuilding from top-level vs. within
libstdc++-v3): -O0, -O2, "-O0 -g", "-O2 -g".
Also, note, please don't touch something in ${glibcpp_srcdir}.
The whole reason for a stamp file should remove any need to touch it.
(I'll update it and commit it once I see yours go in and you say you
agree; or else free feel to include it in your before you first commit.)
Regards,
Loren
Index: libstdc++-v3/include/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/Makefile.am,v
retrieving revision 1.54
diff -c -r1.54 Makefile.am
*** libstdc++-v3/include/Makefile.am 14 Mar 2003 22:16:05 -0000 1.54
--- libstdc++-v3/include/Makefile.am 16 Apr 2003 23:11:13 -0000
***************
*** 341,354 ****
${target_builddir}/gthr-default.h
pch_input = stdc++.h
! pch_output = stdc++.h.gch
pch_source = ${glibcpp_srcdir}/include/${pch_input}
# List of all timestamp files. By keeping only one copy of this list, both
# CLEANFILES and all-local are kept up-to-date.
allstamps = \
stamp-std stamp-bits stamp-c_base stamp-c_compatibility \
! stamp-backward stamp-ext stamp-target
# Here are the rules for building the headers
all-local: ${target_builddir}/c++config.h ${thread_target_headers} ${allstamps}
--- 341,354 ----
${target_builddir}/gthr-default.h
pch_input = stdc++.h
! pch_output_builddir = stdc++.h.gch
pch_source = ${glibcpp_srcdir}/include/${pch_input}
# List of all timestamp files. By keeping only one copy of this list, both
# CLEANFILES and all-local are kept up-to-date.
allstamps = \
stamp-std stamp-bits stamp-c_base stamp-c_compatibility \
! stamp-backward stamp-ext stamp-target stamp-stdc++-precompile
# Here are the rules for building the headers
all-local: ${target_builddir}/c++config.h ${thread_target_headers} ${allstamps}
***************
*** 367,378 ****
echo `date` > stamp-std ;\
fi
! PCHFLAGS=-Winvalid-pch -x c++-header $(CXXFLAGS)
stamp-stdc++-precompile: stamp-std ${target_builddir}/c++config.h ${pch_source}
! if [ ! -f "${pch_output}" ]; then \
! $(CXX) $(PCHFLAGS) $(INCLUDES) ${pch_source} -o ${pch_output}; \
! touch ${pch_input}; \
fi; \
touch stamp-stdc++-precompile
stamp-bits: ${bits_headers}
--- 367,381 ----
echo `date` > stamp-std ;\
fi
! PCHFLAGS=-Winvalid-pch -Wno-deprecated -x c++-header $(CXXFLAGS)
stamp-stdc++-precompile: stamp-std ${target_builddir}/c++config.h ${pch_source}
! if [ ! -d "${pch_output_builddir}" ]; then \
! mkdir -p ${pch_output_builddir}; \
fi; \
+ $(CXX) $(PCHFLAGS) $(INCLUDES) ${pch_source} -O0 -o ${pch_output_builddir}/O0; \
+ $(CXX) $(PCHFLAGS) $(INCLUDES) ${pch_source} -O2 -o ${pch_output_builddir}/O2; \
+ $(CXX) $(PCHFLAGS) $(INCLUDES) ${pch_source} -O0 -g -o ${pch_output_builddir}/O0g; \
+ $(CXX) $(PCHFLAGS) $(INCLUDES) ${pch_source} -O2 -g -o ${pch_output_builddir}/O2g; \
touch stamp-stdc++-precompile
stamp-bits: ${bits_headers}
***************
*** 388,398 ****
@if [ ! -d "${c_base_builddir}" ]; then \
mkdir -p ${c_base_builddir} ;\
fi ;\
- (cd ${c_base_builddir} && for h in ${c_base_headers}; do \
- official_name=`echo $$h | sed -e 's,.*/std_,,' -e 's,\.h$$,,'` ;\
- @LN_S@ $$h ./$${official_name} || true ;\
- done) ;\
if [ ! -f stamp-c_base ]; then \
if [ ! -z "${c_base_headers_extra}" ]; then \
(cd ${bits_builddir} && @LN_S@ ${c_base_headers_extra} . || true) ;\
fi ;\
--- 391,401 ----
@if [ ! -d "${c_base_builddir}" ]; then \
mkdir -p ${c_base_builddir} ;\
fi ;\
if [ ! -f stamp-c_base ]; then \
+ (cd ${c_base_builddir} && for h in ${c_base_headers}; do \
+ official_name=`echo $$h | sed -e 's,.*/std_,,' -e 's,\.h$$,,'` ;\
+ @LN_S@ $$h ./$${official_name} || true ;\
+ done) ;\
if [ ! -z "${c_base_headers_extra}" ]; then \
(cd ${bits_builddir} && @LN_S@ ${c_base_headers_extra} . || true) ;\
fi ;\
***************
*** 524,529 ****
--- 527,535 ----
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${std_builddir}
for file in ${std_headers_rename}; do \
$(INSTALL_DATA) ${std_builddir}/$${file} $(DESTDIR)${gxx_include_dir}/${std_builddir}; done
+ $(INSTALL_DATA) ${std_builddir}/${pch_input} $(DESTDIR)${gxx_include_dir}/${std_builddir}
+ for file in ${std_builddir}/${pch_output_builddir}/*; do \
+ $(INSTALL_DATA) $$file $(DESTDIR)${gxx_include_dir}/${std_builddir}/${pch_output_builddir}; done
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${target_builddir}
for file in ${target_headers} ${target_headers_extra} \
${thread_target_headers}; do \