Stop using HOST_OS, whitelist windows modules
Bug: 23566667
Change-Id: I7ef9d73b897788ed4c8a8d8ca9a582cc08af15f9
diff --git a/Android.mk b/Android.mk
index ad21289..b9ce1c9 100644
--- a/Android.mk
+++ b/Android.mk
@@ -83,14 +83,10 @@
include $(CLEAR_VARS)
LOCAL_MODULE := libbcc
-LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_HOST_OS := darwin linux windows
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_IS_HOST_MODULE := true
-ifneq ($(HOST_OS),windows)
-LOCAL_CLANG := true
-endif
-
LOCAL_WHOLE_STATIC_LIBRARIES += $(libbcc_WHOLE_STATIC_LIBRARIES)
LOCAL_STATIC_LIBRARIES += \
@@ -100,17 +96,18 @@
LOCAL_SHARED_LIBRARIES := libbcinfo
-ifndef USE_MINGW
-LOCAL_LDLIBS := -ldl -lpthread
-endif
+LOCAL_LDLIBS_darwin := -ldl -lpthread
+LOCAL_LDLIBS_linux := -ldl -lpthread
include $(LIBBCC_ROOT_PATH)/llvm-loadable-libbcc.mk
ifeq ($(CAN_BUILD_HOST_LLVM_LOADABLE_MODULE),true)
-LOCAL_STATIC_LIBRARIES += libLLVMLinker
+LOCAL_STATIC_LIBRARIES_linux += libLLVMLinker
else
-LOCAL_SHARED_LIBRARIES += libLLVM
+LOCAL_SHARED_LIBRARIES_linux += libLLVM
endif
+LOCAL_SHARED_LIBRARIES_darwin += libLLVM
+LOCAL_SHARED_LIBRARIES_windows += libLLVM
include $(LIBBCC_HOST_BUILD_MK)
include $(LLVM_HOST_BUILD_MK)
diff --git a/bcinfo/Android.mk b/bcinfo/Android.mk
index 3da0d34..89dd817 100644
--- a/bcinfo/Android.mk
+++ b/bcinfo/Android.mk
@@ -69,7 +69,7 @@
LOCAL_MODULE := libbcinfo
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
-LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_HOST_OS := darwin linux windows
LOCAL_IS_HOST_MODULE := true
LOCAL_SRC_FILES := $(libbcinfo_SRC_FILES)
@@ -81,15 +81,16 @@
LOCAL_STATIC_LIBRARIES += $(libbcinfo_STATIC_LIBRARIES)
LOCAL_STATIC_LIBRARIES += libcutils liblog
-ifndef USE_MINGW
-LOCAL_LDLIBS := -ldl -lpthread
-endif
+LOCAL_LDLIBS_darwin := -ldl -lpthread
+LOCAL_LDLIBS_linux := -ldl -lpthread
include $(LOCAL_PATH)/../llvm-loadable-libbcc.mk
ifneq ($(CAN_BUILD_HOST_LLVM_LOADABLE_MODULE),true)
-LOCAL_SHARED_LIBRARIES += libLLVM
+LOCAL_SHARED_LIBRARIES_linux += libLLVM
endif
+LOCAL_SHARED_LIBRARIES_darwin += libLLVM
+LOCAL_SHARED_LIBRARIES_windows += libLLVM
include $(LLVM_ROOT_PATH)/llvm-host-build.mk
include $(BUILD_HOST_SHARED_LIBRARY)
diff --git a/bcinfo/BitReader_2_7/Android.mk b/bcinfo/BitReader_2_7/Android.mk
index 181c731..f966459 100644
--- a/bcinfo/BitReader_2_7/Android.mk
+++ b/bcinfo/BitReader_2_7/Android.mk
@@ -16,7 +16,7 @@
LOCAL_MODULE:= libLLVMBitReader_2_7
-LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_HOST_OS := darwin linux windows
include $(LLVM_HOST_BUILD_MK)
include $(LLVM_GEN_INTRINSICS_MK)
@@ -31,8 +31,6 @@
LOCAL_MODULE:= libLLVMBitReader_2_7
-LOCAL_MODULE_TAGS := optional
-
include $(LLVM_DEVICE_BUILD_MK)
include $(LLVM_GEN_INTRINSICS_MK)
include $(BUILD_STATIC_LIBRARY)
diff --git a/bcinfo/BitReader_3_0/Android.mk b/bcinfo/BitReader_3_0/Android.mk
index 95ccd40..e0d642f 100644
--- a/bcinfo/BitReader_3_0/Android.mk
+++ b/bcinfo/BitReader_3_0/Android.mk
@@ -11,7 +11,7 @@
include $(CLEAR_VARS)
LOCAL_MODULE:= libLLVMBitReader_3_0
-LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_HOST_OS := darwin linux windows
LOCAL_SRC_FILES := $(bitcode_reader_3_0_SRC_FILES)
LOCAL_CFLAGS += -D__HOST__
@@ -26,7 +26,6 @@
include $(CLEAR_VARS)
LOCAL_MODULE:= libLLVMBitReader_3_0
-LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(bitcode_reader_3_0_SRC_FILES)
diff --git a/bcinfo/Wrap/Android.mk b/bcinfo/Wrap/Android.mk
index 1b5db36..92508d8 100644
--- a/bcinfo/Wrap/Android.mk
+++ b/bcinfo/Wrap/Android.mk
@@ -33,7 +33,7 @@
include $(CLEAR_VARS)
LOCAL_MODULE:= libLLVMWrap
-LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_HOST_OS := darwin linux windows
LOCAL_SRC_FILES := $(llvm_wrap_SRC_FILES)
LOCAL_CFLAGS += -D__HOST__
@@ -49,7 +49,6 @@
include $(CLEAR_VARS)
LOCAL_MODULE:= libLLVMWrap
-LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(llvm_wrap_SRC_FILES)
LOCAL_C_INCLUDES := $(llvm_wrap_C_INCLUDES)
@@ -57,4 +56,4 @@
include $(LLVM_DEVICE_BUILD_MK)
include $(LLVM_GEN_INTRINSICS_MK)
include $(BUILD_STATIC_LIBRARY)
-endif
\ No newline at end of file
+endif
diff --git a/lib/Core/Android.mk b/lib/Core/Android.mk
index 80d9f7b..e880b5c 100644
--- a/lib/Core/Android.mk
+++ b/lib/Core/Android.mk
@@ -35,7 +35,6 @@
include $(CLEAR_VARS)
LOCAL_MODULE := libbccCore
-LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
LOCAL_SRC_FILES := $(libbcc_core_SRC_FILES)
@@ -53,7 +52,7 @@
include $(CLEAR_VARS)
LOCAL_MODULE := libbccCore
-LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_HOST_OS := darwin linux windows
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
LOCAL_SRC_FILES := $(libbcc_core_SRC_FILES)
diff --git a/lib/Renderscript/Android.mk b/lib/Renderscript/Android.mk
index 4b18eda..7744447 100644
--- a/lib/Renderscript/Android.mk
+++ b/lib/Renderscript/Android.mk
@@ -42,7 +42,6 @@
include $(CLEAR_VARS)
LOCAL_MODULE := libbccRenderscript
-LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
LOCAL_SRC_FILES := $(libbcc_renderscript_SRC_FILES)
@@ -59,7 +58,7 @@
include $(CLEAR_VARS)
LOCAL_MODULE := libbccRenderscript
-LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_HOST_OS := darwin linux windows
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
LOCAL_IS_HOST_MODULE := true
diff --git a/lib/Support/Android.mk b/lib/Support/Android.mk
index b8cdc60..5efbabd 100644
--- a/lib/Support/Android.mk
+++ b/lib/Support/Android.mk
@@ -36,7 +36,6 @@
include $(CLEAR_VARS)
LOCAL_MODULE := libbccSupport
-LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
LOCAL_SRC_FILES := \
@@ -54,7 +53,7 @@
include $(CLEAR_VARS)
LOCAL_MODULE := libbccSupport
-LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_HOST_OS := darwin linux windows
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
LOCAL_SRC_FILES := \
diff --git a/libbcc-host-build.mk b/libbcc-host-build.mk
index 22f0f72..5dc69b7 100644
--- a/libbcc-host-build.mk
+++ b/libbcc-host-build.mk
@@ -14,10 +14,6 @@
# limitations under the License.
#
-ifneq ($(HOST_OS),windows)
-LOCAL_CLANG := true
-endif
-
LOCAL_CFLAGS := \
-Wall \
-Wno-unused-parameter \
diff --git a/llvm-loadable-libbcc.mk b/llvm-loadable-libbcc.mk
index 7675167..5e47ced 100644
--- a/llvm-loadable-libbcc.mk
+++ b/llvm-loadable-libbcc.mk
@@ -18,14 +18,6 @@
# host.
CAN_BUILD_HOST_LLVM_LOADABLE_MODULE := true
-ifdef USE_MINGW
-CAN_BUILD_HOST_LLVM_LOADABLE_MODULE := false
-endif
-
-ifeq ($(HOST_OS),darwin)
-CAN_BUILD_HOST_LLVM_LOADABLE_MODULE := false
-endif
-
ifneq ($(FORCE_BUILD_LLVM_COMPONENTS),true)
CAN_BUILD_HOST_LLVM_LOADABLE_MODULE := false
endif
diff --git a/tools/bcc_compat/Android.mk b/tools/bcc_compat/Android.mk
index aa6f7bb..49f5f36 100644
--- a/tools/bcc_compat/Android.mk
+++ b/tools/bcc_compat/Android.mk
@@ -25,6 +25,7 @@
LOCAL_MODULE := bcc_compat
LOCAL_MODULE_CLASS := EXECUTABLES
+LOCAL_MODULE_HOST_OS := darwin linux windows
LOCAL_SHARED_LIBRARIES := \
libbcc \
@@ -34,9 +35,8 @@
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/../../include
-ifndef USE_MINGW
-LOCAL_LDLIBS = -ldl
-endif
+LOCAL_LDLIBS_darwin = -ldl
+LOCAL_LDLIBS_linux = -ldl
LOCAL_SRC_FILES := Main.cpp
diff --git a/tools/bcc_strip_attr/Android.mk b/tools/bcc_strip_attr/Android.mk
index a8296bc..b83a5e0 100644
--- a/tools/bcc_strip_attr/Android.mk
+++ b/tools/bcc_strip_attr/Android.mk
@@ -29,9 +29,8 @@
$(LOCAL_PATH)/../../include
LOCAL_LDLIBS += -lm
-ifndef USE_MINGW
-LOCAL_LDLIBS += -lpthread -ldl
-endif
+LOCAL_LDLIBS_darwin += -lpthread -ldl
+LOCAL_LDLIBS_linux += -lpthread -ldl
LOCAL_SRC_FILES := bcc_strip_attr.cpp
include $(LIBBCC_HOST_BUILD_MK)