1RELUP=	/..
2.include "../../Makefile.inc"
3SRCDIR=	${GCCDIR}/libstdc++-v3
4.include "Makefile.headers"
5
6.PATH:	${SRCDIR}
7
8# These sections are detailed in Makefile.headers
9# parallel section is empty, skip it
10# make buildincludes, make installincludes before make depend
11glibcxx_srcdir=	${SRCDIR}
12HSECT=	std bits bits_sup backward ext ext_compat tr1 tr2 decimal \
13	c_base c_compatibility debug profile profile_impl host supc \
14	parallel experimental ext_host
15PBSECT=	1 2 3 4 5 6 7
16HD=	${INCLUDEDIR}/c++/${GCCPOINTVER}
17
18.for i in ${HSECT}
19INCSGROUPS+=		${i}_headers
20${i}_headersDIR=	${HD}/${${i}_builddir}
21.endfor
22
23PATHGROUP=
24.for i in ${PBSECT}
25.  for k in ${pb_headers${i}}
26.    if ${PATHGROUP:M${k:H:T}} == ""
27PATHGROUP+=${k:H:T}
28PATH_${k:H:T}=${k:H:T}
29.    endif
30PBG_${k:H:T}+=${k}
31.  endfor
32.endfor
33
34INCSGROUPS+=		PBG_pb_ds
35PBG_pb_dsDIR=		${HD}/${pb_builddir}
36
37INCSGROUPS+=		PBG_detail
38PBG_detailDIR=		${HD}/${pb_builddir}/detail
39
40.for k in ${PATHGROUP:Npb_ds:Ndetail}
41INCSGROUPS+=		PBG_${k}
42PBG_${k}DIR=		${HD}/${pb_builddir}/detail/${PATH_${k}}
43.endfor
44
45INCSGROUPS+=		experimental_bits_headers
46experimental_bits_headersDIR=	${HD}/experimental/bits
47
48INCSGROUPS+=		host_headers_extra
49host_headers_extraDIR=	${HD}/bits
50host_headers_extraNAME_basic_file_stdio.h=	basic_file.h
51host_headers_extraNAME_c_locale.h=		c++locale.h
52host_headers_extraNAME_c_io_stdio.h+=		c++io.h
53host_headers_extraNAME_new_allocator_base.h=	c++allocator.h
54
55cxxabi_forced.h: ${SRCDIR}/libsupc++/cxxabi_forced.h
56	cp ${.ALLSRC} ${.TARGET}
57
58gthr.h: ${GCCDIR}/libgcc/gthr.h
59	sed -e '/^#pragma/b' \
60	    -e '/^#/s/\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_][ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*\)/_GLIBCXX_\1/g' \
61	    -e 's/_GLIBCXX_SUPPORTS_WEAK/__GXX_WEAK__/g' \
62	    -e 's/_GLIBCXX___MINGW32_GLIBCXX___/__MINGW32__/g' \
63	    -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
64	    < ${GCCDIR}/libgcc/gthr.h > ${.TARGET}
65
66gthr-single.h: ${GCCDIR}/libgcc/gthr.h
67	sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
68	    -e 's/\(GCC[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*_H\)/_GLIBCXX_\1/g' \
69	    < ${GCCDIR}/libgcc/gthr-single.h > ${.TARGET}
70
71gthr-posix.h: ${GCCDIR}/libgcc/gthr-posix.h
72	sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
73	    -e 's/\(GCC[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*_H\)/_GLIBCXX_\1/g' \
74	    -e 's/SUPPORTS_WEAK/__GXX_WEAK__/g' \
75	    -e 's/\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*USE_WEAK\)/_GLIBCXX_\1/g' \
76	    < ${GCCDIR}/libgcc/gthr-posix.h > ${.TARGET}
77
78gthr-default.h: gthr-posix.h
79	cp ${.ALLSRC} ${.TARGET}
80
81release=${GCCMAJORVER}
82ns_version=0
83visibility=1
84externtemplate=1
85dualabi=1
86cxx11abi=1
87allocatornew=1
88float128=define _GLIBCXX_USE_FLOAT128 1
89#float128=undef _GLIBCXX_USE_FLOAT128
90ldbl_compat='s,g,g,'
91S1='s,define __GLIBCXX__,define __GLIBCXX__ ${GCCSHORTDATE},'
92S2='s,define _GLIBCXX_RELEASE,define _GLIBCXX_RELEASE ${release},'
93S3='s,define _GLIBCXX_INLINE_VERSION, define _GLIBCXX_INLINE_VERSION ${ns_version},'
94S4='s,define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY, define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY ${visibility},'
95S5='s,define _GLIBCXX_EXTERN_TEMPLATE$$, define _GLIBCXX_EXTERN_TEMPLATE ${externtemplate},'
96S6='s,define _GLIBCXX_USE_DUAL_ABI, define _GLIBCXX_USE_DUAL_ABI ${dualabi},'
97S7='s,define _GLIBCXX_USE_CXX11_ABI, define _GLIBCXX_USE_CXX11_ABI ${cxx11abi},'
98S8='s,define _GLIBCXX_USE_ALLOCATOR_NEW, define _GLIBCXX_USE_ALLOCATOR_NEW ${allocatornew},'
99S9='s,define _GLIBCXX_USE_FLOAT128, ${float128},'
100S10='${ldbl_compat}'
101
102c++config.h: config.h
103	sed -e ${S1} -e ${S2} -e ${S3} -e ${S4} -e ${S5} -e ${S6} -e ${S7} -e ${S8} -e ${S9} -e ${S10} \
104	    < ${GCCDIR}/libstdc++-v3/include/bits/c++config > ${.TARGET}
105	sed -e 's/HAVE_/_GLIBCXX_HAVE_/g' \
106	    -e 's/PACKAGE/_GLIBCXX_PACKAGE/g' \
107	    -e 's/VERSION/_GLIBCXX_VERSION/g' \
108	    -e 's/WORDS_/_GLIBCXX_WORDS_/g' \
109	    -e 's/ICONV_CONST/_GLIBCXX_ICONV_CONST/g' \
110	    -e '/[	 ]_GLIBCXX_LONG_DOUBLE_COMPAT[	 ]/d' \
111	    < ${.ALLSRC} >> ${.TARGET}
112	echo "" >> ${.TARGET}
113	echo "#endif // _GLIBCXX_CXX_CONFIG_H" >> ${.TARGET}
114
115CLEANFILES=	gthr.h gthr-default.h gthr-single.h gthr-posix.h \
116		c++config.h cxxabi_forced.h
117
118.include <bsd.lib.mk>
119