From 6c930fc1c954b1eee163ae49206406b40614f356 Mon Sep 17 00:00:00 2001 From: Ying Wang Date: Thu, 27 Feb 2014 14:10:53 -0800 Subject: [PATCH] Select src arch for prebuilts. Change-Id: I2d08f923d28d59cfef93ff0bd9893352baaee60b --- core/definitions.mk | 7 +++++++ core/prebuilt_internal.mk | 8 ++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/core/definitions.mk b/core/definitions.mk index d2dc3a6167..399eb421bd 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -2145,6 +2145,13 @@ define include-if-build-from-source $(if $(call if-build-from-source,$(2),$(3)),$(eval include $(1))) endef +## Return the arch for the source file of a prebuilt +# $(1) the list of archs supported by the prebuilt +define get-prebuilt-src-arch +$(strip $(if $(filter $(TARGET_ARCH),$(1)),$(TARGET_ARCH),\ + $(if $(filter $(TARGET_2ND_ARCH),$(1)),$(TARGET_2ND_ARCH)))) +endef + ########################################################### ## Other includes ########################################################### diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk index 01e0954bd1..51440c41a1 100644 --- a/core/prebuilt_internal.mk +++ b/core/prebuilt_internal.mk @@ -20,9 +20,13 @@ endif LOCAL_DONT_CHECK_MODULE := true ifdef LOCAL_PREBUILT_MODULE_FILE -my_prebuilt_src_file := $(LOCAL_PREBUILT_MODULE_FILE) + my_prebuilt_src_file := $(LOCAL_PREBUILT_MODULE_FILE) else -my_prebuilt_src_file := $(LOCAL_PATH)/$(LOCAL_SRC_FILES) + ifdef LOCAL_SRC_FILES_$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH) + my_prebuilt_src_file := $(LOCAL_PATH)/$(LOCAL_SRC_FILES_$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) + else + my_prebuilt_src_file := $(LOCAL_PATH)/$(LOCAL_SRC_FILES) + endif endif ifdef LOCAL_IS_HOST_MODULE