From 5f87b7d398bad162d1fc8df3866e9e0ea2ea201d Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Sun, 23 Dec 2007 02:46:40 +0000 Subject: [PATCH] - Add THREAD_LIB to make.conf - Export LIBTHREAD in bsd.libnames.mk based on THREAD_LIB - Bail out earlier, if NO_LIBC_R is defined and THREAD_LIB is "r_c" - Set DPADD to LIBTHREAD in lib/libpthread/Makefile # Default thread library is still lib/libthread_xu --- Makefile.inc1 | 11 +++++++++-- etc/defaults/make.conf | 5 ++++- lib/libpthread/Makefile | 12 +++++------- share/mk/bsd.libnames.mk | 5 ++++- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index fe8f1bfae4..03f5efe8f5 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1,6 +1,6 @@ # # $FreeBSD: src/Makefile.inc1,v 1.141.2.62 2003/04/06 19:54:00 dwmalone Exp $ -# $DragonFly: src/Makefile.inc1,v 1.110 2007/12/15 07:13:18 sephe Exp $ +# $DragonFly: src/Makefile.inc1,v 1.111 2007/12/23 02:46:40 sephe Exp $ # # Build-time options are documented in make.conf(5). # @@ -162,6 +162,13 @@ TARGET_PLATFORM= pc64 .endif .endif +THREAD_LIB?= thread_xu +.if ${THREAD_LIB} == "c_r" +.if defined(NO_LIBC_R) +.error libc_r is chosen as the default thread library, but NO_LIBC_R is defined +.endif +.endif + # BTOOLS (Natively built) All non-cross-development tools that the # main build needs. This includes things like 'mkdir' and 'rm'. # We will not use the native system's exec path once we start @@ -927,7 +934,7 @@ _generic_libs+= kerberos5/lib _prebuild_libs+= lib/libcom_err lib/libcrypt lib/libmd \ lib/libncurses/libncurses lib/libopie lib/libradius \ lib/libsbuf lib/libskey lib/libtacplus lib/libz lib/libm \ - lib/libpam lib/libc_r lib/libthread_xu + lib/libpam lib/lib${THREAD_LIB} lib/libopie__L lib/libradius__L lib/libtacplus__L: lib/libmd__L lib/libskey__L: lib/libcrypt__L lib/libmd__L diff --git a/etc/defaults/make.conf b/etc/defaults/make.conf index 186e23a99f..d9ab9e4e31 100644 --- a/etc/defaults/make.conf +++ b/etc/defaults/make.conf @@ -1,5 +1,5 @@ # $FreeBSD: src/etc/defaults/make.conf,v 1.97.2.80 2003/02/15 16:34:56 trhodes Exp $ -# $DragonFly: src/etc/defaults/make.conf,v 1.32 2007/09/07 02:43:49 pavalos Exp $ +# $DragonFly: src/etc/defaults/make.conf,v 1.33 2007/12/23 02:46:40 sephe Exp $ # # NOTE: Please would any committer updating this file also update the # make.conf(5) manual page, if necessary, which is located in @@ -92,6 +92,9 @@ BDECFLAGS= -W -Wall -ansi -pedantic -Wbad-function-cast -Wcast-align \ # To enable installing ssh(1) with the setuid bit turned on #ENABLE_SUID_SSH= true # +# Default thread library (c_r or thread_xu) +THREAD_LIB?= thread_xu +# # To avoid building various parts of the base system: #NO_BIND= true # do not build BIND #NO_CRYPT= true # do not build crypto code diff --git a/lib/libpthread/Makefile b/lib/libpthread/Makefile index 153621d5a9..f319cd8f6c 100644 --- a/lib/libpthread/Makefile +++ b/lib/libpthread/Makefile @@ -1,13 +1,11 @@ -# $DragonFly: src/lib/libpthread/Makefile,v 1.4 2007/12/15 07:13:18 sephe Exp $ +# $DragonFly: src/lib/libpthread/Makefile,v 1.5 2007/12/23 02:46:40 sephe Exp $ LIBNAME= libpthread SHLIB_MAJOR= 0 SHLIB_NAME= ${LIBNAME}.so SONAME= ${SHLIB_NAME}.${SHLIB_MAJOR} -DEFAULT_PTHREAD_LIB?= thread_xu -# XXX -#DPADD= ${DESTDIR}${LIBDIR}/lib${DEFAULT_PTHREAD_LIB}.a -LDADD= -l${DEFAULT_PTHREAD_LIB} # or any lib defining the pthread interface +DPADD= ${LIBTHREAD} +LDADD= -l${THREAD_LIB} # or any lib defining the pthread interface SRCS= dummy.c @@ -15,11 +13,11 @@ realinstall: linkinstall linkinstall: # Do not overwrite existing symlinks if [ ! -e ${DESTDIR}${TARGET_SHLIBDIR}/${SONAME} ]; then \ - ${LN} -fs lib${DEFAULT_PTHREAD_LIB}.so \ + ${LN} -fs lib${THREAD_LIB}.so \ ${DESTDIR}${TARGET_SHLIBDIR}/${SONAME}; \ fi if [ ! -e ${DESTDIR}${TARGET_LIBDIR}/${LIBNAME}.a ]; then \ - ${LN} -fs lib${DEFAULT_PTHREAD_LIB}.a \ + ${LN} -fs lib${THREAD_LIB}.a \ ${DESTDIR}${TARGET_LIBDIR}/${LIBNAME}.a; \ fi diff --git a/share/mk/bsd.libnames.mk b/share/mk/bsd.libnames.mk index 60156e546b..11319b05db 100644 --- a/share/mk/bsd.libnames.mk +++ b/share/mk/bsd.libnames.mk @@ -1,5 +1,5 @@ # $FreeBSD: src/share/mk/bsd.libnames.mk,v 1.28.2.10 2002/08/08 09:33:28 ru Exp $ -# $DragonFly: src/share/mk/bsd.libnames.mk,v 1.11 2007/11/18 17:53:01 pavalos Exp $ +# $DragonFly: src/share/mk/bsd.libnames.mk,v 1.12 2007/12/23 02:46:40 sephe Exp $ # # The include file define library names. # Other include files (e.g. bsd.prog.mk, bsd.lib.mk) include this @@ -111,3 +111,6 @@ LIBWRAP?= ${DESTDIR}${LIBDIR}/libwrap.a LIBXPG4?= ${DESTDIR}${LIBDIR}/libxpg4.a LIBY?= ${DESTDIR}${LIBDIR}/liby.a LIBZ?= ${DESTDIR}${LIBDIR}/libz.a + +THREAD_LIB?= thread_xu +LIBTHREAD?= ${DESTDIR}${LIBDIR}/lib${THREAD_LIB}.a -- 2.41.0