From 97a4e747bfac14f34646c55ddf639e8fe22f2f55 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Sun, 20 Sep 2009 14:19:41 +0200 Subject: 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 file changed, 15 insertions(+), 9 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 9d769eab..162c8394 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 -- cgit v1.2.3