1# Selects a Java compiler. 2# 3# Inputs: 4# CUSTOM_JAVA_COMPILER -- "eclipse", "openjdk". or nothing for the system 5# default 6# ALTERNATE_JAVAC -- the alternate java compiler to use 7# 8# Outputs: 9# COMMON_JAVAC -- Java compiler command with common arguments 10# 11 12ifndef ANDROID_COMPILE_WITH_JACK 13# Defines if compilation with jack is enabled by default. 14ANDROID_COMPILE_WITH_JACK := true 15endif 16 17common_jdk_flags := -Xmaxerrs 9999999 18 19# Use the indexer wrapper to index the codebase instead of the javac compiler 20ifeq ($(ALTERNATE_JAVAC),) 21JAVACC := javac 22else 23JAVACC := $(ALTERNATE_JAVAC) 24endif 25 26JAVA := java 27JAVADOC := javadoc 28JAR := jar 29 30# The actual compiler can be wrapped by setting the JAVAC_WRAPPER var. 31ifdef JAVAC_WRAPPER 32 ifneq ($(JAVAC_WRAPPER),$(firstword $(JAVACC))) 33 JAVACC := $(JAVAC_WRAPPER) $(JAVACC) 34 endif 35endif 36 37# Whatever compiler is on this system. 38COMMON_JAVAC := $(JAVACC) -J-Xmx2048M $(common_jdk_flags) 39 40# Eclipse. 41ifeq ($(CUSTOM_JAVA_COMPILER), eclipse) 42 COMMON_JAVAC := java -Xmx256m -jar prebuilt/common/ecj/ecj.jar -5 \ 43 -maxProblems 9999999 -nowarn 44 $(info CUSTOM_JAVA_COMPILER=eclipse) 45endif 46 47GLOBAL_JAVAC_DEBUG_FLAGS := -g 48 49HOST_JAVAC ?= $(COMMON_JAVAC) 50TARGET_JAVAC ?= $(COMMON_JAVAC) 51 52#$(info HOST_JAVAC=$(HOST_JAVAC)) 53#$(info TARGET_JAVAC=$(TARGET_JAVAC)) 54