summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-08-10 11:55:20 -0700
committerJunio C Hamano <gitster@pobox.com>2016-08-10 11:55:21 -0700
commitf98a20c50a52342556f0d71a83763a61a170c26c (patch)
tree716ed9a2a53ebe7101e35362451cb143abbdd361
parente223c2c77f7e578e085c80c59440475cff056dc0 (diff)
parenta9b02de8b79de44ee8f4a0506b65a62f38999bd8 (diff)
downloadgit-f98a20c50a52342556f0d71a83763a61a170c26c.tar.gz
Merge branch 'ew/autoconf-pthread' into maint
Existing autoconf generated test for the need to link with pthread library did not check all the functions from pthread libraries; recent FreeBSD has some functions in libc but not others, and we mistakenly thought linking with libc is enough when it is not. * ew/autoconf-pthread: configure.ac: stronger test for pthread linkage
-rw-r--r--configure.ac5
1 files changed, 5 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index c279025747..aa9c91d20d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1108,14 +1108,19 @@ GIT_CONF_SUBST([HAVE_BSD_SYSCTL])
AC_DEFUN([PTHREADTEST_SRC], [
AC_LANG_PROGRAM([[
#include <pthread.h>
+static void *noop(void *ignore) { return ignore; }
]], [[
pthread_mutex_t test_mutex;
pthread_key_t test_key;
+ pthread_t th;
int retcode = 0;
+ void *ret = (void *)0;
retcode |= pthread_key_create(&test_key, (void *)0);
retcode |= pthread_mutex_init(&test_mutex,(void *)0);
retcode |= pthread_mutex_lock(&test_mutex);
retcode |= pthread_mutex_unlock(&test_mutex);
+ retcode |= pthread_create(&th, ret, noop, ret);
+ retcode |= pthread_join(th, &ret);
return retcode;
]])])