$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);
}
}
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
%:
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.
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
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