2014-02-06 23:45:37 +01:00
|
|
|
# We don't automatically set up rules to build packages for both
|
|
|
|
# TARGET_ARCH and TARGET_2ND_ARCH.
|
2014-03-21 20:29:32 +01:00
|
|
|
# To build it for TARGET_2ND_ARCH in a 64bit product, use "LOCAL_MULTILIB := 32".
|
|
|
|
|
2016-03-17 03:53:19 +01:00
|
|
|
ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
|
|
|
|
LOCAL_MULTILIB := first
|
|
|
|
endif
|
|
|
|
|
2014-04-17 19:03:35 +02:00
|
|
|
my_prefix := TARGET_
|
2014-03-21 20:29:32 +01:00
|
|
|
include $(BUILD_SYSTEM)/multilib.mk
|
|
|
|
|
2014-04-10 20:29:05 +02:00
|
|
|
ifeq ($(TARGET_SUPPORTS_32_BIT_APPS)|$(TARGET_SUPPORTS_64_BIT_APPS),true|true)
|
|
|
|
# packages default to building for either architecture,
|
|
|
|
# the preferred if its supported, otherwise the non-preferred.
|
|
|
|
else ifeq ($(TARGET_SUPPORTS_64_BIT_APPS),true)
|
|
|
|
# only 64-bit apps supported
|
|
|
|
ifeq ($(filter $(my_module_multilib),64 both first),$(my_module_multilib))
|
|
|
|
# if my_module_multilib was 64, both, first, or unset, build for 64-bit
|
|
|
|
my_module_multilib := 64
|
|
|
|
else
|
|
|
|
# otherwise don't build this app
|
|
|
|
my_module_multilib := none
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
# only 32-bit apps supported
|
|
|
|
ifeq ($(filter $(my_module_multilib),32 both),$(my_module_multilib))
|
|
|
|
# if my_module_multilib was 32, both, or unset, build for 32-bit
|
|
|
|
my_module_multilib := 32
|
|
|
|
else ifeq ($(my_module_multilib),first)
|
|
|
|
ifndef TARGET_IS_64_BIT
|
|
|
|
# if my_module_multilib was first and this is a 32-bit build, build for
|
|
|
|
# 32-bit
|
|
|
|
my_module_multilib := 32
|
|
|
|
else
|
|
|
|
# if my_module_multilib was first and this is a 64-bit build, don't build
|
|
|
|
# this app
|
|
|
|
my_module_multilib := none
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
# my_module_mulitlib was 64 or none, don't build this app
|
|
|
|
my_module_multilib := none
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2014-02-04 20:16:16 +01:00
|
|
|
LOCAL_NO_2ND_ARCH_MODULE_SUFFIX := true
|
|
|
|
|
2014-05-01 03:09:13 +02:00
|
|
|
# if TARGET_PREFER_32_BIT_APPS is set, try to build 32-bit first
|
2014-04-10 21:28:56 +02:00
|
|
|
ifdef TARGET_2ND_ARCH
|
2014-05-01 03:09:13 +02:00
|
|
|
ifeq ($(TARGET_PREFER_32_BIT_APPS),true)
|
2014-04-10 21:28:56 +02:00
|
|
|
LOCAL_2ND_ARCH_VAR_PREFIX := $(TARGET_2ND_ARCH_VAR_PREFIX)
|
|
|
|
else
|
2014-02-06 23:45:37 +01:00
|
|
|
LOCAL_2ND_ARCH_VAR_PREFIX :=
|
2014-04-10 21:28:56 +02:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
# check if preferred arch is supported
|
2014-02-06 23:45:37 +01:00
|
|
|
include $(BUILD_SYSTEM)/module_arch_supported.mk
|
|
|
|
ifeq ($(my_module_arch_supported),true)
|
2014-03-21 20:29:32 +01:00
|
|
|
# first arch is supported
|
2014-02-06 23:45:37 +01:00
|
|
|
include $(BUILD_SYSTEM)/package_internal.mk
|
|
|
|
else ifneq (,$(TARGET_2ND_ARCH))
|
2014-04-10 21:28:56 +02:00
|
|
|
# check if the non-preferred arch is the primary or secondary
|
2014-05-01 03:09:13 +02:00
|
|
|
ifeq ($(TARGET_PREFER_32_BIT_APPS),true)
|
2014-04-10 21:28:56 +02:00
|
|
|
LOCAL_2ND_ARCH_VAR_PREFIX :=
|
|
|
|
else
|
2014-02-06 23:45:37 +01:00
|
|
|
LOCAL_2ND_ARCH_VAR_PREFIX := $(TARGET_2ND_ARCH_VAR_PREFIX)
|
2014-04-10 21:28:56 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
# check if non-preferred arch is supported
|
2014-02-06 23:45:37 +01:00
|
|
|
include $(BUILD_SYSTEM)/module_arch_supported.mk
|
|
|
|
ifeq ($(my_module_arch_supported),true)
|
|
|
|
# secondary arch is supported
|
|
|
|
include $(BUILD_SYSTEM)/package_internal.mk
|
2012-05-25 06:05:19 +02:00
|
|
|
endif
|
2014-02-06 23:45:37 +01:00
|
|
|
endif # TARGET_2ND_ARCH
|
2009-03-04 04:28:42 +01:00
|
|
|
|
2014-02-06 23:45:37 +01:00
|
|
|
LOCAL_2ND_ARCH_VAR_PREFIX :=
|
2014-02-04 20:16:16 +01:00
|
|
|
LOCAL_NO_2ND_ARCH_MODULE_SUFFIX :=
|
|
|
|
|
2014-02-06 23:45:37 +01:00
|
|
|
my_module_arch_supported :=
|