dnl Annoyingly, the Portland Group compiler compiles code with
dnl __builtin_expect just fine, but then doesn't want to link it,
dnl saying it doesn't know this function. So simply not test for
-dnl __builtin_expect with that compiler.
+dnl __builtin_expect with that compiler, and to be extrasure make
+dnl sure we're doing the right thing also link .
dnl
dnl Usage: DEAL_II_HAVE_BUILTIN_EXPECT
dnl
AC_MSG_CHECKING(for __builtin_expect)
AC_LANG(C++)
CXXFLAGS="$CXXFLAGSG"
- AC_TRY_COMPILE(
+ AC_TRY_LINK(
[
- bool f();
+ bool f() {}
],
[
if (__builtin_expect(f(),false));
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
- bool f();
+ bool f() {}
int
main ()
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "${ECHO_T}no" >&6
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi