aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2015-09-02 22:50:46 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-09-02 22:50:46 +0000
commit05c10489f02137c99b9e927fe2d5a7165e94dc39 (patch)
tree67b893b1121efb0ebc3ab675f390a041ba8f5fb9
parent8f341123970bcc4bc28e7f2c9434e72f1d0b0f76 (diff)
parent2d2dc9f1b26d4f1884468294dd509088fa04b2b0 (diff)
downloadclang-05c10489f02137c99b9e927fe2d5a7165e94dc39.tar.gz
Merge "Stop using HOST_OS, whitelist windows modules"
-rw-r--r--clang-host-build.mk2
-rw-r--r--shared_clang.mk33
-rw-r--r--tools/driver/Android.mk8
-rw-r--r--utils/TableGen/Android.mk8
4 files changed, 32 insertions, 19 deletions
diff --git a/clang-host-build.mk b/clang-host-build.mk
index 9cd2bf4bbb..afdd0230bd 100644
--- a/clang-host-build.mk
+++ b/clang-host-build.mk
@@ -27,6 +27,8 @@ LOCAL_C_INCLUDES := \
$(CLANG_ROOT_PATH)/lib/CodeGen \
$(LOCAL_C_INCLUDES)
+LOCAL_MODULE_HOST_OS := darwin linux windows
+
LLVM_ROOT_PATH := external/llvm
include $(LLVM_ROOT_PATH)/llvm.mk
diff --git a/shared_clang.mk b/shared_clang.mk
index 151a626ea4..8b81d168d3 100644
--- a/shared_clang.mk
+++ b/shared_clang.mk
@@ -1,5 +1,3 @@
-# Don't build the library unless forced to.
-ifeq (true,$(FORCE_BUILD_LLVM_COMPONENTS))
# Don't build the library in unbundled branches.
ifeq (,$(TARGET_BUILD_APPS))
@@ -33,17 +31,34 @@ LOCAL_MODULE:= libclang
LOCAL_MODULE_TAGS := optional
LOCAL_WHOLE_STATIC_LIBRARIES := $(clang_whole_static_libraries)
+LOCAL_SHARED_LIBRARIES := libLLVM
+
+LOCAL_LDLIBS_windows := -limagehlp -lpsapi
+
+LOCAL_SHARED_LIBRARIES_darwin := libc++
+LOCAL_SHARED_LIBRARIES_linux := libc++
+LOCAL_LDLIBS_darwin := -ldl -lpthread
+LOCAL_LDLIBS_linux := -ldl -lpthread
+
+include $(CLANG_HOST_BUILD_MK)
+
+# Don't build the library unless forced to. We don't
+# have prebuilts for windows.
+ifneq (true,$(FORCE_BUILD_LLVM_COMPONENTS))
+LOCAL_MODULE_HOST_OS := windows
+# BUILD_HOST_SHARED_LIBRARY can be moved out once
+# LOCAL_MODULE_HOST_OS is enforced.
ifeq ($(HOST_OS),windows)
- LOCAL_SHARED_LIBRARIES := libLLVM
- LOCAL_LDLIBS := -limagehlp -lpsapi
+include $(BUILD_HOST_SHARED_LIBRARY)
+endif
else
- LOCAL_SHARED_LIBRARIES := libLLVM libc++
- LOCAL_LDLIBS := -ldl -lpthread
+LOCAL_MODULE_HOST_OS := darwin linux windows
+include $(BUILD_HOST_SHARED_LIBRARY)
endif
-include $(CLANG_HOST_BUILD_MK)
-include $(BUILD_HOST_SHARED_LIBRARY)
+# Don't build the library unless forced to.
+ifeq (true,$(FORCE_BUILD_LLVM_COMPONENTS))
# device
include $(CLEAR_VARS)
@@ -56,6 +71,6 @@ LOCAL_LDLIBS := -ldl
include $(CLANG_DEVICE_BUILD_MK)
include $(BUILD_SHARED_LIBRARY)
+endif # don't build unless forced to
endif # don't build in unbundled branches
-endif # don't build unless forced to
diff --git a/tools/driver/Android.mk b/tools/driver/Android.mk
index 30d931fd7e..f851bd1379 100644
--- a/tools/driver/Android.mk
+++ b/tools/driver/Android.mk
@@ -97,11 +97,9 @@ LOCAL_STATIC_LIBRARIES := \
libLLVMSupport
LOCAL_LDLIBS += -lm
-ifdef USE_MINGW
-LOCAL_LDLIBS += -limagehlp
-else
-LOCAL_LDLIBS += -lpthread -ldl
-endif
+LOCAL_LDLIBS_windows := -limagehlp
+LOCAL_LDLIBS_darwin := -lpthread -ldl
+LOCAL_LDLIBS_linux := -lpthread -ldl
# remove when we can use PIE binaries in all places again
LOCAL_NO_FPIE := true
diff --git a/utils/TableGen/Android.mk b/utils/TableGen/Android.mk
index 4a40dc8543..0b9f09d102 100644
--- a/utils/TableGen/Android.mk
+++ b/utils/TableGen/Android.mk
@@ -25,11 +25,9 @@ LOCAL_STATIC_LIBRARIES := \
libLLVMSupport
LOCAL_LDLIBS += -lm
-ifeq ($(HOST_OS),windows)
- LOCAL_LDLIBS += -limagehlp -lpsapi
-else
- LOCAL_LDLIBS += -lpthread -ldl
-endif
+LOCAL_LDLIBS_windows := -limagehlp -lpsapi
+LOCAL_LDLIBS_darwin := -lpthread -ldl
+LOCAL_LDLIBS_linux := -lpthread -ldl
include $(LLVM_HOST_BUILD_MK)
include $(BUILD_HOST_EXECUTABLE)