X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=configure.ac;h=2c1b6c00b26ce5c2bebe19c0e2eca4098459cd5f;hb=0854ccff976f2893a7f04aaa4b48090f423802a5;hp=a4e675fca1f87aa2262a638566f1bf8414dd9794;hpb=90586875e92a9cdc6c7088d8e9815a6a0f54beb1;p=userspace-rcu.git diff --git a/configure.ac b/configure.ac index a4e675f..2c1b6c0 100644 --- a/configure.ac +++ b/configure.ac @@ -12,6 +12,7 @@ AC_CONFIG_SRCDIR([urcu.h]) AH_TEMPLATE([CONFIG_SMP], [Enable SMP support. With SMP support enabled, uniprocessors are also supported. With SMP support disabled, UP systems work fine, but the behavior of SMP systems is undefined.]) AH_TEMPLATE([CONFIG_HAVE_FENCE], [Defined when on a system that has memory fence instructions.]) +AH_TEMPLATE([CONFIG_HAVE_FUTEX], [Defined when on a system with futex support.]) AC_CONFIG_HEADERS([config.h]) # Checks for programs. @@ -52,17 +53,40 @@ AC_SUBST(ARCHTYPE) AC_SUBST(SUBARCHTYPE) [ -if test "x$ARCHTYPE" = "xx86" -a "x$target_cpu" != "xi386" -a "x$target_cpu" != -"xi486" -a "x$target_cpu" != "xi586"; then +if test "x$ARCHTYPE" = "xx86" -a "x$target_cpu" != "xi386" -a "x$target_cpu" != "xi486" -a "x$target_cpu" != "xi586"; then ] AC_DEFINE([CONFIG_HAVE_FENCE], [1]) [ fi ] +AC_MSG_CHECKING([presence of sys_futex()]) +AC_TRY_COMPILE( +[ +#include +], +[ +#ifndef __NR_futex +#error "futexes not available" +#endif +], +[ + AC_MSG_RESULT([yes]) + AC_DEFINE([CONFIG_HAVE_FUTEX], [1]) + compat_futex_test=0 +] +, +[ + AC_MSG_RESULT([no]) + compat_futex_test=1 +] +) + +AM_CONDITIONAL([COMPAT_FUTEX], [ test "x$compat_futex_test" = "x1" ]) + AM_CONDITIONAL([GCC_API], [test "x$ARCHTYPE" != xx86 -a "x$ARCHTYPE" != xppc]) -AM_CONDITIONAL([COMPAT_ARCH], [test "x$SUBARCHTYPE" == xx86compat ]) +AM_CONDITIONAL([COMPAT_ARCH], [test "x$SUBARCHTYPE" = xx86compat ]) AC_ARG_ENABLE([smp-support], [ --disable-smp-support Disable SMP support. Warning: only use this on uniprocessor systems. [[default=enabled]]], [def_smp_support=$enableval], [def_smp_support="yes"])