Makefile.am (pch1_input, [...]): Move from pch_*.

2006-06-29  Benjamin Kosnik  <bkoz@redhat.com>

	* include/Makefile.am (pch1_input, pch1_output_builddir,
	pch1_outputj_installdir, pch1_source): Move from pch_*.
	(pch2_input, pch2_output_builddir,
	pch2_output_installdir, pch2_source): Clone for ext.
	(pch3_input, pch3_output_builddir,
	pch3_output_installdir, pch3_source): Clone for tr1.
	(install-pch): Same.
	* include/Makefile.in: Regenerate.

	* include/precompiled: New directory.
	* include/stdc++.h: Move...
	* include/precompiled/stdc++.h: ... here.		
	* include/precompiled/stdtr1c++.h: New.
	* include/precompiled/extc++.h: New.

	* testsuite/lib/libstdc++.exp (libstdc++_init): Set PCH_CXXFLAGS
	to -include bits/stdtr1c++.h.

From-SVN: r115078
This commit is contained in:
Benjamin Kosnik 2006-06-29 21:24:57 +00:00 committed by Benjamin Kosnik
parent 5656a184e8
commit 6cbd871cb0
7 changed files with 226 additions and 27 deletions

View file

@ -1,3 +1,23 @@
2006-06-29 Benjamin Kosnik <bkoz@redhat.com>
* include/Makefile.am (pch1_input, pch1_output_builddir,
pch1_outputj_installdir, pch1_source): Move from pch_*.
(pch2_input, pch2_output_builddir,
pch2_output_installdir, pch2_source): Clone for ext.
(pch3_input, pch3_output_builddir,
pch3_output_installdir, pch3_source): Clone for tr1.
(install-pch): Same.
* include/Makefile.in: Regenerate.
* include/precompiled: New directory.
* include/stdc++.h: Move...
* include/precompiled/stdc++.h: ... here.
* include/precompiled/stdtr1c++.h: New.
* include/precompiled/extc++.h: New.
* testsuite/lib/libstdc++.exp (libstdc++_init): Set PCH_CXXFLAGS
to -include bits/stdtr1c++.h.
2006-06-29 Benjamin Kosnik <bkoz@redhat.com>
* testsuite/lib/libstdc++.exp (v3_target_compile): Set timeout to

View file

