summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 158629b)
raw | patch | inline | side by side (parent: 158629b)
author | David M. Syzdek <david.syzdek@acsalaska.net> | |
Mon, 3 Nov 2008 18:14:28 +0000 (09:14 -0900) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 9 Nov 2008 19:26:54 +0000 (11:26 -0800) |
Set the value of PTHREAD_LIBS to the correct flags for linking pthreads on
the current environment.
Signed-off-by: David M. Syzdek <david.syzdek@acsalaska.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
the current environment.
Signed-off-by: David M. Syzdek <david.syzdek@acsalaska.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
config.mak.in | patch | blob | history | |
configure.ac | patch | blob | history |
diff --git a/config.mak.in b/config.mak.in
index 717072943f67a126834a06ae9ac820e972e11ae0..ea7705c1edb6040a900159077a60e129e03a5de1 100644 (file)
--- a/config.mak.in
+++ b/config.mak.in
NO_DEFLATE_BOUND=@NO_DEFLATE_BOUND@
FREAD_READS_DIRECTORIES=@FREAD_READS_DIRECTORIES@
SNPRINTF_RETURNS_BOGUS=@SNPRINTF_RETURNS_BOGUS@
+PTHREAD_LIBS=@PTHREAD_LIBS@
diff --git a/configure.ac b/configure.ac
index a0d53f31241aa8400b62583ade516f2ca1413935..3f058a087b109fad3b60e6073bdfacad4a16b6f5 100644 (file)
--- a/configure.ac
+++ b/configure.ac
#
# Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link.
# Enable it on Windows. By default, symrefs are still used.
+#
+# Define PTHREAD_LIBS to the linker flag used for Pthread support.
+AC_LANG_CONFTEST([AC_LANG_PROGRAM(
+ [[#include <pthread.h>]],
+ [[pthread_mutex_t test_mutex;]]
+)])
+${CC} -pthread conftest.c -o conftest.o > /dev/null 2>&1
+if test $? -eq 0;then
+ PTHREAD_LIBS="-pthread"
+else
+ ${CC} -lpthread conftest.c -o conftest.o > /dev/null 2>&1
+ if test $? -eq 0;then
+ PTHREAD_LIBS="-lpthread"
+ fi
+fi
+AC_SUBST(PTHREAD_LIBS)
## Site configuration (override autodetection)
## --with-PACKAGE[=ARG] and --without-PACKAGE