]> granicus.if.org Git - llvm/commitdiff
[llvm-config] Report --bindir based on LLVM_TOOLS_INSTALL_DIR
authorKeno Fischer <keno@alumni.harvard.edu>
Thu, 1 Jun 2017 19:20:33 +0000 (19:20 +0000)
committerKeno Fischer <keno@alumni.harvard.edu>
Thu, 1 Jun 2017 19:20:33 +0000 (19:20 +0000)
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304458 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-config/BuildVariables.inc.in
tools/llvm-config/llvm-config.cpp

index 0740c3f9d9f5a7f689390183f724b718ca057566..f201e1f7bff0e8cb79e8b4d3c9ad9d41c697bea3 100644 (file)
@@ -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@"
index 25344e4cd01180906b9d9f32b59fc57bd7c52e18..888da7143c9f2a9ba5761506d64f8daa3fe59a4a 100644 (file)
@@ -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;