From 2b9dac397bd97909876bbda8532e2cbce9d8a77f Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Wed, 21 Apr 2010 12:58:54 +0100 Subject: Make XF86VIDMODE extension optional Code in glx/glxcmds.c which uses the XF86VIDMODE extension is already guarded. Also use that guard to control inclusion of the xf86vmode.h header, and only enable that guard if the XF86VIDMODE extension is found by pkgconfig. This changes the behaviour on platforms which XF86VIDMODE exists, in that XF86VIDMODE used to be mandatory, but is now optional. Presumably other build systems are already arranging for -DXF86VIDMODE to be supplied to the complier when glxcmds.c is compiled, so are not affected by this change Signed-off-by: Jon TURNEY --- src/glx/Makefile | 6 +++++- src/glx/glxcmds.c | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src/glx') diff --git a/src/glx/Makefile b/src/glx/Makefile index ba5708ffed..2c94ef1cd4 100644 --- a/src/glx/Makefile +++ b/src/glx/Makefile @@ -1,7 +1,11 @@ TOP = ../.. include $(TOP)/configs/current -EXTRA_DEFINES = -DXF86VIDMODE -D_REENTRANT \ +ifeq ($(HAVE_XF86VIDMODE),yes) +EXTRA_DEFINES_XF86VIDMODE = -DXF86VIDMODE +endif + +EXTRA_DEFINES = $(EXTRA_DEFINES_XF86VIDMODE) -D_REENTRANT \ -DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\" SOURCES = \ diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index 5cd928753f..7016fdf2a8 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -44,7 +44,9 @@ #include "glx_error.h" #else #include +#ifdef XF86VIDMODE #include +#endif #include "xf86dri.h" #endif #else -- cgit v1.2.3