From cd821901ffb95566616d3da798c0f5748e6de19c Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Wed, 21 Apr 2010 14:43:06 +0100 Subject: [PATCH 3/3] Make DRI2PROTO optional in a GLX_INDIRECT_RENDERING only build Don't try to include dri2proto.h unless DRI2PROTO is found by pkgconfig during configure Sadly, this introduces a new preprocessor symbol that other build systems will need to know to define, perhaps this should just be guarded by GLX_DIRECT_RENDERING instead? Signed-off-by: Jon TURNEY --- configure.ac | 6 +++++- src/glx/glxext.c | 2 ++ 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/configure.ac b/configure.ac index a13391f..c0ea111 100644 --- a/configure.ac +++ b/configure.ac @@ -626,7 +626,7 @@ dri) # Check for libdrm PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED], HAVE_LIBDRM=yes, HAVE_LIBDRM=no) - PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED]) + PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED], HAVE_DRI2PROTO=yes, HAVE_DRI2PROTO=no) PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED]) if test "$HAVE_LIBDRM" = no; then @@ -638,6 +638,10 @@ dri) DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED" fi + if test "$HAVE_DRI2PROTO" = yes; then + DEFINES="$DEFINES -DHAVE_DRI2PROTO" + fi + # find the DRI deps for libGL if test "$x11_pkgconfig" = yes; then dri_modules="x11 xext xdamage xfixes" diff --git a/src/glx/glxext.c b/src/glx/glxext.c index 6d6f89e..6ec477a 100644 --- a/src/glx/glxext.c +++ b/src/glx/glxext.c @@ -41,7 +41,9 @@ #include "glxclient.h" #include #include +#ifdef HAVE_DRI2PROTO #include +#endif #include "glxextensions.h" #include "glcontextmodes.h" -- 1.7.0.4