summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorModestas Vainius <modax@debian.org>2011-06-19 23:53:14 +0300
committerJoey Hess <joey@kitenet.net>2011-06-19 18:01:32 -0400
commitfcfcd1298f6ea1fcfb2b2b5a529303270aa800d9 (patch)
treed6196eff0e4e54fb73edf5c771610d904aa0483b
parent1722a1bcfed9558cc438f3c0a1b9e024b46986cc (diff)
Always respect DEB_${flag}_{APPEND,SET} envvars.
Do that even when dpkg-buildpackage modifies environment variables. Also document DEB_${flag}_{APPEND,SET} as recommended way to override standard build flags.
-rw-r--r--Debian/Debhelper/Dh_Lib.pm2
-rw-r--r--debian/changelog4
-rwxr-xr-xdh12
-rwxr-xr-xdh_auto_build5
-rwxr-xr-xdh_auto_configure5
5 files changed, 26 insertions, 2 deletions
diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index 174970b..86f729a 100644
--- a/Debian/Debhelper/Dh_Lib.pm
+++ b/Debian/Debhelper/Dh_Lib.pm
@@ -917,7 +917,7 @@ sub set_buildflags {
$buildflags->load_config();
foreach my $flag ($buildflags->list()) {
next unless $flag =~ /^[A-Z]/; # Skip flags starting with lowercase
- if (! exists $ENV{$flag}) {
+ if (! exists $ENV{$flag} || $buildflags->get_origin($flag) eq "env") {
$ENV{$flag} = $buildflags->get($flag);
}
}
diff --git a/debian/changelog b/debian/changelog
index 3be2eda..743daa0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -12,7 +12,9 @@ debhelper (8.1.7) UNRELEASED; urgency=low
in --libexecdir when using autoconf. Closes: #541458
* dh_auto_build, dh_auto_configure, dh: Set environment variables
listed by dpkg-buildflags --export. Any environment variables that
- are already set to other values will not be changed.
+ are already set to other values will not be changed unless
+ appropriate DEB_${flag}_{APPEND,SET} environment variables are also
+ set (see dpkg-buildflags(1)).
Closes: #544844
* Correct docs about multiarch and v9. Closes: #630826
diff --git a/dh b/dh
index aba8c27..5ea6643 100755
--- a/dh
+++ b/dh
@@ -193,6 +193,18 @@ sequence addons like this:
%:
dh $@ --with quilt
+In order to override standard build flags, export appropriate environment
+variables as documented in the L<dpkg-buildflags(1)> manual page. They will be
+preferred over directly exported their counterparts (CFLAGS, CXXFLAGS, LDFLAGS
+etc.). For example, to append -Wall to the standard CFLAGS and CXXFLAGS, use:
+
+ #!/usr/bin/make -f
+ export DEB_CFLAGS_APPEND = -Wall
+ export DEB_CXXFLAGS_APPEND = -Wall
+
+ %:
+ dh $@
+
Here is an example of overriding where the B<dh_auto_>I<*> commands find
the package's source, for a package where the source is located in a
subdirectory.
diff --git a/dh_auto_build b/dh_auto_build
index dccd04a..77b55ee 100755
--- a/dh_auto_build
+++ b/dh_auto_build
@@ -25,6 +25,11 @@ This is intended to work for about 90% of packages. If it doesn't work,
you're encouraged to skip using B<dh_auto_build> at all, and just run the
build process manually.
+In order to override standard build flags, export appropriate environment
+variables as documented in the L<dpkg-buildflags(1)> manual page. They will be
+preferred over directly exported their counterparts (CFLAGS, CXXFLAGS, LDFLAGS
+etc.).
+
=head1 OPTIONS
See L<debhelper(7)/B<BUILD SYSTEM OPTIONS>> for a list of common build
diff --git a/dh_auto_configure b/dh_auto_configure
index daf5ed0..f08c0f6 100755
--- a/dh_auto_configure
+++ b/dh_auto_configure
@@ -28,6 +28,11 @@ This is intended to work for about 90% of packages. If it doesn't work,
you're encouraged to skip using B<dh_auto_configure> at all, and just run
F<./configure> or its equivalent manually.
+In order to override standard build flags, export appropriate environment
+variables as documented in the L<dpkg-buildflags(1)> manual page. They will be
+preferred over directly exported their counterparts (CFLAGS, CXXFLAGS, LDFLAGS
+etc.).
+
=head1 OPTIONS
See L<debhelper(7)/B<BUILD SYSTEM OPTIONS>> for a list of common build