summaryrefslogtreecommitdiff
path: root/Makefile.rules
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2009-07-03 03:52:47 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2009-07-03 03:52:47 +0000
commit2373c99433b634b8cf9c4deb28d68d1be255a564 (patch)
tree14674fa664e00f7e1cbb89eb246b0a9095844591 /Makefile.rules
parent895f32c212032e546c743bf0a815044981521160 (diff)
downloadllvm-2373c99433b634b8cf9c4deb28d68d1be255a564.tar.gz
llvm-2373c99433b634b8cf9c4deb28d68d1be255a564.tar.bz2
llvm-2373c99433b634b8cf9c4deb28d68d1be255a564.tar.xz
Add --enable-llvmc-dynamic configure option.
Controls whether libCompilerDriver should be loaded dynamically. By default this is needed only on Win32, to make dynamic plugins work. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74759 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Makefile.rules')
-rw-r--r--Makefile.rules21
1 files changed, 15 insertions, 6 deletions
diff --git a/Makefile.rules b/Makefile.rules
index 9787d5fe0b..3ae2db8916 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -200,17 +200,20 @@ ifdef LLVMC_PLUGIN
LIBRARYNAME := $(patsubst %,plugin_llvmc_%,$(LLVMC_PLUGIN))
CPP.Flags += -DLLVMC_PLUGIN_NAME=$(LLVMC_PLUGIN)
REQUIRES_EH := 1
-LD.Flags += -lCompilerDriver
+
+ifeq ($(ENABLE_LLVMC_DYNAMIC),1)
+ LD.Flags += -lCompilerDriver
+endif
# Build a dynamic library if the user runs `make` directly from the plugin
# directory.
ifndef LLVMC_BUILTIN_PLUGIN
-LOADABLE_MODULE = 1
+ LOADABLE_MODULE = 1
endif
# TableGen stuff...
ifneq ($(BUILT_SOURCES),)
-LLVMC_BUILD_AUTOGENERATED_INC=1
+ LLVMC_BUILD_AUTOGENERATED_INC=1
endif
endif # LLVMC_PLUGIN
@@ -218,8 +221,15 @@ endif # LLVMC_PLUGIN
ifdef LLVMC_BASED_DRIVER
TOOLNAME = $(LLVMC_BASED_DRIVER)
+
REQUIRES_EH := 1
-LD.Flags += -lCompilerDriver
+
+ifeq ($(ENABLE_LLVMC_DYNAMIC),1)
+ LD.Flags += -lCompilerDriver
+else
+ LLVMLIBS = CompilerDriver.a
+ LINK_COMPONENTS = support system
+endif
# Preprocessor magic that generates references to static variables in built-in
# plugins.
@@ -502,8 +512,7 @@ ifeq ($(OS),Darwin)
else
ifeq ($(OS),Cygwin)
SharedLinkOptions=-shared -nostdlib -Wl,--export-all-symbols \
- -Wl,--enable-auto-import -Wl,--enable-auto-image-base \
- -Wl,--enable-runtime-pseudo-relocs
+ -Wl,--enable-auto-import -Wl,--enable-auto-image-base
else
SharedLinkOptions=-shared
endif