diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2010-02-22 18:19:51 +0100 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2010-02-22 18:19:51 +0100 |
commit | b9a612ff3f74a3add607b054213d0f52e85cc426 (patch) | |
tree | 0d07d0b4bef5625042caece2ea370e842cd24652 /configure.in | |
parent | f24955519ac0d3b0da5dd87fbb7bfc8cc1e24295 (diff) | |
parent | 61f0ef569b2f879b6b4e1f247253ceec08e774c7 (diff) |
Merge branch 'master' of git@github.com:sustrik/zeromq2
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/configure.in b/configure.in index 2420fa6..b2607bb 100644 --- a/configure.in +++ b/configure.in @@ -158,11 +158,21 @@ case "${host_os}" in # Define on NetBSD to enable all library features CPPFLAGS="-D_NETBSD_SOURCE $CPPFLAGS" AC_DEFINE(ZMQ_HAVE_NETBSD, 1, [Have NetBSD OS]) - # NetBSD 5.0 and newer provides atomic operations + # NetBSD 5.0 and newer provides atomic operations but we can + # only use these on systems where PR #42842 has been fixed so + # we must try and link a test program using C++. netbsd_has_atomic=no - # XXX As of 5.0.1 the functions declared in atomic.h are - # missing "extern C", disable this until upstream fixes it. - # AC_CHECK_HEADERS(atomic.h, [netbsd_has_atomic=yes]) + AC_MSG_CHECKING([whether atomic operations can be used]) + AC_LANG_PUSH([C++]) + AC_LINK_IFELSE([AC_LANG_PROGRAM( + [[#include <atomic.h>]], + [[uint32_t value; + atomic_cas_32 (&value, 0, 0); + return 0;]])], + [netbsd_has_atomic=yes], + [netbsd_has_atomic=no]) + AC_LANG_POP([C++]) + AC_MSG_RESULT([$netbsd_has_atomic]) if test "x$netbsd_has_atomic" = "xno"; then AC_DEFINE(ZMQ_FORCE_MUTEXES, 1, [Force to use mutexes]) fi |