summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/tools/llvm-config/llvm-config.cpp
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2019-03-05 02:18:15 +0000
committerjsg <jsg@openbsd.org>2019-03-05 02:18:15 +0000
commit8af83372ab26e74508ba8e3996fe5d948402e6a2 (patch)
tree2bd90cbdf90a2d7a78af0b833b9adf2570f53772 /gnu/llvm/tools/llvm-config/llvm-config.cpp
parentadd Makefile for llvm-config (diff)
downloadwireguard-openbsd-8af83372ab26e74508ba8e3996fe5d948402e6a2.tar.xz
wireguard-openbsd-8af83372ab26e74508ba8e3996fe5d948402e6a2.zip
libLLVM in base will be installed as libLLVM.so.major.minor with no
symlink for libLLVM-7.so or libLLVM.so. Adjust llvm-config to cope and force llvm-config DyLibExists to true. This is specific to LLVM in base this patch should not be used in ports.
Diffstat (limited to 'gnu/llvm/tools/llvm-config/llvm-config.cpp')
-rw-r--r--gnu/llvm/tools/llvm-config/llvm-config.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/gnu/llvm/tools/llvm-config/llvm-config.cpp b/gnu/llvm/tools/llvm-config/llvm-config.cpp
index 892adc3b9dd..d3dbd069ae2 100644
--- a/gnu/llvm/tools/llvm-config/llvm-config.cpp
+++ b/gnu/llvm/tools/llvm-config/llvm-config.cpp
@@ -377,6 +377,12 @@ int main(int argc, char **argv) {
StaticExt = "a";
StaticDir = SharedDir = ActiveLibDir;
StaticPrefix = SharedPrefix = "lib";
+ } else if (HostTriple.isOSOpenBSD()) {
+ SharedExt = "so";
+ SharedVersionedExt = ".so" ;
+ StaticExt = "a";
+ StaticDir = SharedDir = ActiveLibDir;
+ StaticPrefix = SharedPrefix = "lib";
} else {
// default to the unix values:
SharedExt = "so";
@@ -393,7 +399,7 @@ int main(int argc, char **argv) {
bool DyLibExists = false;
const std::string DyLibName =
- (SharedPrefix + "LLVM-" + SharedVersionedExt).str();
+ (SharedPrefix + "LLVM" + SharedVersionedExt).str();
// If LLVM_LINK_DYLIB is ON, the single shared library will be returned
// for "--libs", etc, if they exist. This behaviour can be overridden with
@@ -405,7 +411,12 @@ int main(int argc, char **argv) {
if (DirSep == "\\") {
std::replace(path.begin(), path.end(), '/', '\\');
}
- DyLibExists = sys::fs::exists(path);
+ // path does not include major.minor
+ if (HostTriple.isOSOpenBSD()) {
+ DyLibExists = true;
+ } else {
+ DyLibExists = sys::fs::exists(path);
+ }
if (!DyLibExists) {
// The shared library does not exist: don't error unless the user
// explicitly passes --link-shared.