diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-28 10:22:19 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-28 10:22:19 +0000 |
commit | add2055dad476baa30b1969210de237cb0e159f8 (patch) | |
tree | 955c8a45336836c8b6d688d28613f005ae3c43ca /libstdc++-v3/acinclude.m4 | |
parent | 3fbf11ef2f391980d12b1049237c62493a4d1aad (diff) | |
download | ppe42-gcc-add2055dad476baa30b1969210de237cb0e159f8.tar.gz ppe42-gcc-add2055dad476baa30b1969210de237cb0e159f8.zip |
2008-08-28 Chris Fairles <chris.fairles@gmail.com>
* acinclude.m4 ([GLIBCXX_CHECK_GTHREADS]): New. Checks for gthread
support used by c++0x thread library.
* configure.ac: Test unconditionally.
* configure: Regenerate.
* config.h.in: Regenerate.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139705 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/acinclude.m4')
-rw-r--r-- | libstdc++-v3/acinclude.m4 | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index 8ea21ceebba..052515b2156 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -2816,6 +2816,45 @@ AC_DEFUN([GLIBCXX_ENABLE_THREADS], [ ]) +dnl +dnl Check if gthread implementation defines the types and functions +dnl required by the c++0x thread library. Conforming gthread +dnl implementations can define __GTHREADS_CXX0X to enable use with c++0x. +dnl +AC_DEFUN([GLIBCXX_CHECK_GTHREADS], [ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + + ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -fno-exceptions -I${toplevel_srcdir}/gcc" + + target_thread_file=`$CXX -v 2>&1 | sed -n 's/^Thread model: //p'` + case $target_thread_file in + posix) + CXXFLAGS="$CXXFLAGS -DSUPPORTS_WEAK -DGTHREAD_USE_WEAK -D_PTHREADS" + esac + + AC_MSG_CHECKING([for gthreads library]) + + AC_TRY_COMPILE([#include "gthr.h"], + [ + #ifndef __GTHREADS_CXX0X + #error + #endif + ], [ac_has_gthreads=yes], [ac_has_gthreads=no]) + + AC_MSG_RESULT([$ac_has_gthreads]) + + if test x"$ac_has_gthreads" = x"yes"; then + AC_DEFINE(_GLIBCXX_HAS_GTHREADS, 1, + [Define if gthreads library is available.]) + fi + + CXXFLAGS="$ac_save_CXXFLAGS" + AC_LANG_RESTORE +]) + + # Check whether LC_MESSAGES is available in <locale.h>. # Ulrich Drepper <drepper@cygnus.com>, 1995. # |