summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-07-18 10:22:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-07-18 18:22:35 (GMT)
commita9b02de8b79de44ee8f4a0506b65a62f38999bd8 (patch)
tree1eaabaf80dd3649ca04a21444f68e27bfad17326 /configure.ac
parent765428699a5381f113d19974720bc91b5bfeaf1d (diff)
downloadgit-a9b02de8b79de44ee8f4a0506b65a62f38999bd8.zip
git-a9b02de8b79de44ee8f4a0506b65a62f38999bd8.tar.gz
git-a9b02de8b79de44ee8f4a0506b65a62f38999bd8.tar.bz2
configure.ac: stronger test for pthread linkage
We need to test linkage of pthread_create and pthread_join, as pthread_mutex_* and pthread_key_* functions do not need extra linkage under FreeBSD 10.3, leading to a false-positive of the empty case. Signed-off-by: Eric Wong <e@80x24.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 bbdde85..a061775 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1083,14 +1083,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;
]])])