Files
itgmania212121/autoconf/m4/tls.m4
T

16 lines
703 B
Plaintext
Raw Normal View History

# See if we have working TLS. We only check to see if it compiles, and that
# the resulting program actually runs, not whether the resulting TLS variables
# work properly; that check is done at runtime, since we can run binaries
# compiled with __thread on systems without TLS.
2005-01-17 17:51:18 +00:00
AC_DEFUN([SM_TLS],
2004-09-09 02:24:52 +00:00
[
AC_MSG_CHECKING(for TLS)
AC_RUN_IFELSE([AC_LANG_SOURCE([[ static __thread int val; int main() { return 0; } ]])],[have_tls=yes],[have_tls=no],[have_tls=no ])
2004-09-09 02:24:52 +00:00
AC_MSG_RESULT($have_tls)
if test "$have_tls" = "yes"; then
AC_DEFINE([HAVE_TLS],[1],[Define if the compiler supports __thread])
2004-09-09 02:24:52 +00:00
AC_DEFINE([thread_local],[__thread],[Define to the compiler TLS keyword])
fi
])