From: Reid Spencer Date: Fri, 24 Mar 2006 07:36:57 +0000 (+0000) Subject: Add a facility for invoking the llvm-config tool when linking a program. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=205b02e97a1fa790b1410532ee1eadb86b43d81a;p=oota-llvm.git Add a facility for invoking the llvm-config tool when linking a program. 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 --- diff --git a/Makefile.rules b/Makefile.rules index a066a56fb85..0144d8dea23 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -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