]> git.proxmox.com Git - mirror_lxc.git/blame - config/tls.m4
string_utils: coding rules
[mirror_lxc.git] / config / tls.m4
CommitLineData
babbea4b
ÇO
1# See if we have working TLS. We only check to see if it compiles, and that
2# the resulting program actually runs, not whether the resulting TLS variables
3# work properly; that check is done at runtime, since we can run binaries
4# compiled with __thread on systems without TLS.
5AC_DEFUN([LXC_CHECK_TLS],
6[
7 AC_MSG_CHECKING(for TLS)
8d6aae92 8 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ static __thread int val; int main() { return 0; } ]])],[have_tls=yes],[have_tls=no],[have_tls=no ])
babbea4b
ÇO
9 AC_MSG_RESULT($have_tls)
10 if test "$have_tls" = "yes"; then
11 AC_DEFINE([HAVE_TLS],[1],[Define if the compiler supports __thread])
12 AC_DEFINE([thread_local],[__thread],[Define to the compiler TLS keyword])
13 fi
14])