+[
+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 <sys/syscall.h>
+],
+[
+#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" ])
+