From c33b570fe85518e2a4119c65635a75c53007214e Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar@redhat.com>
Date: Thu, 18 May 2017 12:10:20 -0400
Subject: [PATCH] Fix llvm-config paths on Fedora
---
.../0001-Fix-llvm-config-paths-on-Fedora.patch | 32 ++++++++++++++++++++++
tools/llvm-config/llvm-config.cpp | 10 +++----
2 files changed, 36 insertions(+), 6 deletions(-)
create mode 100644 tools/llvm-config/0001-Fix-llvm-config-paths-on-Fedora.patch
diff --git a/tools/llvm-config/0001-Fix-llvm-config-paths-on-Fedora.patch b/tools/llvm-config/0001-Fix-llvm-config-paths-on-Fedora.patch
new file mode 100644
index 0000000..07ecaba
--- /dev/null
+++ b/tools/llvm-config/0001-Fix-llvm-config-paths-on-Fedora.patch
@@ -0,0 +1,32 @@
+From 57e09a7c656fa29dfe474d6921fcc050bf6ee921 Mon Sep 17 00:00:00 2001
+From: Tom Stellard <tstellar@redhat.com>
+Date: Thu, 18 May 2017 12:10:20 -0400
+Subject: [PATCH] Fix llvm-config paths on Fedora
+
+---
+ tools/llvm-config/llvm-config.cpp | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
+index 25344e4..ccc9617 100644
+--- a/tools/llvm-config/llvm-config.cpp
++++ b/tools/llvm-config/llvm-config.cpp
+@@ -331,11 +331,11 @@ int main(int argc, char **argv) {
+ ActiveIncludeOption =
+ ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include");
+ } else {
+- ActivePrefix = CurrentExecPrefix;
+- ActiveIncludeDir = ActivePrefix + "/include";
+- ActiveBinDir = ActivePrefix + "/bin";
++ ActivePrefix = CurrentExecPrefix + "/../../../";
++ ActiveIncludeDir = ActivePrefix + "/include/llvm-4.0";
++ ActiveBinDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX + "/llvm-4.0/bin";
+ ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
+- ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
++ ActiveCMakeDir = ActiveLibDir + "/cmake/llvm-4.0";
+ ActiveIncludeOption = "-I" + ActiveIncludeDir;
+ }
+
+--
+1.8.3.1
+
diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
index 08b096a..7dcd8c9 100644
--- a/tools/llvm-config/llvm-config.cpp
+++ b/tools/llvm-config/llvm-config.cpp
@@ -331,13 +331,11 @@ int main(int argc, char **argv) {
ActiveIncludeOption =
("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include");
} else {
- ActivePrefix = CurrentExecPrefix;
- ActiveIncludeDir = ActivePrefix + "/include";
- SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR));
- sys::fs::make_absolute(ActivePrefix, path);
- ActiveBinDir = path.str();
+ ActivePrefix = CurrentExecPrefix + "/../../";
+ ActiveIncludeDir = ActivePrefix + "/include/llvm-5.0";
+ ActiveBinDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX + "/llvm-5.0/bin";
ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
- ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
+ ActiveCMakeDir = ActiveLibDir + "/cmake/llvm-5.0";
ActiveIncludeOption = "-I" + ActiveIncludeDir;
}
--
1.8.3.1