Code

Add autoconf tests for pthreads
[git.git] / Makefile
index 0698365078c4b98de04da8701c68b5d1811b3487..02f68e05f5f78def774b02ab6af843bc48a9f0c9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -229,6 +229,7 @@ INSTALL = install
 RPMBUILD = rpmbuild
 TCL_PATH = tclsh
 TCLTK_PATH = wish
+PTHREAD_LIBS = -lpthread
 
 export TCL_PATH TCLTK_PATH
 
@@ -694,6 +695,11 @@ ifeq ($(uname_S),FreeBSD)
        THREADED_DELTA_SEARCH = YesPlease
        COMPAT_CFLAGS += -Icompat/regex
        COMPAT_OBJS += compat/regex/regex.o
+       ifeq ($(shell expr "$(uname_R)" : '4\.'),2)
+               PTHREAD_LIBS = -pthread
+               NO_UINTMAX_T = YesPlease
+               NO_STRTOUMAX = YesPlease
+       endif
 endif
 ifeq ($(uname_S),OpenBSD)
        NO_STRCASESTR = YesPlease
@@ -1019,7 +1025,7 @@ endif
 
 ifdef THREADED_DELTA_SEARCH
        BASIC_CFLAGS += -DTHREADED_DELTA_SEARCH
-       EXTLIBS += -lpthread
+       EXTLIBS += $(PTHREAD_LIBS)
        LIB_OBJS += thread-utils.o
 endif
 ifdef DIR_HAS_BSD_GROUP_SEMANTICS