X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=config%2Fax_tls.m4;h=7c86daf147cdc8f068161f2dc128bbfd7ef2ebc2;hp=033e3b135b8d6264e0b3151c3528ae7b3a74c6ca;hb=84f4ccb4bcf32c0336a0c7a3a4ba76d90d6dea1b;hpb=a767fdc348289dc37026ee3ab46d1d4102ff57f7 diff --git a/config/ax_tls.m4 b/config/ax_tls.m4 index 033e3b1..7c86daf 100644 --- a/config/ax_tls.m4 +++ b/config/ax_tls.m4 @@ -44,7 +44,23 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 10 +#serial 11 + +# Define m4_ifblank and m4_ifnblank macros from introduced in +# autotools 2.64 m4sugar.m4 if using an earlier autotools. + +ifdef([m4_ifblank], [], [ +m4_define([m4_ifblank], +[m4_if(m4_translit([[$1]], [ ][ ][ +]), [], [$2], [$3])]) +]) + + +ifdef([m4_ifnblank], [], [ +m4_define([m4_ifnblank], +[m4_if(m4_translit([[$1]], [ ][ ][ +]), [], [$3], [$2])]) +]) AC_DEFUN([AX_TLS], [ AC_MSG_CHECKING(for thread local storage (TLS) class) @@ -53,16 +69,11 @@ AC_DEFUN([AX_TLS], [ for ax_tls_keyword in $ax_tls_keywords; do AS_CASE([$ax_tls_keyword], [none], [ac_cv_tls=none ; break], - [AC_TRY_COMPILE( - [#include - static void - foo(void) { - static ] $ax_tls_keyword [ int bar; - exit(1); - }], - [], + [AC_TRY_LINK( + [$ax_tls_keyword int foo;], + [++foo;], [ac_cv_tls=$ax_tls_keyword ; break], - ac_cv_tls=none + [ac_cv_tls=none] )]) done ])