summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorGary V. Vaughan <git@mlists.thewrittenword.com>2010-05-14 09:31:34 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-05-31 23:59:26 (GMT)
commit48793cf46a286a21df420fdd7fc4b0c91c60a0c8 (patch)
tree9827e66440047b313e5b17bb00d3fc799f1e17ee /Makefile
parent66dbfd55e38128db02eb340fcd89f54b734d4c6e (diff)
downloadgit-48793cf46a286a21df420fdd7fc4b0c91c60a0c8.zip
git-48793cf46a286a21df420fdd7fc4b0c91c60a0c8.tar.gz
git-48793cf46a286a21df420fdd7fc4b0c91c60a0c8.tar.bz2
Makefile: -lpthread may still be necessary when libc has only pthread stubs
Without this patch, systems that provide stubs for pthread functions in libc, but which still require libpthread for full the pthread implementation are not detected correctly. Also, some systems require -pthread in CFLAGS for each compilation unit for a successful link of an mt binary, which is also addressed by this patch. Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile4
1 files changed, 4 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index da0cfda..f6085a5 100644
--- a/Makefile
+++ b/Makefile
@@ -294,6 +294,7 @@ RPMBUILD = rpmbuild
TCL_PATH = tclsh
TCLTK_PATH = wish
PTHREAD_LIBS = -lpthread
+PTHREAD_CFLAGS =
export TCL_PATH TCLTK_PATH
@@ -898,6 +899,8 @@ ifeq ($(uname_S),AIX)
BASIC_CFLAGS += -D_LARGE_FILES
ifeq ($(shell expr "$(uname_V)" : '[1234]'),1)
NO_PTHREADS = YesPlease
+ else
+ PTHREAD_LIBS = -lpthread
endif
endif
ifeq ($(uname_S),GNU)
@@ -1349,6 +1352,7 @@ endif
ifdef NO_PTHREADS
BASIC_CFLAGS += -DNO_PTHREADS
else
+ BASIC_CFLAGS += $(PTHREAD_CFLAGS)
EXTLIBS += $(PTHREAD_LIBS)
LIB_OBJS += thread-utils.o
endif