]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Support parallel make check with GNU make 4.2+
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Tue, 7 Aug 2018 11:20:40 +0000 (13:20 +0200)
committerRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Tue, 7 Aug 2018 11:20:40 +0000 (13:20 +0200)
I noticed that make -jN check would run make check-single when using GNU
make 4.2.1.

In the end, it turned out that this is due to this change from the make
4.2 NEWS file:

* The amount of parallelism can be determined by querying MAKEFLAGS, even when
  the job server is enabled (previously MAKEFLAGS would always contain only
  "-j", with no number, when job server was enabled).

The fix is trivial: just accept an optional arg to -j in Makefile.in
(saw_dash_j).  Tested on i386-pc-solaris2.11 with just make and make
-j/-jN with both make 3.82 and 4.2.1.

* Makefile.in (saw_dash_j): Allow for GNU make 4.2+ passing -jN in
MAKEFLAGS.

gdb/testsuite/ChangeLog
gdb/testsuite/Makefile.in

index 3ec7580b97a5e64301a34b34d3492920763c027f..f86e8fb27414f9aa24bfbc81add313ab11f3b59e 100644 (file)
@@ -1,3 +1,8 @@
+2018-08-07  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * Makefile.in (saw_dash_j): Allow for GNU make 4.2+ passing -jN in
+       MAKEFLAGS.
+
 2018-08-06  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * dg-extract-results.sh: Move to toplevel contrib.
index c8e37496f44ee3d8e64001c1f6a1ca5180e20556..f669a3c44580f082ff0caf4b6eb4d9922a00b037 100644 (file)
@@ -137,10 +137,11 @@ $(abs_builddir)/site.exp site.exp: ./config.status Makefile
 
 installcheck:
 
-# See whether -j was given to make.  Either it was given with no
-# arguments, and appears as "j" in the first word, or it was given an
-# argument and appears as "-j" in a separate word.
-saw_dash_j = $(or $(findstring j,$(firstword $(MAKEFLAGS))),$(filter -j,$(MAKEFLAGS)))
+# See whether -j was given to make.  Before GNU make 4.2, either it was
+# given with no arguments, and appears as "j" in the first word, or it was
+# given an argument and appears as "-j" in a separate word.  Starting with
+# GNU make 4.2, it always appears as "-j"/"-jN" in a separate word.
+saw_dash_j = $(or $(findstring j,$(firstword $(MAKEFLAGS))),$(filter -j%,$(MAKEFLAGS)))
 
 # Try to run the tests in parallel if any -j option is given.  If RUNTESTFLAGS
 # is not empty, then by default the tests will be serialized.  This can be