From 02aa14518b30fb3289f1e1c46349f1d18ea6cafc Mon Sep 17 00:00:00 2001
From: Alexandre Julliard <julliard@winehq.org>
Date: Tue, 8 Jan 2013 13:14:11 +0100
Subject: [PATCH] configure: Allow pthread_create to be in the C library.

---
 configure    | 10 ++++++++--
 configure.ac |  5 +++--
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/configure b/configure
index a1caaa49c10..6dc5b50e451 100755
--- a/configure
+++ b/configure
@@ -7255,7 +7255,11 @@ fi
 
 if test "$ac_cv_header_pthread_h" = "yes"
 then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5
+    ac_fn_c_check_func "$LINENO" "pthread_create" "ac_cv_func_pthread_create"
+if test "x$ac_cv_func_pthread_create" = xyes; then :
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5
 $as_echo_n "checking for pthread_create in -lpthread... " >&6; }
 if ${ac_cv_lib_pthread_pthread_create+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -7297,7 +7301,9 @@ if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then :
 fi
 
 fi
-if test "x$LIBPTHREAD" = "x"; then :
+
+fi
+if test "x$ac_cv_func_pthread_create" != xyes -a "x$LIBPTHREAD" = x; then :
   case "x$with_pthread" in
   xno) ;;
   *)   as_fn_error $? "pthread ${notice_platform}development files not found.
diff --git a/configure.ac b/configure.ac
index d14a2df2a81..4b0c3606e20 100644
--- a/configure.ac
+++ b/configure.ac
@@ -954,9 +954,10 @@ dnl **** Check for pthread ****
 
 if test "$ac_cv_header_pthread_h" = "yes"
 then
-    AC_CHECK_LIB(pthread,pthread_create,[AC_SUBST(LIBPTHREAD,"-lpthread")])
+    AC_CHECK_FUNC(pthread_create,,[AC_CHECK_LIB(pthread,pthread_create,[AC_SUBST(LIBPTHREAD,"-lpthread")])])
 fi
-WINE_ERROR_WITH(pthread,[test "x$LIBPTHREAD" = "x"],[pthread ${notice_platform}development files not found.
+WINE_ERROR_WITH(pthread,[test "x$ac_cv_func_pthread_create" != xyes -a "x$LIBPTHREAD" = x],
+[pthread ${notice_platform}development files not found.
 Wine cannot support threads without libpthread.])
 
 dnl **** Check for X11 ****
-- 
GitLab