blob: 74490fd57cdde8e11371fb691e721a187dd3eabe [file] [log] [blame]
The Android Open Source Project88b60792009-03-03 19:28:42 -08001# Selects a Java compiler.
2#
3# Inputs:
4# CUSTOM_JAVA_COMPILER -- "eclipse", "openjdk". or nothing for the system
5# default
6#
7# Outputs:
8# COMMON_JAVAC -- Java compiler command with common arguments
Ying Wangad690992013-09-20 17:11:43 -07009#
10
11ifeq ($(EXPERIMENTAL_USE_JAVA7_OPENJDK),)
12common_flags := -target 1.5 -Xmaxerrs 9999999
13else
14common_flags := -Xmaxerrs 9999999
15endif
16
The Android Open Source Project88b60792009-03-03 19:28:42 -080017
18# Whatever compiler is on this system.
Raphael63c8af92010-06-12 11:36:14 -070019ifeq ($(BUILD_OS), windows)
The Android Open Source Project88b60792009-03-03 19:28:42 -080020 COMMON_JAVAC := development/host/windows/prebuilt/javawrap.exe -J-Xmx256m \
Ying Wangad690992013-09-20 17:11:43 -070021 $(common_flags)
The Android Open Source Project88b60792009-03-03 19:28:42 -080022else
Ying Wangad690992013-09-20 17:11:43 -070023 COMMON_JAVAC := javac -J-Xmx512M $(common_flags)
The Android Open Source Project88b60792009-03-03 19:28:42 -080024endif
25
26# Eclipse.
27ifeq ($(CUSTOM_JAVA_COMPILER), eclipse)
28 COMMON_JAVAC := java -Xmx256m -jar prebuilt/common/ecj/ecj.jar -5 \
29 -maxProblems 9999999 -nowarn
30 $(info CUSTOM_JAVA_COMPILER=eclipse)
31endif
32
The Android Open Source Project88b60792009-03-03 19:28:42 -080033HOST_JAVAC ?= $(COMMON_JAVAC)
34TARGET_JAVAC ?= $(COMMON_JAVAC)
35
36#$(info HOST_JAVAC=$(HOST_JAVAC))
37#$(info TARGET_JAVAC=$(TARGET_JAVAC))