diff options
author | Diego Elio Pettenò <flameeyes@gmail.com> | 2011-05-15 02:17:32 +0200 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-05-30 09:21:47 +0100 |
commit | 340cfb7f5271fd1df4c8948e5c9336f5b69a6e6c (patch) | |
tree | 1d3ddb14a11cfaadb15f45a83fd01b017f6b9542 | |
parent | 9d6e02a135efdea1d169d1938359ab2b553e941c (diff) |
build: do not use AC_CHECK_FILE to find the header files.
Using AC_CHECK_FILE will cause cross-builds to fail picking the right file;
instead use compile/preprocessor checks properly, and check for
xf86driproto earlier.
Reviewed-by: Rémi Cardona <remi@gentoo.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | configure.ac | 56 |
1 files changed, 31 insertions, 25 deletions
diff --git a/configure.ac b/configure.ac index fd5a3cfc..9449e567 100644 --- a/configure.ac +++ b/configure.ac @@ -77,9 +77,7 @@ AC_ARG_WITH(xorg-module-dir, [moduledir="$libdir/xorg/modules"]) AC_ARG_ENABLE(dri, AS_HELP_STRING([--disable-dri], - [Disable DRI support [[default=auto]]]), - [DRI="$enableval"], - [DRI=auto]) + [Disable DRI support [[default=auto]]])) AC_ARG_ENABLE(xvmc, AS_HELP_STRING([--disable-xvmc], [Disable XvMC support [[default=yes]]]), @@ -106,40 +104,48 @@ XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto) # Obtain compiler/linker options for the driver dependencies PKG_CHECK_MODULES(XORG, [xorg-server >= 1.6 xproto fontsproto $REQUIRED_MODULES]) PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.23]) +PKG_CHECK_MODULES(DRI, [xf86driproto], , DRI=no) PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10]) sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server` +if test "x$enable_dri" != "xno"; then save_CFLAGS="$CFLAGS" + save_CPPFLAGS="$CPPFLAGS" CFLAGS="$XORG_CFLAGS $DRI_CFLAGS $DRM_CFLAGS" CPPFLAGS="$XORG_CFLAGS $DRI_CFLAGS $DRM_CFLAGS" -AC_MSG_CHECKING([whether to include DRI support]) -if test x$DRI != xno; 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"]) -fi -AC_MSG_CHECKING([whether to include DRI support]) -if test x$DRI = xauto; then - if test "$have_dri_h" = yes -a \ - "$have_sarea_h" = yes -a \ - "$have_dristruct_h" = yes; then - DRI="yes" + AC_CHECK_HEADERS([dri.h sarea.h dristruct.h],, [DRI=no], + [/* for dri.h */ + #include <xf86str.h> + /* for dristruct.h */ + #include <xorg-server.h> + #ifdef HAVE_DRI_H + # include <dri.h> + #endif + #ifdef HAVE_SAREA_H + # include <sarea.h> + #endif + ]) + CFLAGS="$save_CFLAGS $DEBUGFLAGS" + CPPFLAGS="$save_CPPFLAGS" else - DRI="no" - fi + DRI=no fi -AC_MSG_RESULT([$DRI]) -CFLAGS="$save_CFLAGS $DEBUGFLAGS" -AM_CONDITIONAL(DRI, test x$DRI = xyes) -if test "$DRI" = yes; then - PKG_CHECK_MODULES(DRI, [xf86driproto]) +AC_MSG_CHECKING([whether to include DRI support]) +AC_MSG_RESULT([${DRI-yes}]) + +AM_CONDITIONAL(DRI, test x$DRI != xno) +if test "x$DRI" != "xno"; then AC_DEFINE(XF86DRI,1,[Enable DRI driver support]) AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support]) +else + DRI_CFLAGS="" + DRI_LIBS="" + + if test "x$enable_dri" = "xyes"; then + AC_MSG_ERROR([DRI requested but prerequisites not found]) + fi fi if test "$XVMC" = yes; then |