From patchwork Sun May 15 00:17:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Diego_Elio_Petten=C3=B2?= X-Patchwork-Id: 785502 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4F0I6MS005945 for ; Sun, 15 May 2011 00:18:27 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A5EC89EB0C for ; Sat, 14 May 2011 17:18:06 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ww0-f43.google.com (mail-ww0-f43.google.com [74.125.82.43]) by gabe.freedesktop.org (Postfix) with ESMTP id 833E29E8F9 for ; Sat, 14 May 2011 17:17:49 -0700 (PDT) Received: by wwb17 with SMTP id 17so3253875wwb.12 for ; Sat, 14 May 2011 17:17:48 -0700 (PDT) Received: by 10.216.230.213 with SMTP id j63mr926174weq.20.1305418668433; Sat, 14 May 2011 17:17:48 -0700 (PDT) Received: from localhost.localdomain (host249-252-static.95-94-b.business.telecomitalia.it [94.95.252.249]) by mx.google.com with ESMTPS id y35sm1841407weq.15.2011.05.14.17.17.46 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 14 May 2011 17:17:47 -0700 (PDT) From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= To: intel-gfx@lists.freedesktop.org Date: Sun, 15 May 2011 02:17:32 +0200 Message-Id: <1305418652-14402-1-git-send-email-flameeyes@gmail.com> X-Mailer: git-send-email 1.7.5.rc3 Subject: [Intel-gfx] [xf86-video-intel PATCH] build: do not use AC_CHECK_FILE to find the header files. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sun, 15 May 2011 00:18:27 +0000 (UTC) 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. --- configure.ac | 62 +++++++++++++++++++++++++++++++-------------------------- 1 files changed, 34 insertions(+), 28 deletions(-) diff --git a/configure.ac b/configure.ac index fd5a3cf..9449e56 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` -save_CFLAGS="$CFLAGS" -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"]) +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_CHECK_HEADERS([dri.h sarea.h dristruct.h],, [DRI=no], + [/* for dri.h */ + #include + /* for dristruct.h */ + #include + #ifdef HAVE_DRI_H + # include + #endif + #ifdef HAVE_SAREA_H + # include + #endif + ]) + CFLAGS="$save_CFLAGS $DEBUGFLAGS" + CPPFLAGS="$save_CPPFLAGS" +else + DRI=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" - else - DRI="no" - fi -fi -AC_MSG_RESULT([$DRI]) -CFLAGS="$save_CFLAGS $DEBUGFLAGS" +AC_MSG_RESULT([${DRI-yes}]) -AM_CONDITIONAL(DRI, test x$DRI = xyes) -if test "$DRI" = yes; then - PKG_CHECK_MODULES(DRI, [xf86driproto]) +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