Fails to build from source with --disable-x11
libyami-utils fails to build with "--disable-x11". It does build with "--disable-x11 --disable-tests-gles". Tested on 1.1.0 release only (on Yocto if that matters).
Here's the failure:
| In file included from ../../libyami-utils-1.1.0/tests/egl/gles2_help.c:26:0:
| ../../libyami-utils-1.1.0/tests/egl/gles2_help.h:61:25: error: unknown type name 'Display'
| EGLContextType* eglInit(Display *x11Display, XID window, uint32_t fourcc, int isExternalTexture);
| ^~~~~~~
| ../../libyami-utils-1.1.0/tests/egl/gles2_help.h:61:46: error: unknown type name 'XID'
| EGLContextType* eglInit(Display *x11Display, XID window, uint32_t fourcc, int isExternalTexture);
| ^~~
| ../../libyami-utils-1.1.0/tests/egl/gles2_help.h:63:57: error: unknown type name 'XID'
| GLuint createTextureFromPixmap(EGLContextType *context, XID pixmap);
| ^~~
| ../../libyami-utils-1.1.0/tests/egl/gles2_help.c:92:50: error: unknown type name 'XID'
| createTextureFromPixmap(EGLContextType *context, XID pixmap)
| ^~~
| ../../libyami-utils-1.1.0/tests/egl/gles2_help.c:260:25: error: unknown type name 'Display'
| EGLContextType *eglInit(Display *x11Display, XID x11Window, uint32_t fourcc, int isExternalTexture)
| ^~~~~~~
| ../../libyami-utils-1.1.0/tests/egl/gles2_help.c:260:46: error: unknown type name 'XID'
| EGLContextType *eglInit(Display *x11Display, XID x11Window, uint32_t fourcc, int isExternalTexture)
| ^~~
| Makefile:719: recipe for target 'egl/gles2_help.o' failed
| make[2]: *** [egl/gles2_help.o] Error 1
| make[2]: *** Waiting for unfinished jobs....
| In file included from ../../libyami-utils-1.1.0/tests/decodeoutput.cpp:45:0:
| ../../libyami-utils-1.1.0/tests/./egl/gles2_help.h:61:25: error: 'Display' was not declared in this scope
| EGLContextType* eglInit(Display *x11Display, XID window, uint32_t fourcc, int isExternalTexture);
| ^~~~~~~
| ../../libyami-utils-1.1.0/tests/./egl/gles2_help.h:61:34: error: 'x11Display' was not declared in this scope
| EGLContextType* eglInit(Display *x11Display, XID window, uint32_t fourcc, int isExternalTexture);
| ^~~~~~~~~~
| ../../libyami-utils-1.1.0/tests/./egl/gles2_help.h:61:46: error: 'XID' was not declared in this scope
| EGLContextType* eglInit(Display *x11Display, XID window, uint32_t fourcc, int isExternalTexture);
| ^~~
| ../../libyami-utils-1.1.0/tests/./egl/gles2_help.h:61:67: error: expected primary-expression before 'fourcc'
| EGLContextType* eglInit(Display *x11Display, XID window, uint32_t fourcc, int isExternalTexture);
| ^~~~~~
| ../../libyami-utils-1.1.0/tests/./egl/gles2_help.h:61:75: error: expected primary-expression before 'int'
| EGLContextType* eglInit(Display *x11Display, XID window, uint32_t fourcc, int isExternalTexture);
| ^~~
| ../../libyami-utils-1.1.0/tests/./egl/gles2_help.h:61:96: error: expression list treated as compound expression in initializer [-fpermissive]
| EGLContextType* eglInit(Display *x11Display, XID window, uint32_t fourcc, int isExternalTexture);
| ^
| ../../libyami-utils-1.1.0/tests/./egl/gles2_help.h:63:57: error: 'XID' has not been declared
| GLuint createTextureFromPixmap(EGLContextType *context, XID pixmap);
| ^~~
| Makefile:743: recipe for target 'decodeoutput.o' failed
Thanks for your rising issue, @jku . But I can’t reproduce the issue in my Yocto environment. Compile libyami-utils with –disable-x11 and --enable-tests-gles is ok on my side. The environment as followings: Poky: master: 6e20b31d5d17133e0fca086e12a0ad06ab5c4cc8 meta-intel: master: af8e3762a5932d6705f20e72b43457e112df0c28 libyami-utils_1.1.0.bb: EXTRA_OECONF = " --disable-x11 --enable-tests-gles --disable-md5" Compile cmd: bitbake libyami-utils
I have written a test code as followings, it can be built as well: //g++ -o dd.exe ./dd.cpp #include <stdio.h> #include <stdlib.h> #include <EGL/egl.h>
Display *x11Display; XID x11Window;
int main(int argc, char* argv[]) { printf("sssssssssssss\n"); return 0; }
I hope it can check if your environment is ok.
Maybe I've not mentioned it explicitly so: In the builds with "--disable-x11" X11 is not actually available. This bit in your example will fail when you don't have libx11:
Display *x11Display;
XID x11Window;
I can check what the reproduction instructions are for yocto...
Right, current meta-intel master already has a workaround I sent for this:
PACKAGECONFIG[x11] = "--enable-x11 --enable-tests-gles,--disable-x11 --disable-tests-gles, virtual/libx11"
If you remove the "--disable-tests-gles" from that line, a build without "x11" DISTRO_FEATURE will fail.
(I now notice I've forgotten the "--enable-tests-gles" in the EXTRA_OECONF line: it should not be there but it also does not change the results).