aboutsummaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorCory Fields <theuni-nospam-@xbmc.org>2012-10-15 15:42:14 -0400
committerCory Fields <theuni-nospam-@xbmc.org>2012-10-16 13:51:53 -0400
commitc3adf6738cb94764d0fbccdd3c08b20788a5218c (patch)
tree081fff0d23f9eab1a86f223ba775e20b5d1c84a3 /configure.in
parent937ace2faccf04d50ed666aae7964f534bf499f1 (diff)
build: quit guessing about intrinsics, check specifics
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in31
1 files changed, 31 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index bd2f6f4edf..b300fac18d 100644
--- a/configure.in
+++ b/configure.in
@@ -811,6 +811,37 @@ AC_CHECK_FUNCS([atexit dup2 fdatasync floor fs_stat_dev ftime ftruncate getcwd g
AC_CHECK_SIZEOF([int])
AC_CHECK_SIZEOF([size_t])
+# Check for intrinsics
+AC_MSG_CHECKING([for __sync_add_and_fetch(temp, 1)])
+AC_TRY_COMPILE([],[long* temp=0; __sync_add_and_fetch(temp, 1);],
+ [have_builtin_sync_add_and_fetch=yes],
+ [have_builtin_sync_add_and_fetch=no])
+AC_MSG_RESULT($have_builtin_sync_add_and_fetch)
+if test "x$have_builtin_sync_add_and_fetch" = "xyes"; then
+ AC_DEFINE(HAS_BUILTIN_SYNC_ADD_AND_FETCH, 1,
+ [Define to 1 if your compiler supports the __sync_add_and_fetch() intrinsic.])
+fi
+
+AC_MSG_CHECKING([for __sync_sub_and_fetch(temp, 1)])
+AC_TRY_COMPILE([],[long* temp=0; __sync_sub_and_fetch(temp, 1);],
+ [have_builtin_sync_sub_and_fetch=yes],
+ [have_builtin_sync_sub_and_fetch=no])
+AC_MSG_RESULT($have_builtin_sync_sub_and_fetch)
+if test "x$have_builtin_sync_sub_and_fetch" = "xyes"; then
+ AC_DEFINE(HAS_BUILTIN_SYNC_SUB_AND_FETCH, 1,
+ [Define to 1 if your compiler supports the __sync_sub_and_fetch() intrinsic.])
+fi
+
+AC_MSG_CHECKING([for __sync_val_compare_and_swap(temp, 1, 1)])
+AC_TRY_COMPILE([],[long *temp = 0; __sync_val_compare_and_swap(temp, 1, 1);],
+ [have_builtin_sync_val_compare_and_swap=yes],
+ [have_builtin_sync_val_compare_and_swap=no])
+AC_MSG_RESULT($have_builtin_sync_val_compare_and_swap)
+if test "x$have_builtin_sync_val_compare_and_swap" = "xyes"; then
+ AC_DEFINE(HAS_BUILTIN_SYNC_VAL_COMPARE_AND_SWAP, 1,
+ [Define to 1 if your compiler supports the __sync_val_compare_and_swap() intrinsic.])
+fi
+
# Add top source directory for all builds so we can use config.h
INCLUDES="$INCLUDES -I\$(abs_top_srcdir)"