X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=configure.ac;h=7a315e8a7016440d8d0d517d7962724675845765;hp=4d0c7f4131dfcaadcaa679e70c4bde421de0704f;hb=ffa11a1830c532f3b052146eb9f0dd450cb2a0f2;hpb=58e9f838bba4457b8ad2723f1d13f74e77345996 diff --git a/configure.ac b/configure.ac index 4d0c7f4..7a315e8 100644 --- a/configure.ac +++ b/configure.ac @@ -28,7 +28,20 @@ AH_TEMPLATE([CONFIG_RCU_COMPAT_ARCH], [Compatibility mode for i386 which lacks c 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 @@ -64,6 +77,7 @@ AS_CASE([$host_cpu], [ia64], [ARCHTYPE="gcc"], [arm*], [ARCHTYPE="arm"], [mips*], [ARCHTYPE="mips"], + [tile*], [ARCHTYPE="gcc"], [ARCHTYPE="unknown"] ) @@ -99,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]) @@ -252,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.") +])