Building DRI-disabled drivers with DRI-enabled xserver

Matt Turner mattst88 at
Mon Sep 26 18:57:00 PDT 2011

On Mon, Sep 26, 2011 at 7:22 PM, Matt Turner <mattst88 at> wrote:
> Hi,
> It seems impossible currently to build DDXs with --disable-dri against
> an X server built with DRI. The X server's xorg-server.h file defines
> XF86DRI, which is included by the DDX's config.h files.
> In config.h, if --enable-dri is passed, XF86DRI is defined to 1. With
> --disable-dri, /* #undef XF86DRI */ is added, which doesn't negate the
> definition provided by xorg-server.h, and causes build failures later
> on.
> Is this intended? We've had a bug about it in Gentoo for a while [1]
> and it seems to cover xf86-video-{tdfx,sis,ati,intel,mga,r128,savage}.
> The autoconf manual [2] seems to say there's no way to put #undef XXX
> into config.h. What's the solution here?
> Thanks,
> Matt
> [1]
> [2]

Trying to use autoheader's AH_TOP to do something like AH_TOP([#undef
XF86DRI]) doesn't work. It just comments it out.

The only thing I've come up with is something like the attached patch:
add a disable-dri.h file which just contains #undef XF86DRI, which we
include in config.h with AH_TOP([#include "disable-dri.h"]).

Maybe there are other things we should undef in there as well. I'm not sure.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-disable-dri.h-header-to-allow-disable-dri-to-wor.patch
Type: text/x-patch
Size: 901 bytes
Desc: not available
URL: <>

More information about the xorg-devel mailing list