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 584167 - gnome-desktop-2.26.x fails to compile if Xrandr is too old
gnome-desktop-2.26.x fails to compile if Xrandr is too old
Status: RESOLVED DUPLICATE of bug 554263
Product: gnome-desktop
Classification: Core
Component: libgnome-desktop
2.26.x
Other All
: Normal blocker
: ---
Assigned To: Desktop Maintainers
Desktop Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-05-28 22:09 UTC by Olaf 'Rhialto' Seibert
Modified: 2009-05-29 18:24 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26



Description Olaf 'Rhialto' Seibert 2009-05-28 22:09:04 UTC
Please describe the problem:
If <X11/extensions/Xrandr.h> is "too old" (at least XFree86 4.5.0 qualifies), then the file gnome-desktop-2.26.0/libgnome-desktop/gnome-rr.c fails to compile. Errors include

In file included from gnome-rr.c:38:
gnome-rr-private.h:13: error: expected specifier-qualifier-list before 'XRRScreenResources'
gnome-rr.c:45: error: expected specifier-qualifier-list before RROutput' 
gnome-rr.c:61: error: expected specifier-qualifier-list before 'RROutput'
gnome-rr.c:67: error: expected specifier-qualifier-list before 'RRCrtc'
gnome-rr.c:82: error: expected specifier-qualifier-list before 'RRMode' 
gnome-rr.c:91: error: expected declaration specifiers or '...' before 'RRCrtc'
gnome-rr.c:94: error: expected declaration specifiers or '...' before XRRScreen Resources'
gnome-rr.c:99: error: expected declaration specifiers or '...' before 'RROutput'
gnome-rr.c:101: error: expected declaration specifiers or '...' before 'XRRScreenResources'
gnome-rr.c:107: error: expected declaration specifiers or '...' before 'RRMode'
gnome-rr.c:109: error: expected declaration specifiers or '...' before 'XRRModeInfo'
... many many more ... 
gmake[3]: *** [gnome-rr.lo] Error 1
gmake[3]: Leaving directory `/pkg_comp/obj/pkgsrc/x11/gnome-desktop/default/gnome-desktop-2.26.0/libgnome-desktop' 


Steps to reproduce:
1. Use pksrc-2009Q1 on NetBSD 4.0
2. Try to compile pkgsrc/x11/gnome-desktop (which is version 2.26.0)


Actual results:
error messages see above

Expected results:
I would expect that the configure script does a feature test on the header files that are used. If expected features (in this case, some type names) are not present, a graceful degradation should still enable to compile the package but with some less functionality (as little less as possible).

Does this happen every time?
On NetBSD 4.0, yes.
If you use the recently released NetBSD 5.0, the problem does not occur since it uses a newer version of X.

Other information:
In the thread starting at http://mail-index.netbsd.org/pkgsrc-users/2009/05/28/msg009940.html I present the case and later propose some very crude patches to rip out all the non-compiling code.
Comment 1 Daniel Macks 2009-05-29 00:52:07 UTC
See Bug #554263 (maybe dup, or at least similar problem on different platform)
Comment 2 Federico Mena Quintero 2009-05-29 18:24:32 UTC
Yes, this is the same bug as #554263 - I'll mark this as a duplicate.

Please see bug #554263 comment #9 for the patches I'd like to have.  Rhialto, you already did "#if 0" for a bunch of code, so you found where the problem lies :)

To avoid cluttering the sources, maybe you can look into making gnome-rr.c look something like

#ifdef HAVE_RANDR_1_2

... all the functions that depend on RANDR 1.2 types and functions ...

#endif

GnomeRRScreen *gnome_rr_screen_new ()
{
#ifdef HAVE_RANDR_1_2
    ... current contents of the function ...
#else
    g_set_error (error, ..., "RANDR 1.2 extension is not present");
    return NULL;
#endif
}

That is, wrap all the culprit functions in a big #ifdef block, and just leave gnome_rr_screen_new() as a special case.  The other API entry points will also need special-casing.  Inside them, just leave the g_return_if_fail(screen != NULL) checks outside the #ifdef.

Thanks!

*** This bug has been marked as a duplicate of 554263 ***