GNOME Bugzilla – Bug 765702
build: errors when compiling without X11
Last modified: 2016-05-03 10:15:46 UTC
I just want to only use drm, and no render is needed. So ./configure --enable-glx=no --enable-drm=yes --enable-x11=no --enable-wayland=no --enable-egl=no, and there's no gstreamer-gl installed in the system either. And will meet an compile error. Also can check “tests/test-display.c”, for the “display2, width, height, par_n, par_d” defined in main(), if we only have macro USE_DRM defined, these 5 parameters will never be used. And the compiler will return a warning/error which stopped the build process.
Hi. Could you paste the compilation error? It is not clear to me if the "unused variables" warning is the only one or if there are more.
And, another question, which version of gstreamer-vaapi are you trying to compile?
I'm using the master branch, last commit is: ---------------- commit 018ea8b2fc193f64bcaf8f2a58e67d6a806dfce9 Author: Sreerenj Balachandran <sreerenj.balachandran@intel.com> Date: Wed Apr 27 17:10:26 2016 +0300 ---------------------- Steps: 1. ./configure --enable-x11=no --enable-egl=no --enable-glx=no --enable-wayland=no 2. make -j8. And you should have: --------------------------------------------- test-display.c: In function 'main': test-display.c:273:33: error: unused variable 'par_d' [-Werror=unused-variable] guint width, height, par_n, par_d; ^ test-display.c:273:26: error: unused variable 'par_n' [-Werror=unused-variable] guint width, height, par_n, par_d; ^ test-display.c:273:18: error: unused variable 'height' [-Werror=unused-variable] guint width, height, par_n, par_d; ^ test-display.c:273:11: error: unused variable 'width' [-Werror=unused-variable] guint width, height, par_n, par_d; ^ test-display.c:272:32: error: unused variable 'display2' [-Werror=unused-variable] GstVaapiDisplay *display, *display2; ^ cc1: all warnings being treated as errors ------------------------------------------------------------ btw: if you don't have gl installed in the system(no gstreamer-gl too), even though I set enable-glx=no and enable-egl=no, it will still try to include a header file from gstreamer-gl
It seems you're not only disabling GLX and EGL, but X11 too: display2, width, height, par_n and par_d are used if X11 is enabled.
This fix would need to inforce the gstreamer code-style to all the tests directory.
Created attachment 327004 [details] [review] tests: display: guard possible unused variables
Created attachment 327005 [details] [review] plugin: fix macro processor check Instead of #ifdef it should be used #if becasuse USE_GST_GL_HELPERS is always defined in config.h, but it would be 0 or 1 depending on the configure output.
Li, please let me know if those patches work for you.
hi Victor It works for me now, thanks
Attachment 327004 [details] pushed as 3fcfd40 - tests: display: guard possible unused variables Attachment 327005 [details] pushed as 4f30d28 - plugin: fix macro processor check