OSDN Git Service

am 8ccad4af: Merge "Prepare for the removal of HAVE_MALLOC_H from AndroidConfig.h."
[android-x86/external-llvm.git] / llvm-host-build.mk
index 4ab911b..3093f58 100644 (file)
@@ -1,20 +1,27 @@
+# Windows can't use Clang to build yet
+ifneq ($(HOST_OS),windows)
 LOCAL_CLANG := true
+endif
 
-include external/libcxx/libcxx.mk
+ifeq ($(FORCE_BUILD_LLVM_DEBUG),true)
+local_optflags = -O0 -g
+else
+local_optflags = -O2
+endif
 
 LOCAL_CFLAGS +=        \
        -D_GNU_SOURCE   \
        -D__STDC_LIMIT_MACROS   \
-       -O2     \
+       $(local_optflags)       \
        -fomit-frame-pointer    \
        -Wall   \
        -W      \
        -Wno-unused-parameter   \
        -Wwrite-strings \
-        -Dsprintf=sprintf \
+       -Dsprintf=sprintf \
        $(LOCAL_CFLAGS)
 
-ifeq ($(LLVM_ENABLE_ASSERTION),true)
+ifeq ($(FORCE_BUILD_LLVM_DISABLE_NDEBUG),true)
 LOCAL_CFLAGS :=        \
        $(LOCAL_CFLAGS) \
        -D_DEBUG        \
@@ -45,18 +52,31 @@ LOCAL_C_INCLUDES := \
        $(LLVM_ROOT_PATH)       \
        $(LLVM_ROOT_PATH)/include       \
        $(LLVM_ROOT_PATH)/host/include  \
-        external/libcxx/include \
        $(LOCAL_C_INCLUDES)
 
+# Add on ncurses to have support for terminfo
+ifneq ($(HOST_OS),windows)
+LOCAL_LDLIBS += -lncurses
+ifneq ($(HOST_OS),darwin)
+LOCAL_LDLIBS += -lgcc_s
+endif
+endif
+
 LOCAL_IS_HOST_MODULE := true
 
+ifeq ($(HOST_PREFER_32_BIT),true)
+LOCAL_MULTILIB := 32
+else
+LOCAL_MULTILIB := first
+endif
+
 ###########################################################
 ## Commands for running tblgen to compile a td file
 ###########################################################
 define transform-host-td-to-out
 @mkdir -p $(dir $@)
 @echo "Host TableGen: $(TBLGEN_LOCAL_MODULE) (gen-$(1)) <= $<"
-$(hide) $(TBLGEN) \
+$(hide) $(LLVM_TBLGEN) \
        -I $(dir $<)    \
        -I $(LLVM_ROOT_PATH)/include    \
        -I $(LLVM_ROOT_PATH)/host/include       \