Home | History | Annotate | Download | only in combo
      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 
     12 ifneq ($(LEGACY_USE_JAVA6),)
     13 common_jdk_flags := -target 1.5 -Xmaxerrs 9999999
     14 else
     15 common_jdk_flags := -source 1.7 -target 1.7 -Xmaxerrs 9999999
     16 endif
     17 
     18 # Use the indexer wrapper to index the codebase instead of the javac compiler
     19 ifeq ($(ALTERNATE_JAVAC),)
     20 JAVACC := javac
     21 else
     22 JAVACC := $(ALTERNATE_JAVAC)
     23 endif
     24 
     25 # The actual compiler can be wrapped by setting the JAVAC_WRAPPER var.
     26 ifdef JAVAC_WRAPPER
     27     ifneq ($(JAVAC_WRAPPER),$(firstword $(JAVACC)))
     28         JAVACC := $(JAVAC_WRAPPER) $(JAVACC)
     29     endif
     30 endif
     31 
     32 # Whatever compiler is on this system.
     33 ifeq ($(BUILD_OS), windows)
     34     COMMON_JAVAC := development/host/windows/prebuilt/javawrap.exe -J-Xmx256m \
     35         $(common_jdk_flags)
     36 else
     37     COMMON_JAVAC := $(JAVACC) -J-Xmx1024M $(common_jdk_flags)
     38 endif
     39 
     40 # Eclipse.
     41 ifeq ($(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)
     45 endif
     46 
     47 HOST_JAVAC ?= $(COMMON_JAVAC)
     48 TARGET_JAVAC ?= $(COMMON_JAVAC)
     49 
     50 #$(info HOST_JAVAC=$(HOST_JAVAC))
     51 #$(info TARGET_JAVAC=$(TARGET_JAVAC))
     52