OSDN Git Service

am 7b2c68b1: Merge "Fix darwin build due to deprecated sbrk declaration."
[android-x86/external-llvm.git] / shared_llvm.mk
index 183618c..7a8cf6f 100644 (file)
@@ -73,7 +73,6 @@ llvm_host_static_libraries := \
   libLLVMMCJIT \
   libLLVMOrcJIT
 
-ifeq (true,$(FORCE_BUILD_LLVM_COMPONENTS))
 # HOST LLVM shared library build
 include $(CLEAR_VARS)
 LOCAL_IS_HOST_MODULE := true
@@ -92,15 +91,20 @@ LOCAL_WHOLE_STATIC_LIBRARIES := \
   $(llvm_host_static_libraries) \
   $(llvm_post_static_libraries)
 
-ifeq ($(HOST_OS),windows)
-  LOCAL_LDLIBS := -limagehlp -lpsapi -lole32
+LOCAL_LDLIBS_windows := -limagehlp -lpsapi -lole32
+LOCAL_LDLIBS_darwin := -ldl -lpthread
+LOCAL_LDLIBS_linux := -ldl -lpthread
+
+# Use prebuilts for linux and darwin unless
+# FORCE_BUILD_LLVM_COMPONENTS is true
+ifneq (true,$(FORCE_BUILD_LLVM_COMPONENTS))
+LOCAL_MODULE_HOST_OS := windows
 else
-  LOCAL_LDLIBS := -ldl -lpthread
+LOCAL_MODULE_HOST_OS := darwin linux windows
 endif
 
 include $(LLVM_HOST_BUILD_MK)
 include $(BUILD_HOST_SHARED_LIBRARY)
-endif
 
 ifeq (,$(filter $(TARGET_ARCH),$(LLVM_SUPPORTED_ARCH)))
 $(warning TODO $(TARGET_ARCH): Enable llvm build)