Check if libpthread is required or not.

This commit is contained in:
Tobias Brunner
2009-12-23 17:02:26 +01:00
parent 866dc0134a
commit 070ac5b0b7
5 changed files with 10 additions and 5 deletions
+6 -1
View File
@@ -267,6 +267,11 @@ AC_SEARCH_LIBS(clock_gettime, rt, [RTLIB=$LIBS])
AC_CHECK_FUNCS(clock_gettime)
AC_SUBST(RTLIB)
dnl Android has pthread_* functions in bionic (libc), others need libpthread
LIBS=""
AC_SEARCH_LIBS(pthread_create, pthread, [PTHREADLIB=$LIBS])
AC_SUBST(PTHREADLIB)
LIBS=$saved_LIBS
dnl ======================
@@ -282,7 +287,7 @@ AC_TRY_COMPILE(
dnl check if pthread_condattr_setclock(CLOCK_MONOTONE) is supported
saved_LIBS=$LIBS
LIBS="-lpthread"
LIBS=$PTHREADLIB
AC_MSG_CHECKING([for pthread_condattr_setclock(CLOCK_MONOTONE)])
AC_TRY_RUN(
[#include <pthread.h>