GNOME Bugzilla – Bug 729513
W32: -base erroneously detects X11 headers from tcl/tk
Last modified: 2014-05-04 19:15:50 UTC
Here is what configure detects: configure:27264: Checking libraries for plugins in sys/ configure:27268: checking for X configure:27376: gcc -E -I/mingw/include conftest.c configure:27376: $? = 0 configure:27407: gcc -std=gnu99 -o conftest.exe -g -O2 -I/mingw/include conftest.c -lX11 >&5 conftest.c: In function 'main': conftest.c:78:1: warning: implicit declaration of function 'XrmInitialize' [-Wimplicit-function-declaration] XrmInitialize () ^ f:/e28/mingw/bin/../lib/gcc/i686-w64-mingw32/4.9.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lX11 collect2.exe: error: ld returned 1 exit status configure:27407: $? = 1 [snip] configure:27446: result: no configure:27462: *** checking feature: X libraries and plugins *** configure:27466: *** for plug-ins: ximagesink *** configure:28003: checking for X11/Xlib.h configure:28003: gcc -std=gnu99 -c -g -O2 -I/mingw/include conftest.c >&5 configure:28003: $? = 0 configure:28003: result: yes configure:28037: *** These plugins will be built: ximagesink This enables ximagesink, which fails to build later on: make[3]: Entering directory '/src/mingw/gst-plugins-base-1.0-1.3.1-1/bld/sys/ximage' CC libgstximagesink_la-ximagesink.lo CC libgstximagesink_la-ximage.lo CC libgstximagesink_la-ximagepool.lo ../../../gst-plugins-base-1.3.1/sys/ximage/ximagesink.c:119:24: fatal error: X11/XKBlib.h: No such file or directory #include <X11/XKBlib.h> ^ compilation terminated. ../../../gst-plugins-base-1.3.1/sys/ximage/ximagepool.c: In function 'gst_ximagesink_handle_xerror': ../../../gst-plugins-base-1.3.1/sys/ximage/ximagepool.c:57:3: error: implicit declaration of function 'XGetErrorText' [-Werror=implicit-function-declaration] XGetErrorText (display, xevent->error_code, error_msg, 1024); ^ ../../../gst-plugins-base-1.3.1/sys/ximage/ximagepool.c:57:3: error: nested extern declaration of 'XGetErrorText' [-Werror=nested-externs] Makefile:641: recipe for target 'libgstximagesink_la-ximagesink.lo' failed
Created attachment 275815 [details] [review] Make X11 detection more precise Don't be content with just X11/Xlib.h, check for X11/XKBlib.h as well. This prevents false positives (for example, from partial X11 headers installed by tcl/tk).
Looks good to me.
It may be better to check for a function in libx. For example, that XGetErrorText thing.
LRN, I had already tested and pushed your patch when I read your latest comment. commit: a1be3738a98200ab0060808c6f025f798c27c431
I don't think it is necessary to check for a function. Thanks for the patch! :)