summaryrefslogtreecommitdiffstats
path: root/core/dex_preopt_odex_install.mk
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2014-10-07 18:07:23 -0700
committerYing Wang <wangying@google.com>2014-10-08 10:11:17 -0700
commit20ebd2ef081f2a3e85a4adcf8837e6f5b68bdeea (patch)
tree45fdf7653c684c49a6d53d1bf04f459edefb336f /core/dex_preopt_odex_install.mk
parent8330c4c5e6f8bb8b64e1b45ceed603b49853a086 (diff)
downloadbuild-20ebd2ef081f2a3e85a4adcf8837e6f5b68bdeea.zip
build-20ebd2ef081f2a3e85a4adcf8837e6f5b68bdeea.tar.gz
build-20ebd2ef081f2a3e85a4adcf8837e6f5b68bdeea.tar.bz2
Introduce per-product per-module dex-preopt config
- Added LOCAL_DEX_PREOPT_FLAGS to pass extra flags to dex2oat. - Added macro add-product-dex-preopt-module-config to specify almost arbitrary dex-preopt config/flags to modules in product configuration: $(call \ add-product-dex-preopt-module-config,<module_name_list>,<config_or_flags>) How <config_or_flags> is interpreted is decided by dex_preopt_odex_install.mk and dex2oat. For now if it's "disable" we disable dexpreopt for the given modules; otherwise pass it to dex2oat as command line flags. - If there are multiple configs for the same module in the product inheritance, the first takes precedence. - Added PRODUCT_DEX_PREOPT_DEFAULT_FLAGS so you can specify default dex2oat flags in product configuration. - Added PRODUCT_DEX_PREOPT_BOOT_FLAGS to specify flags of building boot.oat. Bug: 17791867 Change-Id: I1b2955e8e51039e94d1ff43a3265a8d03598632c
Diffstat (limited to 'core/dex_preopt_odex_install.mk')
-rw-r--r--core/dex_preopt_odex_install.mk15
1 files changed, 14 insertions, 1 deletions
diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk
index 28282ec..d4484ca 100644
--- a/core/dex_preopt_odex_install.mk
+++ b/core/dex_preopt_odex_install.mk
@@ -11,7 +11,12 @@ else # WITH_DEXPREOPT=true
ifndef LOCAL_DEX_PREOPT # LOCAL_DEX_PREOPT undefined
ifneq ($(filter $(TARGET_OUT)/%,$(my_module_path)),) # Installed to system.img.
ifeq (,$(LOCAL_APK_LIBRARIES)) # LOCAL_APK_LIBRARIES empty
- LOCAL_DEX_PREOPT := $(DEX_PREOPT_DEFAULT)
+ # If we have product-specific config for this module?
+ ifeq (disable,$(DEXPREOPT.$(TARGET_PRODUCT).$(LOCAL_MODULE).CONFIG))
+ LOCAL_DEX_PREOPT := false
+ else
+ LOCAL_DEX_PREOPT := $(DEX_PREOPT_DEFAULT)
+ endif
else # LOCAL_APK_LIBRARIES not empty
LOCAL_DEX_PREOPT := nostripping
endif # LOCAL_APK_LIBRARIES not empty
@@ -94,6 +99,14 @@ endif # libart
endif # boot jar
ifdef built_odex
+ifndef LOCAL_DEX_PREOPT_FLAGS
+LOCAL_DEX_PREOPT_FLAGS := $(DEXPREOPT.$(TARGET_PRODUCT).$(LOCAL_MODULE).CONFIG)
+ifndef LOCAL_DEX_PREOPT_FLAGS
+LOCAL_DEX_PREOPT_FLAGS := $(PRODUCT_DEX_PREOPT_DEFAULT_FLAGS)
+endif
+endif
+$(built_odex): PRIVATE_DEX_PREOPT_FLAGS := $(LOCAL_DEX_PREOPT_FLAGS)
+
# Use pattern rule - we may have multiple installed odex files.
# Ugly syntax - See the definition get-odex-file-path.
$(installed_odex) : $(dir $(LOCAL_INSTALLED_MODULE))%$(notdir $(word 1,$(installed_odex))) \