2009-03-04 04:28:42 +01:00
|
|
|
# Selects a Java compiler.
|
|
|
|
#
|
|
|
|
# Inputs:
|
2014-06-02 18:37:38 +02:00
|
|
|
# CUSTOM_JAVA_COMPILER -- "eclipse", "openjdk". or nothing for the system
|
2009-03-04 04:28:42 +01:00
|
|
|
# default
|
2014-01-10 00:33:06 +01:00
|
|
|
# ALTERNATE_JAVAC -- the alternate java compiler to use
|
2009-03-04 04:28:42 +01:00
|
|
|
#
|
|
|
|
# Outputs:
|
|
|
|
# COMMON_JAVAC -- Java compiler command with common arguments
|
2013-09-21 02:11:43 +02:00
|
|
|
#
|
2015-01-05 16:10:59 +01:00
|
|
|
|
2016-01-16 04:41:26 +01:00
|
|
|
common_jdk_flags := -Xmaxerrs 9999999
|
2013-09-21 02:11:43 +02:00
|
|
|
|
2014-01-10 00:33:06 +01: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 04:28:42 +01:00
|
|
|
|
2014-06-02 18:37:38 +02: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 04:28:42 +01:00
|
|
|
# Whatever compiler is on this system.
|
2015-08-13 23:31:36 +02:00
|
|
|
COMMON_JAVAC := $(JAVACC) -J-Xmx1024M $(common_jdk_flags)
|
2009-03-04 04:28:42 +01:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2015-09-02 04:12:05 +02:00
|
|
|
GLOBAL_JAVAC_DEBUG_FLAGS := -g
|
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
HOST_JAVAC ?= $(COMMON_JAVAC)
|
|
|
|
TARGET_JAVAC ?= $(COMMON_JAVAC)
|
2014-01-10 00:33:06 +01:00
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
#$(info HOST_JAVAC=$(HOST_JAVAC))
|
|
|
|
#$(info TARGET_JAVAC=$(TARGET_JAVAC))
|