[Build-common-hackers] Bug#712729: Bug#712729: cdbs: langcore.mk: support dpkg-buildflags' DEB_CFLAGS_MAINT_APPEND and similar

Jonas Smedegaard dr at jones.dk
Wed Jun 19 17:14:25 UTC 2013

Quoting Emilio Pozuelo Monfort (2013-06-19 11:29:55)
> Currently if you use CDBS' autotools.mk, gnome.mk, cmake.mk or similar 
> and you don't mess with CFLAGS, LDFLAGS, CPPFLAGS... then you will get 
> dpkg-buildflags' default CFLAGS, LDFLAGS... automatically. Which is 
> great.
> However many packages need to tweak some flag. For example in GNOME we 
> have many packages that do
> LDFLAGS += -Wl,-O1 -Wl,--as-needed
> This means LDFLAGS now gets set to -Wl,-O1 -Wl,--as-needed and loses 
> all the flags returned by dpkg-buildflags. That is AFAICS because CDBS 
> will only set LDFLAGS to what dpkg-buildflags returns if LDFLAGS is 
> not set.

Correct. Reason for this is to keep backwards compatibility: Changing 
this behaviour may break existing packages.

> So what I would like is to be able to do:
> LDFLAGS += -Wl,-O1 -Wl,--as-needed

This may break existing packages.  I would love to simplify both CDBS 
code and its usage, but that requires either that someone analyze and 
ensures that no packages in Debian rely on old behaviour (preferrably in 
stable and oldstable too, to ease backporting CDBS itself).

I see no other way to improve than that or bumping compatibility level - 
which is more work.

> Or
> DEB_LDFLAGS_MAINT_APPEND = -Wl,-O1 -Wl,--as-needed
> and get my package built with LDFLAGS="dpkg build flags plus my other 
> flags".
> There are other kind of DEB_LDFLAGS_MAINT_ vars, which are _PREPEND, 
> _SET and _STRIP. CDBS should honor all of them so if I set one, I will 
> get the right flags.

Anyone wanting that logic can simply do this:

  include /usr/share/dpkg/buildflags.mk

No need for CDBS to replicate code provided by dpkg IMO.

> Hope that's more clear.

Yes, was great now - or maybe I simply needed a good nights sleep :-)

 - Jonas

 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: signature
URL: <http://lists.alioth.debian.org/pipermail/build-common-hackers/attachments/20130619/675184c1/attachment.sig>

More information about the Build-common-hackers mailing list