summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2009-09-20 14:19:41 +0200
committerMichel Dänzer <daenzer@vmware.com>2009-09-20 14:19:41 +0200
commit97a4e747bfac14f34646c55ddf639e8fe22f2f55 (patch)
tree0c8d5b82ba319a1dcfdf388fe28b90c69796936f
parent579070ed9f0218a975e840331b6fe9fa8fd05789 (diff)
use AC_CHECK_HEADER instead of AC_CHECK_FILE
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 <m.olbrich@pengutronix.de> Signed-off-by: Michel Dänzer <daenzer@vmware.com>
-rw-r--r--configure.ac24
1 files changed, 15 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index 9d769ea..162c839 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 <xorg-server.h>
+#include <dristruct.h>
+ ]])],
+ [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