Re: CFLAGS in d/rules (and Debian policy) [Was: Re: RFS: mpg321 (updated package, 2nd try)]
-----BEGIN PGP SIGNED MESSAGE-----
On 2011-02-12 11:24, Paul Gevers wrote:
>> - The CFLAGS in d/rules overrides flags set by dpkg-buildflags, which
>> makes it more difficult to rebuild the package with different default
>> flags (see man dpkg-buildflags).
> I see that the example in the Debian policy on build options  also
> overrides the flags set by dpkg-buildflags. So is this an example how it
> should NOT be done and should this be changed as well?
> I try to add some option to the CFLAGS, but seem not to be able to do it
> properly without specifying my own CFLAGS. My idea would be that you
> just use """CFLAGS+=some_option_here""" in your d/rules, but trying this
> out just gives me a CFLAGS with only my "some_option_here". So this can
> not be correct. It seems that d/rules does not have any CFLAGS available
> before I set them to any value. I must be overseeing something, so can
> you give an example, in mail or web page link, on how to properly
> implement adding options to CFLAGS in d/rules.
> Kind regards
I believe you can use:
CFLAGS:= $(CFLAGS) some_option_here
CFLAGS += some_other_option
Alternatively you can use:
CFLAGS = $(shell dpkg-buildflags --get CFLAGS) some_option_here
But that requires a versioned Build-Depends on dpkg-dev.
That being said, this is one of the places where building via
dpkg-buildpackage and debian/rules binary differs.
As for the policy; it appears that the example might benefit from a
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
-----END PGP SIGNATURE-----