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 549182 - checks for xrandr not enough
checks for xrandr not enough
Status: RESOLVED FIXED
Product: gnome-desktop
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: Desktop Maintainers
Desktop Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-08-24 08:43 UTC by Claudio Saavedra
Modified: 2008-09-01 21:48 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Claudio Saavedra 2008-08-24 08:43:21 UTC
The checks for libxrandr detect if the library is missing but configuration doesn't halt, which causes compilation breakage:

checking for X... libraries , headers 
checking for XLIB... no
checking for gethostbyname... yes
...

config.log:

Package xrandr was not found in the pkg-config search path.
Perhaps you should add the directory containing `xrandr.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xrandr' found
configure:22515: $? = 1
configure:22528: $PKG_CONFIG --exists --print-errors "x11 xrandr >= 1.2"
Package xrandr was not found in the pkg-config search path.
Perhaps you should add the directory containing `xrandr.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xrandr' found
configure:22531: $? = 1
No package 'xrandr' found
configure:22558: result: no

make after configure:

gnome-rr.c:30:35: error: X11/extensions/Xrandr.h: No such file or directory
gnome-rr.c:46: error: expected specifier-qualifier-list before ‘XRRScreenResources’
gnome-rr.c:73: error: expected specifier-qualifier-list before ‘RROutput’
gnome-rr.c:89: error: expected specifier-qualifier-list before ‘RROutput’
gnome-rr.c:95: error: expected specifier-qualifier-list before ‘RRCrtc’
gnome-rr.c:110: error: expected specifier-qualifier-list before ‘RRMode’
gnome-rr.c:119: error: expected declaration specifiers or ‘...’ before ‘RRCrtc’
gnome-rr.c:122: error: expected declaration specifiers or ‘...’ before ‘XRRScreenResources’
gnome-rr.c:126: error: expected declaration specifiers or ‘...’ before ‘RROutput’
gnome-rr.c:128: error: expected declaration specifiers or ‘...’ before ‘XRRScreenResources’
gnome-rr.c:133: error: expected declaration specifiers or ‘...’ before ‘RRMode’
gnome-rr.c:135: error: expected declaration specifiers or ‘...’ before ‘XRRModeInfo’
gnome-rr.c:141: error: expected declaration specifiers or ‘...’ before ‘RROutput’
...
Comment 1 Claudio Saavedra 2008-08-24 09:04:48 UTC
configure.in section for X libraries is buggy:

> PKG_CHECK_MODULES(XLIB, x11 xrandr >= 1.2,
>     X11_PACKAGE=x11,
>     [X11_PACKAGE=
>      AC_PATH_XTRA
>      if test x"$no_x" = xyes; then
>        AC_MSG_ERROR("no (requires X development libraries)")
>      else
>        XLIB_LIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
>        XLIB_CFLAGS=$X_CFLAGS
>      fi])


If $no_x is yes, then it makes no sense to complain about missing X libraries. I think those if/else blocks are swapped.
Comment 2 Claudio Saavedra 2008-08-24 09:07:04 UTC
This gives proper warnings and makes more sense to me:

Index: configure.in
===================================================================
--- configure.in	(revision 5197)
+++ configure.in	(working copy)
@@ -105,11 +105,11 @@
     X11_PACKAGE=x11,
     [X11_PACKAGE=
      AC_PATH_XTRA
-     if test "x$no_x" = xyes; then
-       AC_MSG_ERROR("no (requires X development libraries)")
-     else
+     if test x"$no_x" = xyes; then
        XLIB_LIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
        XLIB_CFLAGS=$X_CFLAGS
+     else
+       AC_MSG_ERROR("no (requires X development libraries)")
      fi])
 AC_SUBST(X11_PACKAGE)
 AC_SUBST(XLIB_CFLAGS)
Comment 3 Vincent Untz 2008-09-01 21:48:04 UTC
This is actually wrong: if you don't have X, you want to fail in configure. The fix was to add -lXrandr