1 # lock.m4 serial 13 (gettext-0.18.2)
2 dnl Copyright (C) 2005-2014 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
11 AC_REQUIRE([gl_THREADLIB])
12 if test "$gl_threads_api" = posix; then
13 # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the
14 # pthread_rwlock_* functions.
15 AC_CHECK_TYPE([pthread_rwlock_t],
16 [AC_DEFINE([HAVE_PTHREAD_RWLOCK], [1],
17 [Define if the POSIX multithreading library has read/write locks.])],
19 [#include <pthread.h>])
20 # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
23 [[#include <pthread.h>]],
26 error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
27 #elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \
28 && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
29 error "No, in Mac OS X < 10.7 recursive mutexes actually don't work."
31 int x = (int)PTHREAD_MUTEX_RECURSIVE;
35 [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], [1],
36 [Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])])
41 # Prerequisites of lib/glthread/lock.c.
42 AC_DEFUN([gl_PREREQ_LOCK], [:])