diff options
author | ljrittle <ljrittle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-06-08 03:53:35 +0000 |
---|---|---|
committer | ljrittle <ljrittle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-06-08 03:53:35 +0000 |
commit | 6e77e3236833da984422d1c758e9d3188d9925c7 (patch) | |
tree | b2cbfba3edc6eab1c6b67a4c3000514516e6ca14 /libstdc++-v3/aclocal.m4 | |
parent | ff09141288889ce509849b1ce77b549f23b54831 (diff) |
* config/threads-no.h: Remove file.
* config/threads-posix.h: Remove file.
* acconfig.h (_GLIBCPP_USE_THREADS): Remove.
(_GLIBCPP_SUPPORTS_WEAK): Add (required by namespace-clean gthr*.h).
(_GLIBCPP_HAVE_GTHR_DEFAULT): Likewise.
* config.h.in: Regenerate.
* acinclude.m4 (GLIBCPP_ENABLE_THREADS): Completely rework to
setup and use gthr*.h files. In particular, make gthr.h files
namespace-clean in the staging area (they don't have to be for
libgcc.a).
* aclocal.m4: Regenerate.
* configure: Regenerate.
* src/Makefile.am (build_headers): Remove bits/c++threads.h
and add bits/gthr.h bits/gthr-single.h bits/gthr-default.h.
* src/Makefile.in: Regenerate.
* include/bits/c++config: Cleanup threading configuration macros.
In particular, define __STL_GTHREADS macro which controls...
* include/bits/stl_threads.h: ...a brand new gthr.h-based
configuration here.
* config/c_io_stdio.h: Include staged gthr.h instead of local
thread configuration file. Always use __gthread_mutex_t
instead of __mutext_type (or int).
* include/bits/std_fstream.h: Likewise.
* docs/html/17_intro/howto.html: Remove placeholder comment in
case this configuration patch didn't make it. Add advice that
section only applies if configured with --enable-threads.
* docs/html/23_containers/howto.html: Reword to make clear
that _PTHREADS is no longer required for any port to be
correctly using STL with threads. Add advice that section
only applies if configured with --enable-threads.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@42998 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/aclocal.m4')
-rw-r--r-- | libstdc++-v3/aclocal.m4 | 52 |
1 files changed, 24 insertions, 28 deletions
diff --git a/libstdc++-v3/aclocal.m4 b/libstdc++-v3/aclocal.m4 index 17c97b39499..d020a142919 100644 --- a/libstdc++-v3/aclocal.m4 +++ b/libstdc++-v3/aclocal.m4 @@ -1130,41 +1130,37 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [ dnl -dnl Check for which threading library to use. -dnl -dnl GLIBCPP_ENABLE_THREADS -dnl --enable-threads=posix sets config/threads-posix.h et. al. -dnl -dnl Default is no threads, which also disables _IO_MTSAFE_IO in -dnl libio. Any actual thread package will enable it. +dnl Setup to use the gcc gthr.h thread-specific memory and mutex model. +dnl We must stage the required headers so that they will be installed +dnl with the library (unlike libgcc, the STL implementation is provided +dnl solely within headers). Since we must not inject random user-space +dnl macro names into user-provided C++ code, we first stage into <file>-in +dnl and process to <file> with an output command. The reason for a two- +dnl stage process here is to correctly handle $srcdir!=$objdir without +dnl having to write complex code (the sed commands to clean the macro +dnl namespace are complex and fragile enough as it is). dnl AC_DEFUN(GLIBCPP_ENABLE_THREADS, [ AC_MSG_CHECKING([for thread model used by GCC]) target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'` AC_MSG_RESULT([$target_thread_file]) - dnl Check for thread package actually supported in libstdc++ - THREADH= - case "$target_thread_file" in - no | none | single) - THREADH=threads-no.h - ;; - posix | pthreads) - THREADH=threads-posix.h - ;; - decosf1 | irix | mach | os2 | solaris | win32 | dce | vxworks) - AC_MSG_WARN(disabling unsupported thread package $target_thread_file) - THREADH=threads-no.h - ;; - *) - AC_MSG_ERROR($target_thread_file: unsupported/unknown thread package) - ;; - esac - - AC_LINK_FILES(config/$THREADH, include/bits/c++threads.h) - if test $THREADH != threads-no.h; then - AC_DEFINE(_GLIBCPP_USE_THREADS) + AC_LINK_FILES(../gcc/gthr.h, include/bits/gthr.h-in) + AC_LINK_FILES(../gcc/gthr-single.h, include/bits/gthr-single.h-in) + AC_LINK_FILES(../gcc/gthr-$target_thread_file.h, + include/bits/gthr-default.h-in) + if test $target_thread_file != single; then + AC_DEFINE(HAVE_GTHR_DEFAULT) + AC_DEFINE(_GLIBCPP_SUPPORTS_WEAK, __GXX_WEAK__) fi + AC_OUTPUT_COMMANDS([d=include/bits + rm -f $d/gthr.h $d/gthr-single.h $d/gthr-default.h + sed '/^#/s/\([A-Z_][A-Z_]*\)/_GLIBCPP_\1/g' <$d/gthr.h-in >$d/gthr.h + sed 's/\(UNUSED\)/_GLIBCPP_\1/g' <$d/gthr-single.h-in \ + | sed 's/\(GCC[A-Z_]*_H\)/_GLIBCPP_\1/g' >$d/gthr-single.h + sed 's/\(UNUSED\)/_GLIBCPP_\1/g' <$d/gthr-default.h-in \ + | sed 's/\(GCC[A-Z_]*_H\)/_GLIBCPP_\1/g' \ + | sed 's/\([A-Z_]*WEAK\)/_GLIBCPP_\1/g' >$d/gthr-default.h]) ]) |