From f583ee67795c94984d7e651c83041323482f9221 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 | 3 +++ 2 files changed, 8 insertions(+), 1 deletions(-) diff --git a/configure.ac b/configure.ac index d9eac22..3853ebb 100644 --- a/configure.ac +++ b/configure.ac @@ -600,7 +600,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 @@ -612,6 +612,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 9e42d83..0f3eebb 100644 --- a/src/glx/glxext.c +++ b/src/glx/glxext.c @@ -41,7 +41,10 @@ #include "glxclient.h" #include #include +#ifdef HAVE_DRI2PROTO #include +#endif + #ifdef GLX_USE_APPLEGL #include "apple_glx.h" #include "apple_visual.h" -- 1.7.1