From patchwork Wed Jul 27 17:17:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foss X-Patchwork-Id: 9250201 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6A9B560757 for ; Wed, 27 Jul 2016 17:18:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 516A2219AC for ; Wed, 27 Jul 2016 17:18:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 45A3526253; Wed, 27 Jul 2016 17:18:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF21B219AC for ; Wed, 27 Jul 2016 17:18:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DC30E6E701; Wed, 27 Jul 2016 17:17:55 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by gabe.freedesktop.org (Postfix) with ESMTPS id DA5886E704 for ; Wed, 27 Jul 2016 17:17:53 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: robertfoss) with ESMTPSA id B21A62607D4 From: robert.foss@collabora.com To: daniel.vetter@ffwll.ch, daniel.stone@collabora.com, marius.c.vlad@intel.com, tomeu.vizoso@collabora.com, emil.l.velikov@gmail.com, chris@chris-wilson.co.uk, intel-gfx@lists.freedesktop.org Date: Wed, 27 Jul 2016 13:17:35 -0400 Message-Id: <1469639867-14929-2-git-send-email-robert.foss@collabora.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1469639867-14929-1-git-send-email-robert.foss@collabora.com> References: <1469639867-14929-1-git-send-email-robert.foss@collabora.com> Subject: [Intel-gfx] [PACTH i-g-t v5 01/13] configure.ac: Test for libdrm_intel and build for it if present X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Robert Foss Test for libdrm_intel and build for it if present. Also expose the HAVE_INTEL #define to allow code to be conditionally compiled. Signed-off-by: Robert Foss Reviewed-by: Emil Velikov --- configure.ac | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index e1f850d..cbf7724 100644 --- a/configure.ac +++ b/configure.ac @@ -119,7 +119,7 @@ if test "x$GCC" = "xyes"; then fi AC_SUBST(ASSEMBLER_WARN_CFLAGS) -PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.67 libdrm]) +PKG_CHECK_MODULES(DRM, [libdrm]) PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10]) case "$target_cpu" in @@ -169,6 +169,23 @@ PKG_CHECK_MODULES(GLIB, glib-2.0) # ----------------------------------------------------------------------------- # Configuration options # ----------------------------------------------------------------------------- +AC_ARG_ENABLE(intel, AS_HELP_STRING([--disable-intel], + [Enable building of intel specific parts (default: auto)]), + [INTEL=$enableval], [INTEL=auto]) +if test "x$INTEL" = xauto; then + PKG_CHECK_EXISTS([libdrm_intel >= 2.4.64], [INTEL=yes], [INTEL=no]) +fi +if test "x$INTEL" = xyes; then + PKG_CHECK_MODULES(DRM_INTEL, [libdrm_intel >= 2.4.64]) + AC_DEFINE(HAVE_LIBDRM_INTEL, 1, [Have intel support]) + DRM_LIBS="$DRM_LIBS $DRM_INTEL_LIBS" + AC_SUBST([DRM_LIBS]) +else + DRM_INTEL_CFLAGS=$(top_srcdir)/lib/stubs/drm/ + AC_SUBST([DRM_INTEL_CFLAGS]) +fi +AM_CONDITIONAL(HAVE_LIBDRM_INTEL, [test "x$INTEL" = xyes]) + # for dma-buf tests AC_ARG_ENABLE(nouveau, AS_HELP_STRING([--disable-nouveau], [Enable use of nouveau API for prime tests (default: auto)]),