Revert 106592 for now. It causes clang-selfhost build failure.
[oota-llvm.git] / lib / CompilerDriver / Makefile
index e5bf3e10a79e5665d8897074d9f64bd49ab30b7b..66c6d11552fc74667a4881e5484c0becc3908ce5 100644 (file)
@@ -12,8 +12,37 @@ LEVEL = ../..
 # We don't want this library to appear in `llvm-config --libs` output, so its
 # name doesn't start with "LLVM".
 
-LIBRARYNAME = CompilerDriver
-LINK_COMPONENTS = support system
+ifeq ($(ENABLE_LLVMC_DYNAMIC),1)
+  LIBRARYNAME = libCompilerDriver
+  LLVMLIBS = LLVMSupport.a LLVMSystem.a
+  LOADABLE_MODULE := 1
+else
+  LIBRARYNAME = CompilerDriver
+  LINK_COMPONENTS = support system
+endif
+
 REQUIRES_EH := 1
+REQUIRES_RTTI := 1
 
 include $(LEVEL)/Makefile.common
+
+ifeq ($(ENABLE_LLVMC_DYNAMIC_PLUGINS), 1)
+    CPP.Flags += -DENABLE_LLVMC_DYNAMIC_PLUGINS
+endif
+
+# Copy libCompilerDriver to the bin dir so that llvmc can find it.
+ifeq ($(ENABLE_LLVMC_DYNAMIC),1)
+
+FullLibName = $(LIBRARYNAME)$(SHLIBEXT)
+
+all-local:: $(ToolDir)/$(FullLibName)
+
+$(ToolDir)/$(FullLibName): $(LibDir)/$(FullLibName) $(ToolDir)/.dir
+       $(Echo) Copying $(BuildMode) Shared Library $(FullLibName) to $@
+       -$(Verb) $(CP) $< $@
+
+clean-local::
+       $(Echo) Removing $(BuildMode) Shared Library $(FullLibName) \
+       from $(ToolDir)
+       -$(Verb) $(RM) -f $(ToolDir)/$(FullLibName)
+endif