blob: 46bf614b2022a74eabf33fb7c2f1cd8e77769aee [file] [log] [blame]
Colin Cross8e404122014-02-06 14:45:37 -08001# We don't automatically set up rules to build packages for both
2# TARGET_ARCH and TARGET_2ND_ARCH.
3# By default, an package is built for TARGET_ARCH.
Colin Crosse6e48f62014-03-21 12:29:32 -07004# To build it for TARGET_2ND_ARCH in a 64bit product, use "LOCAL_MULTILIB := 32".
5
6include $(BUILD_SYSTEM)/multilib.mk
7
Colin Cross58d879f2014-02-04 11:16:16 -08008LOCAL_NO_2ND_ARCH_MODULE_SUFFIX := true
9
Colin Crossd3624d52014-04-10 12:28:56 -070010# if TARGET_PREFER_32_BIT is set, try to build 32-bit first
11ifdef TARGET_2ND_ARCH
12ifeq ($(TARGET_PREFER_32_BIT),true)
13LOCAL_2ND_ARCH_VAR_PREFIX := $(TARGET_2ND_ARCH_VAR_PREFIX)
14else
Colin Cross8e404122014-02-06 14:45:37 -080015LOCAL_2ND_ARCH_VAR_PREFIX :=
Colin Crossd3624d52014-04-10 12:28:56 -070016endif
17endif
18
19# check if preferred arch is supported
Colin Cross8e404122014-02-06 14:45:37 -080020include $(BUILD_SYSTEM)/module_arch_supported.mk
21ifeq ($(my_module_arch_supported),true)
Colin Crosse6e48f62014-03-21 12:29:32 -070022# first arch is supported
Colin Cross8e404122014-02-06 14:45:37 -080023include $(BUILD_SYSTEM)/package_internal.mk
24else ifneq (,$(TARGET_2ND_ARCH))
Colin Crossd3624d52014-04-10 12:28:56 -070025# check if the non-preferred arch is the primary or secondary
26ifeq ($(TARGET_PREFER_32_BIT),true)
27LOCAL_2ND_ARCH_VAR_PREFIX :=
28else
Colin Cross8e404122014-02-06 14:45:37 -080029LOCAL_2ND_ARCH_VAR_PREFIX := $(TARGET_2ND_ARCH_VAR_PREFIX)
Colin Crossd3624d52014-04-10 12:28:56 -070030endif
31
32# check if non-preferred arch is supported
Colin Cross8e404122014-02-06 14:45:37 -080033include $(BUILD_SYSTEM)/module_arch_supported.mk
34ifeq ($(my_module_arch_supported),true)
35# secondary arch is supported
36include $(BUILD_SYSTEM)/package_internal.mk
Joe Onorato899e62a2010-02-04 17:37:21 -080037endif
Colin Cross8e404122014-02-06 14:45:37 -080038endif # TARGET_2ND_ARCH
Colin Cross58d879f2014-02-04 11:16:16 -080039
Colin Cross2343cfb2014-01-24 13:33:39 -080040LOCAL_2ND_ARCH_VAR_PREFIX :=
Colin Cross8e404122014-02-06 14:45:37 -080041LOCAL_NO_2ND_ARCH_MODULE_SUFFIX :=
42
43my_module_arch_supported :=