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

Re: How to pass CFLAGS to upstream's Makefile with debhlepler ?



> On 2011-11-14 06:12, Charles Plessy wrote:
> > 
> > trying to pass dpkg-buildglags' settings to an upstream build system
> > (http://git.debian.org/?p=debian-med/bwa.git), I found no other way than
> > patching their makefile, basically replacing
> > 
> > CFLAGS	 = -g -Wall -O2
> > 
> >   with
> > 
> > CFLAGS  ?= -g -Wall -O2
> > 
> > I wonder if it was the right thing to do, and if it is a change that can be
> > forwarded upstream.

Le Mon, Nov 14, 2011 at 07:28:32AM +0100, Niels Thykier a écrit :
> I believe that:
> 
> override_dh_auto_build:
> 	dh_auto_build -- CFLAGS="$(CFLAGS)"
> 
> 
>  - OR -
> 
> override_dh_auto_build:
> 	$(MAKE) CFLAGS="$(CFLAGS)"
> 
> 
> ought to do.  This only caveat is that it completely overrides the
> CFLAGS variable in the makefile.  This is usually mostly a problem if
> upstream (ab)uses LDFLAGS to add "-llib" flags, which does not really
> belong there.

Le Mon, Nov 14, 2011 at 11:35:03AM +0100, Andrew Shadura a écrit :
> 
> I always use ?= in my Makefiles because it may be important to someone
> to be able at least partially override the setting I use.

Thank you very much for your answers.  I ended up using the following Debhelper
override.

override_dh_auto_build:
	dh_auto_build -- CFLAGS="-Wall $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)"

Does anybody know the reason why dpkg-buildflags does not include -Wall ?

Cheers,

Charles

-- 
Charles Plessy
Tsurumi, Kanagawa, Japan


Reply to: