don't assume that __thread is available just because we use g++ 4, it doesn't support it under all platforms, notably not under OS X

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56932 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-11-23 12:33:32 +00:00
parent ff55f8377b
commit d3dcef0170
2 changed files with 102 additions and 102 deletions

View File

@@ -4998,31 +4998,10 @@ if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then
AC_MSG_WARN([wxMutex won't be recursive on this platform])
fi
fi
dnl test for compiler thread-specific variables support
AX_GXX_VERSION
if test -n "$ax_cv_gxx_version"; then
dnl g++ supports __thread since at least version 3.3 but its support
dnl seems to be broken until 4.1, see
dnl http://thread.gmane.org/gmane.comp.lib.wxwidgets.devel/108388
AC_MSG_CHECKING([for __thread support in g++])
case "$ax_cv_gxx_version" in
1.* | 2.* )
AC_MSG_RESULT([doesn't exist])
wx_cv_cc___thread=no
;;
3.*)
AC_MSG_RESULT([broken])
wx_cv_cc___thread=no
;;
*)
AC_MSG_RESULT([works])
wx_cv_cc___thread=yes
;;
esac
else
AC_CACHE_CHECK([for __thread keyword],
wx_cv_cc___thread,
AC_CACHE_CHECK([for __thread keyword],
wx_cv_cc___thread,
[
AC_TRY_COMPILE([#include <pthread.h>],
[
@@ -5032,7 +5011,31 @@ if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then
wx_cv_cc___thread=yes,
wx_cv_cc___thread=no
)
])
]
)
if test "$wx_cv_cc___thread" = "yes"; then
AX_GXX_VERSION
if test -n "$ax_cv_gxx_version"; then
dnl g++ supports __thread since at least version 3.3 but its support
dnl seems to be broken until 4.1, see
dnl http://thread.gmane.org/gmane.comp.lib.wxwidgets.devel/108388
dnl
dnl NB: we still need to test __thread support with
dnl AC_TRY_COMPILE above even for g++ 4 as it doesn't
dnl support it for all architectures (e.g. it doesn't
dnl work under OS X)
AC_MSG_CHECKING([whether __thread support in g++ is usable])
case "$ax_cv_gxx_version" in
1.* | 2.* | 3.* )
AC_MSG_RESULT([no, it's broken])
wx_cv_cc___thread=no
;;
*)
AC_MSG_RESULT([yes, it works])
;;
esac
fi
fi
if test "$wx_cv_cc___thread" = "yes"; then