diff options
author | Gary V. Vaughan <git@mlists.thewrittenword.com> | 2010-05-14 09:31:34 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-05-31 16:59:26 -0700 |
commit | 48793cf46a286a21df420fdd7fc4b0c91c60a0c8 (patch) | |
tree | 9827e66440047b313e5b17bb00d3fc799f1e17ee /Makefile | |
parent | Rewrite dynamic structure initializations to runtime assignment (diff) | |
download | tgif-48793cf46a286a21df420fdd7fc4b0c91c60a0c8.tar.xz |
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-- | Makefile | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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 |