have the makefiles check the llvm-config error code instead of charging
authorChris Lattner <sabre@nondot.org>
Wed, 1 Sep 2010 16:11:17 +0000 (16:11 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 1 Sep 2010 16:11:17 +0000 (16:11 +0000)
on an producing weird link errors.  Patch by Yuri Gribov!

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

Makefile.rules
lib/CompilerDriver/Makefile

index b8375f2675872810ba8b9fd6609c3242c7e6fd46..59fa834b4cc3f9ae5811d2ae8277e3a7a9d4b5f9 100644 (file)
@@ -917,9 +917,20 @@ endif
 LLVMLibsOptions += -lLLVM-$(LLVMVersion)
 LLVMLibsPaths += $(SharedLibDir)/$(SharedPrefix)LLVM-$(LLVMVersion)$(SHLIBEXT)
 else
-LLVMLibsOptions += $(shell $(LLVM_CONFIG) --libs     $(LINK_COMPONENTS))
-LLVMLibsPaths   += $(LLVM_CONFIG) \
-                   $(shell $(LLVM_CONFIG) --libfiles $(LINK_COMPONENTS))
+
+ifndef NO_LLVM_CONFIG
+LLVMConfigLibs := $(shell $(LLVM_CONFIG) --libs $(LINK_COMPONENTS) || echo Error)
+ifeq ($(LLVMConfigLibs),Error)
+$(error llvm-config --libs failed)
+endif
+LLVMLibsOptions += $(LLVMConfigLibs)
+LLVMConfigLibfiles := $(shell $(LLVM_CONFIG) --libfiles $(LINK_COMPONENTS) || echo Error)
+ifeq ($(LLVMConfigLibfiles),Error)
+$(error llvm-config --libfiles failed)
+endif
+LLVMLibsPaths += $(LLVM_CONFIG) $(LLVMConfigLibfiles)
+endif
+
 endif
 endif
 endif
index 69c3707780a6596489464d896bccf958cb70773d..8e8b73ca8f83f628476d628de80593171bd37ac1 100644 (file)
 LEVEL = ../..
 
 # We don't want this library to appear in `llvm-config --libs` output, so its
-# name doesn't start with "LLVM".
+# name doesn't start with "LLVM" and NO_LLVM_CONFIG is set.
 
 LIBRARYNAME = CompilerDriver
 LINK_COMPONENTS = support system
+NO_LLVM_CONFIG = 1
+
 
 include $(LEVEL)/Makefile.common