aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/acinclude.m4
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/acinclude.m4')
-rw-r--r--libstdc++-v3/acinclude.m442
1 files changed, 28 insertions, 14 deletions
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index f73946a..51c3c51 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -678,10 +678,13 @@ dnl Set up *_FLAGS and *FLAGS variables for all sundry Makefile.am's.
dnl (SECTION_FLAGS is done under CHECK_COMPILER_FEATURES.)
dnl
dnl Substs:
+dnl CPPFLAGS
dnl OPTIMIZE_CXXFLAGS
dnl WARN_FLAGS
dnl
AC_DEFUN([GLIBCXX_EXPORT_FLAGS], [
+ AC_SUBST(CPPFLAGS)
+
# Optimization flags that are probably a good idea for thrill-seekers. Just
# uncomment the lines below and make, everything else is ready to go...
# Alternatively OPTIMIZE_CXXFLAGS can be set in configure.host.
@@ -1352,6 +1355,10 @@ AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [
cygwin*)
ac_has_nanosleep=yes
;;
+ mingw*)
+ ac_has_win32_sleep=yes
+ ac_has_sched_yield=yes
+ ;;
darwin*)
ac_has_nanosleep=yes
ac_has_sched_yield=yes
@@ -1537,6 +1544,9 @@ AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [
if test x"$ac_has_nanosleep" = x"yes"; then
AC_DEFINE(_GLIBCXX_USE_NANOSLEEP, 1,
[ Defined if nanosleep is available. ])
+ elif test x"$ac_has_win32_sleep" = x"yes"; then
+ AC_DEFINE(_GLIBCXX_USE_WIN32_SLEEP, 1,
+ [Defined if Sleep exists.])
else
AC_MSG_CHECKING([for sleep])
AC_TRY_COMPILE([#include <unistd.h>],
@@ -1557,20 +1567,7 @@ AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [
AC_MSG_RESULT($ac_has_usleep)
fi
- if test x"$ac_has_nanosleep$ac_has_sleep" = x"nono"; then
- ac_no_sleep=yes
- AC_MSG_CHECKING([for Sleep])
- AC_TRY_COMPILE([#include <windows.h>],
- [Sleep(1)],
- [ac_has_win32_sleep=yes],[ac_has_win32_sleep=no])
- if test x"$ac_has_win32_sleep" = x"yes"; then
- AC_DEFINE(HAVE_WIN32_SLEEP,1, [Defined if Sleep exists.])
- ac_no_sleep=no
- fi
- AC_MSG_RESULT($ac_has_win32_sleep)
- fi
-
- if test x"$ac_no_sleep" = x"yes"; then
+ if test x"$ac_has_nanosleep$ac_has_win32_sleep$ac_has_sleep" = x"nonono"; then
AC_DEFINE(_GLIBCXX_NO_SLEEP,1, [Defined if no way to sleep is available.])
fi
@@ -3987,6 +3984,15 @@ AC_DEFUN([GLIBCXX_CHECK_GTHREADS], [
case $target_thread_file in
posix)
CXXFLAGS="$CXXFLAGS -DSUPPORTS_WEAK -DGTHREAD_USE_WEAK -D_PTHREADS"
+ ;;
+ win32)
+ CXXFLAGS="$CXXFLAGS -D_WIN32_THREADS"
+ # The support of condition variables is disabled by default in
+ # the Win32 gthreads library, so enable it on explicit request.
+ if test x$enable_libstdcxx_threads = xyes; then
+ CXXFLAGS="$CXXFLAGS -D_WIN32_WINNT=0x0600"
+ fi
+ ;;
esac
AC_MSG_CHECKING([whether it can be safely assumed that mutex_timedlock is available])
@@ -3997,6 +4003,9 @@ AC_DEFUN([GLIBCXX_CHECK_GTHREADS], [
#if (defined(_PTHREADS) \
&& (!defined(_POSIX_TIMEOUTS) || _POSIX_TIMEOUTS <= 0))
#error
+ // In case of Win32 threads there is no support.
+ #elif defined(_WIN32_THREADS)
+ #error
#endif
], [ac_gthread_use_mutex_timedlock=1], [ac_gthread_use_mutex_timedlock=0])
@@ -4043,6 +4052,11 @@ AC_DEFUN([GLIBCXX_CHECK_GTHREADS], [
[],
[#include "gthr.h"])
fi
+
+ # See above for the rationale.
+ if test $target_thread_file = win32; then
+ CPPFLAGS="$CPPFLAGS -D_WIN32_WINNT=0x0600"
+ fi
fi
AC_CHECK_HEADER(semaphore.h, [