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

2011-11-16 Thread Bernhard R. Link
* Nicolas Bourdaud nicolas.bourd...@gmail.com [14 15:25]:
 On 14/11/2011 14:32, Bernhard R. Link wrote:
  Without -Wall you won't get some of the most critical warnings.
  A package should really not be built without at least -Wall.

 I understand, and I think it is a pity that some software produce way
 too many warnings when compiled with -Wall and -Wextra.

 However is it not already too late to catch those warnings when the
 package is being built? IMO, they should have been taken care in
 upstream.

While it might be to late for this package, it is not yet too late for
the next version of a package. Or to use the informationen when looking
for the cause of bugs.

Especially when looking for bugs only showing up on some architectures
(like working on 32 bit but failing on 64 bit) and the like.

 Or do you consider to *massively* patch the source to fix the warnings?

Depends on the type of warnings. But there are definitely cases where
that is called for. (And hopefully those warnings accepted upstream if
there still is a upstream).

Bernhard R. Link


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/2016081741.ga32...@server.brlink.eu



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

2011-11-14 Thread Andrew Shadura
Hello,

On Mon, 14 Nov 2011 14:12:04 +0900
Charles Plessy ple...@debian.org wrote:

 I wonder if it was the right thing to do, and if it is a change that
 can be forwarded upstream.

I always use ?= in my Makefiles because it may be important to someone
to be able at least partially override the setting I use.

 Also, I added $(CPPFLAGS) $(LDFLAGS) in some calls to $(CC), but I
 think I remember reading that $(LDFLAGS) is not needed everywhere.
 When in doubt, is it safe to add them ?

There's LDLIBS or LOADLIBES, you should pass either or both of them to
CC as well. LDFLAGS may be needed sometimes, however.


-- 
WBR, Andrew


signature.asc
Description: PGP signature


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

2011-11-14 Thread Charles Plessy
 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


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/2014104030.gd...@merveille.plessy.net



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

2011-11-14 Thread Nicolas Bourdaud
On 14/11/2011 11:40, Charles Plessy wrote:
 Does anybody know the reason why dpkg-buildflags does not include -Wall ?

I believe, the reason is that -Wall is really useful only the developer,
not the one who build the package.

In addition, not all upstream projects are really warnings free (some
developer never use -Wall -Wextra). So using them by default when
building the package would generate a lot of noise that might hide more
critical warnings.

Cheers,

Nicolas





signature.asc
Description: OpenPGP digital signature


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

2011-11-14 Thread Bernhard R. Link
* Nicolas Bourdaud nicolas.bourd...@gmail.com [14 12:29]:
 I believe, the reason is that -Wall is really useful only the developer,
 not the one who build the package.

 In addition, not all upstream projects are really warnings free (some
 developer never use -Wall -Wextra). So using them by default when
 building the package would generate a lot of noise that might hide more
 critical warnings.

Without -Wall you won't get some of the most critical warnings.
A package should really not be built without at least -Wall.

Bernhard R. Link


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/2014133218.ga21...@server.brlink.eu



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

2011-11-14 Thread Nicolas Bourdaud
On 14/11/2011 14:32, Bernhard R. Link wrote:
 Without -Wall you won't get some of the most critical warnings.
 A package should really not be built without at least -Wall.

I understand, and I think it is a pity that some software produce way
too many warnings when compiled with -Wall and -Wextra.

However is it not already too late to catch those warnings when the
package is being built? IMO, they should have been taken care in
upstream. Or do you consider to *massively* patch the source to fix the
warnings?

Nicolas



signature.asc
Description: OpenPGP digital signature


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

2011-11-14 Thread Gergely Nagy
Nicolas Bourdaud nicolas.bourd...@gmail.com writes:

 On 14/11/2011 14:32, Bernhard R. Link wrote:
 Without -Wall you won't get some of the most critical warnings.
 A package should really not be built without at least -Wall.

 I understand, and I think it is a pity that some software produce way
 too many warnings when compiled with -Wall and -Wextra.

 However is it not already too late to catch those warnings when the
 package is being built? IMO, they should have been taken care in
 upstream. Or do you consider to *massively* patch the source to fix the
 warnings?

Fix them? Not neccessarily. Certainly not all. But it makes it easier to
prod upstream into fixing them himself.

There's also no real harm in enabling -Wall. It makes build logs bigger
in the worst case. But the benefits, imo, far outweight that.

-- 
|8]


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87vcqm21tl.fsf@algernon.balabit



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

2011-11-14 Thread Henrique de Moraes Holschuh
On Mon, 14 Nov 2011, Nicolas Bourdaud wrote:
 However is it not already too late to catch those warnings when the
 package is being built? IMO, they should have been taken care in
 upstream. Or do you consider to *massively* patch the source to fix the

Upstream usually doesn't have access to nearly as many arches as you, as
a DD, will.

IME, -Wall and proper review of the autobuild build logs can root out
some bugs upstream would not be warned about by gcc in the arch they
develop for.  We often use newer gcc versions than upstream as well, and
that also means you could get warnings they won't because they're still
using an older gcc.

IMHO, if you are able to, you should patch the source _and_ send the
changes upstream.  You should then decide whether you should ship the
Debian package with those patches or not, and when in doubt, wait for
upstream.

-- 
  One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie. -- The Silicon Valley Tarot
  Henrique Holschuh


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/2014201428.gb31...@khazad-dum.debian.net



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

2011-11-13 Thread Charles Plessy
Dear all,

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.

Also, I added $(CPPFLAGS) $(LDFLAGS) in some calls to $(CC), but I think I
remember reading that $(LDFLAGS) is not needed everywhere.  When in doubt, is
it safe to add them ?

Have a nice day,

-- 
Charles Plessy
Debian Med packaging team,
http://www.debian.org/devel/debian-med
Tsurumi, Kanagawa, Japan


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/2014051204.ga...@merveille.plessy.net



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

2011-11-13 Thread Niels Thykier
On 2011-11-14 06:12, Charles Plessy wrote:
 Dear all,
 
 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.
 
 Also, I added $(CPPFLAGS) $(LDFLAGS) in some calls to $(CC), but I think I
 remember reading that $(LDFLAGS) is not needed everywhere.  When in doubt, is
 it safe to add them ?
 
 Have a nice day,
 

Hey,

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.

~Niels


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4ec0b510.9060...@thykier.net