mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 07:37:02 +02:00
BUILD: makefile: add a function to collect all options' CFLAGS/LDFLAGS
The new function collect_opts_flags now scans all USE_* options defined in use_opts and appends the corresponding *_CFLAGS and *_LDFLAGS to OPTIONS_{C,LD}FLAGS respectively. This will be useful to get rid of all the individual concatenations to these variables.
This commit is contained in:
parent
b14e89e322
commit
8fa2f49f24
@ -37,3 +37,16 @@ reset_opt_vars = $(foreach name,INC LIB CFLAGS LDFLAGS SRC,$(eval $(1)_$(name)=)
|
|||||||
|
|
||||||
# preset all variables for all supported build options among use_opts
|
# preset all variables for all supported build options among use_opts
|
||||||
reset_opts_vars = $(foreach opt,$(patsubst USE_%,%,$(use_opts)) SSL WOLFSSL,$(call reset_opt_vars,$(opt)))
|
reset_opts_vars = $(foreach opt,$(patsubst USE_%,%,$(use_opts)) SSL WOLFSSL,$(call reset_opt_vars,$(opt)))
|
||||||
|
|
||||||
|
# append $(1)_{C,LD}FLAGS into OPTIONS_{C,LD}FLAGS if not empty
|
||||||
|
define collect_opt_flags =
|
||||||
|
ifneq ($$($(1)_CFLAGS),)
|
||||||
|
OPTIONS_CFLAGS += $$($(1)_CFLAGS)
|
||||||
|
endif
|
||||||
|
ifneq ($$($(1)_LDFLAGS),)
|
||||||
|
OPTIONS_LDFLAGS += $$($(1)_LDFLAGS)
|
||||||
|
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)) SSL,$(eval $(call collect_opt_flags,$(opt))))
|
||||||
|
Loading…
Reference in New Issue
Block a user