From patchwork Tue Aug 14 21:30:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yevgeny Kliteynik X-Patchwork-Id: 1323561 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 4469B3FC71 for ; Tue, 14 Aug 2012 21:31:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752553Ab2HNVbo (ORCPT ); Tue, 14 Aug 2012 17:31:44 -0400 Received: from eu1sys200aog104.obsmtp.com ([207.126.144.117]:54510 "HELO eu1sys200aog104.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752548Ab2HNVbn (ORCPT ); Tue, 14 Aug 2012 17:31:43 -0400 Received: from MTLCAS02.mtl.com ([193.47.165.155]) (using TLSv1) by eu1sys200aob104.postini.com ([207.126.147.11]) with SMTP ID DSNKUCrDvMcrrpUlgRYwaUj8SOhg9mOHMwd7@postini.com; Tue, 14 Aug 2012 21:31:42 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; Wed, 15 Aug 2012 00:30:22 +0300 Message-ID: <502AC36E.3040601@mellanox.co.il> Date: Wed, 15 Aug 2012 00:30:22 +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] 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