summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2017-05-16 16:02:59 +0200
committerTakashi Iwai <tiwai@suse.de>2017-05-16 16:26:20 +0200
commite757a95fc9a544a519dd619fae86ac25e545735c (patch)
tree6d8d9cfbe59f05877337718ee3068ed46a43598c /configure.ac
parent3cf3fbebddad4e58efbd03e4d2217f0a0d07a2ed (diff)
downloadalsa-lib-e757a95fc9a544a519dd619fae86ac25e545735c.tar.gz
conf: Check the availability of PTHREAD_MUTEX_RECURSIVE
Check the availability of PTHREAD_MUTEX_RECURSIVE in configure script and use it only when possible. A fairly old version of glibc still seems working, but just to be sure. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac9
1 files changed, 9 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index ec254762..a17f2c4a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -266,6 +266,15 @@ else
AC_MSG_RESULT(no)
fi
+dnl Check for pthread
+if test "$HAVE_LIBPTHREAD" = "yes"; then
+ AC_CHECK_DECL(PTHREAD_MUTEX_RECURSIVE,
+ AC_DEFINE(HAVE_PTHREAD_MUTEX_RECURSIVE, [],
+ [Define if your pthreads implementation have PTHREAD_MUTEX_RECURSIVE]),
+ ,
+ [#include <pthread.h>])
+fi
+
dnl Check for __thread
AC_MSG_CHECKING([for __thread])
AC_LINK_IFELSE([AC_LANG_PROGRAM([#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && ((__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 1) || (__GNUC__ == 4 && __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ < 2))