Hi, We've got a couple of bug reports saying that gettext's libintl doesn't work when it was compiled on Mac OS X >= 10.7 targetting 10.6, because of missing PTHREAD_RECURSIVE_MUTEX_INITIALIZER definition:
<http://savannah.gnu.org/bugs/?37844> <http://lists.gnu.org/archive/html/bug-gettext/2013-05/msg00007.html> According to the report, other projects seem to have added a work around for this, perhaps good to add the same check to Gnulib. Patch attached. It compiles fine on 10.8, but not actually tested on 10.6. It would be nice if anyone could test the compiled binary on 10.6. Regards, -- Daiki Ueno
>From 19685cf6de36e6f09423edc059d7ba24c8b4e45a 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..b65057e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2013-05-11 Daiki Ueno <u...@gnu.org> + + lock: work around pthread 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..78a72ef 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 __APPLE__ && MAC_OS_X_VERSION_MIN_REQUIRED == 1060 +error "No, in Mac OS X 10.6 recursive mutexes actually don't work." #else int x = (int)PTHREAD_MUTEX_RECURSIVE; return !x; -- 1.7.10.4