am ee803184: am f771489d: Merge "Tweak prelink map, more"
* commit 'ee8031843e4dc3e9ff60c1acdc516121145fece1':
Tweak prelink map, more
diff --git a/core/prebuilt.mk b/core/prebuilt.mk
index f5eebc8..8f9eafb 100644
--- a/core/prebuilt.mk
+++ b/core/prebuilt.mk
@@ -16,6 +16,16 @@
$(error dont use LOCAL_PREBUILT_JAVA_LIBRARIES anymore LOCAL_PATH=$(LOCAL_PATH))
endif
+ifneq ($(filter APPS,$(LOCAL_MODULE_CLASS)),)
+ifeq (true,$(WITH_DEXPREOPT))
+ifeq (,$(TARGET_BUILD_APPS))
+ifndef LOCAL_DEX_PREOPT
+LOCAL_DEX_PREOPT := true
+endif
+endif
+endif
+endif
+
include $(BUILD_SYSTEM)/base_rules.mk
# Deal with the OSX library timestamp issue when installing
@@ -30,8 +40,20 @@
# Ensure that prebuilt .apks have been aligned.
ifneq ($(filter APPS,$(LOCAL_MODULE_CLASS)),)
+ifeq ($(LOCAL_DEX_PREOPT),true)
+# Make sure the boot jars get dexpreopt-ed first
+$(LOCAL_BUILT_MODULE): $(DEXPREOPT_BOOT_ODEXS) | $(DEXPREOPT) $(DEXOPT) $(AAPT)
+endif
$(LOCAL_BUILT_MODULE) : $(LOCAL_PATH)/$(LOCAL_SRC_FILES) | $(ZIPALIGN)
$(transform-prebuilt-to-target-with-zipalign)
+ifeq ($(LOCAL_DEX_PREOPT),true)
+ $(hide) rm -f $(patsubst %.apk,%.odex,$@)
+ $(call dexpreopt-one-file,$@,$(patsubst %.apk,%.odex,$@))
+ $(call dexpreopt-remove-classes.dex,$@)
+
+built_odex := $(basename $(LOCAL_BUILT_MODULE)).odex
+$(built_odex): $(LOCAL_BUILT_MODULE)
+endif
else
ifneq ($(LOCAL_PREBUILT_STRIP_COMMENTS),)
$(LOCAL_BUILT_MODULE) : $(LOCAL_PATH)/$(LOCAL_SRC_FILES)
diff --git a/envsetup.sh b/envsetup.sh
index c94ca7b..6b5f6b9 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -125,6 +125,9 @@
export ANDROID_PRODUCT_OUT=$(get_abs_build_var PRODUCT_OUT)
export OUT=$ANDROID_PRODUCT_OUT
+ unset ANDROID_HOST_OUT
+ export ANDROID_HOST_OUT=$(get_abs_build_var HOST_OUT)
+
# needed for building linux on MacOS
# TODO: fix the path
#export HOST_EXTRACFLAGS="-I "$T/system/kernel_headers/host_include