From: Willy Tarreau Date: Fri, 23 Dec 2022 14:08:38 +0000 (+0100) Subject: BUILD: makefile: only consider settings from enabled options X-Git-Tag: v2.8-dev1~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e70a3986cad4fa148e3b32f92a371d18cabc851;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/include/make/options.mk b/include/make/options.mk index 15e9841d07..1f9aaba691 100644 --- a/include/make/options.mk +++ b/include/make/options.mk @@ -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))))