Merge "Introduce CC/CXX/JAVAC_WRAPPER to wrap the calls to the compiler."

This commit is contained in:
Primiano Tucci
2014-06-03 09:29:50 +00:00
committed by Gerrit Code Review
2 changed files with 22 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
# Selects a Java compiler. # Selects a Java compiler.
# #
# Inputs: # Inputs:
# CUSTOM_JAVA_COMPILER -- "eclipse", "openjdk". or nothing for the system # CUSTOM_JAVA_COMPILER -- "eclipse", "openjdk". or nothing for the system
# default # default
# ALTERNATE_JAVAC -- the alternate java compiler to use # ALTERNATE_JAVAC -- the alternate java compiler to use
# #
@@ -22,6 +22,13 @@ else
JAVACC := $(ALTERNATE_JAVAC) JAVACC := $(ALTERNATE_JAVAC)
endif endif
# 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
# Whatever compiler is on this system. # Whatever compiler is on this system.
ifeq ($(BUILD_OS), windows) ifeq ($(BUILD_OS), windows)
COMMON_JAVAC := development/host/windows/prebuilt/javawrap.exe -J-Xmx256m \ COMMON_JAVAC := development/host/windows/prebuilt/javawrap.exe -J-Xmx256m \

View File

@@ -92,13 +92,20 @@ ifneq ($(USE_CCACHE),)
# Check that the executable is here. # Check that the executable is here.
ccache := $(strip $(wildcard $(ccache))) ccache := $(strip $(wildcard $(ccache)))
ifdef ccache ifdef ccache
# prepend ccache if necessary CC_WRAPPER ?= $(ccache)
ifneq ($(ccache),$(firstword $($(combo_var_prefix)CC))) CXX_WRAPPER ?= $(ccache)
$(combo_var_prefix)CC := $(ccache) $($(combo_var_prefix)CC)
endif
ifneq ($(ccache),$(firstword $($(combo_var_prefix)CXX)))
$(combo_var_prefix)CXX := $(ccache) $($(combo_var_prefix)CXX)
endif
ccache = ccache =
endif endif
endif endif
# The C/C++ compiler can be wrapped by setting the CC/CXX_WRAPPER vars.
ifdef CC_WRAPPER
ifneq ($(CC_WRAPPER),$(firstword $($(combo_var_prefix)CC)))
$(combo_var_prefix)CC := $(CC_WRAPPER) $($(combo_var_prefix)CC)
endif
endif
ifdef CXX_WRAPPER
ifneq ($(CXX_WRAPPER),$(firstword $($(combo_var_prefix)CXX)))
$(combo_var_prefix)CXX := $(CXX_WRAPPER) $($(combo_var_prefix)CXX)
endif
endif