|
Packit |
fc043f |
# lock.m4 serial 13 (gettext-0.18.2)
|
|
Packit |
fc043f |
dnl Copyright (C) 2005-2014 Free Software Foundation, Inc.
|
|
Packit |
fc043f |
dnl This file is free software; the Free Software Foundation
|
|
Packit |
fc043f |
dnl gives unlimited permission to copy and/or distribute it,
|
|
Packit |
fc043f |
dnl with or without modifications, as long as this notice is preserved.
|
|
Packit |
fc043f |
|
|
Packit |
fc043f |
dnl From Bruno Haible.
|
|
Packit |
fc043f |
|
|
Packit |
fc043f |
AC_DEFUN([gl_LOCK],
|
|
Packit |
fc043f |
[
|
|
Packit |
fc043f |
AC_REQUIRE([gl_THREADLIB])
|
|
Packit |
fc043f |
if test "$gl_threads_api" = posix; then
|
|
Packit |
fc043f |
# OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the
|
|
Packit |
fc043f |
# pthread_rwlock_* functions.
|
|
Packit |
fc043f |
AC_CHECK_TYPE([pthread_rwlock_t],
|
|
Packit |
fc043f |
[AC_DEFINE([HAVE_PTHREAD_RWLOCK], [1],
|
|
Packit |
fc043f |
[Define if the POSIX multithreading library has read/write locks.])],
|
|
Packit |
fc043f |
[],
|
|
Packit |
fc043f |
[#include <pthread.h>])
|
|
Packit |
fc043f |
# glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
|
|
Packit |
fc043f |
AC_COMPILE_IFELSE([
|
|
Packit |
fc043f |
AC_LANG_PROGRAM(
|
|
Packit |
fc043f |
[[#include <pthread.h>]],
|
|
Packit |
fc043f |
[[
|
|
Packit |
fc043f |
#if __FreeBSD__ == 4
|
|
Packit |
fc043f |
error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
|
|
Packit |
fc043f |
#elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \
|
|
Packit |
fc043f |
&& __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
|
|
Packit |
fc043f |
error "No, in Mac OS X < 10.7 recursive mutexes actually don't work."
|
|
Packit |
fc043f |
#else
|
|
Packit |
fc043f |
int x = (int)PTHREAD_MUTEX_RECURSIVE;
|
|
Packit |
fc043f |
return !x;
|
|
Packit |
fc043f |
#endif
|
|
Packit |
fc043f |
]])],
|
|
Packit |
fc043f |
[AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], [1],
|
|
Packit |
fc043f |
[Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])])
|
|
Packit |
fc043f |
fi
|
|
Packit |
fc043f |
gl_PREREQ_LOCK
|
|
Packit |
fc043f |
])
|
|
Packit |
fc043f |
|
|
Packit |
fc043f |
# Prerequisites of lib/glthread/lock.c.
|
|
Packit |
fc043f |
AC_DEFUN([gl_PREREQ_LOCK], [:])
|