Re: CFLAGS in d/rules (and Debian policy) [Was: Re: RFS: mpg321 (updated package, 2nd try)]
* Paul Gevers <firstname.lastname@example.org> [110212 11:24]:
> > - 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.
debian/rules should ignore the contents of CFLAGS from the calling
environment. CFLAGS is an environment variable a normal user may have
set for normal development, so a package should not look at them.
Using dpkg-buildflags should be done from debian/rules,
dpkg-buildpackage setting those flags is just a workaround so that
broken packages get some sane defaults of flags.
Bernhard R. Link