Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

Commit be2a63a

Browse files
committed
[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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304458 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 4fadb11 commit be2a63a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

tools/llvm-config/BuildVariables.inc.in

+1
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@
3434
#define LLVM_DYLIB_COMPONENTS "@LLVM_DYLIB_COMPONENTS@"
3535
#define LLVM_DYLIB_VERSION "@LLVM_DYLIB_VERSION@"
3636
#define LLVM_HAS_GLOBAL_ISEL @LLVM_HAS_GLOBAL_ISEL@
37+
#define LLVM_TOOLS_INSTALL_DIR "@LLVM_TOOLS_INSTALL_DIR@"

tools/llvm-config/llvm-config.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,9 @@ int main(int argc, char **argv) {
333333
} else {
334334
ActivePrefix = CurrentExecPrefix;
335335
ActiveIncludeDir = ActivePrefix + "/include";
336-
ActiveBinDir = ActivePrefix + "/bin";
336+
SmallString<PATH_MAX> path(StringRef(LLVM_TOOLS_INSTALL_DIR));
337+
sys::fs::make_absolute(ActivePrefix, path);
338+
ActiveBinDir = path.str();
337339
ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
338340
ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
339341
ActiveIncludeOption = "-I" + ActiveIncludeDir;

0 commit comments

Comments
 (0)