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