Daiki Ueno <u...@gnu.org> writes:

> Patch attached.

Sorry, wrong patch.  Please check the attached one instead.

I've confirmed that HAVE_PTHREAD_MUTEX_RECURSIVE is defined by default
on 10.8, but not with CFLAGS=-mmacosx-version-min=10.6.

Regards,
-- 
Daiki Ueno
>From eb742ec35bfd68288bfc23aae47e3d27dcaff4de Mon Sep 17 00:00:00 2001
From: Daiki Ueno <u...@gnu.org>
Date: Sat, 11 May 2013 10:40:55 +0900
Subject: [PATCH] lock: work around pthread recursive mutexes bug in Mac OS X
 10.6

* m4/lock.m4: Don't define HAVE_PTHREAD_MUTEX_RECURSIVE if the
compilation target is Mac OS X 10.6.
Problem reported by parafin and Andoni Morales in
<http://savannah.gnu.org/bugs/?37844> and
<http://lists.gnu.org/archive/html/bug-gettext/2013-05/msg00007.html>.
---
 ChangeLog  |    9 +++++++++
 m4/lock.m4 |    2 ++
 2 files changed, 11 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 13dafaa..2590e4a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2013-05-11  Daiki Ueno  <u...@gnu.org>
+
+	lock: work around pthread recursive mutexes bug in Mac OS X 10.6
+	* m4/lock.m4: Don't define HAVE_PTHREAD_MUTEX_RECURSIVE if the
+	compilation target is Mac OS X 10.6.
+	Problem reported by parafin and Andoni Morales in
+	<http://savannah.gnu.org/bugs/?37844> and
+	<http://lists.gnu.org/archive/html/bug-gettext/2013-05/msg00007.html>.
+
 2012-05-10  Stefano Lattarini  <stefano.lattar...@gmail.com>
 
 	deps: require Automake >= 1.9.6 in generated Makefile fragments
diff --git a/m4/lock.m4 b/m4/lock.m4
index d3fc1ef..e7aedec 100644
--- a/m4/lock.m4
+++ b/m4/lock.m4
@@ -24,6 +24,8 @@ AC_DEFUN([gl_LOCK],
         [[
 #if __FreeBSD__ == 4
 error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
+#elif defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070
+error "No, in Mac OS X < 10.7 recursive mutexes actually don't work."
 #else
 int x = (int)PTHREAD_MUTEX_RECURSIVE;
 return !x;
-- 
1.7.10.4

Reply via email to