xref: /freebsd/lib/libthr/Makefile (revision 73577bf01de5c4677dc54d97f93310286c254780)
1# $FreeBSD$
2#
3# All library objects contain FreeBSD revision strings by default; they may be
4# excluded as a space-saving measure.  To produce a library that does
5# not contain these strings, add -DSTRIP_FBSDID (see <sys/cdefs.h>) to CFLAGS
6# below.
7
8PACKAGE=	clibs
9SHLIBDIR?= /lib
10
11.include <src.opts.mk>
12MK_SSP=	no
13
14LIB=thr
15SHLIB_MAJOR= 3
16NO_WTHREAD_SAFETY=1
17NO_WCAST_ALIGN.gcc=1    # for gcc 4.2
18CFLAGS+=-DPTHREAD_KERNEL
19CFLAGS+=-I${SRCTOP}/lib/libc/include
20CFLAGS+=-I${SRCTOP}/lib/libc/${MACHINE_CPUARCH}
21CFLAGS+=-I${.CURDIR}/thread
22CFLAGS+=-I${SRCTOP}/include
23CFLAGS+=-I${.CURDIR}/arch/${MACHINE_CPUARCH}/include
24CFLAGS+=-I${.CURDIR}/sys
25CFLAGS+=-I${SRCTOP}/libexec/rtld-elf
26CFLAGS+=-I${SRCTOP}/libexec/rtld-elf/${MACHINE_CPUARCH}
27CFLAGS+=-I${SRCTOP}/lib/libthread_db
28CFLAGS+=-Winline
29
30CFLAGS.thr_stack.c+=	-Wno-cast-align
31CFLAGS.rtld_malloc.c+=	-Wno-cast-align
32CFLAGS.thr_symbols.c+=	-Wno-missing-variable-declarations
33
34.ifndef NO_THREAD_UNWIND_STACK
35CFLAGS+=-fexceptions
36CFLAGS+=-D_PTHREAD_FORCED_UNWIND
37.endif
38
39LDFLAGS+=-Wl,-znodelete
40
41VERSION_DEF=${SRCTOP}/lib/libc/Versions.def
42SYMBOL_MAPS=${.CURDIR}/pthread.map
43
44MAN=	libthr.3
45
46# enable extra internal consistency checks
47CFLAGS+=-D_PTHREADS_INVARIANTS
48
49PRECIOUSLIB=
50
51.PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}
52.PATH: ${SRCTOP}/libexec/rtld-elf
53
54.if exists(${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc)
55.include "${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc"
56.endif
57.include "${.CURDIR}/sys/Makefile.inc"
58.include "${.CURDIR}/thread/Makefile.inc"
59SRCS+= rtld_malloc.c
60
61.if ${MK_INSTALLLIB} != "no"
62SYMLINKS+=lib${LIB}.a ${LIBDIR}/libpthread.a
63.endif
64.if !defined(NO_PIC)
65SYMLINKS+=lib${LIB}.so ${LIBDIR}/libpthread.so
66.endif
67.if ${MK_PROFILE} != "no"
68SYMLINKS+=lib${LIB}_p.a ${LIBDIR}/libpthread_p.a
69.endif
70
71HAS_TESTS=
72SUBDIR.${MK_TESTS}+= tests
73
74.include <bsd.lib.mk>
75