Makefile: -lpthread may still be necessary when libc has only pthread stubs
[gitweb.git] / Makefile
index 910f4713ef1491278500573bab2d00ee1925abb8..f6085a52400a2f440cc174cdd8ab980c3c7a644d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -246,7 +246,7 @@ endif
 
 CFLAGS = -g -O2 -Wall
 LDFLAGS =
-ALL_CFLAGS = $(CFLAGS)
+ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)
 ALL_LDFLAGS = $(LDFLAGS)
 STRIP ?= strip
 
@@ -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