summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/tools/llvm-config/llvm-config.cpp
diff options
context:
space:
mode:
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.