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

This is to make it possible to wrap the compiler invocations with
custom wrappers (e.g., distcc/goma) by setting the CC_WRAPPER,
CXX_WRAPPER, JAVAC_WRAPPER variables in the build environment (without
having to know in advance the path to the compiler)

Change-Id: Ide800c24f0c2ebbb1cfb358bd8f99ec8a9d41253
diff --git a/core/combo/javac.mk b/core/combo/javac.mk
index 4248af0..7f91aa9 100644
--- a/core/combo/javac.mk
+++ b/core/combo/javac.mk
@@ -1,7 +1,7 @@
 # Selects a Java compiler.
 #
 # Inputs:
-#	CUSTOM_JAVA_COMPILER -- "eclipse", "openjdk". or nothing for the system 
+#	CUSTOM_JAVA_COMPILER -- "eclipse", "openjdk". or nothing for the system
 #                           default
 #	ALTERNATE_JAVAC -- the alternate java compiler to use
 #
@@ -22,6 +22,13 @@
 JAVACC := $(ALTERNATE_JAVAC)
 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.
 ifeq ($(BUILD_OS), windows)
     COMMON_JAVAC := development/host/windows/prebuilt/javawrap.exe -J-Xmx256m \