Hello,

Right now we have in the Makefile:

#### Common CFLAGS
# These CFLAGS contain general optimization options, CPU-specific optimizations
# and debug flags. They may be overridden by some distributions which prefer to
# set all of them at once instead of playing with the CPU and DEBUG variables.
CFLAGS = $(ARCH_FLAGS) $(CPU_CFLAGS) $(DEBUG_CFLAGS) $(SPEC_CFLAGS)

So you explicitly suggest to override CFLAGS if someone want to add custom 
options here (say, tune optimisations).

But this way now mandatory -fwrap will be lost.  Or one must remember not to 
loose it.
This is not convenient.

I propose to add some means to inherit CFLAGS defined in haproxy's Makefile, 
but allow to customise it via additional options passed via environment, 
example attached.

What do you think?

(another way would be to add $(CUSTOM_CFLAGS) at the end of CFLAGS assignment).

Thanks.

--- Makefile.orig       2017-06-03 10:48:38.897518000 +0300
+++ Makefile    2017-06-03 10:48:58.640446000 +0300
@@ -205,7 +205,7 @@ ARCH_FLAGS        = $(ARCH_FLAGS.$(ARCH)
 # These CFLAGS contain general optimization options, CPU-specific optimizations
 # and debug flags. They may be overridden by some distributions which prefer to
 # set all of them at once instead of playing with the CPU and DEBUG variables.
-CFLAGS = $(ARCH_FLAGS) $(CPU_CFLAGS) $(DEBUG_CFLAGS) $(SPEC_CFLAGS)
+CFLAGS := $(ARCH_FLAGS) $(CPU_CFLAGS) $(DEBUG_CFLAGS) $(SPEC_CFLAGS) $(CFLAGS)
 
 #### Common LDFLAGS
 # These LDFLAGS are used as the first "ld" options, regardless of any library

Reply via email to