Don't include system/core/include/arch/<arch>/Android.mk for apps-only build.

Bug: 6994483
Change-Id: I76c4d96264cf94a79d59fdeb52bb37c07a9458dd
This commit is contained in:
Ying Wang 2012-08-16 16:45:01 -07:00
parent bc415dd5eb
commit da4bf42514
6 changed files with 38 additions and 35 deletions

View File

@ -161,31 +161,29 @@ LOCAL_ASFLAGS += -D__ASSEMBLY__
###########################################################
## Define PRIVATE_ variables from global vars
###########################################################
ifeq ($(strip $(LOCAL_CLANG)),true)
my_target_global_cflags := $(TARGET_GLOBAL_CLANG_FLAGS)
else
my_target_global_cflags := $(TARGET_GLOBAL_CFLAGS)
endif
ifdef LOCAL_SDK_VERSION
my_target_project_includes :=
my_target_c_includes := $(my_ndk_stl_include_path) $(my_ndk_version_root)/usr/include
# TODO: more reliable way to remove platform stuff.
my_target_global_cflags := $(filter-out -include -I system/%, $(my_target_global_cflags))
my_target_global_cppflags := $(filter-out -include -I system/%, $(TARGET_GLOBAL_CPPFLAGS))
# filter out including of AndroidConfig.h in system/core.
TARGET_GLOBAL_CFLAGS_NO_ANDCONF ?= $(subst $(TARGET_ANDROID_CONFIG_CFLAGS),,\
$(TARGET_GLOBAL_CFLAGS))
my_target_global_cflags := $(TARGET_GLOBAL_CFLAGS_NO_ANDCONF)
else
my_target_project_includes := $(TARGET_PROJECT_INCLUDES)
my_target_c_includes := $(TARGET_C_INCLUDES)
my_target_global_cflags := $(my_target_global_cflags)
my_target_global_cppflags := $(TARGET_GLOBAL_CPPFLAGS)
ifeq ($(strip $(LOCAL_CLANG)),true)
my_target_c_includes += $(CLANG_CONFIG_EXTRA_TARGET_C_INCLUDES)
endif
endif
my_target_global_cflags := $(TARGET_GLOBAL_CLANG_FLAGS)
else
my_target_global_cflags := $(TARGET_GLOBAL_CFLAGS)
endif # LOCAL_CLANG
endif # LOCAL_SDK_VERSION
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_PROJECT_INCLUDES := $(my_target_project_includes)
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_C_INCLUDES := $(my_target_c_includes)
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_GLOBAL_CFLAGS := $(my_target_global_cflags)
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_GLOBAL_CPPFLAGS := $(my_target_global_cppflags)
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_GLOBAL_CPPFLAGS := $(TARGET_GLOBAL_CPPFLAGS)
###########################################################
## Define PRIVATE_ variables used by multiple module types

View File

@ -64,8 +64,10 @@ HOST_STRIP_COMMAND = $(HOST_STRIP) --strip-debug $< -o $@
HOST_SHLIB_SUFFIX := .dylib
HOST_JNILIB_SUFFIX := .jnilib
ifeq (,$(TARGET_BUILD_APPS))
HOST_GLOBAL_CFLAGS += \
-include $(call select-android-config-h,darwin-x86)
endif
ifneq ($(filter 10.7 10.7.% 10.8 10.8.%, $(build_mac_version)),)
HOST_RUN_RANLIB_AFTER_COPYING := false
else

View File

@ -58,8 +58,10 @@ HOST_GLOBAL_LDFLAGS += -static
endif # BUILD_HOST_static
HOST_GLOBAL_CFLAGS += -fPIC
ifeq (,$(TARGET_BUILD_APPS))
HOST_GLOBAL_CFLAGS += \
-include $(call select-android-config-h,linux-x86)
endif
# Disable new longjmp in glibc 2.11 and later. See bug 2967937.
HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0

View File

@ -98,9 +98,6 @@ ifeq ($(FORCE_ARM_DEBUGGING),true)
TARGET_thumb_CFLAGS += -marm -fno-omit-frame-pointer
endif
android_config_h := $(call select-android-config-h,linux-arm)
arch_include_dir := $(dir $(android_config_h))
TARGET_GLOBAL_CFLAGS += \
-msoft-float -fpic -fPIE \
-ffunction-sections \
@ -111,9 +108,11 @@ TARGET_GLOBAL_CFLAGS += \
-Werror=format-security \
-D_FORTIFY_SOURCE=1 \
-fno-short-enums \
$(arch_variant_cflags) \
-include $(android_config_h) \
-I $(arch_include_dir)
$(arch_variant_cflags)
android_config_h := $(call select-android-config-h,linux-arm)
TARGET_ANDROID_CONFIG_CFLAGS := -include $(android_config_h) -I $(dir $(android_config_h))
TARGET_GLOBAL_CFLAGS += $(TARGET_ANDROID_CONFIG_CFLAGS)
# This warning causes dalvik not to build with gcc 4.6.x and -Werror.
# We cannot turn it off blindly since the option is not available

View File

@ -78,9 +78,6 @@ ifeq ($(FORCE_MIPS_DEBUGGING),true)
TARGET_mips_CFLAGS += -fno-omit-frame-pointer
endif
android_config_h := $(call select-android-config-h,linux-mips)
arch_include_dir := $(dir $(android_config_h))
TARGET_GLOBAL_CFLAGS += \
$(TARGET_mips_CFLAGS) \
-Ulinux -U__unix -U__unix__ -Umips \
@ -89,9 +86,11 @@ TARGET_GLOBAL_CFLAGS += \
-fdata-sections \
-funwind-tables \
-Werror=format-security \
$(arch_variant_cflags) \
-include $(android_config_h) \
-I $(arch_include_dir)
$(arch_variant_cflags)
android_config_h := $(call select-android-config-h,linux-mips)
TARGET_ANDROID_CONFIG_CFLAGS := -include $(android_config_h) -I $(dir $(android_config_h))
TARGET_GLOBAL_CFLAGS += $(TARGET_ANDROID_CONFIG_CFLAGS)
# This warning causes dalvik not to build with gcc 4.6.x and -Werror.
# We cannot turn it off blindly since the option is not available

View File

@ -93,8 +93,11 @@ TARGET_GLOBAL_CFLAGS += \
-fno-short-enums \
-fstrict-aliasing \
-funswitch-loops \
-funwind-tables \
-include $(call select-android-config-h,target_linux-x86)
-funwind-tables
android_config_h := $(call select-android-config-h,target_linux-x86)
TARGET_ANDROID_CONFIG_CFLAGS := -include $(android_config_h) -I $(dir $(android_config_h))
TARGET_GLOBAL_CFLAGS += $(TARGET_ANDROID_CONFIG_CFLAGS)
# XXX: Not sure this is still needed. Must check with our toolchains.
TARGET_GLOBAL_CPPFLAGS += \