aboutsummaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2008-12-02 12:14:32 +0000
committerMartin Willi <martin@strongswan.org>2008-12-02 12:14:32 +0000
commitefd0fe21e44f0f757b3cd80cdbaddb8423eeb410 (patch)
tree2da2393fce98cd8bf3b8ab1c7a9c6346c199b3fa /configure.in
parent6905f794bbdfbf82e4ab0fe6e5404db9c8eab3ad (diff)
downloadstrongswan-efd0fe21e44f0f757b3cd80cdbaddb8423eeb410.tar.bz2
strongswan-efd0fe21e44f0f757b3cd80cdbaddb8423eeb410.tar.xz
ref_get()/ref_put() use atomic gcc operations if supported, thanks to Thomas Jarosch for the patch
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in15
1 files changed, 15 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index a251c9912..ea9b6dd20 100644
--- a/configure.in
+++ b/configure.in
@@ -708,6 +708,21 @@ AC_HAVE_LIBRARY(dl)
AC_CHECK_FUNCS(backtrace)
AC_CHECK_FUNCS(dladdr)
+AC_MSG_CHECKING([for gcc atomic operations])
+AC_TRY_RUN(
+[
+ int main() {
+ volatile int ref = 1;
+ __sync_fetch_and_add (&ref, 1);
+ __sync_sub_and_fetch (&ref, 1);
+ /* Make sure test fails if operations are not supported */
+ __sync_val_compare_and_swap(&ref, 1, 0);
+ return ref;
+ }
+],
+[AC_MSG_RESULT([yes]); AC_DEFINE(HAVE_GCC_ATOMIC_OPERATIONS)],
+[AC_MSG_RESULT([no])])
+
if test x$gmp = xtrue; then
AC_HAVE_LIBRARY([gmp],[LIBS="$LIBS"],[AC_MSG_ERROR([GNU Multi Precision library gmp not found])])
AC_MSG_CHECKING([gmp.h version >= 4.1.4])