openbsd-ports/devel/cmake/patches/patch-Source_cmComputeLinkInformation_cxx
dcoppa cf153cacfa Fix libpthread linking (use '-pthread' instead of '-lpthread') for
cmake-based ports that use "CHECK_LIBRARY_EXISTS(pthread ...)".

Fix libpthread linking for devel/llvm too (additional care was
needed).

No fallout in a bulk build: thanks landry!
2012-06-14 09:32:00 +00:00

28 lines
775 B
Plaintext

$OpenBSD: patch-Source_cmComputeLinkInformation_cxx,v 1.3 2012/06/14 09:32:00 dcoppa Exp $
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(strcmp(lib.c_str(), "pthread") == 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));