[llvm] r224921 - [cmake] Teach the llvm-config program to respect LLVM_LIBDIR_SUFFIX.
Chandler Carruth
chandlerc at gmail.com
Mon Dec 29 03:16:25 PST 2014
Author: chandlerc
Date: Mon Dec 29 05:16:25 2014
New Revision: 224921
URL: http://llvm.org/viewvc/llvm-project?rev=224921&view=rev
Log:
[cmake] Teach the llvm-config program to respect LLVM_LIBDIR_SUFFIX.
For this to work, we have to encode it in the build variables and use it
from llvm-config.cpp. I've tried to do this reasonably cleanly, but the
code for llvm-config.cpp is pretty strange. However, with this,
llvm-config stops giving the wrong answer when using LLVM_LIBDIR_SUFFIX.
Note that the configure+make build just sets this to an empty string as
that build system has zero support for multilib of any form. I'm not
planning to add support there either, but this should leave a path for
anyone that wanted to.
Modified:
llvm/trunk/tools/llvm-config/BuildVariables.inc.in
llvm/trunk/tools/llvm-config/Makefile
llvm/trunk/tools/llvm-config/llvm-config.cpp
Modified: llvm/trunk/tools/llvm-config/BuildVariables.inc.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-config/BuildVariables.inc.in?rev=224921&r1=224920&r2=224921&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-config/BuildVariables.inc.in (original)
+++ llvm/trunk/tools/llvm-config/BuildVariables.inc.in Mon Dec 29 05:16:25 2014
@@ -23,5 +23,6 @@
#define LLVM_LDFLAGS "@LLVM_LDFLAGS@"
#define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@"
#define LLVM_BUILDMODE "@LLVM_BUILDMODE@"
+#define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@"
#define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
#define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@"
Modified: llvm/trunk/tools/llvm-config/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-config/Makefile?rev=224921&r1=224920&r2=224921&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-config/Makefile (original)
+++ llvm/trunk/tools/llvm-config/Makefile Mon Dec 29 05:16:25 2014
@@ -59,6 +59,8 @@ $(ObjDir)/BuildVariables.inc: $(BUILDVAR
>> temp.sed
$(Verb) $(ECHO) 's/@LLVM_BUILDMODE@/$(subst /,\/,$(BuildMode))/' \
>> temp.sed
+ $(Verb) $(ECHO) 's/@LLVM_LIBDIR_SUFFIX@//' \
+ >> temp.sed
$(Verb) $(ECHO) 's/@LLVM_SYSTEM_LIBS@/$(subst /,\/,$(LLVM_SYSTEM_LIBS))/' \
>> temp.sed
$(Verb) $(ECHO) 's/@LLVM_TARGETS_BUILT@/$(subst /,\/,$(TARGETS_TO_BUILD))/' \
Modified: llvm/trunk/tools/llvm-config/llvm-config.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-config/llvm-config.cpp?rev=224921&r1=224920&r2=224921&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-config/llvm-config.cpp (original)
+++ llvm/trunk/tools/llvm-config/llvm-config.cpp Mon Dec 29 05:16:25 2014
@@ -243,16 +243,18 @@ int main(int argc, char **argv) {
case MakefileStyle:
ActivePrefix = ActiveObjRoot;
ActiveBinDir = ActiveObjRoot + "/" + build_mode + "/bin";
- ActiveLibDir = ActiveObjRoot + "/" + build_mode + "/lib";
+ ActiveLibDir =
+ ActiveObjRoot + "/" + build_mode + "/lib" + LLVM_LIBDIR_SUFFIX;
break;
case CMakeStyle:
ActiveBinDir = ActiveObjRoot + "/bin";
- ActiveLibDir = ActiveObjRoot + "/lib";
+ ActiveLibDir = ActiveObjRoot + "/lib" + LLVM_LIBDIR_SUFFIX;
break;
case CMakeBuildModeStyle:
ActivePrefix = ActiveObjRoot;
ActiveBinDir = ActiveObjRoot + "/bin/" + build_mode;
- ActiveLibDir = ActiveObjRoot + "/lib/" + build_mode;
+ ActiveLibDir =
+ ActiveObjRoot + "/lib" + LLVM_LIBDIR_SUFFIX + "/" + build_mode;
break;
}
@@ -263,7 +265,7 @@ int main(int argc, char **argv) {
ActivePrefix = CurrentExecPrefix;
ActiveIncludeDir = ActivePrefix + "/include";
ActiveBinDir = ActivePrefix + "/bin";
- ActiveLibDir = ActivePrefix + "/lib";
+ ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
ActiveIncludeOption = "-I" + ActiveIncludeDir;
}
More information about the llvm-commits
mailing list