From patchwork Sun Aug 31 08:48:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Gray X-Patchwork-Id: 4815071 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 18B619F375 for ; Sun, 31 Aug 2014 09:05:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 57D6B2012D for ; Sun, 31 Aug 2014 09:05:13 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 3AD4220136 for ; Sun, 31 Aug 2014 09:05:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 982EB6E180; Sun, 31 Aug 2014 02:05:11 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from lechuck.jsg.id.au (jsg.id.au [210.15.216.215]) by gabe.freedesktop.org (Postfix) with ESMTP id B340D6E180 for ; Sun, 31 Aug 2014 02:05:08 -0700 (PDT) Received: from carla.jsg.id.au (carla.jsg.id.au [192.168.1.42]) by lechuck.jsg.id.au (8.14.8/8.14.8) with ESMTP id s7V8mumw018419 for ; Sun, 31 Aug 2014 18:48:56 +1000 (EST) Received: from carla.jsg.id.au (localhost.jsg.id.au [127.0.0.1]) by carla.jsg.id.au (8.14.8/8.14.3) with ESMTP id s7V8muDp000353 for ; Sun, 31 Aug 2014 18:48:56 +1000 (EST) From: Jonathan Gray To: intel-gfx@lists.freedesktop.org Date: Sun, 31 Aug 2014 18:48:56 +1000 Message-Id: <1409474936-1867-1-git-send-email-jsg@jsg.id.au> X-Mailer: git-send-email 1.8.5.3 Subject: [Intel-gfx] [PATCH xf86-video-intel] configure: check for cpuid.h X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 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-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Instead of checking for a particular version of GCC check for a cpuid.h with __cpuid_count. This allows cpuid.h to be provided for older/different compilers. Signed-off-by: Jonathan Gray --- configure.ac | 18 ++++++++++++++++++ src/sna/sna_cpuid.h | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 4f1cff7..c24b369 100644 --- a/configure.ac +++ b/configure.ac @@ -208,6 +208,24 @@ fi PKG_CHECK_MODULES(X11, [x11 xrender xrandr xext xfixes cairo cairo-xlib-xrender pixman-1 libpng], [x11="yes"], [x11="no"]) AM_CONDITIONAL(HAVE_X11, test "x$x11" = "xyes") +cpuid="yes" +AC_TRY_LINK([ + #include + #include + ], + [ + int eax, ebx, ecx, edx; + if (__get_cpuid_max(0, NULL) < 4) + return 0; + __cpuid_count(4, 0, eax, ebx, ecx, edx); + ], + [cpuid="yes"], + [cpuid="no"] +) +if test "x$cpuid" = "xyes"; then + AC_DEFINE(HAVE_CPUID_H,1,[Found a useable cpuid.h]) +fi + shm=yes AC_CHECK_HEADERS([sys/ipc.h sys/ipc.h], [], [shm="no"]) AC_CHECK_HEADERS([X11/extensions/XShm.h], [], [shm="no"], [ diff --git a/src/sna/sna_cpuid.h b/src/sna/sna_cpuid.h index ed28a0a..14af62b 100644 --- a/src/sna/sna_cpuid.h +++ b/src/sna/sna_cpuid.h @@ -30,9 +30,9 @@ #ifndef SNA_CPUID_H #define SNA_CPUID_H -#include "compiler.h" +#include "config.h" -#if HAS_GCC(4, 4) /* for __cpuid_count() */ +#ifdef HAVE_CPUID_H #include #else #define __get_cpuid_max(x, y) 0