From 5dbaa1c9baff25c36552b634cfc81ed6f354abff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Tue, 7 Sep 2010 15:18:22 +0200 Subject: AX_TLS: add support for actions on found/not-found Converts to AS_CASE/AS_IF; update doc to note that ICC is also supported. --- m4/ax_tls.m4 | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'm4') diff --git a/m4/ax_tls.m4 b/m4/ax_tls.m4 index a40fce4..1d77368 100644 --- a/m4/ax_tls.m4 +++ b/m4/ax_tls.m4 @@ -4,18 +4,19 @@ # # SYNOPSIS # -# AX_TLS +# AX_TLS([action-if-found], [action-if-not-found]) # # DESCRIPTION # # Provides a test for the compiler support of thread local storage (TLS) -# extensions. Defines TLS if it is found. Currently only knows about GCC +# extensions. Defines TLS if it is found. Currently knows about GCC/ICC # and MSVC. I think SunPro uses the same as GCC, and Borland apparently # supports either. # # LICENSE # # Copyright (c) 2008 Alan Woodland +# Copyright (c) 2010 Diego Elio Pettenò # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the @@ -43,34 +44,33 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 7 +#serial 8 AC_DEFUN([AX_TLS], [ AC_MSG_CHECKING(for thread local storage (TLS) class) AC_CACHE_VAL(ac_cv_tls, [ ax_tls_keywords="__thread __declspec(thread) none" for ax_tls_keyword in $ax_tls_keywords; do - case $ax_tls_keyword in - none) ac_cv_tls=none ; break ;; - *) - AC_TRY_COMPILE( - [#include - static void - foo(void) { - static ] $ax_tls_keyword [ int bar; - exit(1); - }], - [], - [ac_cv_tls=$ax_tls_keyword ; break], - ac_cv_tls=none - ) - esac + 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_cv_tls=$ax_tls_keyword ; break], + ac_cv_tls=none + )]) done -]) + ]) + AC_MSG_RESULT($ac_cv_tls) - if test "$ac_cv_tls" != "none"; then - dnl AC_DEFINE([TLS], [], [If the compiler supports a TLS storage class define it to that here]) + AS_IF([test "$ac_cv_tls" != "none"], AC_DEFINE_UNQUOTED([TLS], $ac_cv_tls, [If the compiler supports a TLS storage class define it to that here]) - fi - AC_MSG_RESULT($ac_cv_tls) + m4_ifnblank([$1], [$1]), + m4_ifnblank([$2], [$2]) + ) ]) -- cgit v1.2.1