board/csky: fixup gdb instructions in readme.txt
[buildroot-gz.git] / package / gamin / 0003-fix-missing-PTHREAD_MUTEX_RECURSIVE_NP.patch
blobb5f2e6c521e1c6ba61cfa70c49e43a596b8326ac
1 Fix missing PTHREAD_MUTEX_RECURSIVE_NP
3 The musl C library does not provide the non portable
4 PTHREAD_MUTEX_RECURSIVE_NP. In addition, uClibc does not define it as
5 a #define, but as an enum value, so doing a #if defined() check
6 doesn't work properly. Instead, add a AC_CHECK_DECL() autoconf check.
8 Signed-off-by: Baruch Siach <baruch@tkos.co.il>
9 [Thomas: switch to an autoconf check.]
10 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
12 Index: b/configure.in
13 ===================================================================
14 --- a/configure.in
15 +++ b/configure.in
16 @@ -294,6 +294,10 @@
17 AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)])
18 AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
19 WITH_THREADS="1"]))
21 + AC_CHECK_DECL([PTHREAD_MUTEX_RECURSIVE_NP],
22 + [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE_NP], [], [whether HAVE_PTHREAD_MUTEX_RECURSIVE_NP is defined])],
23 + [], [#include <pthread.h>])
26 dnl Use weak symbols on linux/gcc to avoid imposing libpthreads to apps
27 Index: b/libgamin/gam_data.c
28 ===================================================================
29 --- a/libgamin/gam_data.c
30 +++ b/libgamin/gam_data.c
31 @@ -470,7 +470,7 @@
33 if (is_threaded > 0) {
34 pthread_mutexattr_init(&attr);
35 -#if defined(linux) || defined(PTHREAD_MUTEX_RECURSIVE_NP)
36 +#if defined(HAVE_PTHREAD_MUTEX_RECURSIVE_NP)
37 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
38 #else
39 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);