2009-03-04 11:28:42 +08:00
|
|
|
# Selects a Java compiler.
|
|
|
|
#
|
|
|
|
# Inputs:
|
2014-06-03 00:37:38 +08:00
|
|
|
# CUSTOM_JAVA_COMPILER -- "eclipse", "openjdk". or nothing for the system
|
2009-03-04 11:28:42 +08:00
|
|
|
# default
|
2014-01-10 07:33:06 +08:00
|
|
|
# ALTERNATE_JAVAC -- the alternate java compiler to use
|
2009-03-04 11:28:42 +08:00
|
|
|
#
|
|
|
|
# Outputs:
|
|
|
|
# COMMON_JAVAC -- Java compiler command with common arguments
|
2013-09-21 08:11:43 +08:00
|
|
|
#
|
|
|
|
|
2014-04-01 21:16:26 +08:00
|
|
|
ifneq ($(LEGACY_USE_JAVA6),)
|
2014-05-09 10:36:05 +08:00
|
|
|
common_jdk_flags := -target 1.5 -Xmaxerrs 9999999
|
2013-09-21 08:11:43 +08:00
|
|
|
else
|
2014-05-09 10:36:05 +08:00
|
|
|
common_jdk_flags := -source 1.7 -target 1.7 -Xmaxerrs 9999999
|
2013-09-21 08:11:43 +08:00
|
|
|
endif
|
|
|
|
|
2014-01-10 07:33:06 +08:00
|
|
|
# Use the indexer wrapper to index the codebase instead of the javac compiler
|
|
|
|
ifeq ($(ALTERNATE_JAVAC),)
|
|
|
|
JAVACC := javac
|
|
|
|
else
|
|
|
|
JAVACC := $(ALTERNATE_JAVAC)
|
|
|
|
endif
|
2009-03-04 11:28:42 +08:00
|
|
|
|
2014-06-03 00:37:38 +08:00
|
|
|
# The actual compiler can be wrapped by setting the JAVAC_WRAPPER var.
|
|
|
|
ifdef JAVAC_WRAPPER
|
|
|
|
ifneq ($(JAVAC_WRAPPER),$(firstword $(JAVACC)))
|
|
|
|
JAVACC := $(JAVAC_WRAPPER) $(JAVACC)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
# Whatever compiler is on this system.
|
2010-06-13 02:36:14 +08:00
|
|
|
ifeq ($(BUILD_OS), windows)
|
2009-03-04 11:28:42 +08:00
|
|
|
COMMON_JAVAC := development/host/windows/prebuilt/javawrap.exe -J-Xmx256m \
|
2014-05-09 10:36:05 +08:00
|
|
|
$(common_jdk_flags)
|
2009-03-04 11:28:42 +08:00
|
|
|
else
|
2014-05-09 10:36:05 +08:00
|
|
|
COMMON_JAVAC := $(JAVACC) -J-Xmx1024M $(common_jdk_flags)
|
2009-03-04 11:28:42 +08:00
|
|
|
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)
|
2014-01-10 07:33:06 +08:00
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
#$(info HOST_JAVAC=$(HOST_JAVAC))
|
|
|
|
#$(info TARGET_JAVAC=$(TARGET_JAVAC))
|