]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: makefile: start to automatically collect CFLAGS/LDFLAGS
authorWilly Tarreau <w@1wt.eu>
Thu, 22 Dec 2022 17:24:46 +0000 (18:24 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 23 Dec 2022 15:53:35 +0000 (16:53 +0100)
Now OPTIONS_CFLAGS and OPTIONS_LDFLAGS don't need to be set anymore
for options USE_xxx that set xxx_CFLAGS or xxx_LDFLAGS. These ones
will be automatically connected.

The only entry for now that was ready for this was PCRE2, so it was
adjusted so as not to append to OPTIONS_LDFLAGS anymore. More will
come later.

Makefile

index 98a13995318102100c55637753fd0296c442a5d1..7f96dbc570ab127bab372b51f8bbb7d5b7a90a97 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -795,14 +795,17 @@ OPTIONS_CFLAGS    += -DUSE_PCRE2 -DPCRE2_CODE_UNIT_WIDTH=$(PCRE2_WIDTH)
 OPTIONS_CFLAGS  += $(if $(PCRE2_INC), -I$(PCRE2_INC))
 
 ifneq ($(USE_STATIC_PCRE2),)
-OPTIONS_LDFLAGS += $(if $(PCRE2_LIB),-L$(PCRE2_LIB)) -Wl,-Bstatic -L$(PCRE2_LIB) $(PCRE2_LDFLAGS) -Wl,-Bdynamic
+PCRE2_LDFLAGS   := $(if $(PCRE2_LIB),-L$(PCRE2_LIB)) -Wl,-Bstatic -L$(PCRE2_LIB) $(PCRE2_LDFLAGS) -Wl,-Bdynamic
 else
-OPTIONS_LDFLAGS += $(if $(PCRE2_LIB),-L$(PCRE2_LIB)) -L$(PCRE2_LIB) $(PCRE2_LDFLAGS)
+PCRE2_LDFLAGS   := $(if $(PCRE2_LIB),-L$(PCRE2_LIB)) -L$(PCRE2_LIB) $(PCRE2_LDFLAGS)
 endif
 
 endif
 endif
 
+# appends all foo_{C,LD}FLAGS to OPTIONS_{C,LD}FLAGS
+$(collect_opts_flags)
+
 #### Global compile options
 VERBOSE_CFLAGS = $(CFLAGS) $(TARGET_CFLAGS) $(SMALL_OPTS) $(DEFINE)
 COPTS  = -Iinclude