Do not install llvm-config-host for cross-builds of clang. rdar://11317847
authorBob Wilson <bob.wilson@apple.com>
Wed, 9 May 2012 00:07:02 +0000 (00:07 +0000)
committerBob Wilson <bob.wilson@apple.com>
Wed, 9 May 2012 00:07:02 +0000 (00:07 +0000)
My previous change to install llvm-config-host for cross-builds resulted
in that file being installed even when the normal llvm-config was not
installed, e.g., when building the install-clang target.  Daniel suggested
this alternative, which solves the immediate problem and also avoids the gunk
in the top-level makefile.

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

Makefile
tools/llvm-config/Makefile

index 590fab1222c61620f1e514cab16f8fde05db5a78..ec24862ad6fcefd9b6d0c5edb8ec2e025482bcb0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -102,11 +102,6 @@ endif
 ifeq ($(LLVM_CROSS_COMPILING),1)
 all:: cross-compile-build-tools
 
-install:: $(DESTDIR)$(PROJ_bindir)
-       $(Echo) Installing llvm-config-host
-       $(Verb) $(ProgInstall) $(BuildLLVMToolDir)/llvm-config \
-         $(DESTDIR)$(PROJ_bindir)/llvm-config-host
-
 clean::
        $(Verb) rm -rf BuildTools
 
index 3f11730a37d7ed8a74d5e02602ec5230a2061919..e8c86929e1880946a572c38cfc883b979af12955 100644 (file)
@@ -57,3 +57,11 @@ $(ObjDir)/BuildVariables.inc: $(BUILDVARIABLES_SRCPATH) Makefile $(ObjDir)/.dir
          >> temp.sed
        $(Verb) $(SED) -f temp.sed < $< > $@
        $(Verb) $(RM) temp.sed
+
+# When cross-compiling, install a version of llvm-config that runs on the host.
+ifeq ($(LLVM_CROSS_COMPILING),1)
+install:: $(DESTDIR)$(PROJ_bindir)
+       $(Echo) Installing llvm-config-host
+       $(Verb) $(ProgInstall) $(BuildLLVMToolDir)/llvm-config \
+         $(DESTDIR)$(PROJ_bindir)/llvm-config-host
+endif