]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: threads: Prepare makefile to link with pthread
authorEmeric Brun <ebrun@haproxy.com>
Mon, 26 Jun 2017 16:41:42 +0000 (18:41 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 31 Oct 2017 10:36:13 +0000 (11:36 +0100)
USE_THREAD option has been added to enable the compilation with the experimental
support of threads . Of course for now, there is nothing. And for a while,
HAProxy will be unstable. When we will be confident enough, this option will be
removed.

For this implementation and probably for a while, only the pthread library will
be supported.

Makefile

index c79e4ae251c5059400284e841b009f6406485b5c..aa1a7fee8e91d962adf7be062cabc55303dc5b17 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -561,6 +561,12 @@ BUILD_OPTIONS   += $(call ignore_implicit,USE_DL)
 OPTIONS_LDFLAGS += -ldl
 endif
 
+ifneq ($(USE_THREAD),)
+BUILD_OPTIONS   += $(call ignore_implicit,USE_THREAD)
+OPTIONS_CFLAGS  += -DUSE_THREAD
+OPTIONS_LDFLAGS += -lpthread
+endif
+
 # report DLMALLOC_SRC only if explicitly specified
 ifneq ($(DLMALLOC_SRC),)
 BUILD_OPTIONS += DLMALLOC_SRC=$(DLMALLOC_SRC)