])
+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.
#
-# Checks for compiler support that don't require linking.
+# Checks for compiler support that doesn't require linking.
# All these tests are for C++; save the language and the compiler flags.
# The CXXFLAGS thing is suspicious, but based on similar bits previously
fi
-# Checks for operating systems support that don't require linking.
+# Checks for operating systems support that doesn't require linking.
echo "$as_me:$LINENO: checking for EOWNERDEAD" >&5
+# For gthread support
+
+
+
+ ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+ 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
+
+ echo "$as_me:$LINENO: checking for gthreads library" >&5
+echo $ECHO_N "checking for gthreads library... $ECHO_C" >&6
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include "gthr.h"
+int
+main ()
+{
+
+ #ifndef __GTHREADS_CXX0X
+ #error
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_has_gthreads=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_has_gthreads=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ echo "$as_me:$LINENO: result: $ac_has_gthreads" >&5
+echo "${ECHO_T}$ac_has_gthreads" >&6
+
+ if test x"$ac_has_gthreads" = x"yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define _GLIBCXX_HAS_GTHREADS 1
+_ACEOF
+
+ fi
+
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
if test "${ac_cv_header_locale_h+set}" = set; then
echo "$as_me:$LINENO: checking for locale.h" >&5
GLIBCXX_ENABLE_ATOMIC_BUILTINS
GLIBCXX_ENABLE_THREADS
-# Checks for compiler support that don't require linking.
+# Checks for compiler support that doesn't require linking.
GLIBCXX_CHECK_COMPILER_FEATURES
GLIBCXX_CHECK_STANDARD_LAYOUT
GLIBCXX_ENABLE_CXX_FLAGS
GLIBCXX_ENABLE_FULLY_DYNAMIC_STRING([no])
-# Checks for operating systems support that don't require linking.
+# Checks for operating systems support that doesn't require linking.
GLIBCXX_CHECK_SYSTEM_ERROR
# For the streamoff typedef.
# NB: The default is [no], because otherwise it requires linking.
GLIBCXX_ENABLE_CLOCK_GETTIME([no])
+# For gthread support
+GLIBCXX_CHECK_GTHREADS
+
AC_LC_MESSAGES
# Check for available headers.