# Process this file with autoconf to produce a configure script.
-AC_INIT([userspace-rcu],[0.7.2],[mathieu dot desnoyers at efficios dot com])
+AC_INIT([userspace-rcu],[0.7.6],[mathieu dot desnoyers at efficios dot com])
# Following the numbering scheme proposed by libtool for the library version
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
AH_TEMPLATE([CONFIG_RCU_ARM_HAVE_DMB], [Use the dmb instruction if available for use on ARM.])
AH_TEMPLATE([CONFIG_RCU_TLS], [TLS provided by the compiler.])
-AX_TLS([AC_DEFINE_UNQUOTED([CONFIG_RCU_TLS], $ac_cv_tls)], [])
+# Allow overriding storage used for TLS variables.
+AC_ARG_ENABLE([compiler-tls],
+ AS_HELP_STRING([--disable-compiler-tls], [Use pthread_getspecific() to emulate Thread Local Storage (TLS) variables.]),
+ [def_compiler_tls=$enableval],
+ [def_compiler_tls="yes"])
+
+# If not overridden, use ax_tls.m4 to check if TLS is available.
+AS_IF([test "x$def_compiler_tls" = "xyes"],
+ [AX_TLS([def_tls_detect=$ac_cv_tls], [:])],
+ [:])
+
+AS_IF([test "x$def_tls_detect" = "x"],
+ [:],
+ [AC_DEFINE_UNQUOTED([CONFIG_RCU_TLS], $def_tls_detect)])
# Checks for programs.
AC_PROG_CC
[alpha*], [ARCHTYPE="alpha"],
[ia64], [ARCHTYPE="gcc"],
[arm*], [ARCHTYPE="arm"],
+ [mips*], [ARCHTYPE="mips"],
[ARCHTYPE="unknown"]
)
AC_MSG_RESULT([no])
])
+ # Confirm that we have CPU_SET, and it actually works.
+ AC_MSG_CHECKING([whether CPU_SET works])
+ AH_TEMPLATE([HAVE_CPU_SET], [Defined to 1 if we have CPU_SET and it works])
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+ #define _GNU_SOURCE
+ #include <sched.h>
+ int main()
+ {
+ cpu_set_t foo, mask; CPU_SET (0, &foo);
+ return 0;
+ }
+ ]])
+ ],[
+ # Works!
+ AC_DEFINE(HAVE_CPU_SET, 1)
+ AC_MSG_RESULT([yes])
+ ],[
+ AC_MSG_RESULT([no])
+ ])
+
# Check how many arguments does sched_setaffinity take.
# Should be 3 or 2.
AC_MSG_CHECKING([how many arguments sched_setaffinity takes])
],[
AS_ECHO("SMP support disabled.")
])
+
+AS_IF([test "x$def_tls_detect" = "x"],[
+ AS_ECHO("Thread Local Storage (TLS): pthread_getspecific().")
+],[
+ AS_ECHO("Thread Local Storage (TLS): $def_tls_detect.")
+])