summaryrefslogtreecommitdiffstats
path: root/core/product.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-31 10:12:54 -0700
commit70d617aaf57c636ca7b6aedee5b009a7c46bdd3a (patch)
tree37e7a1566694f0f46b9472c6f0498894f3b704f2 /core/product.mk
parentc9594afa930e5400d35bbf24a17cb9be8d978888 (diff)
downloadbuild-70d617aaf57c636ca7b6aedee5b009a7c46bdd3a.zip
build-70d617aaf57c636ca7b6aedee5b009a7c46bdd3a.tar.gz
build-70d617aaf57c636ca7b6aedee5b009a7c46bdd3a.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 (cherry picked from commit 20ebd2ef081f2a3e85a4adcf8837e6f5b68bdeea) Change-Id: I2ee36892b40655c96837ee7a663dda1d25830878
Diffstat (limited to 'core/product.mk')
-rw-r--r--core/product.mk19
1 files changed, 17 insertions, 2 deletions
diff --git a/core/product.mk b/core/product.mk
index 0075acd..ed906cb 100644
--- a/core/product.mk
+++ b/core/product.mk
@@ -100,14 +100,18 @@ _product_var_list := \
PRODUCT_FACTORY_BUNDLE_MODULES \
PRODUCT_RUNTIMES \
PRODUCT_BOOT_JARS \
- PRODUCT_DEX_PREOPT_IMAGE_IN_DATA \
PRODUCT_SUPPORTS_VERITY \
PRODUCT_OEM_PROPERTIES \
PRODUCT_SYSTEM_PROPERTY_BLACKLIST \
PRODUCT_SYSTEM_SERVER_JARS \
PRODUCT_VERITY_SIGNING_KEY \
PRODUCT_SYSTEM_VERITY_PARTITION \
- PRODUCT_VENDOR_VERITY_PARTITION
+ PRODUCT_VENDOR_VERITY_PARTITION \
+ PRODUCT_DEX_PREOPT_IMAGE_IN_DATA \
+ PRODUCT_DEX_PREOPT_MODULE_CONFIGS \
+ PRODUCT_DEX_PREOPT_DEFAULT_FLAGS \
+ PRODUCT_DEX_PREOPT_BOOT_FLAGS \
+
define dump-product
$(info ==== $(1) ====)\
@@ -299,3 +303,14 @@ endef
define add-to-product-copy-files-if-exists
$(if $(wildcard $(word 1,$(subst :, ,$(1)))),$(1))
endef
+
+# whitespace placeholder when we record module's dex-preopt config.
+_PDPMC_SP_PLACE_HOLDER := |@SP@|
+# Set up dex-preopt config for a module.
+# $(1) list of module names
+# $(2) the modules' dex-preopt config
+define add-product-dex-preopt-module-config
+$(eval _c := $(subst $(space),$(_PDPMC_SP_PLACE_HOLDER),$(strip $(2))))\
+$(eval PRODUCT_DEX_PREOPT_MODULE_CONFIGS += \
+ $(foreach m,$(1),$(m)=$(_c)))
+endef