On Tue, Aug 03, 2010 at 06:54:12PM +0300, Eugene Paskevich wrote: > On Tue, 03 Aug 2010 18:40:25 +0300, Eugene Paskevich > <eug...@raptor.kiev.ua> wrote: > > >On Tue, 03 Aug 2010 17:44:06 +0300, Sven Hoexter > ><s...@timegate.de> wrote: > > > >>I think you can move the LDFLAGS setting out of the override target > >>and set something like > >>LDFLAGS += -Wl,-z,defs,--as-needed,--no-undefined > >>above the %: target and remove the override targets altogether. > > > >Actually it seems that debian/rules could be cut down to: > > > >#!/usr/bin/make -f > > > ># Uncomment this to turn on verbose mode. > >#export DH_VERBOSE=1 > > > >CFLAGS = -g > > > >ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) > > CFLAGS += -O0 > >else > > CFLAGS += -O2 > >endif > > > >LDFLAGS = -Wl,-z,defs,--as-needed,--no-undefined > > > >%: > > dh $@ > > > > > >Could you please confirm this is OK? > >I didn't notice any problems myself with this debian/rules. > > Or even to this: > > #!/usr/bin/make -f > > # Uncomment this to turn on verbose mode. > #export DH_VERBOSE=1 > > LDFLAGS += -Wl,-z,defs,--as-needed,--no-undefined > > %: > dh $@ > > > For as far as I can see, DEB_BUILD_OPTIONS are respected even w/o > debian/rules support.
FWIW, for future versions of the package you might want to take a look at the dpkg-buildflags utility introduced in dpkg-dev 1.15.7 and use it to obtain the default values for CFLAGS, CPPFLAGS, FFLAGS, and LDFLAGS - or, of course, only of those variables you actually need ;) You might take a quick look at e.g. the confget-1.02-3 package from testing/unstable for an example of using dpkg-buildflags. The benefit you get is that your package is always built with the same combination of flags regardless of whether the build is done via pbuilder, debuild, dpkg-buildpackage, or plain old "./debian/rules binary" (or even "debian/rules build"). Of course, this would bring in a build dependency on dpkg-dev >= 1.15.7, which might cause problems if your package is backported, but the person doing the backport should figure out how to set CFLAGS, etc easily enough :) G'luck, Peter -- Peter Pentchev r...@space.bg r...@ringlet.net r...@freebsd.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 This sentence no verb.
signature.asc
Description: Digital signature