[dm-devel] [PATCH] multipath-tools: Makefile: Respect standard toolchain related envvars

Bart Van Assche Bart.VanAssche at wdc.com
Tue Dec 12 16:30:00 UTC 2017


On Tue, 2017-12-12 at 17:09 +0100, Thomas Deutschmann wrote:
> On 2017-12-12 16:28, Bart Van Assche wrote:
> > I agree that we need a way to specify additional compilation flags. However, is
> > OPTFLAGS really a standard? Aren't most developers used to set CFLAGS to specify
> > additional compilation flags?
> 
> When I created the patch I searched in the source code of other projects
> after "OPTFLAGS" usage and came to the conclusion that this isn't a
> standard.
> 
> However, my patch shouldn't break any existing use cases.
> 
> So my understanding was that "OPTFLAGS" is used like the default set of
> flags in case the user hasn't set any flags on its own. However, the
> project may still need to add a special flag which should be set everywhere.
> 
> That's why I created the patch the way I did:
> 
> 1) User can provide own CFLAGS in which case the default set of flags
> (OPTFLAGS) aren't used.
> 
> 2) We now extend set CFLAGS by adding our additional flags (-DRUN_DIR..)
> we want to be set everywhere.
> 
> Your patch will do the same but require downstream to unset/negate
> default flags. I don't really care if we pick your patch or my patch.

Hello Thomas,

I'm fine with dropping my patch and proceeding with your patch. However, I think
that any CFLAGS specified on the make command line or in the environment should
be appended at the end of the CFLAGS/OPTFLAGS specified by the Makefile. Otherwise
it's not possible to override e.g. the -W... flags specified in the Makefile from
the command line.

Thanks,

Bart.




More information about the dm-devel mailing list