make/CompileJavaModules.gmk
changeset 31310 481585782338
parent 31014 a3b1e5a584bd
child 31512 756e4c77cd2d
--- a/make/CompileJavaModules.gmk	Tue Jun 16 13:00:47 2015 -0700
+++ b/make/CompileJavaModules.gmk	Thu Jun 04 18:27:42 2015 +0200
@@ -517,7 +517,8 @@
   # Find the module dependencies by parsing modules.list file
   $1_DEPS := $$(call FindDepsForModule, $1)
 
-  $1_CLASSPATH := $$(addprefix $(JDK_OUTPUTDIR)/modules/,$$($1_DEPS))
+  $1_CLASSPATH := $$(foreach d,$$($1_DEPS), $$(if $$($$d_BIN), $$($$d_BIN), \
+      $(JDK_OUTPUTDIR)/modules/$$d))
   # When crypto classes are prebuilt, need to look for classes already in
   # output dir.
   ifneq ($(BUILD_CRYPTO), true)
@@ -534,10 +535,10 @@
   $$(eval $$(call SetupJavaCompilation,$1, \
       SETUP := $$(if $$($1_SETUP), $$($1_SETUP), GENERATE_JDKBYTECODE), \
       SRC := $$(wildcard $$(call ALL_SRC_DIRS,$1)), \
-      INCLUDES:=$(JDK_USER_DEFINED_FILTER),\
-      BIN := $(JDK_OUTPUTDIR)/modules/$1, \
+      INCLUDES := $(JDK_USER_DEFINED_FILTER),\
+      BIN := $$(if $$($1_BIN), $$($1_BIN), $(JDK_OUTPUTDIR)/modules/$1), \
       HEADERS := $(SUPPORT_OUTPUTDIR)/headers/$1, \
-      ADD_JAVAC_FLAGS := $$($1_JAVAC_FLAGS)))
+      ADD_JAVAC_FLAGS := $$($1_ADD_JAVAC_FLAGS) $$($1_JAVAC_FLAGS)))
 
   $1: $$($1) $$($1_COPY_EXTRA)
 
@@ -548,7 +549,8 @@
   # Only the javac compilation actually depends on other modules so limit
   # dependency declaration to that by using the *_COMPILE_TARGET variable.
   $$($1_COMPILE_TARGETS): $$(foreach d,$$($1_DEPS), \
-      $$(call SetupJavaCompilationCompileTarget, $$d, $(JDK_OUTPUTDIR)/modules/$$d))
+      $$(call SetupJavaCompilationCompileTarget, $$d, \
+          $$(if $$($$d_BIN), $$($$d_BIN), $(JDK_OUTPUTDIR)/modules/$$d)))
 endef
 
 # Setup compilation for each module