am 6ba4b59c: SDK: add hierarchyviewer2 to windows target list.
Merge commit '6ba4b59c9067b747ab2a4c85621e656c4d4614e3' into gingerbread-plus-aosp
* commit '6ba4b59c9067b747ab2a4c85621e656c4d4614e3':
SDK: add hierarchyviewer2 to windows target list.
diff --git a/core/Makefile b/core/Makefile
index 8303592..237ac5a 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -206,7 +206,12 @@
# but it should guarantee that the apkcerts file is rebuilt
# if any packages change which certs they're signed with.
all_built_packages := $(foreach p,$(PACKAGES),$(ALL_MODULES.$(p).BUILT))
+ifneq ($(TARGET_BUILD_APPS),)
+# We don't need to really build all the modules for apps_only build.
+$(APKCERTS_FILE):
+else
$(APKCERTS_FILE): $(all_built_packages)
+endif
@echo APK certs list: $@
@mkdir -p $(dir $@)
@rm -f $@
@@ -220,6 +225,8 @@
.PHONY: apkcerts-list
apkcerts-list: $(APKCERTS_FILE)
+$(call dist-for-goals, apps_only, $(APKCERTS_FILE):apkcerts.txt)
+
# -----------------------------------------------------------------
# module info file
ifdef CREATE_MODULE_INFO_FILE
@@ -252,8 +259,23 @@
.PHONY: event-log-tags
+# Produce an event logs tag file for everything we know about, in order
+# to properly allocate numbers. Then produce a file that's filtered
+# for what's going to be installed.
+
+all_event_log_tags_file := $(TARGET_OUT_COMMON_INTERMEDIATES)/all-event-log-tags.txt
+
+# Include tags from all packages that we know about
+all_event_log_tags_src := \
+ $(sort $(foreach m, $(ALL_MODULES), $(ALL_MODULES.$(m).EVENT_LOG_TAGS)))
+
+$(all_event_log_tags_file): PRIVATE_SRC_FILES := $(all_event_log_tags_src)
+$(all_event_log_tags_file): $(all_event_log_tags_src)
+ $(hide) mkdir -p $(dir $@)
+ $(hide) build/tools/merge-event-log-tags.py -o $@ $(PRIVATE_SRC_FILES)
+
+
event_log_tags_file := $(TARGET_OUT)/etc/event-log-tags
-ALL_PREBUILT += $(event_log_tag_file)
# Include tags from all packages included in this product.
event_log_tags_src := \
@@ -263,14 +285,16 @@
$(ALL_MODULES.$(m).EVENT_LOG_TAGS)))
$(event_log_tags_file): PRIVATE_SRC_FILES := $(event_log_tags_src)
-$(event_log_tags_file): $(event_log_tags_src)
+$(event_log_tags_file): PRIVATE_MERGED_FILE := $(all_event_log_tags_file)
+$(event_log_tags_file): $(event_log_tags_src) $(all_event_log_tags_file)
$(hide) mkdir -p $(dir $@)
- $(hide) build/tools/merge-event-log-tags.py -o $@ $(PRIVATE_SRC_FILES)
+ $(hide) build/tools/merge-event-log-tags.py -o $@ -m $(PRIVATE_MERGED_FILE) $(PRIVATE_SRC_FILES)
event-log-tags: $(event_log_tags_file)
ALL_DEFAULT_INSTALLED_MODULES += $(event_log_tags_file)
+
ifneq ($(TARGET_SIMULATOR),true)
# #################################################################
@@ -315,6 +339,11 @@
INTERNAL_BOOTIMAGE_ARGS += --base $(BOARD_KERNEL_BASE)
endif
+BOARD_KERNEL_PAGESIZE := $(strip $(BOARD_KERNEL_PAGESIZE))
+ifdef BOARD_KERNEL_PAGESIZE
+ INTERNAL_BOOTIMAGE_ARGS += --pagesize $(BOARD_KERNEL_PAGESIZE)
+endif
+
INSTALLED_BOOTIMAGE_TARGET := $(PRODUCT_OUT)/boot.img
ifeq ($(TARGET_BOOTIMAGE_USE_EXT2),true)
@@ -521,11 +550,38 @@
# Targets for user images
# #################################################################
+INTERNAL_USERIMAGES_EXT_VARIANT :=
ifeq ($(TARGET_USERIMAGES_USE_EXT2),true)
-include external/genext2fs/Config.mk
-INTERNAL_MKUSERFS := $(MKEXT2IMG)
+INTERNAL_USERIMAGES_USE_EXT := true
+INTERNAL_USERIMAGES_EXT_VARIANT := ext2
else
-INTERNAL_MKUSERFS := $(MKYAFFS2)
+ifeq ($(TARGET_USERIMAGES_USE_EXT3),true)
+INTERNAL_USERIMAGES_USE_EXT := true
+INTERNAL_USERIMAGES_EXT_VARIANT := ext3
+else
+ifeq ($(TARGET_USERIMAGES_USE_EXT4),true)
+INTERNAL_USERIMAGES_USE_EXT := true
+INTERNAL_USERIMAGES_EXT_VARIANT := ext4
+endif
+endif
+endif
+
+ifeq ($(INTERNAL_USERIMAGES_USE_EXT),true)
+INTERNAL_USERIMAGES_DEPS := $(MKEXT2USERIMG) $(MAKE_EXT4FS)
+INTERNAL_USERIMAGES_BINARY_PATHS := $(sort $(dir $(INTERNAL_USERIMAGES_DEPS)))
+
+# $(1): src directory
+# $(2): output file
+# $(3): label
+# $(4): ext variant (ext2, ext3, ext4)
+# $(5): size of the partition
+define build-userimage-ext-target
+ @mkdir -p $(dir $(2))
+ $(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$(PATH) \
+ $(MKEXT2USERIMG) $(1) $(2) $(4) $(3) $(5)
+endef
+else
+INTERNAL_USERIMAGES_DEPS := $(MKYAFFS2)
endif
# -----------------------------------------------------------------
@@ -562,6 +618,10 @@
ifdef BOARD_KERNEL_BASE
INTERNAL_RECOVERYIMAGE_ARGS += --base $(BOARD_KERNEL_BASE)
endif
+BOARD_KERNEL_PAGESIZE := $(strip $(BOARD_KERNEL_PAGESIZE))
+ifdef BOARD_KERNEL_PAGESIZE
+ INTERNAL_RECOVERYIMAGE_ARGS += --pagesize $(BOARD_KERNEL_PAGESIZE)
+endif
# Keys authorized to sign OTA packages this build will accept. The
# build always uses test-keys for this; release packaging tools will
@@ -640,15 +700,15 @@
$(ALL_GENERATED_SOURCES) \
$(ALL_DEFAULT_INSTALLED_MODULES))
-ifeq ($(TARGET_USERIMAGES_USE_EXT2),true)
+ifeq ($(INTERNAL_USERIMAGES_USE_EXT),true)
## generate an ext2 image
# $(1): output file
define build-systemimage-target
@echo "Target system fs image: $(1)"
- $(call build-userimage-ext2-target,$(TARGET_OUT),$(1),system,)
+ $(call build-userimage-ext-target,$(TARGET_OUT),$(1),system,$(INTERNAL_USERIMAGES_EXT_VARIANT),$(BOARD_SYSTEMIMAGE_PARTITION_SIZE))
endef
-else # TARGET_USERIMAGES_USE_EXT2 != true
+else # INTERNAL_USERIMAGES_USE_EXT != true
## generate a yaffs2 image
# $(1): output file
@@ -657,9 +717,9 @@
@mkdir -p $(dir $(1))
$(hide) $(MKYAFFS2) -f $(mkyaffs2_extra_flags) $(TARGET_OUT) $(1)
endef
-endif # TARGET_USERIMAGES_USE_EXT2
+endif # INTERNAL_USERIMAGES_USE_EXT
-$(BUILT_SYSTEMIMAGE_UNOPT): $(INTERNAL_SYSTEMIMAGE_FILES) $(INTERNAL_MKUSERFS)
+$(BUILT_SYSTEMIMAGE_UNOPT): $(INTERNAL_SYSTEMIMAGE_FILES) $(INTERNAL_USERIMAGES_DEPS)
$(call build-systemimage-target,$@)
# The installed image, which may be optimized or unoptimized.
@@ -706,7 +766,7 @@
.PHONY: systemimage-nodeps snod
systemimage-nodeps snod: $(filter-out systemimage-nodeps snod,$(MAKECMDGOALS)) \
- | $(INTERNAL_MKUSERFS)
+ | $(INTERNAL_USERIMAGES_DEPS)
@echo "make $@: ignoring dependencies"
$(call build-systemimage-target,$(INSTALLED_SYSTEMIMAGE))
$(hide) $(call assert-max-image-size,$(INSTALLED_SYSTEMIMAGE),$(BOARD_SYSTEMIMAGE_PARTITION_SIZE),yaffs)
@@ -772,16 +832,16 @@
INTERNAL_USERDATAIMAGE_FILES := \
$(filter $(TARGET_OUT_DATA)/%,$(ALL_DEFAULT_INSTALLED_MODULES))
-ifeq ($(TARGET_USERIMAGES_USE_EXT2),true)
-## Generate an ext2 image
+ifeq ($(INTERNAL_USERIMAGES_USE_EXT),true)
+## Generate an ext image
define build-userdataimage-target
$(call pretty,"Target userdata fs image: $(INSTALLED_USERDATAIMAGE_TARGET)")
@mkdir -p $(TARGET_OUT_DATA)
- $(call build-userimage-ext2-target,$(TARGET_OUT_DATA),$(INSTALLED_USERDATAIMAGE_TARGET),userdata,)
+ $(call build-userimage-ext-target,$(TARGET_OUT_DATA),$(INSTALLED_USERDATAIMAGE_TARGET),userdata,$(INTERNAL_USERIMAGES_EXT_VARIANT),$(BOARD_USERDATAIMAGE_PARTITION_SIZE))
$(hide) $(call assert-max-image-size,$(INSTALLED_USERDATAIMAGE_TARGET),$(BOARD_USERDATAIMAGE_PARTITION_SIZE),yaffs)
endef
-else # TARGET_USERIMAGES_USE_EXT2 != true
+else # INTERNAL_USERIMAGES_USE_EXT != true
## Generate a yaffs2 image
define build-userdataimage-target
@@ -790,18 +850,18 @@
$(hide) $(MKYAFFS2) -f $(mkyaffs2_extra_flags) $(TARGET_OUT_DATA) $(INSTALLED_USERDATAIMAGE_TARGET)
$(hide) $(call assert-max-image-size,$(INSTALLED_USERDATAIMAGE_TARGET),$(BOARD_USERDATAIMAGE_PARTITION_SIZE),yaffs)
endef
-endif # TARGET_USERIMAGES_USE_EXT2
+endif # INTERNAL_USERIMAGES_USE_EXT
BUILT_USERDATAIMAGE_TARGET := $(PRODUCT_OUT)/userdata.img
# We just build this directly to the install location.
INSTALLED_USERDATAIMAGE_TARGET := $(BUILT_USERDATAIMAGE_TARGET)
-$(INSTALLED_USERDATAIMAGE_TARGET): $(INTERNAL_MKUSERFS) \
+$(INSTALLED_USERDATAIMAGE_TARGET): $(INTERNAL_USERIMAGES_DEPS) \
$(INTERNAL_USERDATAIMAGE_FILES)
$(build-userdataimage-target)
.PHONY: userdataimage-nodeps
-userdataimage-nodeps: $(INTERNAL_MKUSERFS)
+userdataimage-nodeps: $(INTERNAL_USERIMAGES_DEPS)
$(build-userdataimage-target)
#######
@@ -925,6 +985,9 @@
ifdef BOARD_KERNEL_BASE
$(hide) echo "$(BOARD_KERNEL_BASE)" > $(zip_root)/RECOVERY/base
endif
+ifdef BOARD_KERNEL_PAGESIZE
+ $(hide) echo "$(BOARD_KERNEL_PAGESIZE)" > $(zip_root)/RECOVERY/pagesize
+endif
@# Components of the boot image
$(hide) mkdir -p $(zip_root)/BOOT
$(hide) $(call package_files-copy-root, \
@@ -942,6 +1005,9 @@
ifdef BOARD_KERNEL_BASE
$(hide) echo "$(BOARD_KERNEL_BASE)" > $(zip_root)/BOOT/base
endif
+ifdef BOARD_KERNEL_PAGESIZE
+ $(hide) echo "$(BOARD_KERNEL_PAGESIZE)" > $(zip_root)/BOOT/pagesize
+endif
$(hide) $(foreach t,$(INSTALLED_RADIOIMAGE_TARGET),\
mkdir -p $(zip_root)/RADIO; \
$(ACP) $(t) $(zip_root)/RADIO/$(notdir $(t));)
@@ -967,6 +1033,9 @@
$(hide) echo "system $(call image-size-from-data-size,$(BOARD_SYSTEMIMAGE_PARTITION_SIZE))" >> $(zip_root)/META/imagesizes.txt
$(hide) echo "userdata $(call image-size-from-data-size,$(BOARD_USERDATAIMAGE_PARTITION_SIZE))" >> $(zip_root)/META/imagesizes.txt
$(hide) echo "$(tool_extensions)" > $(zip_root)/META/tool-extensions.txt
+ifdef mkyaffs2_extra_flags
+ $(hide) echo "$(mkyaffs2_extra_flags)" > $(zip_root)/META/mkyaffs2-extra-flags.txt
+endif
@# Zip everything up, preserving symlinks
$(hide) (cd $(zip_root) && zip -qry ../$(notdir $@) .)
@# Run fs_config on all the system files in the zip, and save the output
@@ -982,6 +1051,7 @@
ifneq ($(TARGET_SIMULATOR),true)
ifneq ($(TARGET_PRODUCT),sdk)
ifneq ($(TARGET_DEVICE),generic)
+ifneq ($(TARGET_NO_KERNEL),true)
name := $(TARGET_PRODUCT)
ifeq ($(TARGET_BUILD_TYPE),debug)
@@ -1002,7 +1072,7 @@
$(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(OTATOOLS)
@echo "Package OTA: $@"
- $(hide) ./build/tools/releasetools/ota_from_target_files \
+ $(hide) ./build/tools/releasetools/ota_from_target_files -v \
-m $(scriptmode) \
-p $(HOST_OUT) \
-k $(KEY_CERT_PAIR) \
@@ -1011,6 +1081,7 @@
.PHONY: otapackage
otapackage: $(INTERNAL_OTA_PACKAGE_TARGET)
+endif # TARGET_NO_KERNEL != true
endif # TARGET_DEVICE != generic
endif # TARGET_PRODUCT != sdk
endif # TARGET_SIMULATOR != true
@@ -1106,6 +1177,17 @@
$(hide) mkdir -p $(dir $@)
$(hide) zip -qj $@ $(TARGET_OUT_APPS)/*
+
+#------------------------------------------------------------------
+# A zip of emma code coverage meta files. Generated for fully emma
+# instrumented build.
+#
+EMMA_META_ZIP := $(PRODUCT_OUT)/emma_meta.zip
+$(EMMA_META_ZIP): $(INSTALLED_SYSTEMIMAGE)
+ @echo "Collecting Emma coverage meta files."
+ $(hide) find $(TARGET_COMMON_OUT_ROOT) -name "coverage.em" | \
+ zip -@ -q $@
+
endif # TARGET_SIMULATOR != true
# -----------------------------------------------------------------
@@ -1136,9 +1218,10 @@
$(INTERNAL_UPDATE_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(OTATOOLS)
@echo "Package: $@"
- $(hide) ./build/tools/releasetools/img_from_target_files \
+ $(hide) ./build/tools/releasetools/img_from_target_files -v \
-s $(extensions) \
-p $(HOST_OUT) \
+ $(addprefix --fs_type ,$(INTERNAL_USERIMAGES_EXT_VARIANT)) \
$(BUILT_TARGET_FILES_PACKAGE) $@
.PHONY: updatepackage
diff --git a/core/base_rules.mk b/core/base_rules.mk
index 2b95a5c..4126547 100644
--- a/core/base_rules.mk
+++ b/core/base_rules.mk
@@ -222,7 +222,7 @@
logtags_java_sources := $(patsubst %.logtags,%.java,$(addprefix $(intermediates.COMMON)/src/, $(logtags_sources)))
logtags_sources := $(addprefix $(TOP_DIR)$(LOCAL_PATH)/, $(logtags_sources))
-$(logtags_java_sources): $(intermediates.COMMON)/src/%.java: $(TOPDIR)$(LOCAL_PATH)/%.logtags $(TARGET_OUT)/etc/event-log-tags
+$(logtags_java_sources): $(intermediates.COMMON)/src/%.java: $(TOPDIR)$(LOCAL_PATH)/%.logtags $(TARGET_OUT_COMMON_INTERMEDIATES)/all-event-log-tags.txt
$(transform-logtags-to-java)
endif
@@ -381,10 +381,7 @@
# link against the jar with full original names (before proguard processing).
full_java_libs += $(link_instr_intermediates_dir.COMMON)/classes-full-names.jar
-
- # We can't depend on the .jar file, so we depend on something that
- # depends on the jar file; the final built package file.
- full_java_lib_deps += $(link_instr_intermediates_dir)/package.apk
+ full_java_lib_deps += $(link_instr_intermediates_dir.COMMON)/classes-full-names.jar
endif
ifneq ($(strip $(LOCAL_JAR_MANIFEST)),)
@@ -507,6 +504,10 @@
$(ALL_MODULES.$(LOCAL_MODULE).REQUIRED) $(LOCAL_REQUIRED_MODULES)
ALL_MODULES.$(LOCAL_MODULE).EVENT_LOG_TAGS := \
$(ALL_MODULES.$(LOCAL_MODULE).EVENT_LOG_TAGS) $(event_log_tags)
+ALL_MODULES.$(LOCAL_MODULE).INTERMEDIATE_SOURCE_DIR := \
+ $(ALL_MODULES.$(LOCAL_MODULE).INTERMEDIATE_SOURCE_DIR) $(LOCAL_INTERMEDIATE_SOURCE_DIR)
+
+INSTALLABLE_FILES.$(LOCAL_INSTALLED_MODULE).MODULE := $(LOCAL_MODULE)
###########################################################
## Take care of LOCAL_MODULE_TAGS
diff --git a/core/binary.mk b/core/binary.mk
index 2f0a243..e8f1d80 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -5,6 +5,35 @@
## The list of object files is exported in $(all_objects).
###########################################################
+######################################
+## Sanity check for LOCAL_NDK_VERSION
+######################################
+my_ndk_version_root :=
+ifeq ($(TARGET_SIMULATOR),true)
+ # NDK does not support sim build.
+ LOCAL_NDK_VERSION :=
+endif
+ifdef LOCAL_NDK_VERSION
+ ifdef LOCAL_IS_HOST_MODULE
+ $(error $(LOCAL_PATH): LOCAL_NDK_VERSION can not be used in host module)
+ endif
+ ifneq ($(filter-out SHARED_LIBRARIES STATIC_LIBRARIES,$(LOCAL_MODULE_CLASS)),)
+ $(error $(LOCAL_PATH): LOCAL_NDK_VERSION can only be used to build target shared/static libraries, \
+ while your module is of class $(LOCAL_MODULE_CLASS))
+ endif
+ ifeq ($(filter $(LOCAL_NDK_VERSION),$(TARGET_AVAILABLE_NDK_VERSIONS)),)
+ $(error $(LOCAL_PATH): Invalid LOCAL_NDK_VERSION '$(LOCAL_NDK_VERSION)' \
+ Choices are $(TARGET_AVAILABLE_NDK_VERSIONS))
+ endif
+ ifndef LOCAL_SDK_VERSION
+ $(error $(LOCAL_PATH): LOCAL_NDK_VERSION must be defined with LOCAL_SDK_VERSION)
+ endif
+ my_ndk_version_root := $(HISTORICAL_NDK_VERSIONS_ROOT)/android-ndk-r$(LOCAL_NDK_VERSION)/$(BUILD_OS)/platforms/android-$(LOCAL_SDK_VERSION)/arch-$(TARGET_ARCH)
+ ifeq ($(wildcard $(my_ndk_version_root)),)
+ $(error $(LOCAL_PATH): ndk version root does not exist: $(my_ndk_version_root))
+ endif
+endif
+
#######################################
include $(BUILD_SYSTEM)/base_rules.mk
#######################################
@@ -19,6 +48,26 @@
endif
###########################################################
+## Define PRIVATE_ variables from global vars
+###########################################################
+ifdef LOCAL_NDK_VERSION
+my_target_project_includes :=
+my_target_c_inclues := $(my_ndk_version_root)/usr/include
+# TODO: more reliable way to remove platform stuff.
+my_target_global_cflags := $(filter-out -include -I system/%, $(TARGET_GLOBAL_CFLAGS))
+my_target_global_cppflags := $(filter-out -include -I system/%, $(TARGET_GLOBAL_CPPFLAGS))
+else
+my_target_project_includes := $(TARGET_PROJECT_INCLUDES)
+my_target_c_inclues := $(TARGET_C_INCLUDES)
+my_target_global_cflags := $(TARGET_GLOBAL_CFLAGS)
+my_target_global_cppflags := $(TARGET_GLOBAL_CPPFLAGS)
+endif
+$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_PROJECT_INCLUDES := $(my_target_project_includes)
+$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_C_INCLUDES := $(my_target_c_inclues)
+$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_GLOBAL_CFLAGS := $(my_target_global_cflags)
+$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_GLOBAL_CPPFLAGS := $(my_target_global_cppflags)
+
+###########################################################
## Define PRIVATE_ variables used by multiple module types
###########################################################
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_NO_DEFAULT_COMPILER_FLAGS := \
@@ -301,6 +350,10 @@
LOCAL_C_INCLUDES += $(TOPDIR)$(LOCAL_PATH) $(intermediates) $(base_intermediates)
+ifndef LOCAL_NDK_VERSION
+ LOCAL_C_INCLUDES += $(JNI_H_INCLUDE)
+endif
+
$(all_objects) : | $(LOCAL_GENERATED_SOURCES)
ALL_C_CPP_ETC_OBJECTS += $(all_objects)
@@ -317,11 +370,13 @@
# to by supplying a LOCAL_SYSTEM_SHARED_LIBRARIES value. One would
# supply that, for example, when building libc itself.
###########################################################
-ifndef LOCAL_IS_HOST_MODULE
+ifdef LOCAL_IS_HOST_MODULE
ifeq ($(LOCAL_SYSTEM_SHARED_LIBRARIES),none)
- LOCAL_SHARED_LIBRARIES += $($(my_prefix)DEFAULT_SYSTEM_SHARED_LIBRARIES)
- else
- LOCAL_SHARED_LIBRARIES += $(LOCAL_SYSTEM_SHARED_LIBRARIES)
+ LOCAL_SYSTEM_SHARED_LIBRARIES :=
+ endif
+else
+ ifeq ($(LOCAL_SYSTEM_SHARED_LIBRARIES),none)
+ LOCAL_SYSTEM_SHARED_LIBRARIES := $($(my_prefix)DEFAULT_SYSTEM_SHARED_LIBRARIES)
endif
endif
@@ -380,11 +435,35 @@
so_suffix := $($(my_prefix)SHLIB_SUFFIX)
a_suffix := $($(my_prefix)STATIC_LIB_SUFFIX)
+ifdef LOCAL_NDK_VERSION
built_shared_libraries := \
$(addprefix $($(my_prefix)OUT_INTERMEDIATE_LIBRARIES)/, \
$(addsuffix $(so_suffix), \
$(LOCAL_SHARED_LIBRARIES)))
+# Get the list of INSTALLED libraries. Strip off the various
+# intermediates directories and point to the common lib dirs.
+installed_shared_libraries := \
+ $(addprefix $($(my_prefix)OUT_SHARED_LIBRARIES)/, \
+ $(notdir $(built_shared_libraries)))
+
+my_system_shared_libraries_fullpath := $(addprefix $(my_ndk_version_root)/usr/lib/, \
+ $(addsuffix $(so_suffix), $(LOCAL_SYSTEM_SHARED_LIBRARIES)))
+
+built_shared_libraries += $(my_system_shared_libraries_fullpath)
+LOCAL_SHARED_LIBRARIES += $(LOCAL_SYSTEM_SHARED_LIBRARIES)
+else
+LOCAL_SHARED_LIBRARIES += $(LOCAL_SYSTEM_SHARED_LIBRARIES)
+built_shared_libraries := \
+ $(addprefix $($(my_prefix)OUT_INTERMEDIATE_LIBRARIES)/, \
+ $(addsuffix $(so_suffix), \
+ $(LOCAL_SHARED_LIBRARIES)))
+
+installed_shared_libraries := \
+ $(addprefix $($(my_prefix)OUT_SHARED_LIBRARIES)/, \
+ $(notdir $(built_shared_libraries)))
+endif
+
built_static_libraries := \
$(foreach lib,$(LOCAL_STATIC_LIBRARIES), \
$(call intermediates-dir-for, \
@@ -395,12 +474,6 @@
$(call intermediates-dir-for, \
STATIC_LIBRARIES,$(lib),$(LOCAL_IS_HOST_MODULE))/$(lib)$(a_suffix))
-# Get the list of INSTALLED libraries. Strip off the various
-# intermediates directories and point to the common lib dirs.
-installed_shared_libraries := \
- $(addprefix $($(my_prefix)OUT_SHARED_LIBRARIES)/, \
- $(notdir $(built_shared_libraries)))
-
# We don't care about installed static libraries, since the
# libraries have already been linked into the module at that point.
# We do, however, care about the NOTICE files for any static
diff --git a/core/cleanbuild.mk b/core/cleanbuild.mk
index 7e68d6f..24a3565 100644
--- a/core/cleanbuild.mk
+++ b/core/cleanbuild.mk
@@ -181,13 +181,11 @@
./$(PRODUCT_OUT)/*.xlb \
./$(PRODUCT_OUT)/*.zip \
./$(PRODUCT_OUT)/data \
- ./$(PRODUCT_OUT)/obj/lib \
./$(PRODUCT_OUT)/obj/APPS \
./$(PRODUCT_OUT)/obj/NOTICE_FILES \
./$(PRODUCT_OUT)/obj/PACKAGING \
./$(PRODUCT_OUT)/recovery \
./$(PRODUCT_OUT)/root \
- ./$(PRODUCT_OUT)/symbols/system/lib \
./$(PRODUCT_OUT)/system
# The files/dirs to delete during a dataclean, which removes any files
diff --git a/core/cleanspec.mk b/core/cleanspec.mk
index c85c450..5d399a7 100644
--- a/core/cleanspec.mk
+++ b/core/cleanspec.mk
@@ -22,7 +22,7 @@
# IDEALLY, THOSE STEPS SHOULD BE DONE ATOMICALLY.
# **********************************************************************
#
-INTERNAL_CLEAN_BUILD_VERSION := 4
+INTERNAL_CLEAN_BUILD_VERSION := 5
#
# ***********************************************************************
# Do not touch INTERNAL_CLEAN_BUILD_VERSION if you've added a clean step!
diff --git a/core/clear_vars.mk b/core/clear_vars.mk
index 4520956..96ca2e9 100644
--- a/core/clear_vars.mk
+++ b/core/clear_vars.mk
@@ -51,6 +51,7 @@
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES:=
LOCAL_PREBUILT_STRIP_COMMENTS:=
LOCAL_INTERMEDIATE_SOURCES:=
+LOCAL_INTERMEDIATE_SOURCE_DIR:=
LOCAL_JAVACFLAGS:=
LOCAL_JAVA_LIBRARIES:=
LOCAL_NO_STANDARD_LIBRARIES:=
@@ -88,11 +89,14 @@
LOCAL_DX_FLAGS:=
LOCAL_CERTIFICATE:=
LOCAL_SDK_VERSION:=
+LOCAL_NDK_VERSION:=
LOCAL_NO_EMMA_INSTRUMENT:=
LOCAL_NO_EMMA_COMPILE:=
LOCAL_PROGUARD_ENABLED:= # '',optonly,full,custom
LOCAL_PROGUARD_FLAGS:=
+LOCAL_EMMA_COVERAGE_FILTER:=
LOCAL_WARNINGS_ENABLE:=
+LOCAL_MANIFEST_FILE:=
# Trim MAKEFILE_LIST so that $(call my-dir) doesn't need to
# iterate over thousands of entries every time.
diff --git a/core/combo/HOST_darwin-x86.mk b/core/combo/HOST_darwin-x86.mk
index 1a28af9..121f89b 100644
--- a/core/combo/HOST_darwin-x86.mk
+++ b/core/combo/HOST_darwin-x86.mk
@@ -23,6 +23,22 @@
HOST_GLOBAL_CFLAGS += -m32
HOST_GLOBAL_LDFLAGS += -m32
+# Use the Mac OSX SDK 10.5 if the build host is 10.6
+build_mac_version := $(shell sw_vers -productVersion)
+ifneq ($(filter 10.6.%, $(build_mac_version)),)
+sdk_105_root := /Developer/SDKs/MacOSX10.5.sdk
+ifeq ($(wildcard $(sdk_105_root)),)
+$(warning *****************************************************)
+$(warning * You are building on Mac OSX 10.6.)
+$(warning * Can not find SDK 10.5 at $(sdk_105_root))
+$(warning *****************************************************)
+$(error Stop.)
+endif
+
+HOST_GLOBAL_CFLAGS += -isysroot $(sdk_105_root) -mmacosx-version-min=10.5
+HOST_GLOBAL_LDFLAGS += -isysroot $(sdk_105_root) -mmacosx-version-min=10.5
+endif # build_mac_version is 10.6
+
HOST_GLOBAL_CFLAGS += -fPIC
HOST_NO_UNDEFINED_LDFLAGS := -Wl,-undefined,error
diff --git a/core/combo/TARGET_linux-arm.mk b/core/combo/TARGET_linux-arm.mk
index f998cf4..6139b67 100644
--- a/core/combo/TARGET_linux-arm.mk
+++ b/core/combo/TARGET_linux-arm.mk
@@ -44,7 +44,7 @@
# You can set TARGET_TOOLS_PREFIX to get gcc from somewhere else
ifeq ($(strip $(TARGET_TOOLS_PREFIX)),)
TARGET_TOOLS_PREFIX := \
- prebuilt/$(HOST_PREBUILT_TAG)/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
+ prebuilt/$(HOST_PREBUILT_TAG)/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
endif
TARGET_CC := $(TARGET_TOOLS_PREFIX)gcc$(HOST_EXECUTABLE_SUFFIX)
@@ -99,12 +99,25 @@
-ffunction-sections \
-funwind-tables \
-fstack-protector \
+ -Wa,--noexecstack \
+ -Werror=format-security \
-fno-short-enums \
$(arch_variant_cflags) \
-include $(android_config_h) \
-I $(arch_include_dir)
+# This is to avoid the dreaded warning compiler message:
+# note: the mangling of 'va_list' has changed in GCC 4.4
+#
+# The fact that the mangling changed does not affect the NDK ABI
+# very fortunately (since none of the exposed APIs used va_list
+# in their exported C++ functions). Also, GCC 4.5 has already
+# removed the warning from the compiler.
+#
+TARGET_GLOBAL_CFLAGS += -Wno-psabi
+
TARGET_GLOBAL_LDFLAGS += \
+ -Wl,-z,noexecstack \
$(arch_variant_ldflags)
# We only need thumb interworking in cases where thumb support
@@ -200,6 +213,9 @@
TARGET_CRTBEGIN_DYNAMIC_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_dynamic.o
TARGET_CRTEND_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtend_android.o
+TARGET_CRTBEGIN_SO_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_so.o
+TARGET_CRTEND_SO_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtend_so.o
+
TARGET_STRIP_MODULE:=true
TARGET_DEFAULT_SYSTEM_SHARED_LIBRARIES := libc libstdc++ libm
@@ -216,18 +232,20 @@
-nostdlib -Wl,-soname,$(notdir $@) -Wl,-T,$(BUILD_SYSTEM)/armelf.xsc \
-Wl,--gc-sections \
-Wl,-shared,-Bsymbolic \
- $(TARGET_GLOBAL_LD_DIRS) \
+ $(PRIVATE_TARGET_GLOBAL_LD_DIRS) \
$(PRIVATE_ALL_OBJECTS) \
+ $(PRIVATE_TARGET_CRTBEGIN_SO_O) \
-Wl,--whole-archive \
$(call normalize-host-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \
-Wl,--no-whole-archive \
$(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
$(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \
-o $@ \
+ $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
$(PRIVATE_LDFLAGS) \
- $(TARGET_GLOBAL_LDFLAGS) \
- $(TARGET_FDO_LIB) \
- $(TARGET_LIBGCC)
+ $(PRIVATE_TARGET_FDO_LIB) \
+ $(PRIVATE_TARGET_LIBGCC) \
+ $(PRIVATE_TARGET_CRTEND_SO_O)
endef
define transform-o-to-executable-inner
@@ -242,8 +260,8 @@
$(TARGET_CRTBEGIN_DYNAMIC_O) \
$(PRIVATE_ALL_OBJECTS) \
$(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
- $(PRIVATE_LDFLAGS) \
$(TARGET_GLOBAL_LDFLAGS) \
+ $(PRIVATE_LDFLAGS) \
$(TARGET_FDO_LIB) \
$(TARGET_LIBGCC) \
$(TARGET_CRTEND_O)
@@ -255,8 +273,8 @@
-o $@ \
$(TARGET_GLOBAL_LD_DIRS) \
$(TARGET_CRTBEGIN_STATIC_O) \
- $(PRIVATE_LDFLAGS) \
$(TARGET_GLOBAL_LDFLAGS) \
+ $(PRIVATE_LDFLAGS) \
$(PRIVATE_ALL_OBJECTS) \
$(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
$(TARGET_FDO_LIB) \
diff --git a/core/combo/TARGET_linux-sh.mk b/core/combo/TARGET_linux-sh.mk
index 450fd70..cf945fe 100644
--- a/core/combo/TARGET_linux-sh.mk
+++ b/core/combo/TARGET_linux-sh.mk
@@ -105,8 +105,8 @@
TARGET_CRTBEGIN_STATIC_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_static.o
TARGET_CRTBEGIN_DYNAMIC_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_dynamic.o
TARGET_CRTEND_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtend_android.o
-TARGET_SOBEGIN := $(TARGET_OUT_STATIC_LIBRARIES)/sobegin.o
-TARGET_SOEND := $(TARGET_OUT_STATIC_LIBRARIES)/soend.o
+TARGET_CRTBEGIN_SO_O := $(TARGET_OUT_STATIC_LIBRARIES)/sobegin.o
+TARGET_CRTEND_SO_O := $(TARGET_OUT_STATIC_LIBRARIES)/soend.o
TARGET_STRIP_MODULE:=true
@@ -118,8 +118,8 @@
-nostdlib -Wl,-soname,$(notdir $@) -Wl,-T,$(BUILD_SYSTEM)/shlelf.xsc \
-Wl,--gc-sections -Wl,-z,norelro \
-Wl,-shared,-Bsymbolic \
- $(TARGET_GLOBAL_LD_DIRS) \
- $(TARGET_SOBEGIN) \
+ $(PRIVATE_TARGET_GLOBAL_LD_DIRS) \
+ $(PRIVATE_TARGET_CRTBEGIN_SO_O) \
$(PRIVATE_ALL_OBJECTS) \
-Wl,--whole-archive \
$(call normalize-host-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \
@@ -129,8 +129,8 @@
-o $@ \
$(PRIVATE_LDFLAGS) \
$(subst -lrt,, $(subst -lpthread,,$(PRIVATE_LDLIBS))) \
- $(TARGET_LIBGCC) \
- $(TARGET_SOEND)
+ $(PRIVATE_TARGET_LIBGCC) \
+ $(PRIVATE_TARGET_CRTEND_SO_O)
endef
define transform-o-to-executable-inner
diff --git a/core/combo/TARGET_linux-x86.mk b/core/combo/TARGET_linux-x86.mk
index 6d123d0..17c5ec3 100644
--- a/core/combo/TARGET_linux-x86.mk
+++ b/core/combo/TARGET_linux-x86.mk
@@ -106,12 +106,12 @@
TARGET_CUSTOM_LD_COMMAND := true
define transform-o-to-shared-lib-inner
$(TARGET_CXX) \
- $(TARGET_GLOBAL_LDFLAGS) \
+ $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
-nostdlib -Wl,-soname,$(notdir $@) \
-shared -Bsymbolic \
-fPIC -march=i686 \
- $(TARGET_GLOBAL_LD_DIRS) \
- $(TARGET_CRTBEGIN_SO_O) \
+ $(PRIVATE_TARGET_GLOBAL_LD_DIRS) \
+ $(PRIVATE_TARGET_CRTBEGIN_SO_O) \
$(PRIVATE_ALL_OBJECTS) \
-Wl,--whole-archive \
$(call normalize-host-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \
@@ -120,8 +120,8 @@
$(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \
-o $@ \
$(PRIVATE_LDFLAGS) \
- $(TARGET_LIBGCC) \
- $(TARGET_CRTEND_SO_O)
+ $(PRIVATE_TARGET_LIBGCC) \
+ $(PRIVATE_TARGET_CRTEND_SO_O)
endef
diff --git a/core/config.mk b/core/config.mk
index 0a306e1..db2ea51 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -31,6 +31,7 @@
$(TOPDIR)dalvik/libnativehelper/include \
$(TOPDIR)frameworks/base/include \
$(TOPDIR)frameworks/base/opengl/include \
+ $(TOPDIR)frameworks/base/native/include \
$(TOPDIR)external/skia/include
SRC_HOST_HEADERS:=$(TOPDIR)tools/include
SRC_LIBRARIES:= $(TOPDIR)libs
@@ -210,11 +211,13 @@
APICHECK := $(HOST_OUT_EXECUTABLES)/apicheck$(HOST_EXECUTABLE_SUFFIX)
FS_GET_STATS := $(HOST_OUT_EXECUTABLES)/fs_get_stats$(HOST_EXECUTABLE_SUFFIX)
MKEXT2IMG := $(HOST_OUT_EXECUTABLES)/genext2fs$(HOST_EXECUTABLE_SUFFIX)
+MAKE_EXT4FS := $(HOST_OUT_EXECUTABLES)/make_ext4fs$(HOST_EXECUTABLE_SUFFIX)
+MKEXT2USERIMG := $(HOST_OUT_EXECUTABLES)/mkuserimg.sh
MKEXT2BOOTIMG := external/genext2fs/mkbootimg_ext2.sh
MKTARBALL := build/tools/mktarball.sh
TUNE2FS := tune2fs
E2FSCK := e2fsck
-JARJAR := java -jar $(HOST_OUT_JAVA_LIBRARIES)/jarjar.jar
+JARJAR := $(HOST_OUT_JAVA_LIBRARIES)/jarjar.jar
PROGUARD := external/proguard/bin/proguard.sh
JAVATAGS := build/tools/java-event-log-tags.py
@@ -319,6 +322,7 @@
# ###############################################################
HISTORICAL_SDK_VERSIONS_ROOT := $(TOPDIR)prebuilt/sdk
+HISTORICAL_NDK_VERSIONS_ROOT := $(TOPDIR)prebuilt/ndk
# Historical SDK version N is stored in $(HISTORICAL_SDK_VERSIONS_ROOT)/N.
# The 'current' version is whatever this source tree is.
@@ -340,4 +344,8 @@
$(patsubst $(HISTORICAL_SDK_VERSIONS_ROOT)/%/android.jar,%, \
$(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/*/android.jar)))
+TARGET_AVAILABLE_NDK_VERSIONS := $(call numerically_sort,\
+ $(patsubst $(HISTORICAL_NDK_VERSIONS_ROOT)/android-ndk-r%,%, \
+ $(wildcard $(HISTORICAL_NDK_VERSIONS_ROOT)/android-ndk-r*)))
+
INTERNAL_PLATFORM_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/public_api.xml
diff --git a/core/definitions.mk b/core/definitions.mk
index 7e2d1fb..cc638c5 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -767,16 +767,16 @@
$(foreach incdir, \
$(PRIVATE_C_INCLUDES) \
$(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
- $(TARGET_PROJECT_INCLUDES) \
- $(TARGET_C_INCLUDES) \
+ $(PRIVATE_TARGET_PROJECT_INCLUDES) \
+ $(PRIVATE_TARGET_C_INCLUDES) \
) \
, \
-I $(incdir) \
) \
-c \
$(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
- $(TARGET_GLOBAL_CFLAGS) \
- $(TARGET_GLOBAL_CPPFLAGS) \
+ $(PRIVATE_TARGET_GLOBAL_CFLAGS) \
+ $(PRIVATE_TARGET_GLOBAL_CPPFLAGS) \
$(PRIVATE_ARM_CFLAGS) \
) \
-fno-rtti \
@@ -799,15 +799,15 @@
$(foreach incdir, \
$(PRIVATE_C_INCLUDES) \
$(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
- $(TARGET_PROJECT_INCLUDES) \
- $(TARGET_C_INCLUDES) \
+ $(PRIVATE_TARGET_PROJECT_INCLUDES) \
+ $(PRIVATE_TARGET_C_INCLUDES) \
) \
, \
-I $(incdir) \
) \
-c \
$(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
- $(TARGET_GLOBAL_CFLAGS) \
+ $(PRIVATE_TARGET_GLOBAL_CFLAGS) \
$(PRIVATE_ARM_CFLAGS) \
) \
$(PRIVATE_CFLAGS) \
@@ -949,7 +949,7 @@
define extract-and-include-target-whole-static-libs
$(foreach lib,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES), \
- @echo "preparing StaticLib: $(PRIVATE_MODULE) [including $(lib)]"; \
+ $(hide) echo "preparing StaticLib: $(PRIVATE_MODULE) [including $(lib)]"; \
ldir=$(PRIVATE_INTERMEDIATES_DIR)/WHOLE/$(basename $(notdir $(lib)))_objs;\
rm -rf $$ldir; \
mkdir -p $$ldir; \
@@ -969,7 +969,8 @@
@rm -f $@
$(extract-and-include-target-whole-static-libs)
@echo "target StaticLib: $(PRIVATE_MODULE) ($@)"
-$(hide) echo $^ | xargs $(TARGET_AR) $(TARGET_GLOBAL_ARFLAGS) $(PRIVATE_ARFLAGS) $@
+$(hide) echo $(filter %.o, $^) | \
+ xargs $(TARGET_AR) $(TARGET_GLOBAL_ARFLAGS) $(PRIVATE_ARFLAGS) $@
endef
###########################################################
@@ -1062,12 +1063,12 @@
ifneq ($(TARGET_CUSTOM_LD_COMMAND),true)
define transform-o-to-shared-lib-inner
$(TARGET_CXX) \
- $(TARGET_GLOBAL_LDFLAGS) \
+ $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
-Wl,-rpath-link=$(TARGET_OUT_INTERMEDIATE_LIBRARIES) \
-Wl,-rpath,\$$ORIGIN/../lib \
-shared -Wl,-soname,$(notdir $@) \
$(PRIVATE_LDFLAGS) \
- $(TARGET_GLOBAL_LD_DIRS) \
+ $(PRIVATE_TARGET_GLOBAL_LD_DIRS) \
$(PRIVATE_ALL_OBJECTS) \
-Wl,--whole-archive \
$(call normalize-host-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \
@@ -1229,8 +1230,8 @@
$(addprefix -G , $(PRIVATE_PROGUARD_OPTIONS_FILE)) \
$(addprefix --min-sdk-version , $(DEFAULT_APP_TARGET_SDK)) \
$(addprefix --target-sdk-version , $(DEFAULT_APP_TARGET_SDK)) \
- $(addprefix --version-code , $(PLATFORM_SDK_VERSION)) \
- $(addprefix --version-name , $(PLATFORM_VERSION)) \
+ $(if $(filter --version-code,$(PRIVATE_AAPT_FLAGS)),,$(addprefix --version-code , $(PLATFORM_SDK_VERSION))) \
+ $(if $(filter --version-name,$(PRIVATE_AAPT_FLAGS)),,$(addprefix --version-name , $(PLATFORM_VERSION))) \
$(addprefix --rename-manifest-package , $(PRIVATE_MANIFEST_PACKAGE_NAME)) \
$(addprefix --rename-instrumentation-target-package , $(PRIVATE_INSTRUMENTATION_FOR_PACKAGE_NAME))
endef
@@ -1323,7 +1324,8 @@
define transform-classes.jar-to-emma
$(hide) java -classpath $(EMMA_JAR) emma instr -outmode fullcopy -outfile \
- $(PRIVATE_EMMA_COVERAGE_FILE) -ip $< -d $(PRIVATE_EMMA_INTERMEDIATES_DIR)
+ $(PRIVATE_EMMA_COVERAGE_FILE) -ip $< -d $(PRIVATE_EMMA_INTERMEDIATES_DIR) \
+ $(addprefix -ix , $(PRIVATE_EMMA_COVERAGE_FILTER))
endef
#TODO: use a smaller -Xmx value for most libraries;
@@ -1374,8 +1376,8 @@
$(addprefix -I , $(PRIVATE_AAPT_INCLUDES)) \
$(addprefix --min-sdk-version , $(DEFAULT_APP_TARGET_SDK)) \
$(addprefix --target-sdk-version , $(DEFAULT_APP_TARGET_SDK)) \
- $(addprefix --version-code , $(PLATFORM_SDK_VERSION)) \
- $(addprefix --version-name , $(PLATFORM_VERSION)) \
+ $(if $(filter --version-code,$(PRIVATE_AAPT_FLAGS)),,$(addprefix --version-code , $(PLATFORM_SDK_VERSION))) \
+ $(if $(filter --version-name,$(PRIVATE_AAPT_FLAGS)),,$(addprefix --version-name , $(PLATFORM_VERSION))) \
$(addprefix --rename-manifest-package , $(PRIVATE_MANIFEST_PACKAGE_NAME)) \
$(addprefix --rename-instrumentation-target-package , $(PRIVATE_INSTRUMENTATION_FOR_PACKAGE_NAME)) \
-F $@
diff --git a/core/droiddoc.mk b/core/droiddoc.mk
index ba4857b..951ae3c 100644
--- a/core/droiddoc.mk
+++ b/core/droiddoc.mk
@@ -144,7 +144,7 @@
$(full_target): PRIVATE_OUT_ASSET_DIR := $(out_dir)/$(LOCAL_DROIDDOC_ASSET_DIR)
$(full_target): PRIVATE_OUT_CUSTOM_ASSET_DIR := $(out_dir)/$(LOCAL_DROIDDOC_CUSTOM_ASSET_DIR)
ifneq ($(strip $(LOCAL_DROIDDOC_HTML_DIR)),)
-$(full_target): PRIVATE_DROIDDOC_HTML_DIR := -htmldir $(LOCAL_PATH)/$(LOCAL_DROIDDOC_HTML_DIR)
+$(full_target): PRIVATE_DROIDDOC_HTML_DIR := $(foreach dir,$(LOCAL_DROIDDOC_HTML_DIR),-htmldir $(dir))
else
$(full_target): PRIVATE_DROIDDOC_HTML_DIR :=
endif
diff --git a/core/dumpvar.mk b/core/dumpvar.mk
index fa20ece..f469f35 100644
--- a/core/dumpvar.mk
+++ b/core/dumpvar.mk
@@ -9,7 +9,7 @@
ABP:=$(ABP):$(TARGET_OUT_EXECUTABLES)
else
# this should be copied to HOST_OUT_EXECUTABLES instead
- ABP:=$(ABP):$(PWD)/prebuilt/$(HOST_PREBUILT_TAG)/toolchain/arm-eabi-4.4.0/bin
+ ABP:=$(ABP):$(PWD)/prebuilt/$(HOST_PREBUILT_TAG)/toolchain/arm-eabi-4.4.3/bin
endif
ANDROID_BUILD_PATHS := $(ABP)
ANDROID_PREBUILTS := prebuilt/$(HOST_PREBUILT_TAG)
diff --git a/core/java.mk b/core/java.mk
index baa83ee..4c34479 100644
--- a/core/java.mk
+++ b/core/java.mk
@@ -29,7 +29,7 @@
endif
else
ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true)
- LOCAL_JAVA_LIBRARIES := core ext framework $(LOCAL_JAVA_LIBRARIES)
+ LOCAL_JAVA_LIBRARIES := core core-junit ext framework $(LOCAL_JAVA_LIBRARIES)
endif
endif
LOCAL_JAVA_LIBRARIES := $(sort $(LOCAL_JAVA_LIBRARIES))
@@ -63,17 +63,21 @@
# Choose leaf name for the compiled jar file.
ifneq ($(LOCAL_NO_EMMA_COMPILE),true)
full_classes_compiled_jar_leaf := classes-no-debug-var.jar
+built_dex_leaf := classes-no-local.dex
else
full_classes_compiled_jar_leaf := classes-full-debug.jar
+built_dex_leaf := classes-with-local.dex
endif
full_classes_compiled_jar := $(intermediates.COMMON)/$(full_classes_compiled_jar_leaf)
+built_dex_intermediate := $(intermediates.COMMON)/$(built_dex_leaf)
+jarjar_leaf := classes-jarjar.jar
+full_classes_jarjar_jar := $(intermediates.COMMON)/$(jarjar_leaf)
emma_intermediates_dir := $(intermediates.COMMON)/emma_out
-# the 'lib/$(full_classes_compiled_jar_leaf)' portion of this path is fixed in
-# the emma tool
-full_classes_emma_jar := $(emma_intermediates_dir)/lib/$(full_classes_compiled_jar_leaf)
+# emma is hardcoded to use the leaf name of its input for the output file --
+# only the output directory can be changed
+full_classes_emma_jar := $(emma_intermediates_dir)/lib/$(jarjar_leaf)
full_classes_stubs_jar := $(intermediates.COMMON)/stubs.jar
-full_classes_jarjar_jar := $(intermediates.COMMON)/classes-jarjar.jar
full_classes_full_names_jar := $(intermediates.COMMON)/classes-full-names.jar
full_classes_proguard_jar := $(full_classes_jar)
built_dex := $(intermediates.COMMON)/classes.dex
@@ -85,8 +89,10 @@
$(full_classes_full_names_jar) \
$(full_classes_stubs_jar) \
$(full_classes_jarjar_jar) \
- $(built_dex)
+ $(built_dex) \
+ $(built_dex_intermediate)
+LOCAL_INTERMEDIATE_SOURCE_DIR := $(intermediates.COMMON)/src
# TODO: It looks like the only thing we need from base_rules is
# all_java_sources. See if we can get that by adding a
@@ -104,7 +110,7 @@
$(LOCAL_INTERMEDIATE_TARGETS): \
PRIVATE_CLASS_INTERMEDIATES_DIR := $(intermediates.COMMON)/classes
$(LOCAL_INTERMEDIATE_TARGETS): \
- PRIVATE_SOURCE_INTERMEDIATES_DIR := $(intermediates.COMMON)/src
+ PRIVATE_SOURCE_INTERMEDIATES_DIR := $(LOCAL_INTERMEDIATE_SOURCE_DIR)
# Since we're using intermediates.COMMON, make sure that it gets cleaned
# properly.
@@ -154,17 +160,18 @@
# be done after the inclusion of base_rules.mk.
ALL_MODULES.$(LOCAL_MODULE).CHECKED := $(full_classes_compiled_jar)
-ifneq ($(LOCAL_NO_EMMA_COMPILE),true)
-# If you instrument class files that have local variable debug information in
-# them emma does not correctly maintain the local variable table.
-# This will cause an error when you try to convert the class files for Android.
-# The workaround for this to compile the java classes with only
-# line and source debug information, not local information.
-$(full_classes_compiled_jar): PRIVATE_JAVAC_DEBUG_FLAGS := -g:{lines,source}
-else
-# when emma is off, compile with the default flags, which contain full debug
-# info
$(full_classes_compiled_jar): PRIVATE_JAVAC_DEBUG_FLAGS := -g
+
+# Run jarjar if necessary, otherwise just copy the file.
+ifneq ($(strip $(LOCAL_JARJAR_RULES)),)
+$(full_classes_jarjar_jar): PRIVATE_JARJAR_RULES := $(LOCAL_JARJAR_RULES)
+$(full_classes_jarjar_jar): $(full_classes_compiled_jar) | $(JARJAR)
+ @echo JarJar: $@
+ $(hide) java -jar $(JARJAR) process $(PRIVATE_JARJAR_RULES) $< $@
+else
+$(full_classes_jarjar_jar): $(full_classes_compiled_jar) | $(ACP)
+ @echo Copying: $@
+ $(hide) $(ACP) $< $@
endif
ifeq ($(LOCAL_IS_STATIC_JAVA_LIBRARY),true)
@@ -176,30 +183,27 @@
ifneq ($(LOCAL_NO_EMMA_INSTRUMENT),true)
$(full_classes_emma_jar): PRIVATE_EMMA_COVERAGE_FILE := $(intermediates.COMMON)/coverage.em
$(full_classes_emma_jar): PRIVATE_EMMA_INTERMEDIATES_DIR := $(emma_intermediates_dir)
+# module level coverage filter can be defined using LOCAL_EMMA_COVERAGE_FILTER
+# in Android.mk
+ifdef LOCAL_EMMA_COVERAGE_FILTER
+$(full_classes_emma_jar): PRIVATE_EMMA_COVERAGE_FILTER := $(LOCAL_EMMA_COVERAGE_FILTER)
+else
+# by default, avoid applying emma instrumentation onto emma classes itself,
+# otherwise there will be exceptions thrown
+$(full_classes_emma_jar): PRIVATE_EMMA_COVERAGE_FILTER := *,-emma,-emmarun,-com.vladium.*
+endif
# this rule will generate both $(PRIVATE_EMMA_COVERAGE_FILE) and
# $(full_classes_emma_jar)
-$(full_classes_emma_jar): $(full_classes_compiled_jar) | $(EMMA_JAR)
+$(full_classes_emma_jar): $(full_classes_jarjar_jar) | $(EMMA_JAR)
$(transform-classes.jar-to-emma)
$(PRIVATE_EMMA_COVERAGE_FILE): $(full_classes_emma_jar)
# tell proguard to load emma jar
LOCAL_PROGUARD_FLAGS := $(LOCAL_PROGUARD_FLAGS) $(addprefix -libraryjars ,$(EMMA_JAR))
else
-$(full_classes_emma_jar): $(full_classes_compiled_jar) | $(ACP)
- @echo Copying: $<
- $(copy-file-to-target)
-endif
-
-# Run jarjar if necessary, otherwise just copy the file.
-ifneq ($(strip $(LOCAL_JARJAR_RULES)),)
-$(full_classes_jarjar_jar): PRIVATE_JARJAR_RULES := $(LOCAL_JARJAR_RULES)
-$(full_classes_jarjar_jar): $(full_classes_emma_jar) | $(JARJAR)
- @echo JarJar: $@
- $(hide) $(JARJAR) process $(PRIVATE_JARJAR_RULES) $< $@
-else
-$(full_classes_jarjar_jar): $(full_classes_emma_jar) | $(ACP)
+$(full_classes_emma_jar): $(full_classes_jarjar_jar) | $(ACP)
@echo Copying: $@
- $(hide) $(ACP) $< $@
+ $(copy-file-to-target)
endif
# Keep a copy of the jar just before proguard processing.
@@ -252,12 +256,25 @@
ALL_MODULES.$(LOCAL_MODULE).PROGUARD_ENABLED:=$(LOCAL_PROGUARD_ENABLED)
+# If you instrument class files that have local variable debug information in
+# them emma does not correctly maintain the local variable table.
+# This will cause an error when you try to convert the class files for Android.
+# The workaround here is to build different dex file here based on emma switch
+# then later copy into classes.dex. When emma is on, dx is run with --no-locals
+# option to remove local variable information
+
# Override PRIVATE_INTERMEDIATES_DIR so that install-dex-debug
# will work even when intermediates != intermediates.COMMON.
-$(built_dex): PRIVATE_INTERMEDIATES_DIR := $(intermediates.COMMON)
-$(built_dex): PRIVATE_DX_FLAGS := $(LOCAL_DX_FLAGS)
-$(built_dex): $(full_classes_jar) $(DX)
+$(built_dex_intermediate): PRIVATE_INTERMEDIATES_DIR := $(intermediates.COMMON)
+$(built_dex_intermediate): PRIVATE_DX_FLAGS := $(LOCAL_DX_FLAGS)
+ifneq ($(LOCAL_NO_EMMA_COMPILE),true)
+$(built_dex_intermediate): PRIVATE_DX_FLAGS += --no-locals
+endif
+$(built_dex_intermediate): $(full_classes_jar) $(DX)
$(transform-classes.jar-to-dex)
+$(built_dex): $(built_dex_intermediate) | $(ACP)
+ @echo Copying: $@
+ $(hide) $(ACP) $< $@
ifneq ($(GENERATE_DEX_DEBUG),)
$(install-dex-debug)
endif
diff --git a/core/main.mk b/core/main.mk
index b51b3c4..6b851d4 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -50,6 +50,10 @@
DEFAULT_GOAL := droid
$(DEFAULT_GOAL):
+# Used to force goals to build. Only use for conditionally defined goals.
+.PHONY: FORCE
+FORCE:
+
# Set up various standard variables based on configuration
# and host information.
include $(BUILD_SYSTEM)/config.mk
@@ -60,12 +64,23 @@
# be generated correctly
include $(BUILD_SYSTEM)/cleanbuild.mk
-VERSION_CHECK_SEQUENCE_NUMBER := 1
+VERSION_CHECK_SEQUENCE_NUMBER := 2
-include $(OUT_DIR)/versions_checked.mk
ifneq ($(VERSION_CHECK_SEQUENCE_NUMBER),$(VERSIONS_CHECKED))
$(info Checking build tools versions...)
+ifeq ($(BUILD_OS),linux)
+build_arch := $(shell uname -m)
+ifneq (64,$(findstring 64,$(build_arch)))
+$(warning ************************************************************)
+$(warning You are attempting to build on a 32-bit system.)
+$(warning Only 64-bit build environments are supported now.)
+$(warning ************************************************************)
+$(error stop)
+endif
+endif
+
ifneq ($(HOST_OS),windows)
ifneq ($(HOST_OS)-$(HOST_ARCH),darwin-ppc)
# check for a case sensitive file system
@@ -262,11 +277,6 @@
else # !sdk
endif
-# build the full stagefright library
-ifneq ($(strip BUILD_WITH_FULL_STAGEFRIGHT),)
-BUILD_WITH_FULL_STAGEFRIGHT := true
-endif
-
## precise GC ##
ifneq ($(filter dalvik.gc.type-precise,$(PRODUCT_TAGS)),)
@@ -686,6 +696,13 @@
$(INSTALLED_USERDATAIMAGE_TARGET) \
$(INSTALLED_FILES_FILE)
+ifeq ($(EMMA_INSTRUMENT),true)
+ $(call dist-for-goals, droid, $(EMMA_META_ZIP))
+endif
+
+# dist_libraries only for putting your library into the dist directory with a full build.
+.PHONY: dist_libraries
+
ifneq ($(TARGET_BUILD_APPS),)
# If this build is just for apps, only build apps and not the full system by default.
@@ -719,6 +736,7 @@
$(INSTALLED_BUILD_PROP_TARGET) \
$(BUILT_TARGET_FILES_PACKAGE) \
$(INSTALLED_ANDROID_INFO_TXT_TARGET) \
+ $(INSTALLED_RAMDISK_TARGET) \
)
# Tests are installed in userdata.img. If we're building the tests
@@ -733,14 +751,18 @@
endif
# Building a full system-- the default is to build droidcore
-droid: droidcore
+droid: droidcore dist_libraries
-endif # TARGET_BUILD_APPS
+endif
.PHONY: droid tests
tests: droidcore
+# phony target that include any targets in $(ALL_MODULES)
+.PHONY: all_modules
+all_modules: $(ALL_MODULES)
+
.PHONY: docs
docs: $(ALL_DOCS)
diff --git a/core/package.mk b/core/package.mk
index cdeefb4..8254bae 100644
--- a/core/package.mk
+++ b/core/package.mk
@@ -61,6 +61,10 @@
$(error $(LOCAL_PATH): Package modules may not set LOCAL_JAVA_RESOURCE_FILES)
endif
+ifeq ($(strip $(LOCAL_MANIFEST_FILE)),)
+LOCAL_MANIFEST_FILE := AndroidManifest.xml
+endif
+
ifneq ($(strip $(LOCAL_MODULE_CLASS)),)
$(error $(LOCAL_PATH): Package modules may not set LOCAL_MODULE_CLASS)
endif
@@ -160,7 +164,7 @@
DONT_INSTALL_DEX_FILES := $(old_DONT_INSTALL_DEX_FILES)
old_DONT_INSTALL_DEX_FILES =
-full_android_manifest := $(LOCAL_PATH)/AndroidManifest.xml
+full_android_manifest := $(LOCAL_PATH)/$(LOCAL_MANIFEST_FILE)
$(LOCAL_INTERMEDIATE_TARGETS): \
PRIVATE_ANDROID_MANIFEST := $(full_android_manifest)
diff --git a/core/pathmap.mk b/core/pathmap.mk
index f204c76..fe7ba1a 100644
--- a/core/pathmap.mk
+++ b/core/pathmap.mk
@@ -37,7 +37,6 @@
graphics:external/skia/include/core \
libc:bionic/libc/include \
libdrm1:frameworks/base/media/libdrm/mobile1/include \
- libdrm2:frameworks/base/media/libdrm/mobile2/include \
libhardware:hardware/libhardware/include \
libhardware_legacy:hardware/libhardware_legacy/include \
libhost:build/libs/host/include \
@@ -90,6 +89,7 @@
wifi \
vpn \
keystore \
+ voip \
)
#
diff --git a/core/prelink-linux-arm.map b/core/prelink-linux-arm.map
index 22f5f34..7daaf98 100644
--- a/core/prelink-linux-arm.map
+++ b/core/prelink-linux-arm.map
@@ -16,6 +16,11 @@
# [<64K] observed to be less than 64K
# [~1M] rounded up, one megabyte (similarly for other sizes)
# [???] no size observed, assumed to be one megabyte
+#
+# note: look at the LOAD sections in the library header:
+#
+# arm-eabi-objdump -x <lib>
+#
# core system libraries
libdl.so 0xAFF00000 # [<64K]
@@ -77,18 +82,19 @@
libexif.so 0xABB00000 # [~1M]
libcamera_client.so 0xABA80000 # [~1M]
libui.so 0xAB900000 # [~1M]
-# libsgl is for backward-compatibility with donut
-libsgl.so 0xAB800000 # [???]
-libskia.so 0xAB100000 # [~7M]
+libgui.so 0xAB800000 # [~1M]
+libskia.so 0xAB100000 # [~2M]
librs_jni.so 0xAB000000 # [~1M]
libRS.so 0xA9E00000 # [~2M]
+libandroid.so 0xA9D80000 # [<64K]
libjnigraphics.so 0xA9D00000 # [<64K]
libskiagl.so 0xA9C00000 # [~1M]
# audio
libFLAC.so 0xA9B00000 # [???]
libaudiopolicy.so 0xA9A00000 # [~1M]
-libaudiopolicygeneric.so 0xA9900000 # [???]
+libeffects.so 0xA9980000 # [<64K]
+libaudioeffect_jni.so 0xA9900000 # [<64K]
libsoundpool.so 0xA9800000 # [~1M]
libaudio.so 0xA9700000 # [~1M]
libspeech.so 0xA9600000 # [~1M]
diff --git a/core/product.mk b/core/product.mk
index 38d1148..7594f6f 100644
--- a/core/product.mk
+++ b/core/product.mk
@@ -70,7 +70,6 @@
PRODUCT_PROPERTY_OVERRIDES \
PRODUCT_COPY_FILES \
PRODUCT_OTA_PUBLIC_KEYS \
- PRODUCT_POLICY \
PRODUCT_PACKAGE_OVERLAYS \
DEVICE_PACKAGE_OVERLAYS \
PRODUCT_CONTRIBUTORS_FILE \
diff --git a/core/product_config.mk b/core/product_config.mk
index 04f6ce1..50bc7bc 100644
--- a/core/product_config.mk
+++ b/core/product_config.mk
@@ -252,9 +252,6 @@
PRODUCT_DEFAULT_WIFI_CHANNELS := \
$(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEFAULT_WIFI_CHANNELS))
-# Which policy should this product use
-PRODUCT_POLICY := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_POLICY))
-
# A list of words like <source path>:<destination path>. The file at
# the source path should be copied to the destination path when building
# this product. <destination path> is relative to $(PRODUCT_OUT), so
diff --git a/core/proguard.flags b/core/proguard.flags
index 06e32cc..447e7c5 100644
--- a/core/proguard.flags
+++ b/core/proguard.flags
@@ -44,6 +44,19 @@
@com.google.common.annotations.VisibleForTesting *;
}
+# Keep serializable classes and necessary members for serializable classes
+# Copied from the ProGuard manual at http://proguard.sourceforge.net.
+-keepnames class * implements java.io.Serializable
+-keepclassmembers class * implements java.io.Serializable {
+ static final long serialVersionUID;
+ private static final java.io.ObjectStreamField[] serialPersistentFields;
+ !static !transient <fields>;
+ private void writeObject(java.io.ObjectOutputStream);
+ private void readObject(java.io.ObjectInputStream);
+ java.lang.Object writeReplace();
+ java.lang.Object readResolve();
+}
+
# Please specify classes to be kept explicitly in your package's configuration.
# -keep class * extends android.app.Activity
# -keep class * extends android.view.View
diff --git a/core/raw_executable.mk b/core/raw_executable.mk
index 30e0ade..b64173a 100644
--- a/core/raw_executable.mk
+++ b/core/raw_executable.mk
@@ -7,10 +7,10 @@
$(LOCAL_BUILT_MODULE) : PRIVATE_ELF_FILE := $(intermediates)/$(PRIVATE_MODULE).elf
$(LOCAL_BUILT_MODULE) : PRIVATE_LIBS := `$(TARGET_CC) -mthumb-interwork -print-libgcc-file-name`
-$(all_objects) : TARGET_PROJECT_INCLUDES :=
-$(all_objects) : TARGET_C_INCLUDES :=
-$(all_objects) : TARGET_GLOBAL_CFLAGS :=
-$(all_objects) : TARGET_GLOBAL_CPPFLAGS :=
+$(all_objects) : PRIVATE_TARGET_PROJECT_INCLUDES :=
+$(all_objects) : PRIVATE_TARGET_C_INCLUDES :=
+$(all_objects) : PRIVATE_TARGET_GLOBAL_CFLAGS :=
+$(all_objects) : PRIVATE_TARGET_GLOBAL_CPPFLAGS :=
$(LOCAL_BUILT_MODULE): $(all_objects) $(all_libraries)
@$(mkdir -p $(dir $@)
@@ -23,4 +23,3 @@
--start-group $(PRIVATE_ALL_STATIC_LIBRARIES) --end-group \
$(PRIVATE_LIBS)
$(hide) $(TARGET_OBJCOPY) -O binary $(PRIVATE_ELF_FILE) $@
-
diff --git a/core/shared_library.mk b/core/shared_library.mk
index a30d868..77d253f 100644
--- a/core/shared_library.mk
+++ b/core/shared_library.mk
@@ -26,7 +26,29 @@
include $(BUILD_SYSTEM)/dynamic_binary.mk
+# Define PRIVATE_ variables from global vars
+my_target_global_ld_dirs := $(TARGET_GLOBAL_LD_DIRS)
+my_target_global_ldflags := $(TARGET_GLOBAL_LDFLAGS)
+my_target_fdo_lib := $(TARGET_FDO_LIB)
+my_target_libgcc := $(TARGET_LIBGCC)
+my_target_crtbegin_so_o := $(TARGET_CRTBEGIN_SO_O)
+my_target_crtend_so_o := $(TARGET_CRTEND_SO_O)
+ifdef LOCAL_NDK_VERSION
+my_target_global_ld_dirs += -L$(my_ndk_version_root)/usr/lib
+# The latest ndk does NOT support TARGET_CRTBEGIN_SO_O and TARGET_CRTEND_SO_O yet.
+# my_target_crtbegin_so_o := $(my_ndk_version_root)/usr/lib/crtbegin_so.o
+# my_target_crtend_so_o := $(my_ndk_version_root)/usr/lib/crtend_so.o
+my_target_crtbegin_so_o :=
+my_target_crtend_so_o :=
+endif
+$(linked_module): PRIVATE_TARGET_GLOBAL_LD_DIRS := $(my_target_global_ld_dirs)
+$(linked_module): PRIVATE_TARGET_GLOBAL_LDFLAGS := $(my_target_global_ldflags)
+$(linked_module): PRIVATE_TARGET_FDO_LIB := $(my_target_fdo_lib)
+$(linked_module): PRIVATE_TARGET_LIBGCC := $(my_target_libgcc)
+$(linked_module): PRIVATE_TARGET_CRTBEGIN_SO_O := $(my_target_crtbegin_so_o)
+$(linked_module): PRIVATE_TARGET_CRTEND_SO_O := $(my_target_crtend_so_o)
+
$(linked_module): $(all_objects) $(all_libraries) \
$(LOCAL_ADDITIONAL_DEPENDENCIES) \
- $(TARGET_CRTBEGIN_SO_O) $(TARGET_CRTEND_SO_O)
+ $(my_target_crtbegin_so_o) $(my_target_crtend_so_o)
$(transform-o-to-shared-lib)
diff --git a/core/static_library.mk b/core/static_library.mk
index 2138e46..4ff5a34 100644
--- a/core/static_library.mk
+++ b/core/static_library.mk
@@ -19,10 +19,10 @@
ifeq ($(LOCAL_RAW_STATIC_LIBRARY),true)
LOCAL_RAW_STATIC_LIBRARY:=
-$(all_objects) : TARGET_PROJECT_INCLUDES :=
-$(all_objects) : TARGET_C_INCLUDES :=
-$(all_objects) : TARGET_GLOBAL_CFLAGS :=
-$(all_objects) : TARGET_GLOBAL_CPPFLAGS :=
+$(all_objects) : PRIVATE_TARGET_PROJECT_INCLUDES :=
+$(all_objects) : PRIVATE_TARGET_C_INCLUDES :=
+$(all_objects) : PRIVATE_TARGET_GLOBAL_CFLAGS :=
+$(all_objects) : PRIVATE_TARGET_GLOBAL_CPPFLAGS :=
endif
$(LOCAL_BUILT_MODULE): $(built_whole_libraries)
diff --git a/core/tasks/cts.mk b/core/tasks/cts.mk
index a1276f4..f697347 100644
--- a/core/tasks/cts.mk
+++ b/core/tasks/cts.mk
@@ -29,79 +29,17 @@
junit_host_jar := $(HOST_OUT_JAVA_LIBRARIES)/junit.jar
HOSTTESTLIB_JAR := $(HOST_OUT_JAVA_LIBRARIES)/hosttestlib.jar
-CTS_CORE_CASE_LIST := android.core.tests.annotation \
- android.core.tests.archive \
- android.core.tests.concurrent \
- android.core.tests.crypto \
+CTS_CORE_CASE_LIST := \
android.core.tests.dom \
- android.core.tests.logging \
android.core.tests.luni.io \
android.core.tests.luni.lang \
android.core.tests.luni.net \
android.core.tests.luni.util \
- android.core.tests.math \
- android.core.tests.nio \
- android.core.tests.nio_char \
- android.core.tests.prefs \
- android.core.tests.regex \
- android.core.tests.security \
- android.core.tests.sql \
- android.core.tests.text \
android.core.tests.xml \
- android.core.tests.xnet \
android.core.tests.runner
-CTS_SECURITY_APPS_LIST := \
- CtsAppAccessData \
- CtsAppWithData \
- CtsInstrumentationAppDiffCert \
- CtsPermissionDeclareApp \
- CtsSharedUidInstall \
- CtsSharedUidInstallDiffCert \
- CtsSimpleAppInstall \
- CtsSimpleAppInstallDiffCert \
- CtsTargetInstrumentationApp \
- CtsUsePermissionDiffCert
-
-CTS_CASE_LIST := \
- TestDeviceSetup \
- CtsTestStubs \
- CtsAccountManagerTestCases \
- CtsAppTestCases \
- CtsBluetoothTestCases \
- CtsContentTestCases \
- CtsDatabaseTestCases \
- CtsDpiTestCases \
- CtsDpiTestCases2 \
- CtsExampleTestCases \
- CtsGestureTestCases \
- CtsGraphicsTestCases \
- CtsHardwareTestCases \
- CtsJniTestCases \
- CtsLocationTestCases \
- CtsMediaTestCases \
- CtsOsTestCases \
- CtsPermissionTestCases \
- CtsPermission2TestCases \
- CtsProviderTestCases \
- CtsSpeechTestCases \
- CtsTelephonyTestCases \
- CtsTextTestCases \
- CtsUtilTestCases \
- CtsViewTestCases \
- CtsWebkitTestCases \
- CtsWidgetTestCases \
- CtsNetTestCases \
- SignatureTest \
- CtsPerformanceTestCases \
- CtsPerformance2TestCases \
- CtsPerformance3TestCases \
- CtsPerformance4TestCases \
- CtsPerformance5TestCases \
- ApiDemos \
- ApiDemosReferenceTest \
- $(CTS_CORE_CASE_LIST) \
- $(CTS_SECURITY_APPS_LIST)
+-include cts/CtsTestCaseList.mk
+CTS_CASE_LIST := $(CTS_CORE_CASE_LIST) $(CTS_TEST_CASE_LIST)
DEFAULT_TEST_PLAN := $(PRIVATE_DIR)/resource/plans
@@ -147,8 +85,13 @@
endef
CORE_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,core,,COMMON)
+JUNIT_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,core-junit,,COMMON)
+RUNNER_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,core-junitrunner,,COMMON)
+SUPPORT_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,core-tests-support,,COMMON)
+DOM_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,core-tests-dom,,COMMON)
+XML_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,core-tests-xml,,COMMON)
TESTS_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,core-tests,,COMMON)
-GEN_CLASSPATH := $(CORE_INTERMEDIATES)/classes.jar:$(TESTS_INTERMEDIATES)/classes.jar:$(CORE_INTERMEDIATES)/javalib.jar:$(TESTS_INTERMEDIATES)/javalib.jar:$(HOST_OUT_JAVA_LIBRARIES)/descGen.jar:$(HOST_JDK_TOOLS_JAR)
+GEN_CLASSPATH := $(CORE_INTERMEDIATES)/classes.jar:$(JUNIT_INTERMEDIATES)/classes.jar:$(RUNNER_INTERMEDIATES)/classes.jar:$(SUPPORT_INTERMEDIATES)/classes.jar:$(DOM_INTERMEDIATES)/classes.jar:$(XML_INTERMEDIATES)/classes.jar:$(TESTS_INTERMEDIATES)/classes.jar:$(CORE_INTERMEDIATES)/javalib.jar:$(JUNIT_INTERMEDIATES)/javalib.jar:$(RUNNER_INTERMEDIATES)/javalib.jar:$(SUPPORT_INTERMEDIATES)/javalib.jar:$(DOM_INTERMEDIATES)/javalib.jar:$(XML_INTERMEDIATES)/javalib.jar:$(TESTS_INTERMEDIATES)/javalib.jar:$(HOST_OUT_JAVA_LIBRARIES)/descGen.jar:$(HOST_JDK_TOOLS_JAR)
$(cts_dir)/all_cts_core_files_stamp: PRIVATE_CLASSPATH:=$(GEN_CLASSPATH)
$(cts_dir)/all_cts_core_files_stamp: PRIVATE_JAVAOPTS:=-Xmx256M
@@ -159,25 +102,10 @@
# build system requires that dependencies use javalib.jar. If
# javalib.jar is up-to-date, then classes.jar is as well. Depending
# on classes.jar will build the files incorrectly.
-$(cts_dir)/all_cts_core_files_stamp: $(CTS_CORE_CASE_LIST) $(HOST_OUT_JAVA_LIBRARIES)/descGen.jar $(CORE_INTERMEDIATES)/javalib.jar $(TESTS_INTERMEDIATES)/javalib.jar $(cts_dir)/all_cts_files_stamp | $(ACP)
- $(call generate-core-test-description,$(cts_dir)/$(cts_name)/repository/testcases/android.core.tests.annotation,\
- cts/tests/core/annotation/AndroidManifest.xml,\
- tests.annotation.AllTests)
- $(call generate-core-test-description,$(cts_dir)/$(cts_name)/repository/testcases/android.core.tests.archive,\
- cts/tests/core/archive/AndroidManifest.xml,\
- tests.archive.AllTests)
- $(call generate-core-test-description,$(cts_dir)/$(cts_name)/repository/testcases/android.core.tests.concurrent,\
- cts/tests/core/concurrent/AndroidManifest.xml,\
- tests.concurrent.AllTests)
- $(call generate-core-test-description,$(cts_dir)/$(cts_name)/repository/testcases/android.core.tests.crypto,\
- cts/tests/core/crypto/AndroidManifest.xml,\
- tests.crypto.AllTests)
+$(cts_dir)/all_cts_core_files_stamp: $(CTS_CORE_CASE_LIST) $(HOST_OUT_JAVA_LIBRARIES)/descGen.jar $(CORE_INTERMEDIATES)/javalib.jar $(JUNIT_INTERMEDIATES)/javalib.jar $(RUNNER_INTERMEDIATES)/javalib.jar $(SUPPORT_INTERMEDIATES)/javalib.jar $(DOM_INTERMEDIATES)/javalib.jar $(XML_INTERMEDIATES)/javalib.jar $(TESTS_INTERMEDIATES)/javalib.jar $(cts_dir)/all_cts_files_stamp | $(ACP)
$(call generate-core-test-description,$(cts_dir)/$(cts_name)/repository/testcases/android.core.tests.dom,\
cts/tests/core/dom/AndroidManifest.xml,\
tests.dom.AllTests)
- $(call generate-core-test-description,$(cts_dir)/$(cts_name)/repository/testcases/android.core.tests.logging,\
- cts/tests/core/logging/AndroidManifest.xml,\
- tests.logging.AllTests)
$(call generate-core-test-description,$(cts_dir)/$(cts_name)/repository/testcases/android.core.tests.luni.io,\
cts/tests/core/luni-io/AndroidManifest.xml,\
tests.luni.AllTestsIo)
@@ -190,36 +118,9 @@
$(call generate-core-test-description,$(cts_dir)/$(cts_name)/repository/testcases/android.core.tests.luni.util,\
cts/tests/core/luni-util/AndroidManifest.xml,\
tests.luni.AllTestsUtil)
- $(call generate-core-test-description,$(cts_dir)/$(cts_name)/repository/testcases/android.core.tests.math,\
- cts/tests/core/math/AndroidManifest.xml,\
- tests.math.AllTests)
- $(call generate-core-test-description,$(cts_dir)/$(cts_name)/repository/testcases/android.core.tests.nio,\
- cts/tests/core/nio/AndroidManifest.xml,\
- tests.nio.AllTests)
- $(call generate-core-test-description,$(cts_dir)/$(cts_name)/repository/testcases/android.core.tests.nio_char,\
- cts/tests/core/nio_char/AndroidManifest.xml,\
- tests.nio_char.AllTests)
- $(call generate-core-test-description,$(cts_dir)/$(cts_name)/repository/testcases/android.core.tests.prefs,\
- cts/tests/core/prefs/AndroidManifest.xml,\
- tests.prefs.AllTests)
- $(call generate-core-test-description,$(cts_dir)/$(cts_name)/repository/testcases/android.core.tests.regex,\
- cts/tests/core/regex/AndroidManifest.xml,\
- tests.regex.AllTests)
- $(call generate-core-test-description,$(cts_dir)/$(cts_name)/repository/testcases/android.core.tests.security,\
- cts/tests/core/security/AndroidManifest.xml,\
- tests.security.AllTests)
- $(call generate-core-test-description,$(cts_dir)/$(cts_name)/repository/testcases/android.core.tests.sql,\
- cts/tests/core/sql/AndroidManifest.xml,\
- tests.sql.AllTests)
- $(call generate-core-test-description,$(cts_dir)/$(cts_name)/repository/testcases/android.core.tests.text,\
- cts/tests/core/text/AndroidManifest.xml,\
- tests.text.AllTests)
$(call generate-core-test-description,$(cts_dir)/$(cts_name)/repository/testcases/android.core.tests.xml,\
cts/tests/core/xml/AndroidManifest.xml,\
tests.xml.AllTests)
- $(call generate-core-test-description,$(cts_dir)/$(cts_name)/repository/testcases/android.core.tests.xnet,\
- cts/tests/core/xnet/AndroidManifest.xml,\
- tests.xnet.AllTests)
$(hide) touch $@
@@ -229,17 +130,19 @@
VMTESTS_INTERMEDIATES :=$(call intermediates-dir-for,EXECUTABLES,vm-tests,1,)
# core tests only needed to get hold of junit-framework-classes
-TESTS_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,core-tests,,COMMON)
CORE_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,core,,COMMON)
+JUNIT_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,core-junit,,COMMON)
+RUNNER_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,core-junitrunner,,COMMON)
+TESTS_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,core-tests,,COMMON)
-GEN_CLASSPATH := $(CORE_INTERMEDIATES)/classes.jar:$(TESTS_INTERMEDIATES)/classes.jar:$(VMTESTS_INTERMEDIATES)/android.core.vm-tests.jar:$(HOST_OUT_JAVA_LIBRARIES)/descGen.jar:$(HOST_JDK_TOOLS_JAR)
+GEN_CLASSPATH := $(CORE_INTERMEDIATES)/classes.jar:$(JUNIT_INTERMEDIATES)/classes.jar:$(RUNNER_INTERMEDIATES)/classes.jar:$(TESTS_INTERMEDIATES)/classes.jar:$(VMTESTS_INTERMEDIATES)/android.core.vm-tests.jar:$(HOST_OUT_JAVA_LIBRARIES)/descGen.jar:$(HOST_JDK_TOOLS_JAR)
$(CORE_VM_TEST_DESC): PRIVATE_CLASSPATH:=$(GEN_CLASSPATH)
$(CORE_VM_TEST_DESC): PRIVATE_PARAMS:=-Dcts.useSuppliedTestResult=true
$(CORE_VM_TEST_DESC): PRIVATE_PARAMS+=-Dcts.useEnhancedJunit=true
$(CORE_VM_TEST_DESC): PRIVATE_JAVAOPTS:=-Xmx256M
# Please see big comment above on why this line depends on javalib.jar instead of classes.jar
-$(CORE_VM_TEST_DESC): vm-tests $(HOST_OUT_JAVA_LIBRARIES)/descGen.jar $(CORE_INTERMEDIATES)/javalib.jar $(VMTESTS_INTERMEDIATES)/android.core.vm-tests.jar $(TESTS_INTERMEDIATES)/javalib.jar $(cts_dir)/all_cts_files_stamp | $(ACP)
+$(CORE_VM_TEST_DESC): vm-tests $(HOST_OUT_JAVA_LIBRARIES)/descGen.jar $(CORE_INTERMEDIATES)/javalib.jar $(JUNIT_INTERMEDIATES)/javalib.jar $(RUNNER_INTERMEDIATES)/javalib.jar $(VMTESTS_INTERMEDIATES)/android.core.vm-tests.jar $(TESTS_INTERMEDIATES)/javalib.jar $(cts_dir)/all_cts_files_stamp | $(ACP)
$(call generate-core-test-description,$(CORE_VM_TEST_DESC),\
cts/tests/vm-tests/AndroidManifest.xml,\
dot.junit.AllJunitHostTests, cts/tools/vm-tests/Android.mk)
diff --git a/core/tasks/ide.mk b/core/tasks/ide.mk
new file mode 100644
index 0000000..e557e60
--- /dev/null
+++ b/core/tasks/ide.mk
@@ -0,0 +1,62 @@
+#
+# Copyright (C) 2010 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+define filter-ide-goals
+$(strip $(filter $(1)-%,$(MAKECMDGOALS)))
+endef
+
+define filter-ide-modules
+$(strip $(subst -,$(space),$(patsubst $(1)-%,%,$(2))))
+endef
+
+# eclipse
+eclipse_project_goals := $(call filter-ide-goals,ECLIPSE)
+ifdef eclipse_project_goals
+ ifneq ($(words $(eclipse_project_goals)),1)
+ $(error Only one ECLIPSE- goal may be specified: $(eclipse_project_goals))
+ endif
+ eclipse_project_modules := $(call filter-ide-modules,ECLIPSE,$(eclipse_project_goals))
+
+ ifneq ($(filter lunch,$(eclipse_project_modules)),)
+ eclipse_project_modules := $(filter-out lunch,$(eclipse_project_modules))
+ installed_modules := $(foreach m,$(ALL_DEFAULT_INSTALLED_MODULES),\
+ $(INSTALLABLE_FILES.$(m).MODULE))
+ java_modules := $(foreach m,$(installed_modules),\
+ $(if $(filter JAVA_LIBRARIES APPS,$(ALL_MODULES.$(m).CLASS)),$(m),))
+ eclipse_project_modules := $(sort $(eclipse_project_modules) $(java_modules))
+ endif
+
+ source_paths := $(foreach m,$(eclipse_project_modules),$(ALL_MODULES.$(m).PATH)) \
+ $(foreach m,$(eclipse_project_modules),$(ALL_MODULES.$(m).INTERMEDIATE_SOURCE_DIR)) \
+ $(INTERNAL_SDK_SOURCE_DIRS)
+ source_paths := $(sort $(source_paths))
+
+.classpath: PRIVATE_MODULES := $(eclipse_project_modules)
+.classpath: PRIVATE_DIRS := $(source_paths)
+
+# the mess below with ./src tries to guess whether the src
+$(eclipse_project_goals): .classpath
+.classpath: FORCE
+ $(hide) echo Generating .classpath for eclipse
+ $(hide) echo '<classpath>' > $@
+ $(hide) for p in $(PRIVATE_DIRS) ; do \
+ echo -n ' <classpathentry kind="src" path="' >> $@ ; \
+ ( if [ -d $$p/src ] ; then echo -n $$p/src ; else echo -n $$p ; fi ) >> $@ ; \
+ echo '"/>' >> $@ ; \
+ done
+ $(hide) echo '</classpath>' >> $@
+endif
+
diff --git a/envsetup.sh b/envsetup.sh
index 202e6c2..0873474 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -106,7 +106,7 @@
# and in with the new
CODE_REVIEWS=
prebuiltdir=$(getprebuilt)
- export ANDROID_EABI_TOOLCHAIN=$prebuiltdir/toolchain/arm-eabi-4.4.0/bin
+ export ANDROID_EABI_TOOLCHAIN=$prebuiltdir/toolchain/arm-eabi-4.4.3/bin
export ANDROID_TOOLCHAIN=$ANDROID_EABI_TOOLCHAIN
export ANDROID_QTOOLS=$T/development/emulator/qtools
export ANDROID_BUILD_PATHS=:$(get_build_var ANDROID_BUILD_PATHS):$ANDROID_QTOOLS:$ANDROID_TOOLCHAIN:$ANDROID_EABI_TOOLCHAIN$CODE_REVIEWS
@@ -650,7 +650,7 @@
elif [ ! "$M" ]; then
echo "Couldn't locate a makefile from the current directory."
else
- ONE_SHOT_MAKEFILE=$M make -C $T files $@
+ ONE_SHOT_MAKEFILE=$M make -C $T all_modules $@
fi
fi
}
@@ -682,13 +682,15 @@
ARGS="$ARGS snod"
elif [ "$DIR" = showcommands ]; then
ARGS="$ARGS showcommands"
+ elif [ "$DIR" = dist ]; then
+ ARGS="$ARGS dist"
else
echo "No Android.mk in $DIR."
return 1
fi
fi
done
- ONE_SHOT_MAKEFILE="$MAKEFILE" make -C $T $DASH_ARGS files $ARGS
+ ONE_SHOT_MAKEFILE="$MAKEFILE" make -C $T $DASH_ARGS all_modules $ARGS
else
echo "Couldn't locate the top of the tree. Try setting TOP."
fi
diff --git a/target/board/emulator/BoardConfig.mk b/target/board/emulator/BoardConfig.mk
index 784118a..9ab607a 100644
--- a/target/board/emulator/BoardConfig.mk
+++ b/target/board/emulator/BoardConfig.mk
@@ -7,3 +7,6 @@
TARGET_NO_BOOTLOADER := true
TARGET_NO_KERNEL := true
HAVE_HTC_AUDIO_DRIVER := true
+
+# no hardware camera
+USE_CAMERA_STUB := true
diff --git a/target/board/generic/BoardConfig.mk b/target/board/generic/BoardConfig.mk
index f630dac..26bf6ab 100644
--- a/target/board/generic/BoardConfig.mk
+++ b/target/board/generic/BoardConfig.mk
@@ -10,5 +10,8 @@
HAVE_HTC_AUDIO_DRIVER := true
BOARD_USES_GENERIC_AUDIO := true
+# no hardware camera
+USE_CAMERA_STUB := true
+
# Set /system/bin/sh to mksh, not ash, to test the transition.
TARGET_SHELL := mksh
diff --git a/target/board/sim/BoardConfig.mk b/target/board/sim/BoardConfig.mk
index 491b30f..ba25c18 100644
--- a/target/board/sim/BoardConfig.mk
+++ b/target/board/sim/BoardConfig.mk
@@ -20,6 +20,12 @@
# The simulator does not support native code at all
TARGET_CPU_ABI := none
+# But it is very likely SMP.
+TARGET_CPU_SMP := true
+
#the simulator partially emulates the original HTC /dev/eac audio interface
HAVE_HTC_AUDIO_DRIVER := true
BOARD_USES_GENERIC_AUDIO := true
+
+# no hardware camera
+USE_CAMERA_STUB := true
diff --git a/target/product/core.mk b/target/product/core.mk
index a35df85..f87ee46 100644
--- a/target/product/core.mk
+++ b/target/product/core.mk
@@ -18,8 +18,6 @@
PRODUCT_DEVICE := generic
PRODUCT_NAME := core
-PRODUCT_POLICY := android.policy_phone
-
PRODUCT_PROPERTY_OVERRIDES := \
ro.config.notification_sound=OnTheHunt.ogg \
ro.config.alarm_alert=Alarm_Classic.ogg
@@ -47,7 +45,4 @@
Bugreport
PRODUCT_PROPERTY_OVERRIDES += \
- media.stagefright.enable-player=true \
- media.stagefright.enable-meta=true \
- media.stagefright.enable-scan=true \
- media.stagefright.enable-http=true
+ media.stagefright.enable-record=true
diff --git a/target/product/generic.mk b/target/product/generic.mk
index f05c441..1f26a75 100644
--- a/target/product/generic.mk
+++ b/target/product/generic.mk
@@ -39,6 +39,7 @@
QuickSearchBox \
Settings \
Sync \
+ SystemUI \
Updater \
CalendarProvider \
SyncProvider
diff --git a/tools/adbs b/tools/adbs
index 815ae10..8277790 100755
--- a/tools/adbs
+++ b/tools/adbs
@@ -144,13 +144,13 @@
uname = "darwin-ppc"
elif uname == "Linux":
uname = "linux-x86"
- prefix = "./prebuilt/" + uname + "/toolchain/arm-eabi-4.4.0/bin/"
+ prefix = "./prebuilt/" + uname + "/toolchain/arm-eabi-4.4.3/bin/"
addr2line_cmd = prefix + "arm-eabi-addr2line"
if (not os.path.exists(addr2line_cmd)):
try:
prefix = os.environ['ANDROID_BUILD_TOP'] + "/prebuilt/" + uname + \
- "/toolchain/arm-eabi-4.4.0/bin/"
+ "/toolchain/arm-eabi-4.4.3/bin/"
except:
prefix = "";
diff --git a/tools/droiddoc/src/ClearPage.java b/tools/droiddoc/src/ClearPage.java
index 184c8b8..016ca93 100644
--- a/tools/droiddoc/src/ClearPage.java
+++ b/tools/droiddoc/src/ClearPage.java
@@ -23,6 +23,7 @@
import java.io.OutputStreamWriter;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.List;
public class ClearPage
{
@@ -43,7 +44,7 @@
private static boolean mTemplateDirSet = false;
public static String outputDir = "docs";
- public static String htmlDir = null;
+ public static List<String> htmlDirs = new ArrayList<String>();
public static String toroot = null;
public static void addTemplateDir(String dir)
@@ -76,7 +77,7 @@
public static void write(HDF data, String templ, String filename, boolean fullPath)
{
- if (htmlDir != null) {
+ if (!htmlDirs.isEmpty()) {
data.setValue("hasindex", "true");
}
@@ -103,9 +104,11 @@
}
int i=0;
- if (htmlDir != null) {
- data.setValue("hdf.loadpaths." + i, htmlDir);
- i++;
+ if (!htmlDirs.isEmpty()) {
+ for (String dir : htmlDirs) {
+ data.setValue("hdf.loadpaths." + i, dir);
+ i++;
+ }
}
if (mTemplateDirSet) {
for (String dir: mTemplateDirs) {
diff --git a/tools/droiddoc/src/DroidDoc.java b/tools/droiddoc/src/DroidDoc.java
index 4e9d6b1..deb6910 100644
--- a/tools/droiddoc/src/DroidDoc.java
+++ b/tools/droiddoc/src/DroidDoc.java
@@ -122,7 +122,7 @@
sampleCodes.add(new SampleCode(a[1], a[2], a[3]));
}
else if (a[0].equals("-htmldir")) {
- ClearPage.htmlDir = a[1];
+ ClearPage.htmlDirs.add(a[1]);
}
else if (a[0].equals("-title")) {
DroidDoc.title = a[1];
@@ -224,7 +224,7 @@
}
// HTML Pages
- if (ClearPage.htmlDir != null) {
+ if (!ClearPage.htmlDirs.isEmpty()) {
writeHTMLPages();
}
@@ -233,7 +233,7 @@
// Packages Pages
writePackages(javadocDir
- + (ClearPage.htmlDir!=null
+ + (!ClearPage.htmlDirs.isEmpty()
? "packages" + htmlExtension
: "index" + htmlExtension));
@@ -575,11 +575,14 @@
public static void writeHTMLPages()
{
- File f = new File(ClearPage.htmlDir);
- if (!f.isDirectory()) {
- System.err.println("htmlDir not a directory: " + ClearPage.htmlDir);
+ for (String htmlDir : ClearPage.htmlDirs) {
+ File f = new File(htmlDir);
+ if (!f.isDirectory()) {
+ System.err.println("htmlDir not a directory: " + htmlDir);
+ continue;
+ }
+ writeDirectory(f, "");
}
- writeDirectory(f, "");
}
public static void writeLists()
diff --git a/tools/droiddoc/src/Stubs.java b/tools/droiddoc/src/Stubs.java
index e1ec76a..b988ef5 100644
--- a/tools/droiddoc/src/Stubs.java
+++ b/tools/droiddoc/src/Stubs.java
@@ -315,6 +315,12 @@
return;
}
+ // Work around the bogus "Array" class we invent for
+ // Arrays.copyOf's Class<? extends T[]> newType parameter. (http://b/2715505)
+ if (cl.containingPackage() != null && cl.containingPackage().name().equals("")) {
+ return;
+ }
+
String filename = stubsDir + '/' + javaFileName(cl);
File file = new File(filename);
ClearPage.ensureDirectory(file);
@@ -788,6 +794,11 @@
HashSet notStrippable) {
ClassInfo[] classes = classList.toArray(new ClassInfo[classList.size()]);
Arrays.sort(classes, ClassInfo.comparator);
+ // Work around the bogus "Array" class we invent for
+ // Arrays.copyOf's Class<? extends T[]> newType parameter. (http://b/2715505)
+ if (pack.name().equals("")) {
+ return;
+ }
xmlWriter.println("<package name=\"" + pack.name() + "\"\n"
//+ " source=\"" + pack.position() + "\"\n"
+ ">");
diff --git a/tools/droiddoc/templates-sdk/sdkpage.cs b/tools/droiddoc/templates-sdk/sdkpage.cs
index a062af3..0205408 100644
--- a/tools/droiddoc/templates-sdk/sdkpage.cs
+++ b/tools/droiddoc/templates-sdk/sdkpage.cs
@@ -24,10 +24,10 @@
<div id="jd-content">
<p>Redirecting to
<a href="<?cs var:toroot ?>sdk/<?cs
- if:sdk.redirect.path ?><?cs var:sdk.redirect.path ?><?cs
- else ?><?cs var:sdk.current ?>/index.html<?cs /if ?>">sdk/<?cs
- if:sdk.redirect.path ?><?cs var:sdk.redirect.path ?><?cs
- else ?><?cs var:sdk.current ?>/index.html<?cs /if ?>
+ if:sdk.redirect.path ?><?cs var:sdk.redirect.path ?><?cs
+ else ?>index.html<?cs /if ?>"><?cs
+ if:sdk.redirect.path ?><?cs var:sdk.redirect.path ?><?cs
+ else ?>Download the SDK<?cs /if ?>
</a> ...</p>
<?cs else ?>
<div class="g-unit" id="doc-content" >
diff --git a/tools/droiddoc/templates/assets/android-developer-docs.css b/tools/droiddoc/templates/assets/android-developer-docs.css
index da39a4a..bc9e98b 100644
--- a/tools/droiddoc/templates/assets/android-developer-docs.css
+++ b/tools/droiddoc/templates/assets/android-developer-docs.css
@@ -884,7 +884,8 @@
text-decoration:none;
}
-#qv a {
+#qv a,
+#qv a code {
color:#cc6600;
}
diff --git a/tools/droiddoc/templates/assets/images/home/devphone-large.png b/tools/droiddoc/templates/assets/images/home/devphone-large.png
index 6221e0a..0db0f6c 100644
--- a/tools/droiddoc/templates/assets/images/home/devphone-large.png
+++ b/tools/droiddoc/templates/assets/images/home/devphone-large.png
Binary files differ
diff --git a/tools/droiddoc/templates/assets/images/home/devphone-small.png b/tools/droiddoc/templates/assets/images/home/devphone-small.png
old mode 100755
new mode 100644
index b8487f5..e10bfa9
--- a/tools/droiddoc/templates/assets/images/home/devphone-small.png
+++ b/tools/droiddoc/templates/assets/images/home/devphone-small.png
Binary files differ
diff --git a/tools/merge-event-log-tags.py b/tools/merge-event-log-tags.py
index df9ebce..bddda90 100755
--- a/tools/merge-event-log-tags.py
+++ b/tools/merge-event-log-tags.py
@@ -36,6 +36,7 @@
warnings = []
output_file = None
+pre_merged_file = None
# Tags with a tag number of ? are assigned a tag in the range
# [ASSIGN_START, ASSIGN_LIMIT).
@@ -43,7 +44,7 @@
ASSIGN_LIMIT = 1000000
try:
- opts, args = getopt.getopt(sys.argv[1:], "ho:")
+ opts, args = getopt.getopt(sys.argv[1:], "ho:m:")
except getopt.GetoptError, err:
print str(err)
print __doc__
@@ -55,6 +56,8 @@
sys.exit(2)
elif o == "-o":
output_file = a
+ elif o == "-m":
+ pre_merged_file = a
else:
print >> sys.stderr, "unhandled option %s" % (o,)
sys.exit(1)
@@ -71,6 +74,11 @@
by_tagname = {}
by_tagnum = {}
+pre_merged_tags = {}
+if pre_merged_file:
+ for t in event_log_tags.TagFile(pre_merged_file).tags:
+ pre_merged_tags[t.tagname] = t
+
for fn in args:
tagfile = event_log_tags.TagFile(fn)
@@ -140,15 +148,26 @@
# assigned. We do this based on a hash of the tag name so that the
# numbers should stay relatively stable as tags are added.
+# If we were provided pre-merged tags (w/ the -m option), then don't
+# ever try to allocate one, just fail if we don't have a number
+
for name, t in sorted(by_tagname.iteritems()):
if t.tagnum is None:
- while True:
- x = (hashname(name) % (ASSIGN_LIMIT - ASSIGN_START - 1)) + ASSIGN_START
- if x not in by_tagnum:
- t.tagnum = x
- by_tagnum[x] = t
- break
- name = "_" + name
+ if pre_merged_tags:
+ try:
+ t.tagnum = pre_merged_tags[t.tagname]
+ except KeyError:
+ print >> sys.stderr, ("Error: Tag number not defined for tag `%s'."
+ +" Have you done a full build?") % t.tagname
+ sys.exit(1)
+ else:
+ while True:
+ x = (hashname(name) % (ASSIGN_LIMIT - ASSIGN_START - 1)) + ASSIGN_START
+ if x not in by_tagnum:
+ t.tagnum = x
+ by_tagnum[x] = t
+ break
+ name = "_" + name
# by_tagnum should be complete now; we've assigned numbers to all tags.
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index ab6678a..6bb37ae 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -36,6 +36,7 @@
OPTIONS.tempfiles = []
OPTIONS.device_specific = None
OPTIONS.extras = {}
+OPTIONS.mkyaffs2_extra_flags = None
# Values for "certificate" in apkcerts that mean special things.
@@ -69,6 +70,17 @@
pass
+def LoadMkyaffs2ExtraFlags():
+ """Load mkyaffs2 extra flags."""
+ try:
+ fn = os.path.join(OPTIONS.input_tmp, "META", "mkyaffs2-extra-flags.txt");
+ if os.access(fn, os.F_OK):
+ OPTIONS.mkyaffs2_extra_flags = open(fn).read().rstrip("\n")
+ except IOError, e:
+ if e.errno == errno.ENOENT:
+ pass
+
+
def BuildAndAddBootableImage(sourcedir, targetname, output_zip):
"""Take a kernel, cmdline, and ramdisk directory from the input (in
'sourcedir'), and turn them into a boot image. Put the boot image
@@ -121,6 +133,11 @@
cmd.append("--base")
cmd.append(open(fn).read().rstrip("\n"))
+ fn = os.path.join(sourcedir, "pagesize")
+ if os.access(fn, os.F_OK):
+ cmd.append("--pagesize")
+ cmd.append(open(fn).read().rstrip("\n"))
+
cmd.extend(["--ramdisk", ramdisk_img.name,
"--output", img.name])
diff --git a/tools/releasetools/img_from_target_files b/tools/releasetools/img_from_target_files
index d157dca..9bf373c 100755
--- a/tools/releasetools/img_from_target_files
+++ b/tools/releasetools/img_from_target_files
@@ -23,6 +23,11 @@
-b (--board_config) <file>
Deprecated.
+ -f (--fs_type) <value>
+ The file system type of the user image files to be created.
+ It can be ext fs variants, such as ext2, ext3, ext4, etc.
+ efault is yaffs.
+
"""
import sys
@@ -47,6 +52,9 @@
OPTIONS = common.OPTIONS
+class UserImageOptions(object): pass
+USERIMAGE_OPTIONS = UserImageOptions()
+USERIMAGE_OPTIONS.fs_type = None
def AddUserdata(output_zip):
"""Create an empty userdata image and store it in output_zip."""
@@ -61,11 +69,25 @@
os.mkdir(user_dir)
img = tempfile.NamedTemporaryFile()
- p = common.Run(["mkyaffs2image", "-f", user_dir, img.name])
- p.communicate()
- assert p.returncode == 0, "mkyaffs2image of userdata.img image failed"
+ build_command = []
+ if USERIMAGE_OPTIONS.fs_type is not None and USERIMAGE_OPTIONS.fs_type.startswith("ext"):
+ build_command = ["mkuserimg.sh",
+ user_dir, img.name, USERIMAGE_OPTIONS.fs_type, "userdata"]
+ if "userdata.img" in OPTIONS.max_image_size:
+ build_command.append(str(OPTIONS.max_image_size["userdata.img"]))
+ else:
+ build_command = ["mkyaffs2image", "-f"]
+ if OPTIONS.mkyaffs2_extra_flags is not None:
+ build_command.append(OPTIONS.mkyaffs2_extra_flags);
+ build_command.append(user_dir)
+ build_command.append(img.name)
- common.CheckSize(img.name, "userdata.img")
+ p = common.Run(build_command)
+ p.communicate()
+ assert p.returncode == 0, "build userdata.img image failed"
+
+ if USERIMAGE_OPTIONS.fs_type is None or not USERIMAGE_OPTIONS.fs_type.startswith("ext"):
+ common.CheckSize(img.name, "userdata.img")
output_zip.write(img.name, "userdata.img")
img.close()
os.rmdir(user_dir)
@@ -94,16 +116,36 @@
if (e.errno == errno.EEXIST):
pass
- p = common.Run(["mkyaffs2image", "-f",
- os.path.join(OPTIONS.input_tmp, "system"), img.name])
- p.communicate()
- assert p.returncode == 0, "mkyaffs2image of system.img image failed"
+ build_command = []
+ if USERIMAGE_OPTIONS.fs_type is not None and USERIMAGE_OPTIONS.fs_type.startswith("ext"):
+ build_command = ["mkuserimg.sh",
+ os.path.join(OPTIONS.input_tmp, "system"), img.name,
+ USERIMAGE_OPTIONS.fs_type, "system"]
+ if "system.img" in OPTIONS.max_image_size:
+ build_command.append(str(OPTIONS.max_image_size["system.img"]))
+ else:
+ build_command = ["mkyaffs2image", "-f"]
+ if OPTIONS.mkyaffs2_extra_flags is not None:
+ build_command.append(OPTIONS.mkyaffs2_extra_flags);
+ build_command.append(os.path.join(OPTIONS.input_tmp, "system"))
+ build_command.append(img.name)
+
+ # p = common.Run(build_command)
+ # p.communicate()
+ # assert p.returncode == 0, "build system.img image failed"
+
+ # TODO: Why the above common.Run() generate different system.img for crespo?
+ str_command = " ".join(build_command)
+ print "running " + str_command
+ exit_code = os.system(str_command)
+ assert exit_code == 0, "build system.img image failed"
img.seek(os.SEEK_SET, 0)
data = img.read()
img.close()
- common.CheckSize(data, "system.img")
+ if USERIMAGE_OPTIONS.fs_type is None or not USERIMAGE_OPTIONS.fs_type.startswith("ext"):
+ common.CheckSize(data, "system.img")
common.ZipWriteStr(output_zip, "system.img", data)
@@ -118,13 +160,15 @@
def option_handler(o, a):
if o in ("-b", "--board_config"):
pass # deprecated
+ elif o in ("-f", "--fs_type"):
+ USERIMAGE_OPTIONS.fs_type = a
else:
return False
return True
args = common.ParseOptions(argv, __doc__,
- extra_opts="b:",
- extra_long_opts=["board_config="],
+ extra_opts="b:f:",
+ extra_long_opts=["board_config=", "fs_type="],
extra_option_handler=option_handler)
if len(args) != 2:
@@ -140,6 +184,8 @@
print " image size limits."
print
+ common.LoadMkyaffs2ExtraFlags()
+
output_zip = zipfile.ZipFile(args[1], "w", compression=zipfile.ZIP_DEFLATED)
common.AddBoot(output_zip)
diff --git a/tools/soslim/main.c b/tools/soslim/main.c
index fa5a315..dd8a60b 100644
--- a/tools/soslim/main.c
+++ b/tools/soslim/main.c
@@ -337,7 +337,7 @@
section_name = "(undefined)";
}
/* value size binding type section symname */
- PRINT("%-15s %8d: %08llx %08llx %c%c %5d %n%s%n",
+ PRINT("%-15s %8zd: %08llx %08llx %c%c %5d %n%s%n",
file,
index,
sym->st_value, sym->st_size, bind, type,
diff --git a/tools/soslim/prelink_info.c b/tools/soslim/prelink_info.c
index 36516b1..81d5de3 100644
--- a/tools/soslim/prelink_info.c
+++ b/tools/soslim/prelink_info.c
@@ -14,13 +14,13 @@
typedef struct {
uint32_t mmap_addr;
char tag[4]; /* 'P', 'R', 'E', ' ' */
-} prelink_info_t __attribute__((packed));
+} __attribute__((packed)) prelink_info_t;
static inline void set_prelink(long *prelink_addr,
int elf_little,
prelink_info_t *info)
{
- FAILIF(sizeof(prelink_info_t) != 8, "Unexpected sizeof(prelink_info_t) == %d!\n", sizeof(prelink_info_t));
+ FAILIF(sizeof(prelink_info_t) != 8, "Unexpected sizeof(prelink_info_t) == %zd!\n", sizeof(prelink_info_t));
if (prelink_addr) {
if (!(elf_little ^ is_host_little())) {
/* Same endianness */
@@ -35,11 +35,14 @@
int check_prelinked(const char *fname, int elf_little, long *prelink_addr)
{
- FAILIF(sizeof(prelink_info_t) != 8, "Unexpected sizeof(prelink_info_t) == %d!\n", sizeof(prelink_info_t));
+ FAILIF(sizeof(prelink_info_t) != 8, "Unexpected sizeof(prelink_info_t) == %zd!\n", sizeof(prelink_info_t));
int fd = open(fname, O_RDONLY);
FAILIF(fd < 0, "open(%s, O_RDONLY): %s (%d)!\n",
fname, strerror(errno), errno);
off_t end = lseek(fd, 0, SEEK_END);
+#ifndef DEBUG
+ (void)end;
+#endif
int nr = sizeof(prelink_info_t);
@@ -50,14 +53,14 @@
fd, strerror(errno), errno);
prelink_info_t info;
- int num_read = read(fd, &info, nr);
+ ssize_t num_read = read(fd, &info, nr);
FAILIF(num_read < 0,
"read(%d, &info, sizeof(prelink_info_t)): %s (%d)!\n",
fd, strerror(errno), errno);
- FAILIF(num_read != sizeof(info),
- "read(%d, &info, sizeof(prelink_info_t)): did not read %d bytes as "
- "expected (read %d)!\n",
- fd, sizeof(info), num_read);
+ FAILIF((size_t)num_read != sizeof(info),
+ "read(%d, &info, sizeof(prelink_info_t)): did not read %zd bytes as "
+ "expected (read %zd)!\n",
+ fd, sizeof(info), (size_t)num_read);
int prelinked = 0;
if (!strncmp(info.tag, "PRE ", 4)) {
@@ -70,7 +73,7 @@
void setup_prelink_info(const char *fname, int elf_little, long base)
{
- FAILIF(sizeof(prelink_info_t) != 8, "Unexpected sizeof(prelink_info_t) == %d!\n", sizeof(prelink_info_t));
+ FAILIF(sizeof(prelink_info_t) != 8, "Unexpected sizeof(prelink_info_t) == %zd!\n", sizeof(prelink_info_t));
int fd = open(fname, O_WRONLY);
FAILIF(fd < 0,
"open(%s, O_WRONLY): %s (%d)\n" ,
@@ -93,13 +96,13 @@
}
strncpy(info.tag, "PRE ", 4);
- int num_written = write(fd, &info, sizeof(info));
+ ssize_t num_written = write(fd, &info, sizeof(info));
FAILIF(num_written < 0,
"write(%d, &info, sizeof(info)): %s (%d)\n",
fd, strerror(errno), errno);
- FAILIF(sizeof(info) != num_written,
- "Could not write %d bytes (wrote only %d bytes) as expected!\n",
- sizeof(info), num_written);
+ FAILIF(sizeof(info) != (size_t)num_written,
+ "Could not write %zd bytes (wrote only %zd bytes) as expected!\n",
+ sizeof(info), (size_t)num_written);
FAILIF(close(fd) < 0, "close(%d): %s (%d)!\n", fd, strerror(errno), errno);
}
diff --git a/tools/soslim/soslim.c b/tools/soslim/soslim.c
index d32e247..125e29e 100644
--- a/tools/soslim/soslim.c
+++ b/tools/soslim/soslim.c
@@ -42,7 +42,7 @@
int dynsym_idx = -1; /* index in shdr_info[] of dynamic symbol table
section */
- int cnt; /* general-purpose counter */
+ unsigned int cnt; /* general-purpose counter */
/* This flag is true when at least one section is dropped or when the
relative order of sections has changed, so that section indices in
the resulting file will be different from those in the original. */
@@ -51,7 +51,7 @@
size_t idx; /* general-purporse section index */
shdr_info_t *shdr_info = NULL;
- int shdr_info_len = 0;
+ unsigned int shdr_info_len = 0;
GElf_Phdr *phdr_info = NULL;
/* Get the information from the old file. */
@@ -95,7 +95,7 @@
/* Get the number of sections. */
FAILIF_LIBELF(elf_getshnum (elf, &shnum) < 0, elf_getshnum);
- INFO("Original ELF file has %d sections.\n", shnum);
+ INFO("Original ELF file has %zd sections.\n", shnum);
/* Allocate the section-header-info buffer. We allocate one more entry
for the section-strings section because we regenerate that one and
@@ -104,7 +104,7 @@
one more section the header. We just mark the old section for removal
and create one as the last section.
*/
- INFO("Allocating section-header info structure (%d) bytes...\n",
+ INFO("Allocating section-header info structure (%zd) bytes...\n",
shnum*sizeof (shdr_info_t));
shdr_info_len = rebuild_shstrtab ? shnum + 1 : shnum;
shdr_info = (shdr_info_t *)CALLOC(shdr_info_len, sizeof (shdr_info_t));
@@ -305,9 +305,9 @@
/* Check the length of the dynamic-symbol filter. */
FAILIF(sym_filter != NULL &&
- num_symbols != symdata->d_size / elsize,
+ (size_t)num_symbols != symdata->d_size / elsize,
"Length of dynsym filter (%d) must equal the number"
- " of dynamic symbols (%d)!\n",
+ " of dynamic symbols (%zd)!\n",
num_symbols,
symdata->d_size / elsize);
@@ -443,14 +443,14 @@
shdr_info[cnt].se = ebl_strtabadd (shst, shdr_info[cnt].name, 0);
INFO("\tsection [%s] (old offset %lld, old size %lld) will have index %d "
- "(was %d).\n",
+ "(was %zd).\n",
shdr_info[cnt].name,
shdr_info[cnt].old_shdr.sh_offset,
shdr_info[cnt].old_shdr.sh_size,
shdr_info[cnt].idx,
elf_ndxscn(shdr_info[cnt].scn));
} else {
- INFO("\tIgnoring section [%s] (offset %lld, size %lld, index %d), "
+ INFO("\tIgnoring section [%s] (offset %lld, size %lld, index %zd), "
"it will be discarded.\n",
shdr_info[cnt].name,
shdr_info[cnt].shdr.sh_offset,
diff --git a/tools/soslim/symfilter.c b/tools/soslim/symfilter.c
index c21ab2e..b59e68a 100644
--- a/tools/soslim/symfilter.c
+++ b/tools/soslim/symfilter.c
@@ -38,9 +38,9 @@
strerror(errno),
errno);
- INFO("Symbol-filter file %s is %ld bytes long...\n",
+ INFO("Symbol-filter file %s is %zd bytes long...\n",
name,
- fsize);
+ (size_t)fsize);
filter->fsize = fsize;
/* mmap the symbols file */
@@ -48,8 +48,8 @@
PROT_READ | PROT_WRITE, MAP_PRIVATE,
filter->fd, 0);
FAILIF(MAP_FAILED == filter->mmap,
- "mmap(NULL, %ld, PROT_READ, MAP_PRIVATE, %d, 0): %s (%d)\n",
- fsize,
+ "mmap(NULL, %zd, PROT_READ, MAP_PRIVATE, %d, 0): %s (%d)\n",
+ (size_t)fsize,
filter->fd,
strerror(errno),
errno);
@@ -202,6 +202,8 @@
static int match_hash_table_section(Elf *elf, Elf_Scn *sect, void *data)
{
+ (void)elf; // unused argument
+
symfilter_t *filter = (symfilter_t *)data;
Elf32_Shdr *shdr;
@@ -224,6 +226,8 @@
static int match_dynsym_section(Elf *elf, Elf_Scn *sect, void *data)
{
+ (void)elf; // unused argument
+
symfilter_t *filter = (symfilter_t *)data;
Elf32_Shdr *shdr;