summaryrefslogtreecommitdiff
path: root/tools/llvm-config
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2013-12-16 13:09:06 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2013-12-16 13:09:06 +0000
commit64f5838550435e3b7423f2c10631bad79461cadb (patch)
tree8f9bc5829005c14e231e6ff8789324e81c5e39bc /tools/llvm-config
parent56c390e709cf1baa0d3b83726d11f568290456e3 (diff)
llvm-config: Fixup r197380, tweak for cross compilation. SYSTEM_LIBS should be --host's in BuildTools/llvm-config.
FIXME: Host's llvm-config is not generated. It's for target's. Host tools, aka "BuildTools", in utils, do not require llvm-config to build. For example with --host=i686-pc-mingw32 --build=linux, $ BuildTools/Release+Asserts/bin/llvm-config --libs support -lLLVMSupport -lpthread -lshell32 -lpsapi -limagehlp -lm git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197382 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-config')
-rw-r--r--tools/llvm-config/Makefile10
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/llvm-config/Makefile b/tools/llvm-config/Makefile
index b20b6bf4a4b..b78551e68a7 100644
--- a/tools/llvm-config/Makefile
+++ b/tools/llvm-config/Makefile
@@ -30,6 +30,14 @@ SUB_CPPFLAGS := ${CPP.BaseFlags}
SUB_CFLAGS := ${CPP.BaseFlags} ${C.Flags}
SUB_CXXFLAGS := ${CPP.BaseFlags} ${CXX.Flags}
+# Override LIBS with TARGET's LIBS for cross compilation.
+# FIXME: Host's llvm-config is not generated. It's for target's.
+ifneq ($(TARGET_LIBS), )
+ LLVM_SYSTEM_LIBS := $(TARGET_LIBS)
+else
+ LLVM_SYSTEM_LIBS := $(LIBS)
+endif
+
# This is blank for now. We need to be careful about adding stuff here:
# LDFLAGS tend not to be portable, and we don't currently require the
# user to use libtool when linking against LLVM.
@@ -51,7 +59,7 @@ $(ObjDir)/BuildVariables.inc: $(BUILDVARIABLES_SRCPATH) Makefile $(ObjDir)/.dir
>> temp.sed
$(Verb) $(ECHO) 's/@LLVM_BUILDMODE@/$(subst /,\/,$(BuildMode))/' \
>> temp.sed
- $(Verb) $(ECHO) 's/@LLVM_SYSTEM_LIBS@/$(subst /,\/,$(LIBS))/' \
+ $(Verb) $(ECHO) 's/@LLVM_SYSTEM_LIBS@/$(subst /,\/,$(LLVM_SYSTEM_LIBS))/' \
>> temp.sed
$(Verb) $(ECHO) 's/@LLVM_TARGETS_BUILT@/$(subst /,\/,$(TARGETS_TO_BUILD))/' \
>> temp.sed