summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2012-01-25 22:49:21 -0800
committerdormando <dormando@rydia.net>2012-01-25 22:56:02 -0800
commitde1f30c5d5f1d194564123d23f8b1180be21962a (patch)
treed2066251e93275506601a4b10de049f7f43d580f /configure.ac
parent85db132d127a42ccc2bcdef447813fa8895307ae (diff)
downloadmemcached-de1f30c5d5f1d194564123d23f8b1180be21962a.tar.gz
properly detect GCC atomics
I was naive. GCC atomics were added in 4.1.2, and not easily detectable without configure tests. 32bit platforms, centos5, etc.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac14
1 files changed, 14 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index fdb385b..31f1f9d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -454,6 +454,20 @@ fi
AC_C_ALIGNMENT
+dnl Check for our specific usage of GCC atomics.
+dnl These were added in 4.1.2, but 32bit OS's may lack shorts and 4.1.2
+dnl lacks testable defines.
+have_gcc_atomics=no
+AC_MSG_CHECKING(for GCC atomics)
+AC_TRY_LINK([],[
+ unsigned short a;
+ unsigned short b;
+ b = __sync_add_and_fetch(&a, 1);
+ b = __sync_sub_and_fetch(&a, 2);
+ ],[have_gcc_atomics=yes
+ AC_DEFINE(HAVE_GCC_ATOMICS, 1, [GCC Atomics available])])
+AC_MSG_RESULT($have_gcc_atomics)
+
dnl Check for the requirements for running memcached with less privileges
dnl than the default privilege set. On Solaris we need setppriv and priv.h
dnl If you want to add support for other platforms you should check for