]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: makefile: only consider settings from enabled options
authorWilly Tarreau <w@1wt.eu>
Fri, 23 Dec 2022 14:08:38 +0000 (15:08 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 23 Dec 2022 16:01:55 +0000 (17:01 +0100)
Due to the previous SSL exception we coudln't restrict the collected
CFLAGS/LDFLAGS to those of enabled options, so all of them were
considered if set. The problem is that it would prevent simply
disabling a build option without unsetting its xxx_CFLAGS or _LDFLAGS
values if those had incompatible values (e.g. -lfoo).

Now that only existing options are listed in collect_opts_flags, we
can safely check that the option is set and only consider its settings
in this case. Thus OT_LDFLAGS will not be used if USE_OT is not set
for example.

include/make/options.mk

index 15e9841d0776677fdcbd65a3bcb8b29b8fd67824..1f9aaba69142c12130833466b1885350e150b0c7 100644 (file)
@@ -48,5 +48,5 @@ define collect_opt_flags =
   endif
 endef
 
-# collect all known USE_foo's foo_{C,LD}FLAGS into OPTIONS_{C,LD}FLAGS
-collect_opts_flags = $(foreach opt,$(patsubst USE_%,%,$(use_opts)),$(eval $(call collect_opt_flags,$(opt))))
+# collect all enabled USE_foo's foo_{C,LD}FLAGS into OPTIONS_{C,LD}FLAGS
+collect_opts_flags = $(foreach opt,$(enabled_opts),$(eval $(call collect_opt_flags,$(opt))))