tls.m4 revision babbea4b30ff74958a57af623280dec68219df23
ee5342a8882c2fc7631fcffb5497e6597747887cTim Reddehase# See if we have working TLS. We only check to see if it compiles, and that
28c62a48f3ecfd2a6a44552bf9bac888fae7a6a5henning mueller# the resulting program actually runs, not whether the resulting TLS variables
ee5342a8882c2fc7631fcffb5497e6597747887cTim Reddehase# work properly; that check is done at runtime, since we can run binaries
ec96c6e3605c2e9eb5c0113e4e1b07b3b5228c8chenning mueller# compiled with __thread on systems without TLS.
28c62a48f3ecfd2a6a44552bf9bac888fae7a6a5henning muellerAC_DEFUN([LXC_CHECK_TLS],
4d1241ed4d5b5b53ae0da582cd469bffed20a78chenning mueller AC_MSG_CHECKING(for TLS)
2e4d9c9f0e084f77648c6df1bb4b936334fc8fb5Julian Kornberger AC_RUN_IFELSE([AC_LANG_SOURCE([[ static __thread int val; int main() { return 0; } ]])],[have_tls=yes],[have_tls=no],[have_tls=no ])
10be32b36246121321399ec3ab26d4d723d550e3Tim Reddehase AC_MSG_RESULT($have_tls)
10be32b36246121321399ec3ab26d4d723d550e3Tim Reddehase if test "$have_tls" = "yes"; then
5c3122bc6bde5ff70cc8147c32814b616e587af2henning mueller AC_DEFINE([HAVE_TLS],[1],[Define if the compiler supports __thread])
4d1241ed4d5b5b53ae0da582cd469bffed20a78chenning mueller AC_DEFINE([thread_local],[__thread],[Define to the compiler TLS keyword])