[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

dpkg-buildflags and makefile snippet



On Tue, 26 Jul 2011, Raphael Hertzog wrote:
> We evaluated how dpkg-buildflags can be used for this. For most
> autoconf/automake-based build systems there are	2 ways to inject flags:
> 1/ On the ./configure command line:
> ./configure --with-foo CFLAGS="..." LDFLAGS="..." ...
> 2/ In the environment
> 
> The first form seem to be preferred but both approaches work and should be
> properly supported. However dpkg-buildflags does not easily support the
> former approach. This is something that should be fixed.

Just for reference, in the discussion I mentionned that dpkg would start
providing a makefile snippet that helps retrieving the correct value of
all the build flags, you can see it here:
http://anonscm.debian.org/gitweb/?p=dpkg/dpkg.git;a=commitdiff;h=b858e07bddec28c5b86c39d425a02f08d9bd205a

Maintainers who thus want to follow the approach where build flags are
exported in the environment will thus be able to do:
---
DPKG_EXPORT_BUILDFLAGS = yes
include /usr/share/dpkg/default.mk
---

If they just have to feed the flags in some non-standard way that doesn't
require exporting variables in the environment, they can drop the
DPKG_EXPORT_BUILDFLAGS line and just use $(CFLAGS), $(LDFLAGS), etc. where
appropriate.

If you have comments, concerns, feel free to share them but I personally
don't see any incompatibility here with the suggested approach (except
maybe that we don't want to use := but = so that dpkg-buildflags is
actually called multiple times if the variables are used multiple times,
just in case the environment variables influencing dpkg-buildflags have
changed).

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Follow my Debian News ▶ http://RaphaelHertzog.com (English)
                      ▶ http://RaphaelHertzog.fr (Français)


Reply to: