From: Victor Julien Date: Tue, 27 Nov 2012 17:55:28 +0000 (+0100) Subject: clang: make atomics work X-Git-Tag: suricata-1.4rc1~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=467f28e98eb4e6540749b1754aeea88a41a06759;p=thirdparty%2Fsuricata.git clang: make atomics work --- diff --git a/configure.ac b/configure.ac index 80cf1129b5..8051e8a11d 100644 --- a/configure.ac +++ b/configure.ac @@ -37,6 +37,16 @@ AC_INIT(configure.ac) if test `basename $CC` = "clang"; then CFLAGS="$CFLAGS -Wextra -Werror-implicit-function-declaration" + AC_MSG_CHECKING([clang __sync_bool_compare_and_swap]) + AC_TRY_COMPILE([#include ], + [ unsigned int i = 0; (void)__sync_bool_compare_and_swap(&i, 1, 1);], + [ + AC_DEFINE([__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1], [1], [Fake GCC atomic support]) + AC_DEFINE([__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2], [1], [Fake GCC atomic support]) + AC_DEFINE([__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], [1], [Fake GCC atomic support]) + AC_DEFINE([__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8], [1], [Fake GCC atomic support]) + AC_MSG_RESULT([yes]) ], + [AC_MSG_RESULT([no])]) fi if test `basename $CC` = "gcc"; then dnl get gcc version