e2d27887be
- Separate SDK checking from version checking and make messages clearer. - Add explicit source & target versions for javac to make things clearer. - Rename flag from EXPERIMENTAL_USE_JAVA7_OPENJDK to EXPERIMENTAL_USE_JAVA7. - Allow Oracle JDK 1.7 to be used on Mac OS, since there's no official OpenJDK support for that platform. Change-Id: I454d2c917ed78f03ec7559a99659fefe7e7d50f3
37 lines
964 B
Makefile
37 lines
964 B
Makefile
# Selects a Java compiler.
|
|
#
|
|
# Inputs:
|
|
# CUSTOM_JAVA_COMPILER -- "eclipse", "openjdk". or nothing for the system
|
|
# default
|
|
#
|
|
# Outputs:
|
|
# COMMON_JAVAC -- Java compiler command with common arguments
|
|
#
|
|
|
|
ifeq ($(EXPERIMENTAL_USE_JAVA7),)
|
|
common_flags := -target 1.5 -Xmaxerrs 9999999
|
|
else
|
|
common_flags := -source 1.7 -target 1.7 -Xmaxerrs 9999999
|
|
endif
|
|
|
|
|
|
# Whatever compiler is on this system.
|
|
ifeq ($(BUILD_OS), windows)
|
|
COMMON_JAVAC := development/host/windows/prebuilt/javawrap.exe -J-Xmx256m \
|
|
$(common_flags)
|
|
else
|
|
COMMON_JAVAC := javac -J-Xmx512M $(common_flags)
|
|
endif
|
|
|
|
# Eclipse.
|
|
ifeq ($(CUSTOM_JAVA_COMPILER), eclipse)
|
|
COMMON_JAVAC := java -Xmx256m -jar prebuilt/common/ecj/ecj.jar -5 \
|
|
-maxProblems 9999999 -nowarn
|
|
$(info CUSTOM_JAVA_COMPILER=eclipse)
|
|
endif
|
|
|
|
HOST_JAVAC ?= $(COMMON_JAVAC)
|
|
TARGET_JAVAC ?= $(COMMON_JAVAC)
|
|
|
|
#$(info HOST_JAVAC=$(HOST_JAVAC))
|
|
#$(info TARGET_JAVAC=$(TARGET_JAVAC))
|