From ed8523e8085e2de874162b6961b3eba22b421579 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Thu, 17 Sep 2009 10:29:24 +0200 Subject: [PATCH] use AC_CHECK_HEADER instead of AC_CHECK_FILE MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit AC_CHECK_FILE is not possible when cross-compiling. Use AC_CHECK_HEADER / AC_PREPROC_IFELSE instead. [ Michel Dänzer: Shuffled things around slightly to make it work on my setup ] Signed-off-by: Michael Olbrich Signed-off-by: Michel Dänzer --- configure.ac | 24 +++++++++++++++--------- 1 files changed, 15 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 66f76aa..96c85ce 100644 --- a/configure.ac +++ b/configure.ac @@ -102,14 +102,21 @@ sdkdir=$(pkg-config --variable=sdkdir xorg-server) AC_HEADER_STDC if test "$DRI" != no; then - AC_CHECK_FILE([${sdkdir}/dri.h], - [have_dri_h="yes"], [have_dri_h="no"]) - AC_CHECK_FILE([${sdkdir}/sarea.h], - [have_sarea_h="yes"], [have_sarea_h="no"]) - AC_CHECK_FILE([${sdkdir}/dristruct.h], - [have_dristruct_h="yes"], [have_dristruct_h="no"]) - AC_CHECK_FILE([${sdkdir}/damage.h], - [have_damage_h="yes"], [have_damage_h="no"]) + PKG_CHECK_MODULES(DRI, [libdrm >= 2.2 xf86driproto]) + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$XORG_CFLAGS $DRI_CFLAGS" + AC_CHECK_HEADER([dri.h], + [have_dri_h="yes"], [have_dri_h="no"],[-]) + AC_CHECK_HEADER([sarea.h], + [have_sarea_h="yes"], [have_sarea_h="no"],[-]) + AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ +#include +#include + ]])], + [have_dristruct_h="yes"], [have_dristruct_h="no"],[-]) + AC_CHECK_HEADER([damage.h], + [have_damage_h="yes"], [have_damage_h="no"],[-]) + CPPFLAGS="$save_CPPFLAGS" fi AC_MSG_CHECKING([whether to include DRI support]) @@ -126,7 +133,6 @@ AC_MSG_RESULT([$DRI]) AM_CONDITIONAL(DRI, test x$DRI = xyes) if test "$DRI" = yes; then - PKG_CHECK_MODULES(DRI, [libdrm >= 2.2 xf86driproto]) AC_DEFINE(XF86DRI,1,[Enable DRI driver support]) AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support]) if test "$have_damage_h" = yes; then -- 1.6.3.3