]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh
Always respect DEB_${flag}_{APPEND,SET} envvars.
[debhelper.git] / dh
diff --git a/dh b/dh
index 8d8c920a18d69e67854a8aa299098a4926e987d2..5ea6643ad33205b5cada9f410bfbeab78489e72a 100755 (executable)
--- 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.
@@ -278,6 +290,9 @@ options can override this behavior.
 A sequence can also run dependent targets in debian/rules.  For
 example, the "binary" sequence runs the "install" target.
 
+B<dh> sets environment variables listed by B<dpkg-buildflags>, unless
+they are already set. It supports DEB_BUILD_OPTIONS=noopt too.
+
 B<dh> uses the B<DH_INTERNAL_OPTIONS> environment variable to pass information
 through to debhelper commands that are run inside override targets. The
 contents (and indeed, existence) of this environment variable, as the name
@@ -315,7 +330,7 @@ init(options => {
        bundling => 0,
 );
 inhibit_log();
-
+set_buildflags();
 
 # If make is using a jobserver, but it is not available
 # to this process, clean out MAKEFLAGS. This avoids