Make: Don't rely on presence of tools.jar in toolchain.
Some cts, doclava and javassist code uses private APIs that require tools.jar to be on the classpath when building with the standard OpenJDK 8 toolchain. However, OpenJDK 9 toolchains do not have this file nor require it to be on the classpath. The reliance on the presence of tools.jar means that AOSP can currently not build on such toolchains. After this CL, when EXPERIMENTAL_USE_OPENJDK9 is set, the value of HOST_JDK_TOOLS_JAR is empty. That flag can be set via: export EXPERIMENTAL_USE_OPENJDK9=true and unset via: unset EXPERIMENTAL_USE_OPENJDK9 Test: make checkbuild (using OpenJDK 8 toolchain) Test: manually confirmed that device boots Bug: 38177295 Change-Id: Icc5451b51e44a574fd21024d434ed1fa8711de17
This commit is contained in:
parent
5d9c1e7430
commit
3c4c0b6ab3
|
@ -662,13 +662,21 @@ COLUMN:= column
|
|||
|
||||
# We may not have the right JAVA_HOME/PATH set up yet when this is run from envsetup.sh.
|
||||
ifneq ($(CALLED_FROM_SETUP),true)
|
||||
HOST_JDK_TOOLS_JAR:= $(shell $(BUILD_SYSTEM)/find-jdk-tools-jar.sh)
|
||||
|
||||
# Path to tools.jar, or empty if EXPERIMENTAL_USE_OPENJDK9 is set
|
||||
HOST_JDK_TOOLS_JAR :=
|
||||
# TODO: Remove HOST_JDK_TOOLS_JAR and all references to it once OpenJDK 8
|
||||
# toolchains are no longer supported (i.e. when what is now
|
||||
# EXPERIMENTAL_USE_OPENJDK9 becomes the standard). http://b/38418220
|
||||
ifeq ($(EXPERIMENTAL_USE_OPENJDK9),)
|
||||
HOST_JDK_TOOLS_JAR := $(shell $(BUILD_SYSTEM)/find-jdk-tools-jar.sh)
|
||||
|
||||
ifneq ($(HOST_JDK_TOOLS_JAR),)
|
||||
ifeq ($(wildcard $(HOST_JDK_TOOLS_JAR)),)
|
||||
$(error Error: could not find jdk tools.jar at $(HOST_JDK_TOOLS_JAR), please check if your JDK was installed correctly)
|
||||
endif
|
||||
endif
|
||||
endif # ifeq ($(EXPERIMENTAL_USE_OPENJDK9),)
|
||||
|
||||
# Is the host JDK 64-bit version?
|
||||
HOST_JDK_IS_64BIT_VERSION :=
|
||||
|
@ -684,9 +692,13 @@ else
|
|||
MD5SUM:=md5sum
|
||||
endif
|
||||
|
||||
APICHECK_CLASSPATH := $(HOST_JDK_TOOLS_JAR)
|
||||
APICHECK_CLASSPATH := $(APICHECK_CLASSPATH):$(HOST_OUT_JAVA_LIBRARIES)/doclava$(COMMON_JAVA_PACKAGE_SUFFIX)
|
||||
APICHECK_CLASSPATH := $(APICHECK_CLASSPATH):$(HOST_OUT_JAVA_LIBRARIES)/jsilver$(COMMON_JAVA_PACKAGE_SUFFIX)
|
||||
APICHECK_CLASSPATH_ENTRIES := \
|
||||
$(HOST_OUT_JAVA_LIBRARIES)/doclava$(COMMON_JAVA_PACKAGE_SUFFIX) \
|
||||
$(HOST_OUT_JAVA_LIBRARIES)/jsilver$(COMMON_JAVA_PACKAGE_SUFFIX) \
|
||||
$(HOST_JDK_TOOLS_JAR) \
|
||||
)
|
||||
APICHECK_CLASSPATH := $(subst $(space),:,$(strip $(APICHECK_CLASSPATH_ENTRIES)))
|
||||
|
||||
APICHECK_COMMAND := $(APICHECK) -JXmx1024m -J"classpath $(APICHECK_CLASSPATH)"
|
||||
|
||||
# The default key if not set as LOCAL_CERTIFICATE
|
||||
|
|
Loading…
Reference in New Issue