summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-07-25 14:13:46 -0700
committerJunio C Hamano <gitster@pobox.com>2016-07-25 14:13:46 -0700
commit7b01ab562ae14f5e5aedf0c0e769c74925a19809 (patch)
treebbd4096333e30e8aa4a3f8436de258ce96718caa /configure.ac
parent37e9c7f5e15aa423cef640cc4dc137da2f73c5af (diff)
parenta9b02de8b79de44ee8f4a0506b65a62f38999bd8 (diff)
downloadgit-7b01ab562ae14f5e5aedf0c0e769c74925a19809.tar.gz
Merge branch 'ew/autoconf-pthread'
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
Diffstat (limited to 'configure.ac')
-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;
]])])