Add a facility for invoking the llvm-config tool when linking a program.
authorReid Spencer <rspencer@reidspencer.com>
Fri, 24 Mar 2006 07:36:57 +0000 (07:36 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Fri, 24 Mar 2006 07:36:57 +0000 (07:36 +0000)
This facility allows LLVMLIBS to be specified with something like:
LLVMLIBS = config --libs jit
instead of:
LLVMLIBS = JIT
with the same effect. However, the llvm-config utility is much more versatile
than the single keyword approach. Note that "config" is the keyword after
which any arguments to llvm-config are allowed. When llvm-config is tested
and working well, we'll start using this and drop support for the JIT
keyword.

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

Makefile.rules

index a066a56fb85befc2355d280d96f9986f00c65a95..0144d8dea238d53dd77f07534785264c2393d517 100644 (file)
@@ -564,6 +564,14 @@ endif
 # shorthand for a bunch of libraries that get the correct
 # JIT support for a library or a tool that runs JIT.
 #---------------------------------------------------------
+ifeq ($(firstword $(LLVMLIBS)),config)
+LLVM_CONFIG := $(LLVM_SRC_ROOT)/utils/llvm-config/llvm-config 
+LLVMLIBS := $(shell $(LLVM_CONFIG) $(wordlist 2,9999,$(LLVMLIBS)))
+LLVMLIBS := $(patsubst $(PROJ_libdir)/%,%,$(LLVMLIBS))
+LLVMLIBS := $(patsubst %.o,%,$(LLVMLIBS))
+LLVMLIBS := $(patsubst -l%,%.a,$(LLVMLIBS))
+endif
+
 ifeq ($(LLVMLIBS),JIT)
 
 # Make sure we can get our own symbols in the tool