xref: /freebsd/lib/libcxxrt/Makefile (revision 5b56413d04e608379c9a306373554a8e4d321bc0)
1PACKAGE=	clibs
2SHLIBDIR?=	/lib
3
4.include <src.opts.mk>
5
6SRCDIR=		${SRCTOP}/contrib/libcxxrt
7
8SHLIB_MAJOR=	1
9
10.PATH: ${SRCDIR}
11
12LIB=		cxxrt
13
14SRCS+=		auxhelper.cc
15SRCS+=		dynamic_cast.cc
16SRCS+=		exception.cc
17SRCS+=		guard.cc
18SRCS+=		libelftc_dem_gnu3.c
19SRCS+=		memory.cc
20SRCS+=		stdexcept.cc
21SRCS+=		terminate.cc
22SRCS+=		typeinfo.cc
23
24WARNS?=		0
25CFLAGS+=	-isystem ${SRCDIR} -nostdinc++
26CXXSTD?=	c++14
27
28.if exists(Version.map.${MACHINE})
29VERSION_MAP=	${.CURDIR}/Version.map.${MACHINE}
30.else
31.if ${MACHINE_ABI:Mlong32}
32VERSION_MAP=	Version-32.map
33.else
34VERSION_MAP=	Version-64.map
35.endif
36
37Version-32.map: Version.map
38	sed 's/%%NEW_DELETE_TYPE%%/int/' ${.ALLSRC} > ${.TARGET}
39
40Version-64.map: Version.map
41	sed 's/%%NEW_DELETE_TYPE%%/long/' ${.ALLSRC} > ${.TARGET}
42.endif
43
44.include <bsd.lib.mk>
45
46# gcc13 doesn't support _Float16 on riscv, powerpc64, and x86 or __int128
47# on i386.  Disable checks for missing symbols to allow this to link.
48#
49# XXX: This is a hack that hides an ABI divergence between clang and gcc.
50.if ${COMPILER_TYPE} == "gcc" && \
51    (${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || \
52     ${MACHINE_ARCH:Mpowerpc64*} || ${MACHINE_ARCH} == "riscv64")
53LDFLAGS+=	-Wl,--undefined-version
54.endif
55