Annotation of embedaddon/libiconv/srcm4/lock.m4, revision 1.1.1.3
1.1.1.3 ! misho 1: # lock.m4 serial 14
! 2: dnl Copyright (C) 2005-2019 Free Software Foundation, Inc.
1.1 misho 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.
6:
7: dnl From Bruno Haible.
8:
9: AC_DEFUN([gl_LOCK],
10: [
11: AC_REQUIRE([gl_THREADLIB])
12: if test "$gl_threads_api" = posix; then
1.1.1.3 ! misho 13: # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the
1.1 misho 14: # pthread_rwlock_* functions.
1.1.1.3 ! misho 15: has_rwlock=false
1.1 misho 16: AC_CHECK_TYPE([pthread_rwlock_t],
1.1.1.3 ! misho 17: [has_rwlock=true
! 18: AC_DEFINE([HAVE_PTHREAD_RWLOCK], [1],
1.1 misho 19: [Define if the POSIX multithreading library has read/write locks.])],
20: [],
21: [#include <pthread.h>])
1.1.1.3 ! misho 22: if $has_rwlock; then
! 23: gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER
! 24: fi
1.1 misho 25: # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
1.1.1.2 misho 26: AC_COMPILE_IFELSE([
27: AC_LANG_PROGRAM(
28: [[#include <pthread.h>]],
29: [[
30: #if __FreeBSD__ == 4
1.1 misho 31: error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
1.1.1.3 ! misho 32: #elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \
! 33: && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
! 34: error "No, in Mac OS X < 10.7 recursive mutexes actually don't work."
1.1 misho 35: #else
36: int x = (int)PTHREAD_MUTEX_RECURSIVE;
37: return !x;
1.1.1.2 misho 38: #endif
39: ]])],
1.1 misho 40: [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], [1],
41: [Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])])
42: fi
43: gl_PREREQ_LOCK
44: ])
45:
1.1.1.3 ! misho 46: # Prerequisites of lib/glthread/lock.c.
! 47: AC_DEFUN([gl_PREREQ_LOCK], [:])
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>