2017-12-01 20:22:12 +01:00
|
|
|
$NetBSD: patch-tools_llvm-config_llvm-config.cpp,v 1.4 2017/12/01 19:22:13 adam Exp $
|
2016-03-17 03:53:59 +01:00
|
|
|
|
2017-03-17 23:38:17 +01:00
|
|
|
Avoid conflict with lang/clang.
|
2016-03-17 03:53:59 +01:00
|
|
|
Use -lLLVM-3.8 instead of -lLLVM-3.8.0 so we don't break unnecessarily
|
|
|
|
on patch updates.
|
|
|
|
|
2017-12-01 20:22:12 +01:00
|
|
|
--- tools/llvm-config/llvm-config.cpp.orig 2017-06-01 20:51:55.000000000 +0000
|
2016-03-17 03:53:59 +01:00
|
|
|
+++ tools/llvm-config/llvm-config.cpp
|
2017-12-01 20:22:12 +01:00
|
|
|
@@ -332,11 +332,11 @@ int main(int argc, char **argv) {
|
2016-11-14 21:15:32 +01:00
|
|
|
("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include");
|
2016-03-17 03:53:59 +01:00
|
|
|
} else {
|
|
|
|
ActivePrefix = CurrentExecPrefix;
|
|
|
|
- ActiveIncludeDir = ActivePrefix + "/include";
|
|
|
|
+ ActiveIncludeDir = "@PREFIX@/include/libLLVM";
|
2017-12-01 20:22:12 +01:00
|
|
|
SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR));
|
|
|
|
sys::fs::make_absolute(ActivePrefix, path);
|
|
|
|
ActiveBinDir = path.str();
|
2016-03-17 03:53:59 +01:00
|
|
|
- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
|
|
|
|
+ ActiveLibDir = "@PREFIX@/lib/libLLVM";
|
2017-03-17 23:38:17 +01:00
|
|
|
ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
|
2016-03-17 03:53:59 +01:00
|
|
|
ActiveIncludeOption = "-I" + ActiveIncludeDir;
|
|
|
|
}
|
2017-12-01 20:22:12 +01:00
|
|
|
@@ -372,14 +372,14 @@ int main(int argc, char **argv) {
|
2016-11-14 21:15:32 +01:00
|
|
|
StaticDir = ActiveLibDir;
|
2016-03-17 03:53:59 +01:00
|
|
|
} else if (HostTriple.isOSDarwin()) {
|
|
|
|
SharedExt = "dylib";
|
2016-11-14 21:15:32 +01:00
|
|
|
- SharedVersionedExt = LLVM_DYLIB_VERSION ".dylib";
|
2016-03-17 03:53:59 +01:00
|
|
|
+ SharedVersionedExt = ".dylib";
|
|
|
|
StaticExt = "a";
|
|
|
|
StaticDir = SharedDir = ActiveLibDir;
|
|
|
|
StaticPrefix = SharedPrefix = "lib";
|
|
|
|
} else {
|
|
|
|
// default to the unix values:
|
|
|
|
SharedExt = "so";
|
2016-11-14 21:15:32 +01:00
|
|
|
- SharedVersionedExt = LLVM_DYLIB_VERSION ".so";
|
2016-03-17 03:53:59 +01:00
|
|
|
+ SharedVersionedExt = "-@LLVM_MAJOR_MINOR@.so";
|
|
|
|
StaticExt = "a";
|
|
|
|
StaticDir = SharedDir = ActiveLibDir;
|
|
|
|
StaticPrefix = SharedPrefix = "lib";
|
2017-12-01 20:22:12 +01:00
|
|
|
@@ -392,7 +392,7 @@ int main(int argc, char **argv) {
|
2016-03-17 03:53:59 +01:00
|
|
|
|
|
|
|
bool DyLibExists = false;
|
|
|
|
const std::string DyLibName =
|
2016-11-14 21:15:32 +01:00
|
|
|
- (SharedPrefix + "LLVM-" + SharedVersionedExt).str();
|
|
|
|
+ (SharedPrefix + "LLVM" + SharedVersionedExt).str();
|
2016-03-17 03:53:59 +01:00
|
|
|
|
2016-11-14 21:15:32 +01:00
|
|
|
// 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
|
2017-12-01 20:22:12 +01:00
|
|
|
@@ -493,7 +493,7 @@ int main(int argc, char **argv) {
|
2016-03-17 03:53:59 +01:00
|
|
|
OS << ActiveIncludeOption << ' ' << LLVM_CXXFLAGS << '\n';
|
|
|
|
} else if (Arg == "--ldflags") {
|
2016-11-14 21:15:32 +01:00
|
|
|
OS << ((HostTriple.isWindowsMSVCEnvironment()) ? "-LIBPATH:" : "-L")
|
|
|
|
- << ActiveLibDir << ' ' << LLVM_LDFLAGS << '\n';
|
|
|
|
+ << ActiveLibDir << " @COMPILER_RPATH_FLAG@" << ActiveLibDir << ' ' << LLVM_LDFLAGS << '\n';
|
2016-03-17 03:53:59 +01:00
|
|
|
} else if (Arg == "--system-libs") {
|
|
|
|
PrintSystemLibs = true;
|
|
|
|
} else if (Arg == "--libs") {
|