BUILD: makefile: only consider settings from enabled options

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.
This commit is contained in:
Willy Tarreau 2022-12-23 15:08:38 +01:00
parent 6a2cd33509
commit 6e70a3986c
1 changed files with 2 additions and 2 deletions

View 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))))