From patchwork Sun Jul 22 10:46:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yevgeny Kliteynik X-Patchwork-Id: 1224241 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 9FA463FDFB for ; Sun, 22 Jul 2012 10:59:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751458Ab2GVK7G (ORCPT ); Sun, 22 Jul 2012 06:59:06 -0400 Received: from eu2sys200bog115.obsmtp.com ([207.126.150.243]:49516 "HELO eu2sys200bog115.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1750996Ab2GVK6l (ORCPT ); Sun, 22 Jul 2012 06:58:41 -0400 Received: from MTLCAS01.mtl.com ([194.90.237.34]) (using TLSv1) by eu2sys200bob115.postini.com ([207.126.147.11]) with SMTP ID DSNKUAvc4LX+GnRRIkFpI8yK21Zp86o+cMvl@postini.com; Sun, 22 Jul 2012 10:58:41 UTC Received: from [10.7.17.62] (10.0.13.1) by MTLCAS01.mtl.com (10.0.8.71) with Microsoft SMTP Server id 14.2.247.3; Sun, 22 Jul 2012 13:46:45 +0300 Message-ID: <500BDA15.3050509@mellanox.co.il> Date: Sun, 22 Jul 2012 13:46:45 +0300 From: Yevgeny Kliteynik Reply-To: User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Linux RDMA , Subject: [PATCH 1/3] configure.in: check that compiler supports __builtin_expect() X-Originating-IP: [10.0.13.1] Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Signed-off-by: Yevgeny Kliteynik --- configure.in | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/configure.in b/configure.in index b2d07bc..0a56da6 100644 --- a/configure.in +++ b/configure.in @@ -56,6 +56,17 @@ AC_HEADER_TIME AC_STRUCT_TM AC_C_VOLATILE +dnl See if we have __builtin_expect +AC_MSG_CHECKING([if the compiler supports __builtin_expect]) +AC_TRY_COMPILE(, [ return __builtin_expect(1, 1) ? 1 : 0], + [ have_builtin_expect=yes + AC_MSG_RESULT([yes]) ], + [ have_builtin_expect=no + AC_MSG_RESULT([no]) ]) +if test "x_$have_builtin_expect" = "x_yes" ; then + AC_DEFINE([HAVE_BUILTIN_EXPECT], [1], [Define to 1 if the compiler supports __builtin_expect.]) +fi + dnl We use --version-script with ld if possible AC_CACHE_CHECK(whether ld accepts --version-script, ac_cv_version_script, if test -n "`$LD --help < /dev/null 2>/dev/null | grep version-script`"; then