RFR: 8255240: Mobile builds need to exclude some modules [v3]
Magnus Ihse Bursie
ihse at openjdk.java.net
Mon Nov 2 23:58:54 UTC 2020
On Mon, 2 Nov 2020 22:32:38 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:
>> The problem with awt_headless is that this depends on X11 (which we don't have on iOS/Android).
>> I'm not sure what the best approach is. It would need lots of changes to make that work on mobile.
>> Any help is much appreciated.
>
> Now that you mention it, I do remember some fuss long time ago about headless requiring X11. Hmmm. That means that any attempt to use headless is definitely out of bounds for this patch. Maybe the best way for this patch is then to exclude the java.desktop module for iOS and Android in Modules.gmk.
>
> But I'll look into headless once more to see if I can figure out if it *really* needs X11 or if it's just some sloppy programming.
Good news! It turned out that java.desktop can build just fine without X11 if you just want headless.
A quick and dirty hack to confirm that this works for you too:
diff --git a/make/autoconf/libraries.m4 b/make/autoconf/libraries.m4
index 5120918aed2..42a641c3228 100644
--- a/make/autoconf/libraries.m4
+++ b/make/autoconf/libraries.m4
@@ -46,7 +46,7 @@ AC_DEFUN_ONCE([LIB_DETERMINE_DEPENDENCIES],
else
# All other instances need X11, even if building headless only, libawt still
# needs X11 headers.
- NEEDS_LIB_X11=true
+ NEEDS_LIB_X11=false
fi
# Check if fontconfig is needed
I'll open a separate bug to get a fix in mainline so that X11 is not required for headless builds.
-------------
PR: https://git.openjdk.java.net/mobile/pull/10
More information about the mobile-dev
mailing list