summaryrefslogtreecommitdiffstats
path: root/debian/patches/java11-upstream.patch
blob: 8966c9ae6d15ddedbde3ccffc7201f28aac99422 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
--- virtualbox-6.0.4-dfsg.orig/Config.kmk
+++ virtualbox-6.0.4-dfsg/Config.kmk
@@ -2768,7 +2768,8 @@ else # !darwin
  VBOX_JAVAH     = "$(VBOX_JAVA_HOME)/bin/javah$(HOSTSUFF_EXE)"
  VBOX_JAR       = "$(VBOX_JAVA_HOME)/bin/jar$(HOSTSUFF_EXE)"
  VBOX_JAVADOC   = "$(VBOX_JAVA_HOME)/bin/javadoc$(HOSTSUFF_EXE)"
- VBOX_WSIMPORT  = "$(VBOX_JAVA_HOME)/bin/wsimport$(HOSTSUFF_EXE)"
+ # With Java 11 wsimport was removed, usually part of a separate install now.
+ VBOX_WSIMPORT  = $(firstword $(wildcard $(VBOX_JAVA_HOME)/bin/wsimport$(HOSTSUFF_EXE)) wsimport$(HOSTSUFF_EXE))
  # correct for targets we care about
  VBOX_MD_OS     = $(KBUILD_TARGET)
  VBOX_JAVA_INC  = \
@@ -7744,10 +7745,15 @@ else
 endif
 
 # Java compiler options, needs some version checking.
-if defined(VBOX_JAVA_VERSION) && $(VBOX_JAVA_VERSION) >= 10900
+if defined(VBOX_JAVA_VERSION) && $(VBOX_JAVA_VERSION) >= 110000
+ VBOX_JAVA_WS_PATH ?= /usr/share/java
+ VBOX_JAVA_WS_EXTRA_JARS ?= $(VBOX_JAVA_WS_PATH)/jws-api.jar$(VBOX_SEP)$(VBOX_JAVA_WS_PATH)/jaxb-api.jar$(VBOX_SEP)$(VBOX_JAVA_WS_PATH)/jaxws-api.jar
+else if defined(VBOX_JAVA_VERSION) && $(VBOX_JAVA_VERSION) >= 10900
  VBOX_JAVA_WS_OPTS ?= --add-modules java.xml.ws
 endif
-if defined(VBOX_JAVA_VERSION) && $(VBOX_JAVA_VERSION) >= 100000
+if defined(VBOX_JAVA_VERSION) && $(VBOX_JAVA_VERSION) >= 110000
+ VBOX_JAVAC_OPTS   = -encoding UTF-8 -source 9 -target 9 -Xlint:unchecked
+else if defined(VBOX_JAVA_VERSION) && $(VBOX_JAVA_VERSION) >= 100000
  VBOX_JAVAC_OPTS   = -encoding UTF-8 -source 6 -target 6 -Xlint:unchecked
 else
  VBOX_JAVAC_OPTS   = -encoding UTF-8 -source 1.5 -target 1.5 -Xlint:unchecked
--- virtualbox-6.0.4-dfsg.orig/src/VBox/Main/webservice/Makefile.kmk
+++ virtualbox-6.0.4-dfsg/src/VBox/Main/webservice/Makefile.kmk
@@ -480,7 +480,7 @@ $$(VBOX_JWS_JAR): $(VBOX_JWS_GEN)/jwsglu
 	$(call MSG_L1,Compiling bridge code)
 	$(VBOX_JAVAC) $(VBOX_JAVAC_OPTS) $(VBOX_JAVA_WS_OPTS) \
                 @$(VBOX_JWS_GEN)/jwsglue.list \
-		-d $(VBOX_JWS_JDEST) -classpath $(VBOX_JWS_JDEST)
+		-d $(VBOX_JWS_JDEST) -classpath $(VBOX_JWS_JDEST)$(VBOX_SEP)$(VBOX_JAVA_WS_EXTRA_JARS)
 	$(QUIET)$(SED) -e "s/vboxweb.wsdl/vboxweb$(VBOX_API_SUFFIX).wsdl/" <  $(VBOXWEBSERVICE_WSDL) > $(VBOX_JWS_JDEST)/vboxwebService$(VBOX_API_SUFFIX).wsdl
 	$(QUIET)$(CP) -f $(VBOXWEB_WSDL) $(VBOX_JWS_JDEST)/vboxweb$(VBOX_API_SUFFIX).wsdl
 	$(call MSG_LINK,$(notdir $@),$@)
@@ -503,7 +503,7 @@ $$(VBOX_JWSDOC_JAR): $(VBOX_JWS_GEN)/jws
 	$(call MSG_L1,Generating javadoc html documentation)
 	$(VBOX_JAVADOC) $(VBOX_JAVADOC_OPTS) $(VBOX_JAVA_WS_OPTS) -quiet \
 		-sourcepath $(VBOX_JWS_GEN)/java org.virtualbox$(VBOX_API_SUFFIX) \
-		-d $(VBOX_JWSDOC_JDEST)
+		-d $(VBOX_JWSDOC_JDEST) -classpath $(VBOX_SEP)$(VBOX_JAVA_WS_EXTRA_JARS)
 	$(call MSG_LINK,$(notdir $@),$@)
 	$(VBOX_JAR) cf $@ -C $(VBOX_JWSDOC_JDEST) .