[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:

Maintainers who thus want to follow the approach where build flags are
exported in the environment will thus be able to do:
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

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

Raphaël Hertzog ◈ Debian Developer

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

Reply to: