Bug#578597: Recommend usage of dpkg-buildflags to initialize CFLAGS and al.
On Sat, 01 May 2010, Loïc Minier wrote:
> On Wed, Apr 21, 2010, Raphael Hertzog wrote:
> > The desired outcome is that all package grab the values directly from
> > dpkg-buildflags and that we can stop exporting the variables from
> > dpkg-buildpackage. That way calling debian/rules directly and via
> > dpkg-buildpackage should give the same result.
> I wonder why would we ever want to remove the exports? To prevent
> accidental pickup of *FLAGS from the env?
Because they will be useless and induce different behaviour between a raw
debian/rules call and dpkg-buildpackage.
> > CFLAGS=$(shell dpkg-buildflags --get CFLAGS)
> Would it make sense to recommend:
> CFLAGS ?= $(shell dpkg-buildflags --get CFLAGS)
IMO no, because we don't want to pickup a value from the environment. If
the user want to alter the flags used by the current build, he should use
the interface offered by dpkg-buildflags (i.e. DEB_CFLAGS_SET/APPEND).
> Or perhaps:
> DEB_CFLAGS_SET ?= $(shell dpkg-buildflags --get CFLAGS)
> ./configure CFLAGS="$(DEB_CFLAGS_SET)"
> I see that's not in the man page, not sure it would make sense in
> policy either.
This definitely not, DEB_CFLAGS_SET is for the user not for the maintainer.
Like what I do? Sponsor me: http://ouaza.com/wp/2010/01/05/5-years-of-freexian/
My Debian goals: http://ouaza.com/wp/2010/01/09/debian-related-goals-for-2010/