RFR: 8255240: Mobile builds need to exclude some modules [v3]
Magnus Ihse Bursie
ihse at openjdk.java.net
Wed Nov 4 10:28:00 UTC 2020
On Wed, 4 Nov 2020 09:42:29 GMT, Johan Vos <jvos at openjdk.org> wrote:
>> Maybe try add missing includes before exclude?
>
> I'd like to include as much as possible, but if that results in ending up complete implementations between
> #ifndef IOS
> #endif
> statements, I worry that we are moving away from the platform-independent idea as well.
>
> The GLX code is a problem since glx.h has an include to X11/Xlib.h and X11/Xutil.h and it really depends on what is defined there. That header is included in e.g. GLXGraphicsConfig.c (via GLXGraphicsConfig.h)
>
> There is a check on HEADLESS in that file, but it's after the includes. I can move that #ifdef before the includes, but that basically rules out the whole file, and then we are closer to the scenario were everything is included, but all implementations are removed via #ifndef IOS (or #ifndef ANDROID)
>
> I ran into a small build issue, where the -DHEADLESS was not passed to LIBAWT_CFLAGS but that is an easy fix.
I think the include of GLXGraphicsConfig.h should really be inside the ifdefs. It does not make sense as it is now. If you look at the GLX code, it is basically split in two, a "dummy" implementation for headless which just does:
JNIEXPORT jint JNICALL
Java_sun_java2d_opengl_GLXGraphicsConfig_getOGLCapabilities(JNIEnv *env, jclass glxgc, jlong configInfo) {
return CAPS_EMPTY;
}
and the real implementation for non-headless.
But this got me worried about my fix of building headless without X11. I wonder how I could compile this without X11, or if the compiler dragged up X11 from a local installation without me noticing it. :(
-------------
PR: https://git.openjdk.java.net/mobile/pull/10
More information about the mobile-dev
mailing list