summaryrefslogtreecommitdiffstats
path: root/core/prebuilt_internal.mk
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2015-05-01 14:02:26 -0700
committerYing Wang <wangying@google.com>2015-05-01 16:09:58 -0700
commit3797466fbd31cc3ca5a1eddea64e7fdf0921ea67 (patch)
tree887ad604498355e96f2287e5d5ab7c28be0ee2d5 /core/prebuilt_internal.mk
parent069f1f8942bf89817b064506495f6ab181548b55 (diff)
downloadbuild-3797466fbd31cc3ca5a1eddea64e7fdf0921ea67.zip
build-3797466fbd31cc3ca5a1eddea64e7fdf0921ea67.tar.gz
build-3797466fbd31cc3ca5a1eddea64e7fdf0921ea67.tar.bz2
Don't extract jni from prebuilt apks.
- We don't need LOCAL_PAGE_ALIGN_JNI_SHARED_LIBRARIES now, for we always page-align jni shared libraries and store them umcompressed. - For prebuilt apks, we don't extract jni any more; Instead we always run uncompress-shared-libs on them. - For apks built from source, we still install the jni separately, because that way multiple apks can share the same jni and it saves space. With this change, for most prebuilt apks, we don't need to specify LOCAL_PREBUILT_JNI_LIBS ("@lib/<abi>/foo.so") any more, for the build system automatically replaces the embedded jni with uncompressed files; But if a prebuilt is a fat apk (i.e. containing jni not needed by the current product architecture), you still need LOCAL_PREBUILT_JNI_LIBS to specify what jni to keep. Otherwise all embedded jni will be replaced with uncompressed files, that wastes space. Bug: 8076853 Change-Id: Icf07e0998ac3602e6e05e80fed836fbafca33e01
Diffstat (limited to 'core/prebuilt_internal.mk')
-rw-r--r--core/prebuilt_internal.mk14
1 files changed, 8 insertions, 6 deletions
diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk
index 8d03746..19fdad6 100644
--- a/core/prebuilt_internal.mk
+++ b/core/prebuilt_internal.mk
@@ -195,14 +195,18 @@ endif
include $(BUILD_SYSTEM)/dex_preopt_odex_install.mk
#######################################
# Sign and align non-presigned .apks.
-$(built_module) : PRIVATE_PAGE_ALIGN_JNI_SHARED_LIBRARIES := $(LOCAL_PAGE_ALIGN_JNI_SHARED_LIBRARIES)
+
+# The embedded prebuilt jni to uncompress.
+ifndef embedded_prebuilt_jni_libs
+# No LOCAL_PREBUILT_JNI_LIBS, uncompress all.
+embedded_prebuilt_jni_libs := 'lib/*.so'
+endif
+$(built_module): PRIVATE_EMBEDDED_JNI_LIBS := $(embedded_prebuilt_jni_libs)
+
$(built_module) : $(my_prebuilt_src_file) | $(ACP) $(ZIPALIGN) $(SIGNAPK_JAR)
$(transform-prebuilt-to-target)
ifneq ($(LOCAL_CERTIFICATE),PRESIGNED)
@# Only strip out files if we can re-sign the package.
-ifdef extracted_jni_libs
- $(hide) zip -d $@ 'lib/*.so' # strip embedded JNI libraries.
-endif
ifdef LOCAL_DEX_PREOPT
ifneq (nostripping,$(LOCAL_DEX_PREOPT))
$(call dexpreopt-remove-classes.dex,$@)
@@ -210,9 +214,7 @@ endif
endif
$(sign-package)
endif
-ifeq ($(LOCAL_PAGE_ALIGN_JNI_SHARED_LIBRARIES),true)
$(uncompress-shared-libs)
-endif
$(align-package)
###############################