summaryrefslogtreecommitdiff
path: root/mk/pthread.builtin.mk
diff options
context:
space:
mode:
authorjlam <jlam>2004-11-26 08:12:59 +0000
committerjlam <jlam>2004-11-26 08:12:59 +0000
commitde601093a46de92a49bad3bdb8e284ae55f4a8ea (patch)
tree7acb70816441ade39a4cb5364926d8163d464901 /mk/pthread.builtin.mk
parent670ad77d92d70d9f271b3b5f518ae4645ce9a984 (diff)
downloadpkgsrc-de601093a46de92a49bad3bdb8e284ae55f4a8ea.tar.gz
More tightly integrate the OSF1 changes into pthread.builtin.mk by using
more feature tests instead of OPSYS tests.
Diffstat (limited to 'mk/pthread.builtin.mk')
-rw-r--r--mk/pthread.builtin.mk41
1 files changed, 17 insertions, 24 deletions
diff --git a/mk/pthread.builtin.mk b/mk/pthread.builtin.mk
index 4fd1a930611..fed1754c551 100644
--- a/mk/pthread.builtin.mk
+++ b/mk/pthread.builtin.mk
@@ -1,25 +1,19 @@
-# $NetBSD: pthread.builtin.mk,v 1.2 2004/11/20 05:19:12 grant Exp $
+# $NetBSD: pthread.builtin.mk,v 1.3 2004/11/26 08:12:59 jlam Exp $
-.if !defined(_BLNK_LIBPTHREAD_FOUND)
-_BLNK_LIBPTHREAD_FOUND!= \
- if ${TEST} "`${ECHO} /usr/lib/libpthread.*`" = "/usr/lib/libpthread.*"; then \
+.for _lib_ in pthread c_r rt
+. if !defined(_BLNK_LIB_FOUND.${_lib_})
+_BLNK_LIB_FOUND.${_lib_}!= \
+ if ${TEST} "`${ECHO} /usr/lib/lib${_lib_}.*`" = "/usr/lib/lib${_lib_}.*"; then \
${ECHO} "no"; \
- elif ${TEST} "`${ECHO} /lib/libpthread.*`" = "/lib/libpthread.*"; then \
+ elif ${TEST} "`${ECHO} /lib/lib${_lib_}.*`" = "/lib/lib${_lib_}.*"; then \
${ECHO} "no"; \
else \
${ECHO} "yes"; \
fi
-BUILDLINK_VARS+= _BLNK_LIBPTHREAD_FOUND
-.endif
-.if !defined(_BLNK_LIBC_R_FOUND)
-_BLNK_LIBC_R_FOUND!= \
- if ${TEST} "`${ECHO} /usr/lib/libc_r.*`" = "/usr/lib/libc_r.*"; then \
- ${ECHO} "no"; \
- else \
- ${ECHO} "yes"; \
- fi
-BUILDLINK_VARS+= _BLNK_LIBC_R_FOUND
-.endif
+BUILDLINK_VARS+= _BLNK_LIB_FOUND.${_lib_}
+. endif
+.endfor
+.undef _lib_
.if !defined(IS_BUILTIN.pthread)
IS_BUILTIN.pthread= no
@@ -53,24 +47,23 @@ BUILDLINK_LDFLAGS.pthread= # empty
. if ${OPSYS} == "FreeBSD" || ${OPSYS} == "Linux" || ${OPSYS} == "NetBSD"
BUILDLINK_CFLAGS.pthread+= -pthread
BUILDLINK_LDFLAGS.pthread+= -pthread
+. elif ${OPSYS} == "OSF1"
+BUILDLINK_CFLAGS.pthread+= -pthread
. else
BUILDLINK_CPPFLAGS.pthread+= -D_REENTRANT
. endif
-. if ${OPSYS} == "OSF1"
-BUILDLINK_CFLAGS.pthread+= -pthread
-BUILDLINK_LDFLAGS.pthread+= -lpthread -lrt
-BUILDLINK_CPPFLAGS.pthread+= -pthread
-. endif
-
# Handle systems which have pthreads functions in libc_r such as
# FreeBSD 5.x, or fall back to libc if we don't find libc_r.
#
. if ${OPSYS} == "NetBSD"
BUILDLINK_LIBS.pthread= # empty
-. elif !empty(_BLNK_LIBPTHREAD_FOUND:M[yY][eE][sS])
+. elif !empty(_BLNK_LIB_FOUND.pthread:M[yY][eE][sS])
BUILDLINK_LIBS.pthread= -lpthread
-. elif !empty(_BLNK_LIBC_R_FOUND:M[yY][eE][sS])
+. if !empty(_BLNK_LIB_FOUND.rt:M[yY][eE][sS])
+BUILDLINK_LIBS.pthread+= -lrt
+. endif
+. elif !empty(_BLNK_LIB_FOUND.c_r:M[yY][eE][sS])
BUILDLINK_LIBS.pthread= -lc_r
. else
BUILDLINK_LIBS.pthread= # empty