1 # $DragonFly: src/gnu/lib/gcc41/libstdc++/Makefile,v 1.3 2007/01/20 18:24:34 corecode Exp $
3 .include "../Makefile.inc"
5 .if ${MACHINE_ARCH} == "i386" && !empty(MACHINE_CPU:Mi486)
8 MARCHDIR= ${MACHINE_ARCH}
11 SRCDIR= ${GCCDIR}/libstdc++-v3
12 SUPDIR= ${SRCDIR}/libsupc++
14 .PATH: ${SRCDIR}/src ${SRCDIR}/libmath ${SRCDIR}/config/io
15 .PATH: ${SRCDIR}/config/locale/generic ${SRCDIR}
16 .PATH: ${SUPDIR} ${GCCDIR}/gcc ${GCCDIR}/libiberty
23 CFLAGS+= -DIN_GLIBCPP_V3 -DHAVE_CONFIG_H
24 CFLAGS+= -I. -I${.CURDIR}
25 CFLAGS+= -I${SUPDIR} -I${GCCDIR}/gcc -I${GCCDIR}/include
26 CXXFLAGS+= -I${SRCDIR}/config/cpu/${MARCHDIR}
27 CXXFLAGS+= -fno-implicit-templates -ffunction-sections -fdata-sections \
33 # libstdc++ sources (libstdc++/src/Makefile.in, do not reorder)
92 host_sources_extra = \
96 SRCS+= ctype_noninline.h ctype_base.h
99 echo '#include "atomicity.h"' > ${.TARGET}
101 CLEANFILES+= atomicity.cc
106 # Embedded copy of libsupc++
142 unwind.h: unwind-generic.h
143 cp ${.ALLSRC} ${.TARGET}
145 CLEANFILES+= unwind.h
148 strstream.cc: ${SRCDIR}/src/strstream.cc
149 sed -e 's,^#include <strstream>,#include <backward/strstream>,g' \
150 < ${.ALLSRC} > ${.TARGET}
152 CLEANFILES+= strstream.cc
155 INCSGROUPS= BITSHDRS BKWHDRS DEBUGHDRS EXTHDRS TR1HDRS \
156 BASEHDRS BASEXHDRS STDHDRS TARGETHDRS THRHDRS
189 STDHDRSNAME_$h=${h:R:S;^std_;;}
191 STDHDRS:= ${STDHDRS:S;^;${SRCDIR}/include/std/;}
192 STDHDRSDIR= ${INCLUDEDIR}/c++/4.1
202 boost_concept_check.h \
225 streambuf_iterator.h \
236 stl_iterator_base_funcs.h \
237 stl_iterator_base_types.h \
245 stl_raw_storage_iter.h \
251 stl_uninitialized.h \
260 BITSHDRS:= ${BITSHDRS:S;^;${SRCDIR}/include/bits/;}
261 BITSHDRSDIR= ${INCLUDEDIR}/c++/4.1/bits
301 BKWHDRS:= ${BKWHDRS:S;^;${SRCDIR}/include/backward/;}
302 BKWHDRSDIR= ${INCLUDEDIR}/c++/4.1/backward
309 codecvt_specializations.h \
312 stdio_sync_filebuf.h \
337 EXTHDRS:= ${EXTHDRS:S;^;${SRCDIR}/include/ext/;}
338 EXTHDRSDIR= ${INCLUDEDIR}/c++/4.1/ext
348 functional_iterate.h \
361 TR1HDRS:= ${TR1HDRS:S;^;${SRCDIR}/include/tr1/;}
362 TR1HDRSDIR= ${INCLUDEDIR}/c++/4.1/tr1
365 # This is the common subset of files that all three "C" header models use.
385 .for h in ${BASEHDRS}
386 BASEHDRSNAME_$h=${h:R:S;^std_;;}
388 BASEHDRS:= ${BASEHDRS:S;^;${SRCDIR}/include/c_std/;}
389 BASEHDRSDIR= ${INCLUDEDIR}/c++/4.1
391 # Some of the different "C" header models need extra files.
392 BASEXHDRS= ${SRCDIR}/include/c_std/cmath.tcc
393 BASEXHDRSDIR= ${INCLUDEDIR}/c++/4.1/bits
422 DEBUGHDRS:= ${DEBUGHDRS:S;^;${SRCDIR}/include/debug/;}
423 DEBUGHDRSDIR= ${INCLUDEDIR}/c++/4.1/debug
426 # c++locale <- c_locale.h
427 TARGETHDRS= io/basic_file_stdio.h
428 TARGETHDRSNAME_basic_file_stdio.h= basic_file.h
429 TARGETHDRS+= allocator/new_allocator_base.h
430 TARGETHDRSNAME_new_allocator_base.h= c++allocator.h
431 TARGETHDRS+= io/c_io_stdio.h
432 TARGETHDRSNAME_c_io_stdio.h= c++io.h
433 TARGETHDRS+= locale/generic/c_locale.h locale/generic/c++locale_internal.h
434 TARGETHDRSNAME_c_locale.h= c++locale.h
435 TARGETHDRS+= locale/generic/messages_members.h
436 TARGETHDRS+= locale/generic/time_members.h
437 TARGETHDRS+= os/bsd/netbsd/ctype_inline.h
438 TARGETHDRS:= ${TARGETHDRS:S;^;${SRCDIR}/config/;}
439 TARGETHDRS+= ctype_base.h ctype_noninline.h os_defines.h
440 TARGETHDRS+= c++config.h
441 TARGETHDRSDIR= ${INCLUDEDIR}/c++/4.1/bits
443 MARCHHDRS= atomic_word.h cxxabi_tweaks.h cpu_defines.h
445 .for h in ${MARCHHDRS}
446 .if exists(${SRCDIR}/config/cpu/${MARCHDIR}/${h})
447 TARGETHDRS+= ${SRCDIR}/config/cpu/${MARCHDIR}/${h}
449 TARGETHDRS+= ${SRCDIR}/config/cpu/generic/${h}
453 THRHDRS= gthr.h gthr-single.h gthr-posix.h gthr-default.h
454 THRHDRSDIR= ${INCLUDEDIR}/c++/4.1/bits
456 gthr.h: ${GCCDIR}/gcc/gthr.h
457 sed -e '/^#/s/\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_][ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*\)/_GLIBCPP_\1/g' \
458 -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
459 < ${GCCDIR}/gcc/gthr.h > gthr.h
461 gthr-single.h: ${GCCDIR}/gcc/gthr-single.h
462 sed -e 's/\(UNUSED\)/_GLIBCPP_\1/g' \
463 -e 's/\(GCC[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*_H\)/_GLIBCPP_\1/g' \
464 < ${GCCDIR}/gcc/gthr-single.h > gthr-single.h
466 gthr-posix.h: ${GCCDIR}/gcc/gthr-posix.h
467 sed -e 's/\(UNUSED\)/_GLIBCPP_\1/g' \
468 -e 's/\(GCC[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*_H\)/_GLIBCPP_\1/g' \
469 -e 's/\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*WEAK\)/_GLIBCPP_\1/g' \
470 < ${GCCDIR}/gcc/gthr-posix.h > gthr-posix.h
472 gthr-default.h: ${GCCDIR}/gcc/gthr-posix.h
473 sed -e 's/\(UNUSED\)/_GLIBCPP_\1/g' \
474 -e 's/\(GCC[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*_H\)/_GLIBCPP_\1/g' \
475 -e 's/\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*WEAK\)/_GLIBCPP_\1/g' \
476 -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
477 < ${GCCDIR}/gcc/gthr-posix.h > gthr-default.h
479 ctype_base.h: ${SRCDIR}/config/os/bsd/netbsd/ctype_base.h ctype_base.h.patch
480 patch -o ${.TARGET} -i ${.CURDIR}/ctype_base.h.patch ${SRCDIR}/config/os/bsd/netbsd/ctype_base.h
482 ctype_noninline.h: ${SRCDIR}/config/os/bsd/netbsd/ctype_noninline.h ctype_noninline.h.patch
483 patch -o ${.TARGET} -i ${.CURDIR}/ctype_noninline.h.patch ${SRCDIR}/config/os/bsd/netbsd/ctype_noninline.h
485 c++config.h: config.h ${SRCDIR}/include/bits/c++config DATESTAMP
486 cat ${.ALLSRC:M*c++config} > ${.TARGET}
487 sed -e 's/^/#define __GLIBCXX__ /' < ${.ALLSRC:M*DATESTAMP} >> ${.TARGET}
488 sed -e 's/HAVE_/_GLIBCXX_HAVE_/g' \
489 -e 's/PACKAGE/_GLIBCXX_PACKAGE/g' \
490 -e 's/VERSION/_GLIBCXX_VERSION/g' \
491 -e 's/WORDS_/_GLIBCXX_WORDS_/g' \
492 < ${.ALLSRC:M*config.h} >> ${.TARGET}
493 echo "#endif // _CXXCONFIG_" >> ${.TARGET}
495 CLEANFILES+= ${THRHDRS} ctype_noninline.h ctype_base.h c++config.h
497 .include <bsd.lib.mk>