After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 729513 - W32: -base erroneously detects X11 headers from tcl/tk
W32: -base erroneously detects X11 headers from tcl/tk
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
unspecified
Other All
: Normal normal
: 1.3.2
Assigned To: LRN
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-05-04 16:02 UTC by LRN
Modified: 2014-05-04 19:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Make X11 detection more precise (1.12 KB, patch)
2014-05-04 16:02 UTC, LRN
committed Details | Review

Description LRN 2014-05-04 16:02:08 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
Comment 1 LRN 2014-05-04 16:02:12 UTC
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).
Comment 2 Luis de Bethencourt 2014-05-04 17:50:30 UTC
Looks good to me.
Comment 3 LRN 2014-05-04 17:54:36 UTC
It may be better to check for a function in libx. For example, that XGetErrorText thing.
Comment 4 Luis de Bethencourt 2014-05-04 17:57:10 UTC
LRN, I had already tested and pushed your patch when I read your latest comment.

commit: a1be3738a98200ab0060808c6f025f798c27c431
Comment 5 Luis de Bethencourt 2014-05-04 18:20:44 UTC
I don't think it is necessary to check for a function.

Thanks for the patch! :)