aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/acinclude.m4
diff options
context:
space:
mode:
authorChris Fairles <chris.fairles@gmail.com>2008-07-15 23:23:23 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2008-07-15 23:23:23 +0000
commit15e38d0dce922e77304932817a10f1f42579553f (patch)
treeeafc38353a48e1cd63e574edc380874a144179ef /libstdc++-v3/acinclude.m4
parent141368f01df366809a596c6093825d205835c86b (diff)
downloadgcc-15e38d0dce922e77304932817a10f1f42579553f.zip
gcc-15e38d0dce922e77304932817a10f1f42579553f.tar.gz
gcc-15e38d0dce922e77304932817a10f1f42579553f.tar.bz2
chrono: New, as per N2661.
2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
Diffstat (limited to 'libstdc++-v3/acinclude.m4')
-rw-r--r--libstdc++-v3/acinclude.m488
1 files changed, 88 insertions, 0 deletions
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index a68ab9b..e998471 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -1009,6 +1009,94 @@ AC_DEFUN([GLIBCXX_ENABLE_C99], [
dnl
+dnl Check for IEEE Std 1003.1-2001 clock_gettime required for
+dnl 20.8.5 [time.clock] in the current C++0X working draft.
+dnl
+AC_DEFUN([GLIBCXX_CHECK_CLOCK_GETTIME], [
+
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -fno-exceptions"
+
+ AC_CHECK_HEADERS(unistd.h, ac_has_unistd_h=yes, ac_has_unistd_h=no)
+
+ ac_has_clock_monotonic=no;
+ ac_has_clock_realtime=no;
+ if test x"$ac_has_unistd_h" = x"yes"; then
+ AC_MSG_CHECKING([for monotonic clock])
+ AC_TRY_LINK(
+ [#include <unistd.h>
+ #include <time.h>
+ ],
+ [#if _POSIX_TIMERS > 0 && defined(_POSIX_MONOTONIC_CLOCK)
+ timespec tp;
+ #endif
+ clock_gettime(CLOCK_MONOTONIC, &tp);
+ ], [ac_has_clock_monotonic=yes], [ac_has_clock_monotonic=no])
+
+ AC_MSG_RESULT($ac_has_clock_monotonic)
+
+ AC_MSG_CHECKING([for realtime clock])
+ AC_TRY_LINK(
+ [#include <unistd.h>
+ #include <time.h>
+ ],
+ [#if _POSIX_TIMERS > 0
+ timespec tp;
+ #endif
+ clock_gettime(CLOCK_REALTIME, &tp);
+ ], [ac_has_clock_realtime=yes], [ac_has_clock_realtime=no])
+
+ AC_MSG_RESULT($ac_has_clock_realtime)
+ fi
+
+ if test x"$ac_has_clock_monotonic" = x"yes"; then
+ AC_DEFINE(_GLIBCXX_USE_CLOCK_MONOTONIC, 1,
+ [ Defined if clock_gettime has monotonic clock support. ])
+ fi
+
+ if test x"$ac_has_clock_realtime" = x"yes"; then
+ AC_DEFINE(_GLIBCXX_USE_CLOCK_REALTIME, 1,
+ [ Defined if clock_gettime has realtime clock support. ])
+ fi
+
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ AC_LANG_RESTORE
+])
+
+dnl
+dnl Check for IEEE Std 1003.1-2001 gettimeofday required for
+dnl 20.8.5 [time.clock] in the current C++0X working draft.
+dnl
+AC_DEFUN([GLIBCXX_CHECK_GETTIMEOFDAY], [
+
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -fno-exceptions"
+
+ ac_has_gettimeofday=no;
+ AC_CHECK_HEADERS(sys/time.h, ac_has_sys_time_h=yes, ac_has_sys_time_h=no)
+ if test x"$ac_has_sys_time_h" = x"yes"; then
+ AC_MSG_CHECKING([for gettimeofday])
+ AC_TRY_LINK([#include <sys/time.h>],
+ [timeval tv; gettimeofday(&tv, 0);],
+ [ac_has_gettimeofday=yes], [ac_has_gettimeofday=no])
+
+ AC_MSG_RESULT($ac_has_gettimeofday)
+ fi
+
+ if test x"$ac_has_gettimeofday" = x"yes"; then
+ AC_DEFINE(_GLIBCXX_USE_GETTIMEOFDAY, 1,
+ [ Defined if gettimeofday is available. ])
+ fi
+
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ AC_LANG_RESTORE
+])
+
+dnl
dnl Check for ISO/IEC 9899:1999 "C99" support to ISO/IEC DTR 19768 "TR1"
dnl facilities in Chapter 8, "C compatibility".
dnl