summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorgrant <grant@pkgsrc.org>2004-06-12 03:19:52 +0000
committergrant <grant@pkgsrc.org>2004-06-12 03:19:52 +0000
commitc4e3c8cd15f6b5bfa8da0d39262adfa1fc19a37a (patch)
tree497e04b5f1b837b3a85cbe0c16108e375d4becfb /mk
parent0880f4dc0231f98ea7ffa9ed606d1de698e6539a (diff)
downloadpkgsrc-c4e3c8cd15f6b5bfa8da0d39262adfa1fc19a37a.tar.gz
when using native threads, only set BUILDLINK_CFLAGS.pthread=-pthread on
systems known to support its (FreeBSD, NetBSD, Linux). fixes breakage caused by passing -pthread to SunPro cc(1) and likely also fixes platforms other than the above.
Diffstat (limited to 'mk')
-rw-r--r--mk/pthread.buildlink2.mk8
-rw-r--r--mk/pthread.buildlink3.mk12
2 files changed, 17 insertions, 3 deletions
diff --git a/mk/pthread.buildlink2.mk b/mk/pthread.buildlink2.mk
index aa91dc6480f..31487e9524f 100644
--- a/mk/pthread.buildlink2.mk
+++ b/mk/pthread.buildlink2.mk
@@ -1,4 +1,4 @@
-# $NetBSD: pthread.buildlink2.mk,v 1.16 2003/09/14 16:30:34 danw Exp $
+# $NetBSD: pthread.buildlink2.mk,v 1.17 2004/06/12 03:19:52 grant Exp $
#
# The pthreads strategy for pkgsrc is to "bless" a particular pthread
# package as the Official Pthread Replacement (OPR). A package that uses
@@ -154,7 +154,13 @@ BUILDLINK_FILES.pthread+= lib/libpthread.*
BUILDLINK_TARGETS+= pthread-buildlink
BUILDLINK_TARGETS+= pthread-buildlink-la
+# only pass -pthread on platforms known to support it.
+. if ${OPSYS} == "FreeBSD" || ${OPSYS} == "Linux" || \
+ ${OPSYS} == "NetBSD"
BUILDLINK_CFLAGS.pthread= -pthread
+. else
+BUILDLINK_CFLAGS.pthread= # empty
+. 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.
diff --git a/mk/pthread.buildlink3.mk b/mk/pthread.buildlink3.mk
index beb1d53a4ec..ba2b2fd0ca4 100644
--- a/mk/pthread.buildlink3.mk
+++ b/mk/pthread.buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: pthread.buildlink3.mk,v 1.5 2004/03/31 20:18:46 seb Exp $
+# $NetBSD: pthread.buildlink3.mk,v 1.6 2004/06/12 03:19:52 grant Exp $
#
# The pthreads strategy for pkgsrc is to "bless" a particular pthread
# package as the Official Pthread Replacement (OPR). A package that uses
@@ -145,8 +145,16 @@ PKG_SKIP_REASON= "${PKGNAME} requires a working pthreads implementation."
# Link the native pthread libraries and headers into ${BUILDLINK_DIR}.
#
BUILDLINK_PREFIX.pthread= /usr
-BUILDLINK_CFLAGS.pthread= -pthread
BUILDLINK_LDFLAGS.pthread= # empty
+
+# only pass -pthread on platforms known to support it.
+. if ${OPSYS} == "FreeBSD" || ${OPSYS} == "Linux" || \
+ ${OPSYS} == "NetBSD"
+BUILDLINK_CFLAGS.pthread= -pthread
+. else
+BUILDLINK_CFLAGS.pthread= # empty
+. 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.