[debhelper-devel] [Git][debian/debhelper][master] makefile: Pass -O to make with -jX

Niels Thykier gitlab at salsa.debian.org
Sun Feb 18 08:07:46 UTC 2018


Niels Thykier pushed to branch master at Debian / debhelper


Commits:
f8d7a6ea by Niels Thykier at 2018-02-18T08:05:55+00:00
makefile: Pass -O to make with -jX

Signed-off-by: Niels Thykier <niels at thykier.net>

- - - - -


3 changed files:

- debian/changelog
- debian/control
- lib/Debian/Debhelper/Buildsystem/makefile.pm


Changes:

=====================================
debian/changelog
=====================================
--- a/debian/changelog
+++ b/debian/changelog
@@ -16,6 +16,9 @@ debhelper (11.1.5) UNRELEASED; urgency=medium
     is needed or not.  However, the warning remains for calling
     dh_testroot outside the source root (as we may need to check
     the compat level in a future version of debhelper).
+  * makefile.pm: Synchronize output from make (via -O) when
+    make runs in parallel.  Thanks to Goswin von Brederlow for
+    the suggestion.  (Closes: #768791)
 
  -- Niels Thykier <niels at thykier.net>  Sun, 04 Feb 2018 18:03:34 +0000
 


=====================================
debian/control
=====================================
--- a/debian/control
+++ b/debian/control
@@ -30,6 +30,9 @@ Depends: autotools-dev,
          dpkg-dev (>= 1.19.0.5~),
          file (>= 3.23),
          libdpkg-perl (>= 1.17.14),
+# makefile.pm uses -O which according to #768791 requires make (>= 4~).
+# The -O is an aid to maintainers, debhelper works perfectly fine without it.
+         make (>= 4~),
          man-db,
          po-debconf,
          ${misc:Depends},


=====================================
lib/Debian/Debhelper/Buildsystem/makefile.pm
=====================================
--- a/lib/Debian/Debhelper/Buildsystem/makefile.pm
+++ b/lib/Debian/Debhelper/Buildsystem/makefile.pm
@@ -80,7 +80,15 @@ sub do_make {
 	clean_jobserver_makeflags();
 
 	# Note that this will override any -j settings in MAKEFLAGS.
-	unshift @_, "-j" . ($this->get_parallel() > 0 ? $this->get_parallel() : "");
+	my $parallel = $this->get_parallel();
+	if ($parallel == 0 or $parallel > 1) {
+		# We have to use the empty string for "unlimited"
+		$parallel = '' if $parallel == 0;
+		# -O is for synchronizing the output.
+		unshift(@_, "-j${parallel}", '-O');
+	} else {
+		unshift(@_, '-j1');
+	}
 
 	my @root_cmd;
 	if (exists($this->{_run_make_as_root}) and $this->{_run_make_as_root}) {



View it on GitLab: https://salsa.debian.org/debian/debhelper/commit/f8d7a6ead49e747430124bcea4b55ba05157d4b4

---
View it on GitLab: https://salsa.debian.org/debian/debhelper/commit/f8d7a6ead49e747430124bcea4b55ba05157d4b4
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/debhelper-devel/attachments/20180218/9c802638/attachment-0001.html>


More information about the debhelper-devel mailing list