summaryrefslogtreecommitdiffstats
path: root/core/package.mk
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2014-04-10 11:29:05 -0700
committerColin Cross <ccross@android.com>2014-04-10 20:44:24 -0700
commit1750944332ea4e461383bcf79614b46cdfb047fa (patch)
tree90c234b610162c3ee48762dc350a2a16c1bc6590 /core/package.mk
parentdc1c95aa2096367b78512025e59c50ebe99bc263 (diff)
downloadbuild-1750944332ea4e461383bcf79614b46cdfb047fa.zip
build-1750944332ea4e461383bcf79614b46cdfb047fa.tar.gz
build-1750944332ea4e461383bcf79614b46cdfb047fa.tar.bz2
build: use TARGET_SUPPORTS_32_BIT_APPS and TARGET_SUPPORTS_64_BIT_APPS
Use TARGET_SUPPORTS_32_BIT_APPS and TARGET_SUPPORTS_64_BIT_APPS to determine which native libraries to build for an app. If both are set, it will use 64-bit unless TARGET_PREFER_32_BIT is set. If only one is set, it will only build apps that work on that architecture. If neither is set it will fall back to only building 32-bit apps. On existing 32-bit devices neither variable will be set, and the build system will continue to build 32-bit apps. Once a device has support for a 64-bit runtime, the same logic that selects the dual runtimes should set TARGET_SUPPORTS_32_BIT_APPS and TARGET_SUPPORTS_64_BIT_APPS, and packages will be built for the preferred arch, or fall back to the non-preferrred arch if necessary. For testing, a device may set TARGET_SUPPORTS_64_BIT_APPS without TARGET_SUPPORTS_32_BIT_APPS to produce only 64-bit apps. Change-Id: I5b5e23f15602c3cf9bd96791971208a85492c7a3
Diffstat (limited to 'core/package.mk')
-rw-r--r--core/package.mk33
1 files changed, 33 insertions, 0 deletions
diff --git a/core/package.mk b/core/package.mk
index 46bf614..fe4d0e4 100644
--- a/core/package.mk
+++ b/core/package.mk
@@ -5,6 +5,39 @@
include $(BUILD_SYSTEM)/multilib.mk
+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
+
LOCAL_NO_2ND_ARCH_MODULE_SUFFIX := true
# if TARGET_PREFER_32_BIT is set, try to build 32-bit first