From 9cef5b6c0753a72f45a292b435e8d3dcfbb280e0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 14 Sep 2010 15:14:32 +0200 Subject: Update test --- m4/threads.m4 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'm4') diff --git a/m4/threads.m4 b/m4/threads.m4 index 7c32abe..ea547c0 100644 --- a/m4/threads.m4 +++ b/m4/threads.m4 @@ -5,6 +5,8 @@ dnl license : GNU GPL v2; see accompanying LICENSE file dnl AC_DEFUN([THREADS],[ +threads_thread_keyword=no + AC_ARG_ENABLE( [threads], AS_HELP_STRING([--disable-threads], [disable threads (enabled by default)]), @@ -30,6 +32,24 @@ if test x$threads = xcheck; then threads=posix LIBS="$LIBS $PTHREAD_LIBS" CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS" + + # Check if we can use the __thread keyword. + # + AC_MSG_CHECKING([for __thread keyword]) + + CXX_LIBTOOL_LINK_IFELSE( + AC_LANG_SOURCE([[ + __thread int tls_var; + + int + main () + { + tls_var = 0; + } + ]]), + [threads_thread_keyword=yes]) + + AC_MSG_RESULT([$threads_thread_keyword]) fi ;; esac -- cgit v1.1