build-sys: use more strict method to check __builtin_expect

The problem with the detection of gcc's __builtin_expect, the autoconf
set up uses EX_COMPILE_IFELSE which only compiles the test code with gcc
-c, it does not link so a missing __builtin_expect is treated as a
missing symbol and is not detected.

Reported-by: Conor McCarthy <mr.spuratic@gmail.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2013-11-08 19:19:27 +00:00
parent 1eca347196
commit 631bf0bf7c

View file

@ -70,7 +70,7 @@ AC_CHECK_FUNCS([\
]) ])
AC_MSG_CHECKING([if the compiler supports __builtin_expect]) AC_MSG_CHECKING([if the compiler supports __builtin_expect])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
return __builtin_expect(1, 1) ? 1 : 0 return __builtin_expect(1, 1) ? 1 : 0
]])],[ ]])],[
have_builtin_expect=yes have_builtin_expect=yes