diff mbox

[1/8,v2] opensm/configure.in: check that compiler supports __builtin_expect()

Message ID 504F57AE.20208@mellanox.co.il (mailing list archive)
State Accepted
Delegated to: Alex Netes
Headers show

Commit Message

Yevgeny Kliteynik Sept. 11, 2012, 3:24 p.m. UTC
Signed-off-by: Yevgeny Kliteynik <kliteyn@dev.mellanox.co.il>
---
 configure.in | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Alex Netes Sept. 16, 2012, 10:10 a.m. UTC | #1
Hi Yevgeny,

On 18:24 Tue 11 Sep     , Yevgeny Kliteynik wrote:
> 
> Signed-off-by: Yevgeny Kliteynik <kliteyn@dev.mellanox.co.il>
> ---

Applied all the patches. Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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