xref: /openbsd/gnu/lib/libstdc++-v3/Makefile (revision 91f110e0)
1# $FreeBSD: src/gnu/lib/libstdc++/Makefile,v 1.63.2.1 2009/08/03 08:13:06 kensmith Exp $
2# $OpenBSD: Makefile,v 1.7 2013/06/21 17:07:30 robert Exp $
3
4.include "${.CURDIR}/Makefile.common"
5
6GCC_TARGET=	${MACHINE_ARCH}-unknown-openbsd${OSREV}
7
8LIB=		stdc++
9
10CFLAGS+=	-DIN_GLIBCPP_V3 -DHAVE_CONFIG_H
11.if ${MACHINE_ARCH} == "arm"
12CFLAGS+=	-D_GLIBCXX_SJLJ_EXCEPTIONS=1
13.endif
14CFLAGS+=	-I${.CURDIR} -I${SUPDIR} -I${GCCDIR} -I${SRCDIR}/include
15CFLAGS+=	-I${GCCLIB}/include -I${SRCDIR}/include -I${.CURDIR}/../libiberty/include -I.
16CFLAGS+=	-frandom-seed=RepeatabilityConsideredGood
17CXXFLAGS+=	-fno-implicit-templates -ffunction-sections -fdata-sections \
18		-Wno-deprecated
19
20DPADD=		${LIBM}
21LDADD=		-lm
22
23# libstdc++ sources
24SRCS+=	bitmap_allocator.cc pool_allocator.cc \
25	mt_allocator.cc codecvt.cc compatibility.cc complex_io.cc \
26	ctype.cc debug.cc debug_list.cc functexcept.cc globals_io.cc \
27	ios.cc ios_failure.cc ios_init.cc ios_locale.cc limits.cc \
28	list.cc locale.cc locale_init.cc locale_facets.cc \
29	localename.cc stdexcept.cc strstream.cc tree.cc \
30	allocator-inst.cc concept-inst.cc fstream-inst.cc ext-inst.cc \
31	ios-inst.cc iostream-inst.cc istream-inst.cc istream.cc \
32	locale-inst.cc misc-inst.cc ostream-inst.cc sstream-inst.cc \
33	streambuf-inst.cc streambuf.cc string-inst.cc valarray-inst.cc \
34	wlocale-inst.cc wstring-inst.cc atomicity.cc \
35	codecvt_members.cc collate_members.cc ctype_members.cc \
36	messages_members.cc monetary_members.cc numeric_members.cc \
37	time_members.cc basic_file_stdio.cc c_locale.cc \
38#	compatibility-ldbl.cc
39
40# target sources
41SRCS+=  atomicity.cc codecvt_members.cc collate_members.cc ctype_members.cc \
42	messages_members.cc monetary_members.cc numeric_members.cc \
43	time_members.cc
44
45# target sources extra
46SRCS+=  basic_file_stdio.cc c_locale.cc
47
48# C parts of math
49SRCS+=	stubs.c
50
51# Embedded copy of libsupc++
52SRCS+=	${SUPSRCS}
53
54# MD headers location
55.if ${MACHINE_ARCH} == "sparc64"
56MARCHDIR=	sparc
57.elif ${MACHINE_ARCH} == "i386" && ${MACHINE_CPU} != 'i386'
58MARCHDIR=	i486
59.elif ${MACHINE_ARCH} == "amd64"
60MARCHDIR=	i486
61.else
62MARCHDIR=	${MACHINE_ARCH}
63.endif
64
65.if exists(${SRCDIR}/config/cpu/${MARCHDIR}/atomicity.h)
66ATOMICITY_H=	${SRCDIR}/config/cpu/${MARCHDIR}/atomicity.h
67.else
68ATOMICITY_H=	${SRCDIR}/config/cpu/generic/atomicity_mutex/atomicity.h
69.endif
70
71.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "sparc64" || \
72    ${MACHINE_ARCH} == "i386"
73.if exists(${SRCDIR}/config/cpu/generic/atomicity_builtins/atomicity.h)
74ATOMICITY_H=	${SRCDIR}/config/cpu/generic/atomicity_builtins/atomicity.h
75.endif
76.endif
77
78atomicity.cc:	${ATOMICITY_H}
79	ln -sf ${.ALLSRC} ${.TARGET}
80CLEANFILES+=	atomicity.cc
81
82INCSGROUPS=	BITSHDRS BKWHDRS EXTHDRS BASEHDRS BASEXHDRS STDHDRS SUPHDRS \
83		TARGETHDRS THRHDRS DEBUGHDRS TR1HDRS PBHDRS0 PBHDRS1
84CXXINCLUDEDIR=	${DESTDIR}/usr/include/g++
85
86SUPHDRS=	cxxabi.h exception exception_defines.h new typeinfo
87SUPHDRS:=	${SUPHDRS:S;^;${SRCDIR}/libsupc++/;}
88SUPHDRSDIR=	${CXXINCLUDEDIR}
89
90STDHDRS=	std_algorithm.h std_bitset.h std_complex.h std_deque.h \
91		std_fstream.h std_functional.h std_iomanip.h std_ios.h \
92		std_iosfwd.h std_iostream.h std_istream.h std_iterator.h \
93		std_limits.h std_list.h std_locale.h std_map.h std_memory.h \
94		std_numeric.h std_ostream.h std_queue.h std_set.h \
95		std_sstream.h std_stack.h std_stdexcept.h std_streambuf.h \
96		std_string.h std_utility.h std_valarray.h std_vector.h
97.for h in ${STDHDRS}
98STDHDRSNAME_$h=${h:R:S;^std_;;}
99.endfor
100STDHDRS:=	${STDHDRS:S;^;${SRCDIR}/include/std/;}
101STDHDRSDIR=	${CXXINCLUDEDIR}
102
103BITSHDRS=	allocator.h basic_ios.h basic_ios.tcc basic_string.h \
104		basic_string.tcc boost_concept_check.h char_traits.h codecvt.h \
105		concept_check.h cpp_type_traits.h deque.tcc fstream.tcc \
106		functexcept.h gslice.h gslice_array.h indirect_array.h \
107		ios_base.h istream.tcc list.tcc locale_classes.h \
108		locale_facets.h locale_facets.tcc localefwd.h mask_array.h \
109		ostream.tcc ostream_insert.h postypes.h stream_iterator.h \
110		streambuf_iterator.h slice_array.h sstream.tcc stl_algo.h \
111		stl_algobase.h stl_bvector.h stl_construct.h stl_deque.h \
112		stl_function.h stl_heap.h stl_iterator.h \
113		stl_iterator_base_funcs.h stl_iterator_base_types.h stl_list.h \
114		stl_map.h stl_multimap.h stl_multiset.h stl_numeric.h \
115		stl_pair.h stl_queue.h stl_raw_storage_iter.h stl_relops.h \
116		stl_set.h stl_stack.h stl_tempbuf.h stl_tree.h \
117		stl_uninitialized.h stl_vector.h streambuf.tcc stringfwd.h \
118		valarray_array.h valarray_array.tcc valarray_before.h \
119		valarray_after.h vector.tcc
120BITSHDRS:=	${BITSHDRS:S;^;${SRCDIR}/include/bits/;}
121BITSHDRSDIR=	${CXXINCLUDEDIR}/bits
122
123BKWHDRS=	complex.h iomanip.h istream.h ostream.h stream.h streambuf.h \
124		algo.h algobase.h alloc.h bvector.h defalloc.h deque.h \
125		function.h hash_map.h hash_set.h hashtable.h heap.h iostream.h \
126		iterator.h list.h map.h multimap.h new.h multiset.h pair.h \
127		queue.h rope.h set.h slist.h stack.h tempbuf.h tree.h \
128		vector.h fstream.h strstream backward_warning.h
129BKWHDRS:=	${BKWHDRS:S;^;${SRCDIR}/include/backward/;}
130BKWHDRSDIR=	${CXXINCLUDEDIR}/backward
131
132EXTHDRS=	algorithm atomicity.h array_allocator.h bitmap_allocator.h \
133		codecvt_specializations.h concurrence.h debug_allocator.h \
134		stdio_filebuf.h stdio_sync_filebuf.h functional \
135		hash_map hash_set hash_fun.h hashtable.h iterator \
136		malloc_allocator.h memory mt_allocator.h new_allocator.h \
137		numeric numeric_traits.h pod_char_traits.h pool_allocator.h \
138		rb_tree rope ropeimpl.h slist throw_allocator.h typelist.h \
139		type_traits.h rc_string_base.h sso_string_base.h vstring.h \
140		vstring.tcc vstring_fwd.h vstring_util.h
141
142EXTHDRS:=	${EXTHDRS:S;^;${SRCDIR}/include/ext/;}
143EXTHDRSDIR=	${CXXINCLUDEDIR}/ext
144
145TR1HDRS=	array bind_repeat.h bind_iterate.h boost_shared_ptr.h cctype \
146		cfenv cfloat cinttypes climits cmath common.h complex cstdarg \
147		cstdbool cstdint cstdio cstdlib ctgmath ctime ctype.h cwchar \
148		cwctype fenv.h float.h functional functional_hash.h \
149		functional_iterate.h hashtable hashtable_policy.h inttypes.h \
150		limits.h math.h memory mu_iterate.h random random.tcc \
151		ref_fwd.h ref_wrap_iterate.h repeat.h stdarg.h stdbool.h \
152		stdint.h stdio.h stdlib.h tgmath.h tuple tuple_defs.h \
153		tuple_iterate.h type_traits type_traits_fwd.h unordered_set \
154		unordered_map utility wchar.h wctype.h
155
156TR1HDRS:=	${TR1HDRS:S;^;${SRCDIR}/include/tr1/;}
157TR1HDRSDIR=	${CXXINCLUDEDIR}/tr1
158
159# This is the common subset of files that all three "C" header models use.
160BASEHDRS=	std_cassert.h std_cctype.h std_cerrno.h std_cfloat.h \
161		std_ciso646.h std_climits.h std_clocale.h std_cmath.h \
162		std_csetjmp.h std_csignal.h std_cstdarg.h std_cstddef.h \
163		std_cstdio.h std_cstdlib.h std_cstring.h std_ctime.h \
164		std_cwchar.h std_cwctype.h
165.for h in ${BASEHDRS}
166BASEHDRSNAME_$h=${h:R:S;^std_;;}
167.endfor
168BASEHDRS:=	${BASEHDRS:S;^;${SRCDIR}/include/c_std/;}
169BASEHDRSDIR=	${CXXINCLUDEDIR}
170
171# Some of the different "C" header models need extra files.
172BASEXHDRS=	${SRCDIR}/include/c_std/cmath.tcc
173BASEXHDRSDIR=	${CXXINCLUDEDIR}/bits
174
175DEBUGHDRS=	bitset debug.h deque formatter.h functions.h hash_map \
176		hash_map.h hash_multimap.h hash_multiset.h hash_set hash_set.h \
177		list macros.h map map.h multimap.h multiset.h safe_base.h \
178		safe_iterator.h safe_iterator.tcc safe_sequence.h set set.h \
179		string vector
180DEBUGHDRS:=	${DEBUGHDRS:S;^;${SRCDIR}/include/debug/;}
181DEBUGHDRSDIR=	${CXXINCLUDEDIR}/debug
182
183# Not installed, but kept here for completeness
184COMPATHDRS=	assert.h ctype.h errno.h float.h iso646.h limits.h locale.h \
185		math.h setjmp.h signal.h stdarg.h stddef.h stdio.h stdlib.h \
186		string.h time.h wchar.h wctype.h
187COMPATHDRS:=	${COMPATHDRS:S;^;${SRCDIR}/include/debug/;}
188COMPATHDRSDIR=	${CXXINCLUDEDIR}/c_compatibility
189
190PBHDRS0 = \
191	assoc_container.hpp \
192	exception.hpp \
193	hash_policy.hpp \
194	list_update_policy.hpp \
195	priority_queue.hpp \
196	tag_and_trait.hpp \
197	tree_policy.hpp \
198	trie_policy.hpp
199PBHDRS0:=	${PBHDRS0:S;^;${SRCDIR}/include/ext/pb_ds/;}
200PBHDRS0DIR=	${CXXINCLUDEDIR}/ext/pb_ds
201
202PBHDRS1 = \
203	basic_types.hpp \
204	cond_dealtor.hpp \
205	constructors_destructor_fn_imps.hpp \
206	container_base_dispatch.hpp \
207	map_debug_base.hpp \
208	priority_queue_base_dispatch.hpp \
209	standard_policies.hpp \
210	tree_trace_base.hpp \
211	type_utils.hpp \
212	types_traits.hpp
213PBHDRS1:=	${PBHDRS1:S;^;${SRCDIR}/include/ext/pb_ds/detail/;}
214PBHDRS1DIR=	${CXXINCLUDEDIR}/ext/pb_ds/detail
215
216PBHDRS+= \
217	basic_tree_policy/basic_tree_policy_base.hpp \
218	basic_tree_policy/null_node_metadata.hpp \
219	basic_tree_policy/traits.hpp \
220	basic_types.hpp \
221	binary_heap_/binary_heap_.hpp \
222	binary_heap_/const_iterator.hpp \
223	binary_heap_/const_point_iterator.hpp \
224	binary_heap_/constructors_destructor_fn_imps.hpp \
225	binary_heap_/debug_fn_imps.hpp \
226	binary_heap_/entry_cmp.hpp \
227	binary_heap_/entry_pred.hpp \
228	binary_heap_/erase_fn_imps.hpp \
229	binary_heap_/find_fn_imps.hpp \
230	binary_heap_/info_fn_imps.hpp \
231	binary_heap_/insert_fn_imps.hpp \
232	binary_heap_/iterators_fn_imps.hpp \
233	binary_heap_/policy_access_fn_imps.hpp \
234	binary_heap_/resize_policy.hpp \
235	binary_heap_/split_join_fn_imps.hpp \
236	binary_heap_/trace_fn_imps.hpp \
237	binomial_heap_base_/binomial_heap_base_.hpp \
238	binomial_heap_base_/constructors_destructor_fn_imps.hpp \
239	binomial_heap_base_/debug_fn_imps.hpp \
240	binomial_heap_base_/erase_fn_imps.hpp \
241	binomial_heap_base_/find_fn_imps.hpp \
242	binomial_heap_base_/insert_fn_imps.hpp \
243	binomial_heap_base_/split_join_fn_imps.hpp \
244	binomial_heap_/binomial_heap_.hpp \
245	binomial_heap_/constructors_destructor_fn_imps.hpp \
246	binomial_heap_/debug_fn_imps.hpp \
247	bin_search_tree_/bin_search_tree_.hpp \
248	bin_search_tree_/cond_dtor_entry_dealtor.hpp \
249	bin_search_tree_/cond_key_dtor_entry_dealtor.hpp
250
251PBHDRS+= \
252	bin_search_tree_/constructors_destructor_fn_imps.hpp \
253	bin_search_tree_/debug_fn_imps.hpp \
254	bin_search_tree_/erase_fn_imps.hpp \
255	bin_search_tree_/find_fn_imps.hpp \
256	bin_search_tree_/info_fn_imps.hpp \
257	bin_search_tree_/insert_fn_imps.hpp \
258	bin_search_tree_/iterators_fn_imps.hpp \
259	bin_search_tree_/node_iterators.hpp \
260	bin_search_tree_/point_iterators.hpp \
261	bin_search_tree_/policy_access_fn_imps.hpp \
262	bin_search_tree_/r_erase_fn_imps.hpp \
263	bin_search_tree_/rotate_fn_imps.hpp \
264	bin_search_tree_/split_join_fn_imps.hpp \
265	bin_search_tree_/traits.hpp \
266	cc_hash_table_map_/cc_ht_map_.hpp \
267	cc_hash_table_map_/cmp_fn_imps.hpp \
268	cc_hash_table_map_/cond_key_dtor_entry_dealtor.hpp \
269	cc_hash_table_map_/constructor_destructor_fn_imps.hpp \
270	cc_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp \
271	cc_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp \
272	cc_hash_table_map_/debug_fn_imps.hpp \
273	cc_hash_table_map_/debug_no_store_hash_fn_imps.hpp \
274	cc_hash_table_map_/debug_store_hash_fn_imps.hpp \
275	cc_hash_table_map_/entry_list_fn_imps.hpp \
276	cc_hash_table_map_/erase_fn_imps.hpp \
277	cc_hash_table_map_/erase_no_store_hash_fn_imps.hpp \
278	cc_hash_table_map_/erase_store_hash_fn_imps.hpp \
279	cc_hash_table_map_/find_fn_imps.hpp \
280	cc_hash_table_map_/find_store_hash_fn_imps.hpp \
281	cc_hash_table_map_/info_fn_imps.hpp \
282	cc_hash_table_map_/insert_fn_imps.hpp \
283	cc_hash_table_map_/insert_no_store_hash_fn_imps.hpp \
284	cc_hash_table_map_/insert_store_hash_fn_imps.hpp \
285	cc_hash_table_map_/iterators_fn_imps.hpp \
286	cc_hash_table_map_/policy_access_fn_imps.hpp \
287	cc_hash_table_map_/resize_fn_imps.hpp \
288	cc_hash_table_map_/resize_no_store_hash_fn_imps.hpp \
289	cc_hash_table_map_/resize_store_hash_fn_imps.hpp \
290	cc_hash_table_map_/size_fn_imps.hpp \
291	cc_hash_table_map_/standard_policies.hpp
292
293PBHDRS+= \
294	cc_hash_table_map_/trace_fn_imps.hpp \
295	cond_dealtor.hpp \
296	constructors_destructor_fn_imps.hpp \
297	container_base_dispatch.hpp \
298	eq_fn/eq_by_less.hpp \
299	eq_fn/hash_eq_fn.hpp \
300	gp_hash_table_map_/constructor_destructor_fn_imps.hpp \
301	gp_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp \
302	gp_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp \
303	gp_hash_table_map_/debug_fn_imps.hpp \
304	gp_hash_table_map_/debug_no_store_hash_fn_imps.hpp \
305	gp_hash_table_map_/debug_store_hash_fn_imps.hpp \
306	gp_hash_table_map_/erase_fn_imps.hpp \
307	gp_hash_table_map_/erase_no_store_hash_fn_imps.hpp \
308	gp_hash_table_map_/erase_store_hash_fn_imps.hpp \
309	gp_hash_table_map_/find_fn_imps.hpp \
310	gp_hash_table_map_/find_no_store_hash_fn_imps.hpp \
311	gp_hash_table_map_/find_store_hash_fn_imps.hpp \
312	gp_hash_table_map_/gp_ht_map_.hpp \
313	gp_hash_table_map_/info_fn_imps.hpp \
314	gp_hash_table_map_/insert_fn_imps.hpp \
315	gp_hash_table_map_/insert_no_store_hash_fn_imps.hpp \
316	gp_hash_table_map_/insert_store_hash_fn_imps.hpp \
317	gp_hash_table_map_/iterator_fn_imps.hpp \
318	gp_hash_table_map_/policy_access_fn_imps.hpp \
319	gp_hash_table_map_/resize_fn_imps.hpp \
320	gp_hash_table_map_/resize_no_store_hash_fn_imps.hpp \
321	gp_hash_table_map_/resize_store_hash_fn_imps.hpp \
322	gp_hash_table_map_/standard_policies.hpp \
323	gp_hash_table_map_/trace_fn_imps.hpp \
324	hash_fn/direct_mask_range_hashing_imp.hpp \
325	hash_fn/direct_mod_range_hashing_imp.hpp \
326	hash_fn/linear_probe_fn_imp.hpp \
327	hash_fn/mask_based_range_hashing.hpp \
328	hash_fn/mod_based_range_hashing.hpp \
329	hash_fn/probe_fn_base.hpp \
330	hash_fn/quadratic_probe_fn_imp.hpp \
331	hash_fn/ranged_hash_fn.hpp \
332	hash_fn/ranged_probe_fn.hpp
333
334PBHDRS+= \
335	hash_fn/sample_probe_fn.hpp \
336	hash_fn/sample_ranged_hash_fn.hpp \
337	hash_fn/sample_ranged_probe_fn.hpp \
338	hash_fn/sample_range_hashing.hpp \
339	left_child_next_sibling_heap_/const_iterator.hpp \
340	left_child_next_sibling_heap_/const_point_iterator.hpp \
341	left_child_next_sibling_heap_/constructors_destructor_fn_imps.hpp \
342	left_child_next_sibling_heap_/debug_fn_imps.hpp \
343	left_child_next_sibling_heap_/erase_fn_imps.hpp \
344	left_child_next_sibling_heap_/info_fn_imps.hpp \
345	left_child_next_sibling_heap_/insert_fn_imps.hpp \
346	left_child_next_sibling_heap_/iterators_fn_imps.hpp \
347	left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp \
348	left_child_next_sibling_heap_/node.hpp \
349	left_child_next_sibling_heap_/null_metadata.hpp \
350	left_child_next_sibling_heap_/policy_access_fn_imps.hpp \
351	left_child_next_sibling_heap_/trace_fn_imps.hpp \
352	list_update_map_/constructor_destructor_fn_imps.hpp \
353	list_update_map_/debug_fn_imps.hpp \
354	list_update_map_/entry_metadata_base.hpp \
355	list_update_map_/erase_fn_imps.hpp \
356	list_update_map_/find_fn_imps.hpp \
357	list_update_map_/info_fn_imps.hpp \
358	list_update_map_/insert_fn_imps.hpp \
359	list_update_map_/iterators_fn_imps.hpp \
360	list_update_map_/lu_map_.hpp \
361	list_update_map_/trace_fn_imps.hpp \
362	list_update_policy/counter_lu_metadata.hpp \
363	list_update_policy/counter_lu_policy_imp.hpp \
364	list_update_policy/mtf_lu_policy_imp.hpp \
365	list_update_policy/sample_update_policy.hpp \
366	map_debug_base.hpp \
367	ov_tree_map_/cond_dtor.hpp \
368	ov_tree_map_/constructors_destructor_fn_imps.hpp \
369	ov_tree_map_/debug_fn_imps.hpp \
370	ov_tree_map_/erase_fn_imps.hpp \
371	ov_tree_map_/info_fn_imps.hpp \
372	ov_tree_map_/insert_fn_imps.hpp \
373	ov_tree_map_/iterators_fn_imps.hpp \
374	ov_tree_map_/node_iterators.hpp \
375	ov_tree_map_/ov_tree_map_.hpp
376
377PBHDRS+= \
378	ov_tree_map_/policy_access_fn_imps.hpp \
379	ov_tree_map_/split_join_fn_imps.hpp \
380	ov_tree_map_/traits.hpp \
381	pairing_heap_/constructors_destructor_fn_imps.hpp \
382	pairing_heap_/debug_fn_imps.hpp \
383	pairing_heap_/erase_fn_imps.hpp \
384	pairing_heap_/find_fn_imps.hpp \
385	pairing_heap_/insert_fn_imps.hpp \
386	pairing_heap_/pairing_heap_.hpp \
387	pairing_heap_/split_join_fn_imps.hpp \
388	pat_trie_/child_iterator.hpp \
389	pat_trie_/cond_dtor_entry_dealtor.hpp \
390	pat_trie_/const_child_iterator.hpp \
391	pat_trie_/constructors_destructor_fn_imps.hpp \
392	pat_trie_/debug_fn_imps.hpp \
393	pat_trie_/erase_fn_imps.hpp \
394	pat_trie_/find_fn_imps.hpp \
395	pat_trie_/head.hpp \
396	pat_trie_/info_fn_imps.hpp \
397	pat_trie_/insert_join_fn_imps.hpp \
398	pat_trie_/internal_node.hpp \
399	pat_trie_/iterators_fn_imps.hpp \
400	pat_trie_/leaf.hpp \
401	pat_trie_/node_base.hpp \
402	pat_trie_/node_iterators.hpp \
403	pat_trie_/node_metadata_base.hpp \
404	pat_trie_/pat_trie_.hpp \
405	pat_trie_/point_iterators.hpp \
406	pat_trie_/policy_access_fn_imps.hpp \
407	pat_trie_/r_erase_fn_imps.hpp \
408	pat_trie_/rotate_fn_imps.hpp \
409	pat_trie_/split_fn_imps.hpp \
410	pat_trie_/split_join_branch_bag.hpp \
411	pat_trie_/synth_e_access_traits.hpp \
412	pat_trie_/trace_fn_imps.hpp \
413	pat_trie_/traits.hpp \
414	pat_trie_/update_fn_imps.hpp \
415	priority_queue_base_dispatch.hpp \
416	rb_tree_map_/constructors_destructor_fn_imps.hpp \
417	rb_tree_map_/debug_fn_imps.hpp
418
419PBHDRS+= \
420	rb_tree_map_/erase_fn_imps.hpp \
421	rb_tree_map_/find_fn_imps.hpp \
422	rb_tree_map_/info_fn_imps.hpp \
423	rb_tree_map_/insert_fn_imps.hpp \
424	rb_tree_map_/node.hpp \
425	rb_tree_map_/rb_tree_.hpp \
426	rb_tree_map_/split_join_fn_imps.hpp \
427	rb_tree_map_/traits.hpp \
428	rc_binomial_heap_/constructors_destructor_fn_imps.hpp \
429	rc_binomial_heap_/debug_fn_imps.hpp \
430	rc_binomial_heap_/erase_fn_imps.hpp \
431	rc_binomial_heap_/insert_fn_imps.hpp \
432	rc_binomial_heap_/rc_binomial_heap_.hpp \
433	rc_binomial_heap_/rc.hpp \
434	rc_binomial_heap_/split_join_fn_imps.hpp \
435	rc_binomial_heap_/trace_fn_imps.hpp \
436	resize_policy/cc_hash_max_collision_check_resize_trigger_imp.hpp \
437	resize_policy/hash_exponential_size_policy_imp.hpp \
438	resize_policy/hash_load_check_resize_trigger_imp.hpp \
439	resize_policy/hash_load_check_resize_trigger_size_base.hpp \
440	resize_policy/hash_prime_size_policy_imp.hpp \
441	resize_policy/hash_standard_resize_policy_imp.hpp \
442	resize_policy/sample_resize_policy.hpp \
443	resize_policy/sample_resize_trigger.hpp \
444	resize_policy/sample_size_policy.hpp \
445	splay_tree_/constructors_destructor_fn_imps.hpp \
446	splay_tree_/debug_fn_imps.hpp \
447	splay_tree_/erase_fn_imps.hpp \
448	splay_tree_/find_fn_imps.hpp \
449	splay_tree_/info_fn_imps.hpp \
450	splay_tree_/insert_fn_imps.hpp \
451	splay_tree_/node.hpp \
452	splay_tree_/splay_fn_imps.hpp \
453	splay_tree_/splay_tree_.hpp \
454	splay_tree_/split_join_fn_imps.hpp \
455	splay_tree_/traits.hpp \
456	standard_policies.hpp \
457	thin_heap_/constructors_destructor_fn_imps.hpp \
458	thin_heap_/debug_fn_imps.hpp \
459	thin_heap_/erase_fn_imps.hpp
460
461PBHDRS+= \
462	thin_heap_/find_fn_imps.hpp \
463	thin_heap_/insert_fn_imps.hpp \
464	thin_heap_/split_join_fn_imps.hpp \
465	thin_heap_/thin_heap_.hpp \
466	thin_heap_/trace_fn_imps.hpp \
467	tree_policy/node_metadata_selector.hpp \
468	tree_policy/null_node_update_imp.hpp \
469	tree_policy/order_statistics_imp.hpp \
470	tree_policy/sample_tree_node_update.hpp \
471	tree_trace_base.hpp \
472	trie_policy/node_metadata_selector.hpp \
473	trie_policy/null_node_update_imp.hpp \
474	trie_policy/order_statistics_imp.hpp \
475	trie_policy/prefix_search_node_update_imp.hpp \
476	trie_policy/sample_trie_e_access_traits.hpp \
477	trie_policy/sample_trie_node_update.hpp \
478	trie_policy/string_trie_e_access_traits_imp.hpp \
479	trie_policy/trie_policy_base.hpp \
480	types_traits.hpp \
481	type_utils.hpp \
482	unordered_iterator/const_iterator.hpp \
483	unordered_iterator/const_point_iterator.hpp \
484	unordered_iterator/iterator.hpp \
485	unordered_iterator/point_iterator.hpp
486
487PBHDRSDIRS= \
488	pairing_heap_ \
489	splay_tree_ \
490	list_update_map_ \
491	basic_tree_policy \
492	trie_policy \
493	gp_hash_table_map_ \
494	tree_policy \
495	binomial_heap_base_ \
496	resize_policy \
497	bin_search_tree_ \
498	binomial_heap_ \
499	thin_heap_ \
500	pat_trie_ \
501	cc_hash_table_map_ \
502	rc_binomial_heap_ \
503	left_child_next_sibling_heap_ \
504	unordered_iterator \
505	binary_heap_ \
506	ov_tree_map_ \
507	hash_fn \
508	eq_fn \
509	rb_tree_map_ \
510	list_update_policy
511
512.for D in ${PBHDRSDIRS}
513PHDRGRP$D:=	${PBHDRS:M$D/*:S;^;${SRCDIR}/include/ext/pb_ds/detail/;}
514PHDRGRP$DDIR=	${CXXINCLUDEDIR}/ext/pb_ds/detail/$D
515INCSGROUPS+=	PHDRGRP$D
516.endfor
517
518TARGETHDRS=	abi/compatibility.h \
519		allocator/new_allocator_base.h \
520		io/basic_file_stdio.h \
521		io/c_io_stdio.h \
522		locale/generic/c_locale.h \
523		locale/generic/c++locale_internal.h \
524		locale/generic/messages_members.h \
525		locale/generic/time_members.h \
526		os/bsd/openbsd/ctype_base.h \
527		os/bsd/openbsd/ctype_inline.h \
528		os/bsd/openbsd/ctype_noninline.h \
529		os/bsd/openbsd/os_defines.h
530TARGETHDRS:=	${TARGETHDRS:S;^;${SRCDIR}/config/;}
531TARGETHDRS+=	c++config.h
532TARGETHDRSNAME_basic_file_stdio.h= basic_file.h
533TARGETHDRSNAME_c_io_stdio.h= c++io.h
534TARGETHDRSNAME_c_locale.h= c++locale.h
535TARGETHDRSNAME_new_allocator_base.h= c++allocator.h
536TARGETHDRSDIR=	${CXXINCLUDEDIR}/${GCC_TARGET}/bits/
537
538MARCHHDRS=	atomic_word.h cpu_defines.h cxxabi_tweaks.h
539.for h in ${MARCHHDRS}
540.if exists(${SRCDIR}/config/cpu/${MARCHDIR}/${h})
541TARGETHDRS+=	${SRCDIR}/config/cpu/${MARCHDIR}/${h}
542.else
543TARGETHDRS+=	${SRCDIR}/config/cpu/generic/${h}
544.endif
545.endfor
546
547THRHDRS=	gthr.h gthr-single.h gthr-posix.h gthr-tpf.h gthr-default.h
548THRHDRSDIR=	${CXXINCLUDEDIR}/${GCC_TARGET}/bits/
549uppercase =	[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]
550
551gthr.h: ${GCCDIR}/gthr.h
552	sed -e '/^#pragma/b' \
553	    -e '/^#/s/\(${uppercase}${uppercase}*\)/_GLIBCXX_\1/g' \
554	    -e 's/_GLIBCXX_SUPPORTS_WEAK/__GXX_WEAK__/g' \
555	    -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
556	    < ${.ALLSRC} > ${.TARGET}
557
558gthr-single.h: ${GCCDIR}/gthr-single.h
559	sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
560	    -e 's/\(GCC${uppercase}*_H\)/_GLIBCXX_\1/g' \
561	    < ${.ALLSRC} > ${.TARGET}
562
563gthr-posix.h: ${GCCDIR}/gthr-posix.h
564	sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
565	    -e 's/\(GCC${uppercase}*_H\)/_GLIBCXX_\1/g' \
566	    -e 's/SUPPORTS_WEAK/__GXX_WEAK__/g' \
567	    -e 's/\(${uppercase}*USE_WEAK\)/_GLIBCXX_\1/g' \
568	    < ${.ALLSRC} > ${.TARGET}
569
570gthr-tpf.h: ${GCCDIR}/gthr-posix.h
571	sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
572	    -e 's/\(GCC${uppercase}*_H\)/_GLIBCXX_\1/g' \
573	    -e 's/SUPPORTS_WEAK/__GXX_WEAK__/g' \
574	    -e 's/\(${uppercase}*USE_WEAK\)/_GLIBCXX_\1/g' \
575	    < ${.ALLSRC} > ${.TARGET}
576
577gthr-default.h: ${GCCDIR}/gthr-posix.h
578	sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
579	    -e 's/\(GCC${uppercase}*_H\)/_GLIBCXX_\1/g' \
580	    -e 's/SUPPORTS_WEAK/__GXX_WEAK__/g' \
581	    -e 's/\(${uppercase}*USE_WEAK\)/_GLIBCXX_\1/g' \
582	    -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
583	    < ${.ALLSRC} > ${.TARGET}
584
585CLEANFILES+=	${THRHDRS}
586
587DATESTAMP!=	cat ${GCCDIR}/DATESTAMP
588
589c++config.h: ${.CURDIR}/config.h ${SRCDIR}/include/bits/c++config
590	sed -e "s/\\(define __GLIBCXX__\\)/\1 ${DATESTAMP}/" \
591	    -e 's/\(define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY\)/\1 1/' \
592	    -e 's/\(define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION\)/\1 0/' \
593	    < ${SRCDIR}/include/bits/c++config > ${.TARGET} && \
594	sed -e 's/HAVE_/_GLIBCXX_HAVE_/g' \
595	    -e 's/PACKAGE/_GLIBCXX_PACKAGE/g' \
596	    -e 's/VERSION/_GLIBCXX_VERSION/g' \
597	    -e 's/WORDS_/_GLIBCXX_WORDS_/g' \
598	    < ${.CURDIR}/config.h >> ${.TARGET} && \
599	echo "#endif // _CXXCONFIG_" >> ${.TARGET}
600CLEANFILES+=	c++config.h
601
602# Symbol versioning.
603
604VERSION_MAP=  	libstdc++.map
605
606${VERSION_MAP}: ${SRCDIR}/config/abi/pre/gnu.ver
607	ln -sf ${.ALLSRC} ${.TARGET}
608
609CLEANFILES+=	${VERSION_MAP}
610
611prereq: c++config.h ${THRHDRS}
612
613includes: prereq
614.for group in ${INCSGROUPS}
615	test -d ${${group}DIR} || \
616	    ${INSTALL} -d -o root -g bin -m 755 \
617		${${group}DIR}
618.  for f in ${${group}}
619	${INSTALL} -C -o root -g bin -m 644 \
620		${f} ${${group}DIR}/${${group}NAME_${f:T}}
621.  endfor
622.endfor
623
624.include <bsd.lib.mk>
625