]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: report the whole feature set with their status in haproxy -vv
authorWilly Tarreau <w@1wt.eu>
Wed, 27 Mar 2019 12:20:08 +0000 (13:20 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 27 Mar 2019 13:32:58 +0000 (14:32 +0100)
It's not convenient not to know the status of default options, and
requires the user to know what option is enabled by default in each
target. With this patch, a new "Features list" line is added to the
output of "haproxy -vv" to report the whole list of known features
with their respective status. They're prefixed with a "+" when enabled
or a "-" when disabled. The "USE_" prefix is removed for clarity.

Makefile
src/haproxy.c

index 14d9163a0da3e4f474391ef8a1a48a1851b2a1dc..f621ca8d78c376d292537619feda145cfc6c90ff 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -445,7 +445,8 @@ ignore_implicit = $(if $(subst environment,,$(origin $(1))),         \
 # This variable collects all USE_* values except those set to "implicit". This
 # is used to report a list of all flags which were used to build this version.
 # Do not assign anything to it.
-BUILD_OPTIONS := $(foreach opt,$(use_opts),$(call ignore_implicit,$(opt)))
+BUILD_OPTIONS  := $(foreach opt,$(use_opts),$(call ignore_implicit,$(opt)))
+BUILD_FEATURES := $(foreach opt,$(patsubst USE_%,%,$(use_opts)),$(if $(USE_$(opt)),+$(opt),-$(opt)))
 
 ifneq ($(USE_LINUX_SPLICE),)
 OPTIONS_CFLAGS += -DCONFIG_HAP_LINUX_SPLICE
@@ -883,6 +884,7 @@ src/haproxy.o:      src/haproxy.c $(DEP)
              -DBUILD_CC='"$(strip $(CC))"' \
              -DBUILD_CFLAGS='"$(strip $(VERBOSE_CFLAGS))"' \
              -DBUILD_OPTIONS='"$(strip $(BUILD_OPTIONS))"' \
+             -DBUILD_FEATURES='"$(strip $(BUILD_FEATURES))"' \
               -c -o $@ $<
 
 install-man:
index 6a5abcb35e87615534a4ca254d128ade5f92e1a1..cbcc80cdfe2f746dd9340446902542bfb62389c5 100644 (file)
@@ -396,6 +396,9 @@ static void display_build_opts()
 #endif
 #ifdef BUILD_OPTIONS
               "\n  OPTIONS = " BUILD_OPTIONS
+#endif
+#ifdef BUILD_FEATURES
+              "\n\nFeature list : " BUILD_FEATURES
 #endif
               "\n\nDefault settings :"
               "\n  bufsize = %d, maxrewrite = %d, maxpollevents = %d"