PATCH: Install two PCH files instead of one (& place in <target>/bits)

Loren James Rittle rittle@latour.rsch.comm.mot.com
Fri Apr 18 02:06:00 GMT 2003


Update of yesterday's patch.  Added Benjamin's request to move
generated PCH files into <target>/bits.  The base PCH code correctly
rejects handling wrong arch files, etc. but we had a naming problem
and this is our correct solution to such inside the library.  Ah, for
the record, this means that you have to explicitly say (and I did
update the testsuite): g++ -include bits/stdc++.h t.C

Posted as now committed.  Tested by complete rebuild/check/install
cycle of libstdc++-v3 on i386-unknown-freebsd4.8.  Ah, now back to
problems that affect the FSF 3.3 release on my pet ports... ;-)

	* testsuite_flags.in (PCHFLAGS): Find PCH in new home.
	* include/Makefile.am (pch_input): Find in ${target_builddir}.
	(pch_output): Rename to...
	(pch_output_builddir): ..this.  Find in ${target_builddir}.
	(pch_source): Tweak.
	(pch_build): Key off a built file.
	(pch_output rule): Rename to...
	(pch_input rule): ...this.  Produce ${pch_output_builddir}
	instead of ${pch_output}.
	(install-pch rule): Install ${pch_output_builddir}.
	* include/Makefile.in: Regenerated.

Index: testsuite_flags.in
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite_flags.in,v
retrieving revision 1.15
diff -c -r1.15 testsuite_flags.in
*** testsuite_flags.in	17 Apr 2003 03:27:04 -0000	1.15
--- testsuite_flags.in	18 Apr 2003 00:13:00 -0000
***************
*** 43,49 ****
        echo ${CXX}
        ;;
      --build-cxx)
!       PCHFLAGS="-include ${BUILD_DIR}/include/stdc++.h"
        CC_build="@glibcpp_CXX@ ${PCHFLAGS}"
        CXX=`echo $CC_build | sed 's/xgcc/g++/g'`
        echo ${CXX}
--- 43,49 ----
        echo ${CXX}
        ;;
      --build-cxx)
!       PCHFLAGS="-include bits/stdc++.h"
        CC_build="@glibcpp_CXX@ ${PCHFLAGS}"
        CXX=`echo $CC_build | sed 's/xgcc/g++/g'`
        echo ${CXX}
Index: include/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/Makefile.am,v
retrieving revision 1.55
diff -c -r1.55 Makefile.am
*** include/Makefile.am	17 Apr 2003 03:27:05 -0000	1.55
--- include/Makefile.am	18 Apr 2003 00:09:41 -0000
***************
*** 340,351 ****
  	${target_builddir}/gthr-posix.h \
  	${target_builddir}/gthr-default.h
  
! pch_input = stdc++.h
! pch_output = stdc++.h.gch
! pch_source = ${glibcpp_srcdir}/include/${pch_input}
  PCHFLAGS=-Winvalid-pch -Wno-deprecated -x c++-header $(CXXFLAGS)
  if GLIBCPP_BUILD_PCH
! pch_build = ${pch_output}
  pch_install = install-pch
  else
  pch_build = 
--- 340,351 ----
  	${target_builddir}/gthr-posix.h \
  	${target_builddir}/gthr-default.h
  
! pch_input = ${target_builddir}/stdc++.h
! pch_output_builddir = ${target_builddir}/stdc++.h.gch
! pch_source = ${glibcpp_srcdir}/include/stdc++.h
  PCHFLAGS=-Winvalid-pch -Wno-deprecated -x c++-header $(CXXFLAGS)
  if GLIBCPP_BUILD_PCH
! pch_build = ${pch_input}
  pch_install = install-pch
  else
  pch_build = 
***************
*** 500,508 ****
  	    < ${toplevel_srcdir}/gcc/${glibcpp_thread_h} > $@
  
  # Build a precompiled C++ include, stdc++.h.gch.
! ${pch_output}: ${allstamped} ${target_builddir}/c++config.h ${pch_source}
  	touch ${pch_input}; \
! 	$(CXX) $(PCHFLAGS) $(INCLUDES) ${pch_source} -o ${pch_output}; 
  
  # For robustness sake (in light of junk files or in-source
  # configuration), copy from the build or source tree to the install
--- 500,512 ----
  	    < ${toplevel_srcdir}/gcc/${glibcpp_thread_h} > $@
  
  # Build a precompiled C++ include, stdc++.h.gch.
! ${pch_input}: ${allstamped} ${target_builddir}/c++config.h ${pch_source}
  	touch ${pch_input}; \
! 	if [ ! -d "${pch_output_builddir}" ]; then \
! 	  mkdir -p ${pch_output_builddir}; \
! 	fi; \
! 	$(CXX) $(PCHFLAGS) $(INCLUDES) ${pch_source} -O0 -g -o ${pch_output_builddir}/O0g; \
! 	$(CXX) $(PCHFLAGS) $(INCLUDES) ${pch_source} -O2 -g -o ${pch_output_builddir}/O2g;
  
  # For robustness sake (in light of junk files or in-source
  # configuration), copy from the build or source tree to the install
***************
*** 545,551 ****
  	  $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${target_builddir}; done
  
  install-pch:
! 	$(INSTALL_DATA) ${std_builddir}/${pch_output} $(DESTDIR)${gxx_include_dir}/${std_builddir}
  
  # By adding these files here, automake will remove them for 'make clean'
  CLEANFILES = *.gch 
--- 549,557 ----
  	  $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${target_builddir}; done
  
  install-pch:
! 	$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${pch_output_builddir}
! 	for file in ${pch_output_builddir}/*; do \
! 	  $(INSTALL_DATA) $$file $(DESTDIR)${gxx_include_dir}/${pch_output_builddir}; done
  
  # By adding these files here, automake will remove them for 'make clean'
  CLEANFILES = *.gch 



More information about the Libstdc++ mailing list