From 39006f990771518b1b7d4b8dfdfac72409ef26ca Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Fri, 16 Mar 2012 16:57:02 -0700 Subject: [PATCH] Look for pthreads functionality in libc. If there is no libpthread, look for pthreads functionality in libc before failing to configure pthreads. This is necessary on at least the Android platform. Reported by Mike Hommey. --- configure.ac | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 295e646d..47d5784b 100644 --- a/configure.ac +++ b/configure.ac @@ -746,8 +746,11 @@ dnl ============================================================================ dnl Configure pthreads. AC_CHECK_HEADERS([pthread.h], , [AC_MSG_ERROR([pthread.h is missing])]) +dnl Some systems may embed pthreads functionality in libc; check for libpthread +dnl first, but try libc too before failing. AC_CHECK_LIB([pthread], [pthread_create], [LIBS="$LIBS -lpthread"], - [AC_MSG_ERROR([libpthread is missing])]) + [AC_SEARCH_LIBS([pthread_create], , , + AC_MSG_ERROR([libpthread is missing]))]) CPPFLAGS="$CPPFLAGS -D_REENTRANT"