blob: 528e5560cf67fd3d7bb6fbc43d67226847d48f20 [file] [log] [blame]
# Selects a Java compiler.
#
# Inputs:
# CUSTOM_JAVA_COMPILER -- "eclipse", "openjdk". or nothing for the system
# default
# ALTERNATE_JAVAC -- the alternate java compiler to use
#
# Outputs:
# COMMON_JAVAC -- Java compiler command with common arguments
#
ifneq ($(LEGACY_USE_JAVA6),)
common_flags := -target 1.5 -Xmaxerrs 9999999
else
common_flags := -source 1.7 -target 1.7 -Xmaxerrs 9999999
endif
# Use the indexer wrapper to index the codebase instead of the javac compiler
ifeq ($(ALTERNATE_JAVAC),)
JAVACC := javac
else
JAVACC := $(ALTERNATE_JAVAC)
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 := $(JAVACC) -J-Xmx768M $(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))