X-Git-Url: http://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=configure.ac;h=7a315e8a7016440d8d0d517d7962724675845765;hp=46770c5d3adfa23b99955dccd29a0c9e4fbc8ad8;hb=274773cf3b5c0bf223b8827f31c4486859e78208;hpb=ec5e2d14f9f53372f97cb7347d5f343ae0bdd0ad diff --git a/configure.ac b/configure.ac index 46770c5..7a315e8 100644 --- a/configure.ac +++ b/configure.ac @@ -2,11 +2,11 @@ # Process this file with autoconf to produce a configure script. -AC_INIT([userspace-rcu],[0.6.7],[mathieu dot desnoyers at efficios dot com]) +AC_INIT([userspace-rcu],[0.7.4],[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 -AC_SUBST([URCU_LIBRARY_VERSION], [1:0:0]) +AC_SUBST([URCU_LIBRARY_VERSION], [2:0:0]) AC_CONFIG_AUX_DIR([config]) AC_CONFIG_MACRO_DIR([config]) @@ -15,6 +15,8 @@ AC_CANONICAL_HOST AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +m4_include([config/ax_tls.m4]) + AC_CONFIG_SRCDIR([urcu.h]) AC_CONFIG_HEADERS([config.h urcu/config.h]) @@ -24,6 +26,22 @@ AH_TEMPLATE([CONFIG_RCU_HAVE_FENCE], [Defined when on a system that has memory f AH_TEMPLATE([CONFIG_RCU_HAVE_FUTEX], [Defined when on a system with futex support.]) AH_TEMPLATE([CONFIG_RCU_COMPAT_ARCH], [Compatibility mode for i386 which lacks cmpxchg instruction.]) 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.]) + +# 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 @@ -58,6 +76,8 @@ AS_CASE([$host_cpu], [alpha*], [ARCHTYPE="alpha"], [ia64], [ARCHTYPE="gcc"], [arm*], [ARCHTYPE="arm"], + [mips*], [ARCHTYPE="mips"], + [tile*], [ARCHTYPE="gcc"], [ARCHTYPE="unknown"] ) @@ -78,7 +98,14 @@ AS_IF([test "$host_cpu" = "armv7l"],[ # ARM-specific checks AS_IF([test "x$ARCHTYPE" = "xarm"],[ AC_MSG_CHECKING([for dmb instruction]) - AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]], [[asm volatile("dmb":::"memory");]])],[ + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ + int main() + { + asm volatile("dmb":::"memory"); + return 0; + } + ]]) + ],[ AC_MSG_RESULT([yes]) AC_DEFINE([CONFIG_RCU_ARM_HAVE_DMB], [1]) ],[ @@ -86,6 +113,21 @@ AS_IF([test "x$ARCHTYPE" = "xarm"],[ ]) ]) +# Tile-specific checks +AS_IF([echo "$host_cpu" | grep "^tile"],[ + AC_MSG_CHECKING([for Tile architecture type]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #ifndef __tilegx__ + #error + #endif + ]]) + ],[ + AC_MSG_RESULT([ok]) + ],[ + AC_MSG_FAILURE([URCU has only been tested on the TileGx architecture. For other Tile* architectures, please run the tests first and report the results to the maintainer so that proper support can be added.]) + ]) +]) + # x86-specific checks AS_IF([test "x$ARCHTYPE" = "xx86"],[ AC_MSG_CHECKING([if architecture really supports the mfence instruction]) @@ -104,7 +146,6 @@ AS_IF([test "x$ARCHTYPE" = "xx86"],[ AC_MSG_CHECKING([for sys_futex()]) AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ #include - ]],[[ #ifndef __NR_futex #error "futexes not available" #endif @@ -176,8 +217,11 @@ AC_CHECK_FUNCS([sched_setaffinity],[ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ #define _GNU_SOURCE #include - ]],[[ - cpu_set_t foo; CPU_ZERO (&foo); + int main() + { + cpu_set_t foo; CPU_ZERO (&foo); + return 0; + } ]]) ],[ # Works! @@ -192,9 +236,12 @@ AC_CHECK_FUNCS([sched_setaffinity],[ AC_MSG_CHECKING([how many arguments sched_setaffinity takes]) AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ #include - ]],[[ - cpu_set_t foo; - sched_setaffinity (0, sizeof (foo), &foo); + int main() + { + cpu_set_t foo; + sched_setaffinity (0, sizeof (foo), &foo); + return 0; + } ]]) ], [sched_set_affinity_args=3], @@ -217,6 +264,7 @@ AC_CONFIG_LINKS([ ]) AC_CONFIG_FILES([ Makefile + doc/Makefile tests/Makefile liburcu.pc liburcu-bp.pc @@ -233,3 +281,9 @@ AS_IF([test "x$def_smp_support" = "xyes"],[ ],[ 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.") +])