* configure.ac, m4/threads.m4: Revived check for __thread.
authorStefan Ring <stefan@complang.tuwien.ac.at>
Fri, 26 Dec 2008 13:28:58 +0000 (14:28 +0100)
committerStefan Ring <stefan@complang.tuwien.ac.at>
Fri, 26 Dec 2008 13:28:58 +0000 (14:28 +0100)
--HG--
extra : transplant_source : %26b%A5%C4%C5%D2%87%B6%EB%F0%E4%B4q%5C%14%8C%DA%20%ED%2B

configure.ac
m4/threads.m4

index 9312ab4e99ee8d68aba26d7d9d9e85bcd8e1dda0..a1e1cc38fed36b468da0a12eb3ac2161e00e18f6 100644 (file)
@@ -442,6 +442,9 @@ AC_CHECK_ENABLE_RT_TIMING
 AC_CHECK_ENABLE_CYCLE_STATS
 AC_CHECK_ENABLE_JVMTI
 AC_CHECK_ENABLE_THREADS
+if test x"${ENABLE_THREADS}" != "xno"; then
+    AC_CHECK_USE___THREAD
+fi
 AC_CHECK_ENABLE_IFCONV
 AC_CHECK_ENABLE_INLINING
 AC_CHECK_ENABLE_INLINING_DEBUG
index c1acf9baebd91fde444220ee39c0af1c8b8ee380..c123401d305abd9d3ba810fb6174795e7165d6b3 100644 (file)
@@ -70,25 +70,25 @@ esac
 ])
 
 
-dnl currently NOT USED
+AC_DEFUN([AC_CHECK_USE___THREAD],[
+AC_ARG_ENABLE([__thread], [AS_HELP_STRING(--enable-__thread,use TLS features [[default=yes]])], [use__thread=$enableval], [use__thread=yes])
 
-dnl AC_ARG_ENABLE([__thread], [AS_HELP_STRING(--enable-__thread,use TLS features)], [use__thread=$enableval], [use__thread=no])
-dnl 
-dnl dnl Check whether the compiler supports the __thread keyword.
-dnl if test "x$use__thread" != xno; then
-dnl   AC_CACHE_CHECK([for __thread], ac_cv_gcc___thread,
-dnl   [cat > conftest.c <<\EOF
-dnl __thread int a = 42;
-dnl EOF
-dnl   if AC_TRY_COMMAND([${CC-cc} $ARCH_CFLAGS $OPT_CFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
-dnl     ac_cv_gcc___thread=yes 
-dnl   else
-dnl     ac_cv_gcc___thread=no
-dnl   fi
-dnl   rm -f conftest*])
-dnl   if test "$ac_cv_gcc___thread" = yes; then
-dnl     AC_DEFINE([HAVE___THREAD], 1, [have __thread])
-dnl   fi
-dnl else
-dnl   ac_cv_gcc___thread=no
-dnl fi
+dnl Check whether the compiler supports the __thread keyword.
+if test "x$use__thread" != xno; then
+  AC_CACHE_CHECK([for __thread], ac_cv_gcc___thread,
+  [cat > conftest.c <<\EOF
+__thread int a = 42;
+EOF
+  if AC_TRY_COMMAND([${CC-cc} $ARCH_CFLAGS $OPT_CFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
+    ac_cv_gcc___thread=yes 
+  else
+    ac_cv_gcc___thread=no
+  fi
+  rm -f conftest*])
+  if test "$ac_cv_gcc___thread" = yes; then
+    AC_DEFINE([HAVE___THREAD], 1, [have __thread])
+  fi
+else
+  ac_cv_gcc___thread=no
+fi
+])