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=b858e07bddec28c5b86c39d425 a02f08d9bd205a 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) -- To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org Archive: 20110726225504.GA10306@rivendell.home.ouaza.com">h ttp://lists.debian.org/20110726225504.GA10306@rivendell.home.ouaza.com |
dpkg-buildflags and makefile snippet
On Wed, Jul 27, 2011 at 12:55:04AM +0200, Raphael Hertzog wrote:
> 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=b858e07bddec28c5b86c39d425 a02f08d9bd205a > 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 > --- For the record, I'll repeat here the view expressed at the meeting (which I recall being shared by Bdale and Ian): I don't think dpkg should be exposing such an interface at all. We don't want to encourage the use of makefile includes for such things. -- Steve Langasek Give me a lever long enough and a Free OS Debian Developer to set it on, and I can move the world. Ubuntu Developer http://www.debian.org/ slangasek@ubuntu.com vorlon@debian.org -- To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org Archive: 20110730161305.GB30850@virgil.dodds.net">http://lists.debian.org/20110730161305.GB30850@virgil.dodds.net |
dpkg-buildflags and makefile snippet
On Wed, Jul 27, 2011 at 12:55:04AM +0200, Raphael Hertzog wrote:
> 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=b858e07bddec28c5b86c39d425 a02f08d9bd205a While I wholeheartly welcome adding such a script, I am surprised why it is made so complicated and hard to read. Is there a reason for dpkg_late_eval? And why all the ?= in scripts/mk/architecture.mk? Why not simply CFLAGS := $(shell dpkg-buildflags --get CFLAGS) and so on in buildflags.mk and DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH) and so on in architecture.mk? Bernhard R. Link -- To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org Archive: 20110731115549.GA21273@pcpool00.mathematik.uni-freiburg.de">http://lists.debian.org/20110731115549.GA21273@pcpool00.mathematik.uni-freiburg.de |
dpkg-buildflags and makefile snippet
Hi,
On Sun, 31 Jul 2011, Bernhard R. Link wrote: > While I wholeheartly welcome adding such a script, I am surprised why > it is made so complicated and hard to read. > > Is there a reason for dpkg_late_eval? Performance. If the variables are not used, there's no subprocess executed. And once it has been executed, the value is kept (i.e. no multiple executions either). > And why all the ?= in scripts/mk/architecture.mk? Because we need to respect the value in the environment if they are set. dpkg-builpackage does set them to non-standard values if you pass it the -a and/or -t option. Cheers, -- Raphaël Hertzog ◈ Debian Developer Follow my Debian News ▶ http://RaphaelHertzog.com (English) ▶ http://RaphaelHertzog.fr (Français) -- To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org Archive: 20110801065758.GI4573@rivendell.home.ouaza.com">ht tp://lists.debian.org/20110801065758.GI4573@rivendell.home.ouaza.com |
dpkg-buildflags and makefile snippet
* Raphael Hertzog <hertzog@debian.org> [110801 08:58]:
> On Sun, 31 Jul 2011, Bernhard R. Link wrote: > > While I wholeheartly welcome adding such a script, I am surprised why > > it is made so complicated and hard to read. > > > > Is there a reason for dpkg_late_eval? > > Performance. If the variables are not used, there's no subprocess > executed. Is that tiny constant amount worth having files not readable by the majority of people, even of DDs. > And once it has been executed, the value is kept (i.e. no > multiple executions either). := is already doing that. > > And why all the ?= in scripts/mk/architecture.mk? > > Because we need to respect the value in the environment if they are set. > dpkg-builpackage does set them to non-standard values if you pass it the > -a and/or -t option. dpkg-architecture already respects the environment, make does not override values given on the command line. So the only thing this should protect against is if they are not in the environment but set in debian/rules as makefile variables before including this snipped. (Something I see no value in and if someone wants something like that they can just set it after including it). Bernhard R. Link -- To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org Archive: 20110801083940.GA28423@pcpool00.mathematik.uni-freiburg.de">http://lists.debian.org/20110801083940.GA28423@pcpool00.mathematik.uni-freiburg.de |
dpkg-buildflags and makefile snippet
(Are you subscribed to debian-dpkg? Because mail-followup-to drops you
and yet you did not reply to my initial -dpkg mail where I asked for feedback but only to the one who was copied to -ctte) On Mon, 01 Aug 2011, Bernhard R. Link wrote: > > Performance. If the variables are not used, there's no subprocess > > executed. > > Is that tiny constant amount worth having files not readable by the > majority of people, even of DDs. Yes, try it. Execute the perl interpreters several dozen of times, it's noticable. There's documentation of what the variables are, it should be more than enough IMO. If not, let's fix the documentation above. > > And once it has been executed, the value is kept (i.e. no > > multiple executions either). > > := is already doing that. I know, but with := it's always executed even when not used. > > Because we need to respect the value in the environment if they are set. > > dpkg-builpackage does set them to non-standard values if you pass it the > > -a and/or -t option. > > dpkg-architecture already respects the environment, > make does not override values given on the command line. True, but then I'm just reusing the snippet recommended by the dpkg-architecture manual page and thus one idiom that is widely used in debian/rules. And again using ?= avoids calling dpkg-architecture 18 times if the variables are already set. And this is noticable. Cheers, -- Raphaël Hertzog ◈ Debian Developer Follow my Debian News ▶ http://RaphaelHertzog.com (English) ▶ http://RaphaelHertzog.fr (Français) -- To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org Archive: 20110801092748.GA24292@rivendell.home.ouaza.com">h ttp://lists.debian.org/20110801092748.GA24292@rivendell.home.ouaza.com |
| All times are GMT. The time now is 04:55 AM. |
VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.