Re: [PATCH] honor CFLAGS & friends from environment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 15, 2019 at 01:42:53AM +0000, Ramsay Jones wrote:
> On 14/02/2019 23:34, Luc Van Oostenryck wrote:
> > From: Uwe Kleine-König <uwe@xxxxxxxxxxxxxxxxx>
> > 
> > Debian build scripts pass CFLAGS in the environment.
> > However, this is ignored by Sparse's Makefile since 'CFLAGS'
> > is unconditionaly initialized.
> > 
> > Fix this by initializing CFLAGS to their default value using '?='.
> > Do the same for PKG_CONFIG, CHECKER, CHECKER_FLAGS and
> > DESTDIR, BINDIR, MANDIR & MAN1DIR.
> > 
> > Note: It's useless to try to do the same for CC, LD & AR since
> >       they're builtin variables so '?= ...' is a no-op for them
> >       (unless make is called with -R).
> > 
> > Note: This makes sparse native builds reproducible for Debian.
> > 
> > Signed-off-by: Uwe Kleine-König <uwe@xxxxxxxxxxxxxxxxx>
> > Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
> > ---
> >  Makefile | 17 ++++++++---------
> >  1 file changed, 8 insertions(+), 9 deletions(-)
> > 
> > diff --git a/Makefile b/Makefile
> > index bd2b089f3..2d72be9e2 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -6,19 +6,18 @@ OS = linux
> >  
> >  
> >  CC = gcc
> > -CFLAGS = -O2 -g
> > -CFLAGS += -Wall -Wwrite-strings
> > +CFLAGS ?= -O2 -g -Wall -Wwrite-strings
> >  LD = $(CC)
> >  AR = ar
> > -PKG_CONFIG = pkg-config
> > -CHECKER = CHECK=./sparse ./cgcc -no-compile
> > -CHECKER_FLAGS = -Wno-vla
> > +PKG_CONFIG ?= pkg-config
> > +CHECKER ?= CHECK=./sparse ./cgcc -no-compile
> > +CHECKER_FLAGS ?= -Wno-vla
> 
> Hmm, I don't think CHECKER and CHECKER_FLAGS should be
> included here. These are, to my mind anyway, internal
> to the makefile and should not be settable from the
> environment.

Yes, I see things like this too but I thought you added CHECKER
explicitly for being able to override it.
I've moved them now.

Thanks,
-- Luc 



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux