don't use -mthreads switch if the compiler doesn't support it

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16973 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-09-04 15:04:10 +00:00
parent 2bffed64c5
commit ca8e52b3d2
2 changed files with 137 additions and 83 deletions

View File

@@ -3485,10 +3485,28 @@ else
if test "$wxUSE_THREADS" = "yes" ; then
case "${host}" in
*-*-mingw32* )
CFLAGS="$CFLAGS -mthreads"
CXXFLAGS="$CXXFLAGS -mthreads"
TOOLCHAIN_DEFS="$TOOLCHAIN_DEFS -mthreads"
LDFLAGS="$LDFLAGS -mthreads"
dnl check if the compiler accepts -mthreads
AC_CACHE_CHECK([if compiler supports -mthreads],
wx_cv_cflags_mthread,
[
CFLAGS_OLD="$CFLAGS"
CFLAGS="$CFLAGS -mthreads"
AC_TRY_COMPILE([], [],
wx_cv_cflags_mthread=yes,
wx_cv_cflags_mthread=no
)
]
)
if test "$wx_cv_cflags_mthread" = "yes"; then
dnl it does, use it
CXXFLAGS="$CXXFLAGS -mthreads"
TOOLCHAIN_DEFS="$TOOLCHAIN_DEFS -mthreads"
LDFLAGS="$LDFLAGS -mthreads"
else
dnl it doesn't
CFLAGS="$CFLAGS_OLD"
fi
;;
esac
fi