# don't exclude CFLAGS when linking. *sigh*
PTHREAD_CFLAGS="-D_REENTRANT -D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L"
;;
+ solaris2.[1-9])
+ # On Solaris 10 with gcc 3.4.3, the autoconf archive macro doesn't
+ # get the right result. XXX What about Solaris 9 and earlier?
+ if test "$GCC" = yes ; then
+ PTHREAD_CFLAGS="-D_REENTRANT -pthreads"
+ fi
+ ;;
solaris*)
# On Solaris 10 with gcc 3.4.3, the autoconf archive macro doesn't
# get the right result.
if test "$GCC" = yes ; then
PTHREAD_CFLAGS="-D_REENTRANT -pthreads"
fi
+ # On Solaris 10, the thread support is always available in libc.
+ AC_DEFINE(NO_WEAK_PTHREADS,1,[Define if references to pthread routines should be non-weak.])
;;
esac
THREAD_SUPPORT=1
Linux: Stub mutex routines exist, but pthread_once does not.
- Solaris: In libc there's a pthread_once that doesn't seem to do
+ Solaris <10: In libc there's a pthread_once that doesn't seem to do
anything. Bleah. But pthread_mutexattr_setrobust_np is defined
only in libpthread. However, some version of GNU libc (Red Hat's
Fedora Core 5, reportedly) seems to have that function, but no
address. We now have tests to see if pthread_once actually works,
so stick with that for now.
+ Solaris 10: The real thread support now lives in libc, and
+ libpthread is just a filter object. So we might as well use the
+ real functions unconditionally. Since we haven't got a test for
+ this property yet, we use NO_WEAK_PTHREADS defined in aclocal.m4
+ depending on the OS type.
+
IRIX 6.5 stub pthread support in libc is really annoying. The
pthread_mutex_lock function returns ENOSYS for a program not linked
against -lpthread. No link-time failure, no weak symbols, etc.
If we find a platform with non-functional stubs and no weak
references, we may have to resort to some hack like dlsym on the
symbol tables of the current process. */
-#ifdef HAVE_PRAGMA_WEAK_REF
+#if defined(HAVE_PRAGMA_WEAK_REF) && !defined(NO_WEAK_PTHREADS)
# pragma weak pthread_once
# pragma weak pthread_mutex_lock
# pragma weak pthread_mutex_unlock
# endif
#endif
-#ifdef HAVE_PRAGMA_WEAK_REF
+#if defined(HAVE_PRAGMA_WEAK_REF) && !defined(NO_WEAK_PTHREADS)
# define USE_PTHREAD_LOCK_ONLY_IF_LOADED
-#endif
-#ifdef HAVE_PRAGMA_WEAK_REF
/* Can't rely on useful stubs -- see above regarding Solaris. */
typedef struct {
pthread_once_t o;