From 0d451ee3891d87268322dc3b72b487fdd2fbade6 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 15 Sep 2014 08:15:04 +0100 Subject: [PATCH] configure: Require the presence of xorg/glamor.h for --enable-glamor Check that we have the required Xorg headers for glamor if the user requests --enable-glamor. There is a possiblity that the headers mismatch as they don't have internal versioning, but this should catch the majority of errors early on. Signed-off-by: Chris Wilson --- configure.ac | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 0191bd5c..8b34c773 100644 --- a/configure.ac +++ b/configure.ac @@ -424,6 +424,9 @@ if test "x$UXA" != "xno"; then UXA=yes fi +PKG_CHECK_MODULES(XORG, [xorg-server >= $required_xorg_server_version xproto fontsproto pixman-1 >= $required_pixman_version $REQUIRED_MODULES]) +ABI_VERSION=`$PKG_CONFIG --variable=abi_videodrv xorg-server` + AC_ARG_ENABLE(glamor, AS_HELP_STRING([--enable-glamor], [Enable glamor, a new GL-based acceleration [default=no]]), @@ -434,7 +437,13 @@ if test "x$GLAMOR" != "xno"; then AC_MSG_ERROR([Glamor acceleration requested but UXA is not enabled]) fi if pkg-config --exists "xorg-server >= 1.15.99.901"; then - GLAMOR="yes (using Xorg glamor module)" + save_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$XORG_CFLAGS" + AC_CHECK_HEADER([glamor.h], + [GLAMOR="yes (using Xorg glamor module)"], + [test "x$GLAMOR" != "xauto" && AC_MSG_ERROR("failed to find required Xorg headers for glamor") + GLAMOR="no"], [#include ]) + CPPFLAGS=$save_CPPFLAGS else PKG_CHECK_MODULES(LIBGLAMOR, [glamor >= 0.6.0]) PKG_CHECK_MODULES(LIBGLAMOR_EGL, [glamor-egl]) @@ -443,9 +452,6 @@ if test "x$GLAMOR" != "xno"; then AC_DEFINE(USE_GLAMOR, 1, [Enable glamor acceleration]) fi -PKG_CHECK_MODULES(XORG, [xorg-server >= $required_xorg_server_version xproto fontsproto pixman-1 >= $required_pixman_version $REQUIRED_MODULES]) -ABI_VERSION=`$PKG_CONFIG --variable=abi_videodrv xorg-server` - if test "x$ONLY_UMS" = "xyes"; then UMS="yes" KMS="no"