# HG changeset patch
# Parent f44555017ca294fa283c4c114208438a87f249c7
Disable gthreads on Solaris 8/9 (PR libstdc++/52189)
@@ -3325,7 +3325,14 @@ dnl Check if gthread implementation defi
dnl required by the c++0x thread library. Conforming gthread
dnl implementations can define __GTHREADS_CXX0X to enable use with c++0x.
dnl
+dnl GLIBCXX_ENABLE_SYMVERS must be done before this.
+dnl
AC_DEFUN([GLIBCXX_CHECK_GTHREADS], [
+ GLIBCXX_ENABLE(libstdcxx-threads,auto,,[enable C++11 threads support])
+
+ if test x$enable_libstdcxx_threads = xauto ||
+ test x$enable_libstdcxx_threads = xyes; then
+
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
@@ -3364,7 +3371,28 @@ AC_DEFUN([GLIBCXX_CHECK_GTHREADS], [
#ifndef __GTHREADS_CXX0X
#error
#endif
- ], [ac_has_gthreads=yes], [ac_has_gthreads=no])
+ ], [case $target_os in
+ # gthreads support breaks symbol versioning on Solaris 8/9 (PR
+ # libstdc++/52189).
+ solaris2.[[89]]*)
+ if test x$enable_symvers = xno; then
+ ac_has_gthreads=yes
+ elif test x$enable_libstdcxx_threads = xyes; then
+ AC_MSG_WARN([You have requested C++11 threads support, but])
+ AC_MSG_WARN([this breaks symbol versioning.])
+ ac_has_gthreads=yes
+ else
+ ac_has_gthreads=no
+ fi
+ ;;
+ *)
+ ac_has_gthreads=yes
+ ;;
+ esac],
+ [ac_has_gthreads=no])
+ else
+ ac_has_gthreads=no
+ fi
AC_MSG_RESULT([$ac_has_gthreads])
@@ -164,9 +164,6 @@ GLIBCXX_CHECK_GETTIMEOFDAY
# NB: The default is [no], because otherwise it requires linking.
GLIBCXX_ENABLE_LIBSTDCXX_TIME([no])
-# For gthread support
-GLIBCXX_CHECK_GTHREADS
-
AC_LC_MESSAGES
# For hardware_concurrency
@@ -335,6 +332,9 @@ GLIBCXX_CONDITIONAL(GLIBCXX_LDBL_COMPAT,
# This depends on GLIBCXX_ENABLE_SYMVERS and GLIBCXX_IS_NATIVE.
GLIBCXX_CONFIGURE_TESTSUITE
+# For gthread support. Depends on GLIBCXX_ENABLE_SYMVERS.
+GLIBCXX_CHECK_GTHREADS
+
# Define documentation rules conditionally.
# See if makeinfo has been installed and is modern enough
@@ -161,6 +161,13 @@
</para>
</listitem></varlistentry>
+ <varlistentry><term><code>--enable-libstdcxx-threads</code></term>
+ <listitem><para>Enable C++11 threads support. If not explicitly specified,
+ the configure process enables it if possible. It defaults to 'off'
+ on Solaris 8 and 9, where it would break symbol versioning. This
+ option can change the library ABI.
+ </para>
+ </listitem></varlistentry>
<varlistentry><term><code>--enable-libstdcxx-time</code></term>
<listitem><para>This is an abbreviated form of