Use the i486 headers for amd64.
[dragonfly.git] / gnu / lib / gcc41 / libstdc++ / Makefile
CommitLineData
4c05d4f0 1# $DragonFly: src/gnu/lib/gcc41/libstdc++/Makefile,v 1.4 2007/08/23 06:13:30 corecode Exp $
ddf7cc86
SS
2
3.include "../Makefile.inc"
4
45918ca3 5.if ${MACHINE_ARCH} == "i386" && !empty(MACHINE_CPU:Mi486)
ddf7cc86 6MARCHDIR= i486
4c05d4f0
SS
7.elif ${MACHINE_ARCH} == "amd64"
8MARCHDIR= i486
ddf7cc86
SS
9.else
10MARCHDIR= ${MACHINE_ARCH}
11.endif
12
13SRCDIR= ${GCCDIR}/libstdc++-v3
14SUPDIR= ${SRCDIR}/libsupc++
15
16.PATH: ${SRCDIR}/src ${SRCDIR}/libmath ${SRCDIR}/config/io
17.PATH: ${SRCDIR}/config/locale/generic ${SRCDIR}
18.PATH: ${SUPDIR} ${GCCDIR}/gcc ${GCCDIR}/libiberty
19
20#SUBDIR= doc
21
22LIB= stdc++
23SHLIB_MAJOR= 9
24
25CFLAGS+= -DIN_GLIBCPP_V3 -DHAVE_CONFIG_H
26CFLAGS+= -I. -I${.CURDIR}
27CFLAGS+= -I${SUPDIR} -I${GCCDIR}/gcc -I${GCCDIR}/include
28CXXFLAGS+= -I${SRCDIR}/config/cpu/${MARCHDIR}
29CXXFLAGS+= -fno-implicit-templates -ffunction-sections -fdata-sections \
30 -Wno-deprecated
31
91908873 32LDADD+= -lm
ddf7cc86
SS
33DPADD+= ${LIBM}
34
ddf7cc86
SS
35# libstdc++ sources (libstdc++/src/Makefile.in, do not reorder)
36SRCS+= \
37 bitmap_allocator.cc \
38 pool_allocator.cc \
39 mt_allocator.cc \
40 codecvt.cc \
41 compatibility.cc \
42 complex_io.cc \
43 ctype.cc \
44 debug.cc \
45 debug_list.cc \
46 functexcept.cc \
47 globals_locale.cc \
48 globals_io.cc \
49 ios.cc \
50 ios_failure.cc \
51 ios_init.cc \
52 ios_locale.cc \
53 limits.cc \
54 list.cc \
55 locale.cc \
56 locale_init.cc \
57 locale_facets.cc \
58 localename.cc \
59 stdexcept.cc \
60 strstream.cc \
61 tree.cc \
62 allocator-inst.cc \
63 concept-inst.cc \
64 fstream-inst.cc \
65 ext-inst.cc \
66 ios-inst.cc \
67 iostream-inst.cc \
68 istream-inst.cc \
69 istream.cc \
70 locale-inst.cc \
71 locale-misc-inst.cc \
72 misc-inst.cc \
73 ostream-inst.cc \
74 sstream-inst.cc \
75 streambuf-inst.cc \
76 streambuf.cc \
77 string-inst.cc \
78 valarray-inst.cc \
79 wlocale-inst.cc \
80 wstring-inst.cc \
81 ${host_sources} \
82 ${host_sources_extra}
83
84host_sources = \
85 atomicity.cc \
86 codecvt_members.cc \
87 collate_members.cc \
88 ctype_members.cc \
89 messages_members.cc \
90 monetary_members.cc \
91 numeric_members.cc \
92 time_members.cc
93
94host_sources_extra = \
95 basic_file_stdio.cc \
96 c_locale.cc
97
98SRCS+= ctype_noninline.h ctype_base.h
99
100atomicity.cc:
101 echo '#include "atomicity.h"' > ${.TARGET}
102
103CLEANFILES+= atomicity.cc
104
105# C parts of math
106SRCS+= stubs.c
107
108# Embedded copy of libsupc++
109SRCS+= \
110 del_op.cc \
111 del_opnt.cc \
112 del_opv.cc \
113 del_opvnt.cc \
114 eh_alloc.cc \
115 eh_arm.cc \
116 eh_aux_runtime.cc \
117 eh_call.cc \
118 eh_catch.cc \
119 eh_exception.cc \
120 eh_globals.cc \
121 eh_personality.cc \
122 eh_term_handler.cc \
123 eh_terminate.cc \
124 eh_throw.cc \
125 eh_type.cc \
126 eh_unex_handler.cc \
127 guard.cc \
128 new_handler.cc \
129 new_op.cc \
130 new_opnt.cc \
131 new_opv.cc \
132 new_opvnt.cc \
133 pure.cc \
134 tinfo.cc \
135 tinfo2.cc \
136 vec.cc \
137 vterminate.cc
138
139# from libiberty
140SRCS+= cp-demangle.c
141
142SRCS+= unwind.h
143
144unwind.h: unwind-generic.h
145 cp ${.ALLSRC} ${.TARGET}
146
147CLEANFILES+= unwind.h
148
149
150strstream.cc: ${SRCDIR}/src/strstream.cc
151 sed -e 's,^#include <strstream>,#include <backward/strstream>,g' \
152 < ${.ALLSRC} > ${.TARGET}
153
154CLEANFILES+= strstream.cc
155
156
157INCSGROUPS= BITSHDRS BKWHDRS DEBUGHDRS EXTHDRS TR1HDRS \
158 BASEHDRS BASEXHDRS STDHDRS TARGETHDRS THRHDRS
159
160STDHDRS= \
161 std_algorithm.h \
162 std_bitset.h \
163 std_complex.h \
164 std_deque.h \
165 std_fstream.h \
166 std_functional.h \
167 std_iomanip.h \
168 std_ios.h \
169 std_iosfwd.h \
170 std_iostream.h \
171 std_istream.h \
172 std_iterator.h \
173 std_limits.h \
174 std_list.h \
175 std_locale.h \
176 std_map.h \
177 std_memory.h \
178 std_numeric.h \
179 std_ostream.h \
180 std_queue.h \
181 std_set.h \
182 std_sstream.h \
183 std_stack.h \
184 std_stdexcept.h \
185 std_streambuf.h \
186 std_string.h \
187 std_utility.h \
188 std_valarray.h \
189 std_vector.h
190.for h in ${STDHDRS}
191STDHDRSNAME_$h=${h:R:S;^std_;;}
192.endfor
193STDHDRS:= ${STDHDRS:S;^;${SRCDIR}/include/std/;}
194STDHDRSDIR= ${INCLUDEDIR}/c++/4.1
195
196
197BITSHDRS= \
198 allocator.h \
199 atomicity.h \
200 basic_ios.h \
201 basic_ios.tcc \
202 basic_string.h \
203 basic_string.tcc \
204 boost_concept_check.h \
205 char_traits.h \
206 codecvt.h \
207 concept_check.h \
208 concurrence.h \
209 cpp_type_traits.h \
210 deque.tcc \
211 fstream.tcc \
212 functexcept.h \
213 gslice.h \
214 gslice_array.h \
215 indirect_array.h \
216 ios_base.h \
217 istream.tcc \
218 list.tcc \
219 locale_classes.h \
220 locale_facets.h \
221 locale_facets.tcc \
222 localefwd.h \
223 mask_array.h \
224 ostream.tcc \
225 postypes.h \
226 stream_iterator.h \
227 streambuf_iterator.h \
228 slice_array.h \
229 sstream.tcc \
230 stl_algo.h \
231 stl_algobase.h \
232 stl_bvector.h \
233 stl_construct.h \
234 stl_deque.h \
235 stl_function.h \
236 stl_heap.h \
237 stl_iterator.h \
238 stl_iterator_base_funcs.h \
239 stl_iterator_base_types.h \
240 stl_list.h \
241 stl_map.h \
242 stl_multimap.h \
243 stl_multiset.h \
244 stl_numeric.h \
245 stl_pair.h \
246 stl_queue.h \
247 stl_raw_storage_iter.h \
248 stl_relops.h \
249 stl_set.h \
250 stl_stack.h \
251 stl_tempbuf.h \
252 stl_tree.h \
253 stl_uninitialized.h \
254 stl_vector.h \
255 streambuf.tcc \
256 stringfwd.h \
257 valarray_array.h \
258 valarray_array.tcc \
259 valarray_before.h \
260 valarray_after.h \
261 vector.tcc
262BITSHDRS:= ${BITSHDRS:S;^;${SRCDIR}/include/bits/;}
263BITSHDRSDIR= ${INCLUDEDIR}/c++/4.1/bits
264
265
266BKWHDRS= \
267 complex.h \
268 iomanip.h \
269 istream.h \
270 ostream.h \
271 stream.h \
272 streambuf.h \
273 algo.h \
274 algobase.h \
275 alloc.h \
276 bvector.h \
277 defalloc.h \
278 deque.h \
279 function.h \
280 hash_map.h \
281 hash_set.h \
282 hashtable.h \
283 heap.h \
284 iostream.h \
285 iterator.h \
286 list.h \
287 map.h \
288 multimap.h \
289 new.h \
290 multiset.h \
291 pair.h \
292 queue.h \
293 rope.h \
294 set.h \
295 slist.h \
296 stack.h \
297 tempbuf.h \
298 tree.h \
299 vector.h \
300 fstream.h \
301 strstream \
302 backward_warning.h
303BKWHDRS:= ${BKWHDRS:S;^;${SRCDIR}/include/backward/;}
304BKWHDRSDIR= ${INCLUDEDIR}/c++/4.1/backward
305
306
307EXTHDRS= \
308 algorithm \
309 array_allocator.h \
310 bitmap_allocator.h \
311 codecvt_specializations.h \
312 debug_allocator.h \
313 stdio_filebuf.h \
314 stdio_sync_filebuf.h \
315 functional \
316 hash_map \
317 hash_set \
318 hash_fun.h \
319 hashtable.h \
320 iterator \
321 malloc_allocator.h \
322 memory \
323 mt_allocator.h \
324 new_allocator.h \
325 numeric \
326 pod_char_traits.h \
327 pool_allocator.h \
328 rb_tree \
329 rope \
330 ropeimpl.h \
331 slist \
332 typelist.h \
333 rc_string_base.h \
334 sso_string_base.h \
335 vstring.h \
336 vstring.tcc \
337 vstring_fwd.h \
338 vstring_util.h
339EXTHDRS:= ${EXTHDRS:S;^;${SRCDIR}/include/ext/;}
340EXTHDRSDIR= ${INCLUDEDIR}/c++/4.1/ext
341
342
343TR1HDRS= \
344 array \
345 bind_repeat.h \
346 bind_iterate.h \
347 boost_shared_ptr.h \
348 mu_iterate.h \
349 functional \
350 functional_iterate.h \
351 memory \
352 ref_fwd.h \
353 ref_wrap_iterate.h \
354 repeat.h \
355 tuple \
356 tuple_iterate.h \
357 utility \
358 type_traits \
359 type_traits_fwd.h \
360 hashtable \
361 unordered_set \
362 unordered_map
363TR1HDRS:= ${TR1HDRS:S;^;${SRCDIR}/include/tr1/;}
364TR1HDRSDIR= ${INCLUDEDIR}/c++/4.1/tr1
365
366
367# This is the common subset of files that all three "C" header models use.
368BASEHDRS= \
369 std_cassert.h \
370 std_cctype.h \
371 std_cerrno.h \
372 std_cfloat.h \
373 std_ciso646.h \
374 std_climits.h \
375 std_clocale.h \
376 std_cmath.h \
377 std_csetjmp.h \
378 std_csignal.h \
379 std_cstdarg.h \
380 std_cstddef.h \
381 std_cstdio.h \
382 std_cstdlib.h \
383 std_cstring.h \
384 std_ctime.h \
385 std_cwchar.h \
386 std_cwctype.h
387.for h in ${BASEHDRS}
388BASEHDRSNAME_$h=${h:R:S;^std_;;}
389.endfor
390BASEHDRS:= ${BASEHDRS:S;^;${SRCDIR}/include/c_std/;}
391BASEHDRSDIR= ${INCLUDEDIR}/c++/4.1
392
393# Some of the different "C" header models need extra files.
394BASEXHDRS= ${SRCDIR}/include/c_std/cmath.tcc
395BASEXHDRSDIR= ${INCLUDEDIR}/c++/4.1/bits
396
397
398DEBUGHDRS= \
399 bitset \
400 debug.h \
401 deque \
402 formatter.h \
403 functions.h \
404 hash_map \
405 hash_map.h \
406 hash_multimap.h \
407 hash_multiset.h \
408 hash_set \
409 hash_set.h \
410 list \
411 map \
412 macros.h \
413 map.h \
414 multimap.h \
415 multiset.h \
416 safe_base.h \
417 safe_iterator.h \
418 safe_iterator.tcc \
419 safe_sequence.h \
420 set \
421 set.h \
422 string \
423 vector
424DEBUGHDRS:= ${DEBUGHDRS:S;^;${SRCDIR}/include/debug/;}
425DEBUGHDRSDIR= ${INCLUDEDIR}/c++/4.1/debug
426
427
428# c++locale <- c_locale.h
429TARGETHDRS= io/basic_file_stdio.h
430TARGETHDRSNAME_basic_file_stdio.h= basic_file.h
431TARGETHDRS+= allocator/new_allocator_base.h
432TARGETHDRSNAME_new_allocator_base.h= c++allocator.h
433TARGETHDRS+= io/c_io_stdio.h
434TARGETHDRSNAME_c_io_stdio.h= c++io.h
435TARGETHDRS+= locale/generic/c_locale.h locale/generic/c++locale_internal.h
436TARGETHDRSNAME_c_locale.h= c++locale.h
437TARGETHDRS+= locale/generic/messages_members.h
438TARGETHDRS+= locale/generic/time_members.h
439TARGETHDRS+= os/bsd/netbsd/ctype_inline.h
440TARGETHDRS:= ${TARGETHDRS:S;^;${SRCDIR}/config/;}
441TARGETHDRS+= ctype_base.h ctype_noninline.h os_defines.h
442TARGETHDRS+= c++config.h
443TARGETHDRSDIR= ${INCLUDEDIR}/c++/4.1/bits
444
445MARCHHDRS= atomic_word.h cxxabi_tweaks.h cpu_defines.h
446
447.for h in ${MARCHHDRS}
448.if exists(${SRCDIR}/config/cpu/${MARCHDIR}/${h})
449TARGETHDRS+= ${SRCDIR}/config/cpu/${MARCHDIR}/${h}
450.else
451TARGETHDRS+= ${SRCDIR}/config/cpu/generic/${h}
452.endif
453.endfor
454
455THRHDRS= gthr.h gthr-single.h gthr-posix.h gthr-default.h
456THRHDRSDIR= ${INCLUDEDIR}/c++/4.1/bits
457
458gthr.h: ${GCCDIR}/gcc/gthr.h
459 sed -e '/^#/s/\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_][ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*\)/_GLIBCPP_\1/g' \
460 -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
461 < ${GCCDIR}/gcc/gthr.h > gthr.h
462
463gthr-single.h: ${GCCDIR}/gcc/gthr-single.h
464 sed -e 's/\(UNUSED\)/_GLIBCPP_\1/g' \
465 -e 's/\(GCC[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*_H\)/_GLIBCPP_\1/g' \
466 < ${GCCDIR}/gcc/gthr-single.h > gthr-single.h
467
468gthr-posix.h: ${GCCDIR}/gcc/gthr-posix.h
469 sed -e 's/\(UNUSED\)/_GLIBCPP_\1/g' \
470 -e 's/\(GCC[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*_H\)/_GLIBCPP_\1/g' \
471 -e 's/\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*WEAK\)/_GLIBCPP_\1/g' \
472 < ${GCCDIR}/gcc/gthr-posix.h > gthr-posix.h
473
474gthr-default.h: ${GCCDIR}/gcc/gthr-posix.h
475 sed -e 's/\(UNUSED\)/_GLIBCPP_\1/g' \
476 -e 's/\(GCC[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*_H\)/_GLIBCPP_\1/g' \
477 -e 's/\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*WEAK\)/_GLIBCPP_\1/g' \
478 -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
479 < ${GCCDIR}/gcc/gthr-posix.h > gthr-default.h
480
481ctype_base.h: ${SRCDIR}/config/os/bsd/netbsd/ctype_base.h ctype_base.h.patch
482 patch -o ${.TARGET} -i ${.CURDIR}/ctype_base.h.patch ${SRCDIR}/config/os/bsd/netbsd/ctype_base.h
483
484ctype_noninline.h: ${SRCDIR}/config/os/bsd/netbsd/ctype_noninline.h ctype_noninline.h.patch
485 patch -o ${.TARGET} -i ${.CURDIR}/ctype_noninline.h.patch ${SRCDIR}/config/os/bsd/netbsd/ctype_noninline.h
486
487c++config.h: config.h ${SRCDIR}/include/bits/c++config DATESTAMP
488 cat ${.ALLSRC:M*c++config} > ${.TARGET}
489 sed -e 's/^/#define __GLIBCXX__ /' < ${.ALLSRC:M*DATESTAMP} >> ${.TARGET}
490 sed -e 's/HAVE_/_GLIBCXX_HAVE_/g' \
491 -e 's/PACKAGE/_GLIBCXX_PACKAGE/g' \
492 -e 's/VERSION/_GLIBCXX_VERSION/g' \
493 -e 's/WORDS_/_GLIBCXX_WORDS_/g' \
494 < ${.ALLSRC:M*config.h} >> ${.TARGET}
495 echo "#endif // _CXXCONFIG_" >> ${.TARGET}
496
497CLEANFILES+= ${THRHDRS} ctype_noninline.h ctype_base.h c++config.h
498
499.include <bsd.lib.mk>