Skip to contentSkip to conversation

package/x11r7/xserver_xorg-server: add libdrm-specific cflags

PATCH New Bernd Kuhls 2 participants 4 messages Jul 25, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/x11r7/xserver_xorg-server: add libdrm-specific cflags

As described in
http://lists.busybox.net/pipermail/buildroot/2015-February/119410.html
xserver_xorg-server still uses PKG_CHECK_EXISTS to find libdrm but does not add libdrm-specific CFLAGS to Makefile causing the build to fail.

Fixes
http://autobuild.buildroot.net/results/3b2/3b2b10314cde2ecacb7fd3949990a4cac2117f4c/

---
 package/x11r7/xserver_xorg-server/xserver_xorg-server.mk | 1 +
 1 file changed, 1 insertion(+)
package/x11r7/xserver_xorg-server/xserver_xorg-server.mk +1 -0
index 85d7e98..0d14654 100644
@@ -99,6 +99,7 @@ XSERVER_XORG_SERVER_CONF_OPTS += --enable-xorg
 XSERVER_XORG_SERVER_DEPENDENCIES += libpciaccess
 ifeq ($(BR2_PACKAGE_LIBDRM),y)
 XSERVER_XORG_SERVER_DEPENDENCIES += libdrm
+XSERVER_XORG_SERVER_CONF_ENV += LIBDRM_CFLAGS="`$(PKG_CONFIG_HOST_BINARY) --cflags libdrm`"
 XSERVER_XORG_SERVER_CONF_OPTS += --enable-libdrm
 else
 XSERVER_XORG_SERVER_CONF_OPTS += --disable-libdrm
Signature · 1 line
2.8.1
#1 lore raw

PATCH 2/2 package/x11r7/xserver_xorg-server: libdrm needs dri2

While fixing
http://autobuild.buildroot.net/results/3b2/3b2b10314cde2ecacb7fd3949990a4cac2117f4c/
the build throws an error in the modesettings driver after libdrm CFLAGS were fixed by the previous patch:

In file included from dri2.c:43:0:
./../../dri2/dri2.h:36:39: fatal error: X11/extensions/dri2tokens.h: No such file or directory
#include <X11/extensions/dri2tokens.h>

According to configure.ac the modesettings driver is enabled if libdrm was found:
https://cgit.freedesktop.org/xorg/xserver/commit/configure.ac?id=bc4b234d6f4b7b211f7a9750a97524e9652d0e6e

This patch adds the necessary dri2 dependency.

Fixes additional build error in
http://autobuild.buildroot.net/results/3b2/3b2b10314cde2ecacb7fd3949990a4cac2117f4c/

---
 package/x11r7/xserver_xorg-server/xserver_xorg-server.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/x11r7/xserver_xorg-server/xserver_xorg-server.mk +1 -1
index 0d14654..13f9087 100644
@@ -97,7 +97,7 @@ endif
 ifeq ($(BR2_PACKAGE_XSERVER_XORG_SERVER_MODULAR),y)
 XSERVER_XORG_SERVER_CONF_OPTS += --enable-xorg
 XSERVER_XORG_SERVER_DEPENDENCIES += libpciaccess
-ifeq ($(BR2_PACKAGE_LIBDRM),y)
+ifeq ($(BR2_PACKAGE_LIBDRM)$(BR2_PACKAGE_XPROTO_DRI2PROTO),yy)
 XSERVER_XORG_SERVER_DEPENDENCIES += libdrm
 XSERVER_XORG_SERVER_CONF_ENV += LIBDRM_CFLAGS="`$(PKG_CONFIG_HOST_BINARY) --cflags libdrm`"
 XSERVER_XORG_SERVER_CONF_OPTS += --enable-libdrm
Signature · 1 line
2.8.1
#2 lore raw

PATCH 2/2 package/x11r7/xserver_xorg-server: libdrm needs dri2

Hello,

Quoted 9 lines · Bernd Kuhls

While fixing
http://autobuild.buildroot.net/results/3b2/3b2b10314cde2ecacb7fd3949990a4cac2117f4c/
the build throws an error in the modesettings driver after libdrm CFLAGS were fixed by the previous patch:

In file included from dri2.c:43:0:
./../../dri2/dri2.h:36:39: fatal error: X11/extensions/dri2tokens.h: No such file or directory
#include <X11/extensions/dri2tokens.h>

Quoted 8 lines

According to configure.ac the modesettings driver is enabled if libdrm was found:
https://cgit.freedesktop.org/xorg/xserver/commit/configure.ac?id=bc4b234d6f4b7b211f7a9750a97524e9652d0e6e

This patch adds the necessary dri2 dependency.

Fixes additional build error in
http://autobuild.buildroot.net/results/3b2/3b2b10314cde2ecacb7fd3949990a4cac2117f4c/

Could you revisit this in the light of my comments on PATCH 1/2 ?

Quoted 1 line

+ifeq ($(BR2_PACKAGE_LIBDRM)$(BR2_PACKAGE_XPROTO_DRI2PROTO),yy)

libdrm can be used with DRI or DRI3 as well, according to the configure.ac script.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH 1/2 package/x11r7/xserver_xorg-server: add libdrm-specific cflags

In reply to Bernd Kuhls

Hello,

Quoted 4 lines · Bernd Kuhls

As described in
http://lists.busybox.net/pipermail/buildroot/2015-February/119410.html
xserver_xorg-server still uses PKG_CHECK_EXISTS to find libdrm but does not add libdrm-specific CFLAGS to Makefile causing the build to fail.

I am not convinced because the xserver is using PKG_CHECK_MODULES() to check for libdrm:

if test "x$DRI" = xyes || test "x$DRI2" = xyes || test "x$DRI3" = xyes || test "x$CONFIG_UDEV_KMS" = xyes; then
if test "x$DRM" = xyes; then
AC_DEFINE(WITH_LIBDRM, 1, [Building with libdrm support]) PKG_CHECK_MODULES([LIBDRM], $LIBDRM)
fi
fi

and PKG_CHECK_MODULES() does fill in LIBDRM_CFLAGS.

PKG_CHECK_EXISTS() is only used for libdrm:

* In a Solaris specific case, irrelevant;

* To define XORG_DRIVER_MODESETTING to yes or no

So I'm not convinced by your explanation for this change.

Essentially, what I believe happens is that PKG_CHECK_MODULES() is only called when DRI is enabled *or* DRI2 is enabled *or* DRI3 is enabled *or* UDEV_KMS is enabled. Since none of these conditions are meant in the configuration of
http://autobuild.buildroot.net/results/3b2/3b2b10314cde2ecacb7fd3949990a4cac2117f4c/,
the build fails.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com