1bb535300SJeff Roberson# $FreeBSD$ 2bb535300SJeff Roberson# 3bb535300SJeff Roberson# All library objects contain FreeBSD revision strings by default; they may be 4bb535300SJeff Roberson# excluded as a space-saving measure. To produce a library that does 5bb535300SJeff Roberson# not contain these strings, add -DSTRIP_FBSDID (see <sys/cdefs.h>) to CFLAGS 6bb535300SJeff Roberson# below. Note, there are no IDs for syscall stubs whose sources are generated. 7bb535300SJeff Roberson# To included legacy CSRG sccsid strings, add -DLIBC_SCCS and -DSYSLIBC_SCCS 8bb535300SJeff Roberson# (for system call stubs) to CFLAGS below. -DSYSLIBC_SCCS affects just the 9bb535300SJeff Roberson# system call stubs. 105740a2b6SRuslan Ermilov 11c389411cSGlen BarberPACKAGE= clibs 12241715e7SRuslan ErmilovSHLIBDIR?= /lib 13241715e7SRuslan Ermilov 14c6063d0dSWarner Losh.include <src.opts.mk> 15d9ca85fcSRuslan ErmilovMK_SSP= no 1600fb440cSDaniel Eischen 17bb535300SJeff RobersonLIB=thr 18419ecd5dSDaniel EischenSHLIB_MAJOR= 3 196eccf6e3SEric van GyzenNO_WTHREAD_SAFETY=1 20a091d823SDavid XuCFLAGS+=-DPTHREAD_KERNEL 2158368ba9SEnji CooperCFLAGS+=-I${SRCTOP}/lib/libc/include -I${.CURDIR}/thread \ 2258368ba9SEnji Cooper -I${SRCTOP}/include 23f4fbf9c8SNathan WhitehornCFLAGS+=-I${.CURDIR}/arch/${MACHINE_CPUARCH}/include 24a091d823SDavid XuCFLAGS+=-I${.CURDIR}/sys 2558368ba9SEnji CooperCFLAGS+=-I${SRCTOP}/libexec/rtld-elf 2658368ba9SEnji CooperCFLAGS+=-I${SRCTOP}/libexec/rtld-elf/${MACHINE_CPUARCH} 2758368ba9SEnji CooperCFLAGS+=-I${SRCTOP}/lib/libthread_db 28a091d823SDavid XuCFLAGS+=-Winline 293832fd24SDavid Xu 30*0b2f3f20SEric van GyzenCFLAGS.thr_stack.c+= -Wno-cast-align 31*0b2f3f20SEric van Gyzen.include <bsd.compiler.mk> 32*0b2f3f20SEric van Gyzen.if !(${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} < 40300) 33*0b2f3f20SEric van GyzenCFLAGS.thr_symbols.c+= -Wno-missing-variable-declarations 34*0b2f3f20SEric van Gyzen.endif 35*0b2f3f20SEric van Gyzen 36f4213b90SDavid Xu.ifndef NO_THREAD_UNWIND_STACK 370935fc89SDavid XuCFLAGS+=-fexceptions 383832fd24SDavid XuCFLAGS+=-D_PTHREAD_FORCED_UNWIND 393832fd24SDavid Xu.endif 403832fd24SDavid Xu 416d772c3bSKonstantin BelousovLDFLAGS+=-Wl,-znodelete 42a091d823SDavid Xu 4358368ba9SEnji CooperVERSION_DEF=${SRCTOP}/lib/libc/Versions.def 44a9b9744fSDag-Erling SmørgravSYMBOL_MAPS=${.CURDIR}/pthread.map 45bb535300SJeff Roberson 465335c6bcSRobert WatsonMAN= libthr.3 475335c6bcSRobert Watson 48e13c6045SKonstantin Belousov# enable extra internal consistency checks 4944a31c2dSDavid XuCFLAGS+=-D_PTHREADS_INVARIANTS 50bb535300SJeff Roberson 51a35d8893SRuslan ErmilovPRECIOUSLIB= 52bb535300SJeff Roberson 5310f3ae58SWarner Losh.PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH}/${MACHINE_CPUARCH} 5410f3ae58SWarner Losh 5520fe2c94SAndrew Turner.if exists(${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc) 56f4fbf9c8SNathan Whitehorn.include "${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc" 5720fe2c94SAndrew Turner.endif 58a091d823SDavid Xu.include "${.CURDIR}/sys/Makefile.inc" 59a091d823SDavid Xu.include "${.CURDIR}/thread/Makefile.inc" 60bb535300SJeff Roberson 61455cc6ecSJung-uk Kim.if ${MK_INSTALLLIB} != "no" 6255ac4c35SDavid XuSYMLINKS+=lib${LIB}.a ${LIBDIR}/libpthread.a 63455cc6ecSJung-uk Kim.endif 6455ac4c35SDavid Xu.if !defined(NO_PIC) 6584e709f1SRuslan ErmilovSYMLINKS+=lib${LIB}.so ${LIBDIR}/libpthread.so 6655ac4c35SDavid Xu.endif 675740a2b6SRuslan Ermilov.if ${MK_PROFILE} != "no" 6855ac4c35SDavid XuSYMLINKS+=lib${LIB}_p.a ${LIBDIR}/libpthread_p.a 6955ac4c35SDavid Xu.endif 7055ac4c35SDavid Xu 711119ece4SEnji Cooper.if ${MK_TESTS} != "no" 721119ece4SEnji CooperSUBDIR+= tests 731119ece4SEnji Cooper.endif 743eee258dSEnji Cooper 75bb535300SJeff Roberson.include <bsd.lib.mk> 76