Hi!

The diff below makes devel/llvm correctly link with '-pthread',
instead of '-lpthread'.

More generally, it should fix all the ports that uses
"CHECK_LIBRARY_EXISTS(pthread pthread_mutex_blahblah blahblahblah...)"
once and for all.

Thoughts?

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/cmake/Makefile,v
retrieving revision 1.55
diff -u -p -r1.55 Makefile
--- Makefile    15 May 2012 08:36:28 -0000      1.55
+++ Makefile    12 Jun 2012 07:21:23 -0000
@@ -7,7 +7,7 @@ HOMEPAGE =      http://www.cmake.org/
 CATEGORIES =   devel
 COMMENT =      portable build system
 DISTNAME =     cmake-2.8.8
-REVISION =     2
+REVISION =     3
 MASTER_SITES = ${HOMEPAGE}files/v2.8/
 
 MAINTAINER =   David Coppa <[email protected]>
Index: patches/patch-Source_cmComputeLinkInformation_cxx
===================================================================
RCS file: patches/patch-Source_cmComputeLinkInformation_cxx
diff -N patches/patch-Source_cmComputeLinkInformation_cxx
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-Source_cmComputeLinkInformation_cxx   12 Jun 2012 07:21:23 
-0000
@@ -0,0 +1,27 @@
+$OpenBSD$
+
+Fix libpthread linking on OpenBSD: use '-pthread' instead of
+'-lpthread'.
+
+--- Source/cmComputeLinkInformation.cxx.orig   Wed Apr 18 20:10:54 2012
++++ Source/cmComputeLinkInformation.cxx        Mon Jun 11 14:28:03 2012
+@@ -1304,7 +1304,19 @@ void cmComputeLinkInformation::AddUserItem(std::string
+     }
+ 
+   // Create an option to ask the linker to search for the library.
++#if defined(__OpenBSD__)
++  std::string out;
++  if(strncmp(lib.c_str(), "pthread", 7) == 0)
++    {
++    out += "-";
++    }
++  else
++    {
++    out += this->LibLinkFlag;
++    }
++#else
+   std::string out = this->LibLinkFlag;
++#endif
+   out += lib;
+   out += this->LibLinkSuffix;
+   this->Items.push_back(Item(out, false));

Reply via email to