Pádraig Brady wrote:
Looks good thanks,
though it would be worth mentioning in the commit why extensions is used.

Thanks, I pushed the attached.
From 5d34c7ba14c0b85c1e9130f5ca0514d9e4adeeb2 Mon Sep 17 00:00:00 2001
From: Paul Eggert <egg...@cs.ucla.edu>
Date: Sat, 14 Jun 2014 12:33:26 -0700
Subject: [PATCH] pthread: don't assume AC_CANONICAL_HOST, port better to
 Solaris, etc.

* modules/pthread (Depends-on): Add 'extensions', as it defines
_POSIX_PTHREAD_SEMANTICS, which is needed on Solaris.
(configure.ac-early): New section.
* m4/pthread.m4 (gl_PTHREAD_CHECK): Revert previous change, as
it is no longer needed.
---
 ChangeLog       |  9 +++++++++
 m4/pthread.m4   | 14 --------------
 modules/pthread |  5 +++++
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0550153..6fff9d7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2014-06-14  Paul Eggert  <egg...@cs.ucla.edu>
+
+       pthread: don't assume AC_CANONICAL_HOST, port better to Solaris, etc.
+       * modules/pthread (Depends-on): Add 'extensions', as it defines
+       _POSIX_PTHREAD_SEMANTICS, which is needed on Solaris.
+       (configure.ac-early): New section.
+       * m4/pthread.m4 (gl_PTHREAD_CHECK): Revert previous change, as
+       it is no longer needed.
+
 2014-06-14  Pádraig Brady  <p...@draigbrady.com>
 
        pthread: define thread-safe macros on some platforms
diff --git a/m4/pthread.m4 b/m4/pthread.m4
index 44538bd..1ed0dd3 100644
--- a/m4/pthread.m4
+++ b/m4/pthread.m4
@@ -88,20 +88,6 @@ AC_DEFUN([gl_PTHREAD_CHECK],
    fi
    AC_SUBST([LIB_PTHREAD])
 
-   dnl Some systems optimize for single-threaded programs by default, and
-   dnl need special flags to disable these optimizations. For example, the
-   dnl definition of 'errno' in <errno.h>.
-   case "$host_os" in
-     aix* | freebsd*)
-       AC_DEFINE([_THREAD_SAFE], 1,
-         [Define on some systems, to enable only thread-safe operations.])
-     ;;
-     osf* | solaris*)
-       AC_DEFINE([_REENTRANT], 1,
-         [Define on some systems, to enable only thread-safe operations.])
-     ;;
-   esac
-
    AC_REQUIRE([AC_C_RESTRICT])
 ])
 
diff --git a/modules/pthread b/modules/pthread
index e583929..3fb3920 100644
--- a/modules/pthread
+++ b/modules/pthread
@@ -7,10 +7,15 @@ lib/pthread.in.h
 m4/pthread.m4
 
 Depends-on:
+extensions
 extern-inline
 sched
 time
 
+configure.ac-early:
+AC_DEFINE([_REENTRANT], 1, [For thread-safety on OSF/1, Solaris.])
+AC_DEFINE([_THREAD_SAFE], 1, [For thread-safety on AIX, FreeBSD.])
+
 configure.ac:
 gl_PTHREAD_CHECK
 gl_MODULE_INDICATOR([pthread])
-- 
1.9.3

Reply via email to