TLS test is broken also include a hunk from diff --git a/acinclude.m4 b/acinclude.m4 index 3fd2c89..07480d8 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -330,12 +330,21 @@ m4_pushdef([AC_OUTPUT], # AC_DEFUN([FR_TLS], [ - AC_MSG_CHECKING(for TLS) - AC_RUN_IFELSE([AC_LANG_SOURCE([[ static __thread int val; int main(int argc, char *argv[]) { return val = argc; } ]])],[have_tls=yes],[have_tls=no],[have_tls=no ]) - AC_MSG_RESULT($have_tls) - if test "$have_tls" = "yes"; then - AC_DEFINE([HAVE_THREAD_TLS],[1],[Define if the compiler supports __thread]) - fi + AC_MSG_CHECKING(for __thread support in compiler) + AC_RUN_IFELSE( + [AC_LANG_SOURCE( + [[ + static __thread int val; + int main(int argc, char **argv) { + val = 0; + return val; + } + ]]) + ],[have_tls=yes],[have_tls=no],[have_tls=no]) + AC_MSG_RESULT($have_tls) + if test "x$have_tls" = "xyes"; then + AC_DEFINE([HAVE_THREAD_TLS],[1],[Define if the compiler supports __thread]) + fi ]) diff --git a/confifgure.in b/configure.in index 3fd2c89..07480d8 100644 --- a/configure.in +++ b/configure.in @@ -547,6 +561,10 @@ else ) fi +if test "x$WITH_THREADS" = "xyes"; then + AC_DEFINE(WITH_THREADS, [1], [define if you want thread support]) +fi + dnl Check if we need -lsocket AC_CHECK_LIB(dl, dlopen)