summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gmail.com>2010-09-07 15:18:22 +0200
committerPeter Simons <simons@cryp.to>2010-09-07 19:02:53 +0200
commit5dbaa1c9baff25c36552b634cfc81ed6f354abff (patch)
tree28a18b222bc4f1394ea4d6ce8f31b1fa1a0fd018 /m4
parent591a2370b649bcb35d1c9c65c2d1ccbcf3444a22 (diff)
downloadautoconf-archive-5dbaa1c9baff25c36552b634cfc81ed6f354abff.tar.gz
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.
Diffstat (limited to 'm4')
-rw-r--r--m4/ax_tls.m446
1 files changed, 23 insertions, 23 deletions
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 <ajw05@aber.ac.uk>
+# Copyright (c) 2010 Diego Elio Pettenò <flameeyes@gmail.com>
#
# 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 <stdlib.h>
- 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 <stdlib.h>
+ 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])
+ )
])