immutable: Add tests.
[gnulib.git] / m4 / pthread-cond.m4
blob75e37c6138984165caea98d6255e16af27ecda6d
1 # pthread-cond.m4 serial 1
2 dnl Copyright (C) 2019-2021 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.
7 AC_DEFUN([gl_PTHREAD_COND],
9   AC_REQUIRE([gl_PTHREAD_H])
10   AC_REQUIRE([AC_CANONICAL_HOST])
12   if { case "$host_os" in mingw*) true;; *) false;; esac; } \
13      && test $gl_threads_api = windows; then
14     dnl Choose function names that don't conflict with the mingw-w64 winpthreads
15     dnl library.
16     REPLACE_PTHREAD_COND_INIT=1
17     REPLACE_PTHREAD_CONDATTR_INIT=1
18     REPLACE_PTHREAD_CONDATTR_DESTROY=1
19     REPLACE_PTHREAD_COND_WAIT=1
20     REPLACE_PTHREAD_COND_TIMEDWAIT=1
21     REPLACE_PTHREAD_COND_SIGNAL=1
22     REPLACE_PTHREAD_COND_BROADCAST=1
23     REPLACE_PTHREAD_COND_DESTROY=1
24   else
25     if test $HAVE_PTHREAD_H = 0; then
26       HAVE_PTHREAD_COND_INIT=1
27       HAVE_PTHREAD_CONDATTR_INIT=1
28       HAVE_PTHREAD_CONDATTR_DESTROY=1
29       HAVE_PTHREAD_COND_WAIT=1
30       HAVE_PTHREAD_COND_TIMEDWAIT=1
31       HAVE_PTHREAD_COND_SIGNAL=1
32       HAVE_PTHREAD_COND_BROADCAST=1
33       HAVE_PTHREAD_COND_DESTROY=1
34     fi
35   fi