From patchwork Tue Sep 11 15:24:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yevgeny Kliteynik X-Patchwork-Id: 1438601 X-Patchwork-Delegate: alexne@voltaire.com 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 104B04025E for ; Tue, 11 Sep 2012 15:24:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756690Ab2IKPYy (ORCPT ); Tue, 11 Sep 2012 11:24:54 -0400 Received: from eu1sys200aog103.obsmtp.com ([207.126.144.115]:46109 "HELO eu1sys200aog103.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1756550Ab2IKPYx (ORCPT ); Tue, 11 Sep 2012 11:24:53 -0400 Received: from MTLCAS02.mtl.com ([193.47.165.155]) (using TLSv1) by eu1sys200aob103.postini.com ([207.126.147.11]) with SMTP ID DSNKUE9Xw+ZzFthGiXoaKX+Sdw/dGSdnCK62@postini.com; Tue, 11 Sep 2012 15:24:53 UTC Received: from [10.7.17.62] (10.0.13.1) by MTLCAS02.mtl.com (10.0.8.72) with Microsoft SMTP Server id 14.2.247.3; Tue, 11 Sep 2012 18:24:50 +0300 Message-ID: <504F57AE.20208@mellanox.co.il> Date: Tue, 11 Sep 2012 18:24:30 +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 , Yevgeny Kliteynik Subject: [PATCH 1/8 v2] opensm/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 e48c066..eb252ff 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