X-Git-Url: http://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=configure.ac;h=be9fd72b499b7e9fef75d02da51ce01f93a8bbae;hp=422b11b31f721a7ba32adc3a6e55d52067e1a3ee;hb=49617de1d80d771ac9a1d45b1710b16fac65e0aa;hpb=7d413817f09b2d17b1a79ea012590609ffab5eb6 diff --git a/configure.ac b/configure.ac index 422b11b..be9fd72 100644 --- a/configure.ac +++ b/configure.ac @@ -9,8 +9,10 @@ AC_CANONICAL_HOST AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip]) 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.]) -AC_CONFIG_HEADERS([config.h]) +AH_TEMPLATE([CONFIG_URCU_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_URCU_HAVE_FENCE], [Defined when on a system that has memory fence instructions.]) +AH_TEMPLATE([CONFIG_URCU_HAVE_FUTEX], [Defined when on a system with futex support.]) +AC_CONFIG_HEADERS([urcu/config.h]) # Checks for programs. AC_PROG_CC @@ -49,9 +51,41 @@ fi 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 +] + AC_DEFINE([CONFIG_URCU_HAVE_FENCE], [1]) +[ +fi +] + +AC_MSG_CHECKING([sys_futex()]) +AC_TRY_COMPILE( +[ +#include +], +[ +#ifndef __NR_futex +#error "futexes not available" +#endif +], +[ + AC_MSG_RESULT([yes]) + AC_DEFINE([CONFIG_URCU_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"]) @@ -61,7 +95,7 @@ if test "$def_smp_support" = "no"; then echo "SMP support disabled." else ] - AC_DEFINE([CONFIG_SMP], [1]) + AC_DEFINE([CONFIG_URCU_SMP], [1]) [ echo "SMP support enabled." fi