@ -763,10 +763,22 @@ thread_host_headers = \
${host_builddir}/gthr-tpf.h \
${host_builddir}/gthr-default.h
pch_input = ${host_builddir}/stdc++.h
pch_output_builddir = ${host_builddir}/stdc++.h.gch
pch_output_installdir = ${host_installdir}/stdc++.h.gch
pch_source = ${glibcxx_srcdir}/include/stdc++.h
pch1_input = ${host_builddir}/stdc++.h
pch1_output_builddir = ${host_builddir}/stdc++.h.gch
pch1_output_installdir = ${host_installdir}/stdc++.h.gch
pch1_source = ${glibcxx_srcdir}/include/precompiled/stdc++.h
pch2_input = ${host_builddir}/stdtr1c++.h
pch2_output_builddir = ${host_builddir}/stdtr1c++.h.gch
pch2_output_installdir = ${host_installdir}/stdtr1c++.h.gch
pch2_source = ${glibcxx_srcdir}/include/precompiled/stdtr1c++.h
pch3_input = ${host_builddir}/extc++.h
pch3_output_builddir = ${host_builddir}/extc++.h.gch
pch3_output_installdir = ${host_installdir}/extc++.h.gch
pch3_source = ${glibcxx_srcdir}/include/precompiled/extc++.h
pch_input = ${pch1_input} ${pch2_input} ${pch3_input}
PCHFLAGS=-Winvalid-pch -Wno-deprecated -x c++-header $(CXXFLAGS)
if GLIBCXX_BUILD_PCH
pch_build = ${pch_input}
@ -1026,13 +1038,32 @@ ${host_builddir}/gthr-default.h: ${toplevel_srcdir}/gcc/${glibcxx_thread_h} \
< ${toplevel_srcdir}/gcc/${glibcxx_thread_h} > $@
# Build a precompiled C++ include, stdc++.h.gch.
${pch_input}: ${allstamped} ${host_builddir}/c++config.h ${pch_source}
touch ${pch_input}; \
if [ ! -d "${pch_output_builddir}" ]; then \
mkdir -p ${pch_output_builddir}; \
${pch1_input}: ${allstamped} ${host_builddir}/c++config.h ${pch1_source}
touch ${pch1_input}; \
if [ ! -d "${pch1_output_builddir}" ]; then \
mkdir -p ${pch1_output_builddir}; \
fi; \
$(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) ${pch_source} -O0 -g -o ${pch_output_builddir}/O0g.gch; \
$(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) ${pch_source} -O2 -g -o ${pch_output_builddir}/O2g.gch;
$(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) ${pch1_source} -O0 -g -o ${pch1_output_builddir}/O0g.gch; \
$(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) ${pch1_source} -O2 -g -o ${pch1_output_builddir}/O2g.gch;
# Build a precompiled TR1 include, stdtr1c++.h.gch.
${pch2_input}: ${allstamped} ${host_builddir}/c++config.h ${pch2_source} ${pch1_input}
touch ${pch2_input}; \
if [ ! -d "${pch2_output_builddir}" ]; then \
mkdir -p ${pch2_output_builddir}; \
fi; \
$(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) ${pch2_source} -O2 -g -o ${pch2_output_builddir}/O2g.gch;
# Build a precompiled extension include, extc++.h.gch.
${pch3_input}: ${allstamped} ${host_builddir}/c++config.h ${pch3_source} ${pch2_input}
touch ${pch3_input}; \
if [ ! -d "${pch3_output_builddir}" ]; then \
mkdir -p ${pch3_output_builddir}; \
fi; \
$(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) ${pch3_source} -O2 -g -o ${pch3_output_builddir}/O2g.gch;
# For robustness sake (in light of junk files or in-source
# configuration), copy from the build or source tree to the install
@ -1132,9 +1163,12 @@ install-headers:
$(INSTALL_DATA) $${file} $(DESTDIR)${host_installdir}; done
install-pch:
$(mkinstalldirs) $(DESTDIR)${pch_output_installdir}
for file in ${pch_output_builddir}/*; do \
$(INSTALL_DATA) $$file $(DESTDIR)${pch_output_installdir}; done
$(mkinstalldirs) $(DESTDIR)${pch1_output_installdir}
for file in ${pch1_output_builddir}/*; do \
$(INSTALL_DATA) $$file $(DESTDIR)${pch1_output_installdir}; done
$(mkinstalldirs) $(DESTDIR)${pch2_output_installdir}
for file in ${pch2_output_builddir}/*; do \
$(INSTALL_DATA) $$file $(DESTDIR)${pch2_output_installdir}; done
# By adding these files here, automake will remove them for 'make clean'
CLEANFILES = ${pch_input} ${pch_output_builddir}/*

View file

@ -978,10 +978,19 @@ thread_host_headers = \
${host_builddir}/gthr-tpf.h \
${host_builddir}/gthr-default.h
pch_input = ${host_builddir}/stdc++.h
pch_output_builddir = ${host_builddir}/stdc++.h.gch
pch_output_installdir = ${host_installdir}/stdc++.h.gch
pch_source = ${glibcxx_srcdir}/include/stdc++.h
pch1_input = ${host_builddir}/stdc++.h
pch1_output_builddir = ${host_builddir}/stdc++.h.gch
pch1_output_installdir = ${host_installdir}/stdc++.h.gch
pch1_source = ${glibcxx_srcdir}/include/precompiled/stdc++.h
pch2_input = ${host_builddir}/stdtr1c++.h
pch2_output_builddir = ${host_builddir}/stdtr1c++.h.gch
pch2_output_installdir = ${host_installdir}/stdtr1c++.h.gch
pch2_source = ${glibcxx_srcdir}/include/precompiled/stdtr1c++.h
pch3_input = ${host_builddir}/extc++.h
pch3_output_builddir = ${host_builddir}/extc++.h.gch
pch3_output_installdir = ${host_installdir}/extc++.h.gch
pch3_source = ${glibcxx_srcdir}/include/precompiled/extc++.h
pch_input = ${pch1_input} ${pch2_input} ${pch3_input}
PCHFLAGS = -Winvalid-pch -Wno-deprecated -x c++-header $(CXXFLAGS)
@GLIBCXX_BUILD_PCH_FALSE@pch_build =
@GLIBCXX_BUILD_PCH_TRUE@pch_build = ${pch_input}
@ -1401,13 +1410,29 @@ ${host_builddir}/gthr-default.h: ${toplevel_srcdir}/gcc/${glibcxx_thread_h} \
< ${toplevel_srcdir}/gcc/${glibcxx_thread_h} > $@
# Build a precompiled C++ include, stdc++.h.gch.
${pch_input}: ${allstamped} ${host_builddir}/c++config.h ${pch_source}
touch ${pch_input}; \
if [ ! -d "${pch_output_builddir}" ]; then \
mkdir -p ${pch_output_builddir}; \
${pch1_input}: ${allstamped} ${host_builddir}/c++config.h ${pch1_source}
touch ${pch1_input}; \
if [ ! -d "${pch1_output_builddir}" ]; then \
mkdir -p ${pch1_output_builddir}; \
fi; \
$(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) ${pch_source} -O0 -g -o ${pch_output_builddir}/O0g.gch; \
$(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) ${pch_source} -O2 -g -o ${pch_output_builddir}/O2g.gch;
$(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) ${pch1_source} -O0 -g -o ${pch1_output_builddir}/O0g.gch; \
$(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) ${pch1_source} -O2 -g -o ${pch1_output_builddir}/O2g.gch;
# Build a precompiled TR1 include, stdtr1c++.h.gch.
${pch2_input}: ${allstamped} ${host_builddir}/c++config.h ${pch2_source} ${pch1_input}
touch ${pch2_input}; \
if [ ! -d "${pch2_output_builddir}" ]; then \
mkdir -p ${pch2_output_builddir}; \
fi; \
$(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) ${pch2_source} -O2 -g -o ${pch2_output_builddir}/O2g.gch;
# Build a precompiled extension include, extc++.h.gch.
${pch3_input}: ${allstamped} ${host_builddir}/c++config.h ${pch3_source} ${pch2_input}
touch ${pch3_input}; \
if [ ! -d "${pch3_output_builddir}" ]; then \
mkdir -p ${pch3_output_builddir}; \
fi; \
$(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) ${pch3_source} -O2 -g -o ${pch3_output_builddir}/O2g.gch;
# For robustness sake (in light of junk files or in-source
# configuration), copy from the build or source tree to the install
@ -1504,9 +1529,12 @@ install-headers:
$(INSTALL_DATA) $${file} $(DESTDIR)${host_installdir}; done
install-pch:
$(mkinstalldirs) $(DESTDIR)${pch_output_installdir}
for file in ${pch_output_builddir}/*; do \
$(INSTALL_DATA) $$file $(DESTDIR)${pch_output_installdir}; done
$(mkinstalldirs) $(DESTDIR)${pch1_output_installdir}
for file in ${pch1_output_builddir}/*; do \
$(INSTALL_DATA) $$file $(DESTDIR)${pch1_output_installdir}; done
$(mkinstalldirs) $(DESTDIR)${pch2_output_installdir}
for file in ${pch2_output_builddir}/*; do \
$(INSTALL_DATA) $$file $(DESTDIR)${pch2_output_installdir}; done
# Stop implicit '.o' make rules from ever stomping on extensionless
# headers, in the improbable case where some foolish, crack-addled

View file

@ -0,0 +1,61 @@
// C++ includes used for precompiling extensions -*- C++ -*-
// Copyright (C) 2006 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#include <bits/stdtr1c++.h>
#include <ext/algorithm>
#include <ext/array_allocator.h>
#include <ext/bitmap_allocator.h>
#include <ext/codecvt_specializations.h>
#include <ext/debug_allocator.h>
#include <ext/functional>
#include <ext/hash_map>
#include <ext/hash_set>
#include <ext/iterator>
#include <ext/malloc_allocator.h>
#include <ext/memory>
#include <ext/mt_allocator.h>
#include <ext/new_allocator.h>
#include <ext/numeric>
#include <ext/pod_char_traits.h>
#include <ext/pool_allocator.h>
#include <ext/rb_tree>
#include <ext/rope>
#include <ext/slist>
#include <ext/stdio_filebuf.h>
#include <ext/stdio_sync_filebuf.h>
#include <ext/typelist.h>
#include <ext/vstring.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/priority_queue.hpp>
#include <ext/pb_ds/exception.hpp>
#include <ext/pb_ds/hash_policy.hpp>
#include <ext/pb_ds/list_update_policy.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/trie_policy.hpp>

View file

@ -0,0 +1,54 @@
// C++ includes used for precompiling TR1 -*- C++ -*-
// Copyright (C) 2006 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#include <bits/stdc++.h>
#include <tr1/array>
#include <tr1/cctype>
#include <tr1/cfenv>
#include <tr1/cfloat>
#include <tr1/cinttypes>
#include <tr1/climits>
#include <tr1/cmath>
#include <tr1/complex>
#include <tr1/cstdarg>
#include <tr1/cstdbool>
#include <tr1/cstdint>
#include <tr1/cstdio>
#include <tr1/cstdlib>
#include <tr1/ctgmath>
#include <tr1/ctime>
#include <tr1/cwchar>
#include <tr1/cwctype>
#include <tr1/functional>
#include <tr1/random>
#include <tr1/tuple>
#include <tr1/unordered_map>
#include <tr1/unordered_set>
#include <tr1/utility>

View file

@ -213,7 +213,9 @@ proc libstdc++_init { testfile } {
set lines [v3_target_compile $src "config[pid].o" object \
"additional_flags=-include additional_flags=bits/stdc++.h"]
if {$lines == "" } {
set PCH_CXXFLAGS "-include bits/stdc++.h"
# set PCH_CXXFLAGS "-include bits/extc++.h"
set PCH_CXXFLAGS "-include bits/stdtr1c++.h"
# set PCH_CXXFLAGS "-include bits/stdc++.h"
} else {
set PCH_CXXFLAGS ""
}