summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2009-09-20 14:19:41 +0200
committerMichel Dänzer <michel@daenzer.net>2009-09-20 14:30:19 +0200
commitd1d3681748251fb7e95b8d56e6c37847ca6b1a8d (patch)
treef952a6b464cca973094baebaaf4456372f0122c5
parentb7c14b00ff6a217cb69727b384cc4f4b433a907e (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> (cherry picked from commit 97a4e747bfac14f34646c55ddf639e8fe22f2f55)
-rw-r--r--configure.ac24
1 files changed, 15 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index f081c67f..a19a308a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -88,14 +88,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])
@@ -112,7 +119,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