xref: /freebsd/lib/libthr/Makefile (revision c93b6e5fa24ba172ab271432c6692f9cc604e15a)
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
32.include <bsd.compiler.mk>
33.if !(${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} < 40300)
34CFLAGS.thr_symbols.c+=	-Wno-missing-variable-declarations
35.endif
36
37.ifndef NO_THREAD_UNWIND_STACK
38CFLAGS+=-fexceptions
39CFLAGS+=-D_PTHREAD_FORCED_UNWIND
40.endif
41
42LDFLAGS+=-Wl,-znodelete
43
44VERSION_DEF=${SRCTOP}/lib/libc/Versions.def
45SYMBOL_MAPS=${.CURDIR}/pthread.map
46
47MAN=	libthr.3
48
49# enable extra internal consistency checks
50CFLAGS+=-D_PTHREADS_INVARIANTS
51
52PRECIOUSLIB=
53
54.PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}
55.PATH: ${SRCTOP}/libexec/rtld-elf
56
57.if exists(${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc)
58.include "${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc"
59.endif
60.include "${.CURDIR}/sys/Makefile.inc"
61.include "${.CURDIR}/thread/Makefile.inc"
62SRCS+= rtld_malloc.c
63
64.if ${MK_INSTALLLIB} != "no"
65SYMLINKS+=lib${LIB}.a ${LIBDIR}/libpthread.a
66.endif
67.if !defined(NO_PIC)
68SYMLINKS+=lib${LIB}.so ${LIBDIR}/libpthread.so
69.endif
70.if ${MK_PROFILE} != "no"
71SYMLINKS+=lib${LIB}_p.a ${LIBDIR}/libpthread_p.a
72.endif
73
74HAS_TESTS=
75SUBDIR.${MK_TESTS}+= tests
76
77.include <bsd.lib.mk>
78