blob: d4c04e726b76a0eb5d64617f621b402d0f6bdbb1 [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
9
10# Whatever compiler is on this system.
11ifeq ($(HOST_OS), windows)
12 COMMON_JAVAC := development/host/windows/prebuilt/javawrap.exe -J-Xmx256m \
13 -target 1.5 -Xmaxerrs 9999999
14else
15 COMMON_JAVAC := javac -J-Xmx512M -target 1.5 -Xmaxerrs 9999999
16endif
17
18# Eclipse.
19ifeq ($(CUSTOM_JAVA_COMPILER), eclipse)
20 COMMON_JAVAC := java -Xmx256m -jar prebuilt/common/ecj/ecj.jar -5 \
21 -maxProblems 9999999 -nowarn
22 $(info CUSTOM_JAVA_COMPILER=eclipse)
23endif
24
25# OpenJDK.
26ifeq ($(CUSTOM_JAVA_COMPILER), openjdk)
27 # We set the VM options (like -Xmx) in the javac script.
28 COMMON_JAVAC := prebuilt/common/openjdk/bin/javac -target 1.5 \
29 -Xmaxerrs 9999999
30 $(info CUSTOM_JAVA_COMPILER=openjdk)
31endif
32
33HOST_JAVAC ?= $(COMMON_JAVAC)
34TARGET_JAVAC ?= $(COMMON_JAVAC)
35
36#$(info HOST_JAVAC=$(HOST_JAVAC))
37#$(info TARGET_JAVAC=$(TARGET_JAVAC))