On Sat, Jun 03, 2017 at 10:36:04AM +0200, Aleksandar Lazic wrote:
> Hi Dmitry Sivachenko,
> 
> Dmitry wrote on:
> 
> > 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).
> 
> Personally I would prefer the CUSTOM_CFLAGS way.

Same here, and it's important not to create confusion on the way
CFLAGS are computed.

By the way, usually if I need to add some specific flags (eg #define),
I do it via DEFINE or SMALL_OPTS. If I want to change the optimization
options, I use CPU_CFLAGS or CPU_CFLAGS.<target_name>.

So maybe you already have what you need and only the documentation needs
to be improved.

Willy

Reply via email to