summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeno Fischer <keno@alumni.harvard.edu>2017-06-01 19:20:33 +0000
committerKeno Fischer <keno@alumni.harvard.edu>2017-06-01 19:20:33 +0000
commit532a9e888a6e759c044ea34f3b0d01113ff6d6be (patch)
tree486b8d5fcf55d9802801dcc8ffd38db8aa53777b
parentb762f689b900101a8188cadd8a2240b0657f8374 (diff)
downloadbcm5719-llvm-532a9e888a6e759c044ea34f3b0d01113ff6d6be.tar.gz
bcm5719-llvm-532a9e888a6e759c044ea34f3b0d01113ff6d6be.zip
[llvm-config] Report --bindir based on LLVM_TOOLS_INSTALL_DIR
Summary: `LLVM_TOOLS_INSTALL_DIR` was introduced in r272200 in order to override the directory name into which to install LLVM's executable. However, `llvm-config --bindir` still reported `$PREFIX/bin` independent of what LLVM_TOOLS_INSTALL_DIR was set to. This fixes the out-of-tree clang standalone build for me. Reviewers: beanz, tstellar Reviewed By: tstellar Subscribers: chapuni, tstellar, llvm-commits Differential Revision: https://reviews.llvm.org/D22499 llvm-svn: 304458
-rw-r--r--llvm/tools/llvm-config/BuildVariables.inc.in1
-rw-r--r--llvm/tools/llvm-config/llvm-config.cpp4
2 files changed, 4 insertions, 1 deletions
diff --git a/llvm/tools/llvm-config/BuildVariables.inc.in b/llvm/tools/llvm-config/BuildVariables.inc.in
index 0740c3f9d9f..f201e1f7bff 100644
--- a/llvm/tools/llvm-config/BuildVariables.inc.in
+++ b/llvm/tools/llvm-config/BuildVariables.inc.in
@@ -34,3 +34,4 @@
#define LLVM_DYLIB_COMPONENTS "@LLVM_DYLIB_COMPONENTS@"
#define LLVM_DYLIB_VERSION "@LLVM_DYLIB_VERSION@"
#define LLVM_HAS_GLOBAL_ISEL @LLVM_HAS_GLOBAL_ISEL@
+#define LLVM_TOOLS_INSTALL_DIR "@LLVM_TOOLS_INSTALL_DIR@"
diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp
index 25344e4cd01..888da7143c9 100644
--- a/llvm/tools/llvm-config/llvm-config.cpp
+++ b/llvm/tools/llvm-config/llvm-config.cpp
@@ -333,7 +333,9 @@ int main(int argc, char **argv) {
} else {
ActivePrefix = CurrentExecPrefix;
ActiveIncludeDir = ActivePrefix + "/include";
- ActiveBinDir = ActivePrefix + "/bin";
+ SmallString<PATH_MAX> path(StringRef(LLVM_TOOLS_INSTALL_DIR));
+ sys::fs::make_absolute(ActivePrefix, path);
+ ActiveBinDir = path.str();
ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
ActiveIncludeOption = "-I" + ActiveIncludeDir;
OpenPOWER on IntegriCloud