Use system modules generated by soong when using javac -target 1.9
Soong has support for building system modules. Use the directories
produced by Soong with --system to replace -bootclasspath arguments
when using javac -target 1.9.
Since soong can't generate current SDK stubs yet, and no existing
SDK stubs need -target, only use -target 1.9 for modules that are
not compiling against the SDK. That means in practice the only
system modules that will be used for now is the default one,
core-system-modules.
Bug: 63986449
Test: m -j EXPERIMENTAL_USE_OPENJDK9=true makes some progress
Change-Id: I350ef50aedf36fdd72458c23d4fe8a2edf1a9a02
diff --git a/core/math.mk b/core/math.mk
index 57cb681..44e03ce 100644
--- a/core/math.mk
+++ b/core/math.mk
@@ -72,6 +72,10 @@
$(if $(filter $(1),$(call math_max,$(1),$(2))),true)
endef
+define math_lt
+$(if $(call math_gt_or_eq,$(1),$(2)),,true)
+endef
+
#$(warning $(call math_gt_or_eq, 2, 1))
#$(warning $(call math_gt_or_eq, 1, 1))
#$(warning $(if $(call math_gt_or_eq, 1, 2),false,true))
@@ -81,6 +85,15 @@
$(strip $(eval $(1) := $($(1)) .)$(words $($(1))))
endef
+# Returns the words in $2 that are numbers and are less than $1
+define numbers_less_than
+$(strip \
+ $(foreach n,$2, \
+ $(if $(call math_is_number,$(n)), \
+ $(if $(call math_lt,$(n),$(1)), \
+ $(n)))))
+endef
+
_INT_LIMIT_WORDS := $(foreach a,x x,$(foreach b,x x x x x x x x x x x x x x x x,\
$(foreach c,x x x x x x x x x x x x x x x x,x x x x x x x x x x x x x x x x)))