Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/pkgsrc/mk/pthread.buildlink3.mk,v rcsdiff: /ftp/cvs/cvsroot/pkgsrc/mk/pthread.buildlink3.mk,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.2 retrieving revision 1.10 diff -u -p -r1.2 -r1.10 --- pkgsrc/mk/pthread.buildlink3.mk 2004/01/25 16:17:37 1.2 +++ pkgsrc/mk/pthread.buildlink3.mk 2004/07/27 11:28:41 1.10 @@ -1,4 +1,4 @@ -# $NetBSD: pthread.buildlink3.mk,v 1.2 2004/01/25 16:17:37 jlam Exp $ +# $NetBSD: pthread.buildlink3.mk,v 1.10 2004/07/27 11:28:41 xtraeme Exp $ # # The pthreads strategy for pkgsrc is to "bless" a particular pthread # package as the Official Pthread Replacement (OPR). A package that uses @@ -101,6 +101,8 @@ # Makefile for ${_PKG_PTHREAD}. It's used to see if ${_PKG_PTHREADS} # can actually be used to replace a native pthreads. # +PTHREAD_BUILDLINK3_MK:= ${PTHREAD_BUILDLINK3_MK}+ + _PKG_PTHREAD?= pth _PKG_PTHREAD_DEPENDS?= pth>=2.0.0 _PKG_PTHREAD_PKGSRCDIR?= ../../devel/${_PKG_PTHREAD} @@ -138,16 +140,20 @@ PKG_SKIP_REASON= "${PKGNAME} requires a . endif .endif -.if !defined(PTHREAD_BUILDLINK3_MK) -PTHREAD_BUILDLINK3_MK= # defined - .if ${PTHREAD_TYPE} == "native" # # 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. @@ -156,6 +162,17 @@ BUILDLINK_LDFLAGS.pthread= # empty BUILDLINK_LDADD.pthread= -lpthread . elif exists(/usr/lib/libc_r.so) BUILDLINK_LDADD.pthread= -lc_r +# In OpenBSD there is no libpthread.so, just libpthread.so.X.X. +. elif ${OPSYS} == "OpenBSD" +_CHECK_LIBPTH!= \ + if [ -f /usr/lib/libpthread.so.* ]; then \ + ${ECHO} "yes"; \ + else \ + ${ECHO} "no"; \ + fi +. if ${_CHECK_LIBPTH} == "yes" +BUILDLINK_LDADD.pthread= -lpthread +. endif . else BUILDLINK_LDADD.pthread= # empty . endif @@ -175,6 +192,8 @@ PKG_SKIP_REASON= "${PKGNAME} needs pthre . endif .endif +.if !empty(PTHREAD_BUILDLINK3_MK:M+) +# # Define user-visible PTHREAD_CFLAGS and PTHREAD_LDFLAGS as compiler # options used to compile/link pthreaded code. # @@ -184,5 +203,4 @@ PTHREAD_LDFLAGS= ${BUILDLINK_LDFLAGS.pth PTHREADBASE= ${BUILDLINK_PREFIX.pthread} CONFIGURE_ENV+= PTHREADBASE=${PTHREADBASE} MAKE_ENV+= PTHREADBASE=${PTHREADBASE} - .endif # PTHREAD_BUILDLINK3_MK