[PATCH, testsuite]: Fix detection of -j make argument
Uros Bizjak
ubizjak@gmail.com
Tue Nov 22 12:25:00 GMT 2016
Hello!
New makes (e.g. GNU Make 4.2.1) pass -j argument in MFLAGS is a
different way. While older makes pass only "-j", newer makes pass e.g.
"-j4" when -j is specified on the command line. The detection of "-j"
make argument doesn't work in the later case.
Attached patch reworks this functionality to detect -j correctly in all cases.
gcc/ChangeLog
2016-11-22 Uros Bizjak <ubizjak@gmail.com>
* Makefile.in ($(lang_checks_parallelized)): Fix detection
of -j argument.
gcc/ada/ChangeLog
2016-11-22 Uros Bizjak <ubizjak@gmail.com>
* gcc-interface/Make-lang.in (check-acats): Fix detection
of -j argument.
libstdc++-v3/ChangeLog
2016-11-22 Uros Bizjak <ubizjak@gmail.com>
* testsuite/Makefile.am
(check-DEJAGNU $(check_DEJAGNU_normal_targets)):Fix detection
of -j argument.
* testsuite/Makefile.in: Regenereate.
Patch was bootstrapped and regression tested on x86_64-linux-gnu with
"GNU Make 4.2.1" and "GNU Make 3.81". Ada was not checked, but the
change is consistent with other changes.
OK for mainline SVN and release branches?
Uros.
-------------- next part --------------
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 7ecd1e4..d1acede 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -3914,7 +3914,7 @@ check_p_subdirs=$(wordlist 1,$(check_p_count),$(wordlist 1, \
# testsuites like objc or go.
$(lang_checks_parallelized): check-% : site.exp
-rm -rf $(TESTSUITEDIR)/$*-parallel
- @if [ "$(filter -j, $(MFLAGS))" = "-j" ]; then \
+ @if [ -n "$(filter -j%, $(MFLAGS))" ]; then \
test -d $(TESTSUITEDIR) || mkdir $(TESTSUITEDIR) || true; \
test -d $(TESTSUITEDIR)/$*-parallel || mkdir $(TESTSUITEDIR)/$*-parallel || true; \
GCC_RUNTEST_PARALLELIZE_DIR=`${PWD_COMMAND}`/$(TESTSUITEDIR)/$(check_p_tool)-parallel ; \
diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in
index b5d1f0e..eb0489b 100644
--- a/gcc/ada/gcc-interface/Make-lang.in
+++ b/gcc/ada/gcc-interface/Make-lang.in
@@ -890,7 +890,7 @@ check-acats:
@test -d $(ACATSDIR) || mkdir -p $(ACATSDIR); \
rootme=`${PWD_COMMAND}`; export rootme; \
EXPECT=$(EXPECT); export EXPECT; \
- if [ -z "$(CHAPTERS)" ] && [ "$(filter -j, $(MFLAGS))" = "-j" ]; \
+ if [ -z "$(CHAPTERS)" ] && [ -n "$(filter -j%, $(MFLAGS))" ]; \
then \
rm -rf $(ACATSDIR)-parallel; \
mkdir $(ACATSDIR)-parallel; \
diff --git a/libstdc++-v3/testsuite/Makefile.am b/libstdc++-v3/testsuite/Makefile.am
index af57d0b..65848f0 100644
--- a/libstdc++-v3/testsuite/Makefile.am
+++ b/libstdc++-v3/testsuite/Makefile.am
@@ -117,7 +117,7 @@ $(check_DEJAGNU_normal_targets): check-DEJAGNUnormal%: normal%/site.exp
check-DEJAGNU $(check_DEJAGNU_normal_targets): check-DEJAGNU%: site.exp
$(if $*,@)AR="$(AR)"; export AR; \
RANLIB="$(RANLIB)"; export RANLIB; \
- if [ -z "$*" ] && [ "$(filter -j, $(MFLAGS))" = "-j" ]; then \
+ if [ -z "$*" ] && [ -n "$(filter -j%, $(MFLAGS))" ]; then \
rm -rf normal-parallel || true; \
mkdir normal-parallel; \
$(MAKE) $(AM_MAKEFLAGS) $(check_DEJAGNU_normal_targets); \
diff --git a/libstdc++-v3/testsuite/Makefile.in b/libstdc++-v3/testsuite/Makefile.in
index b37758b..1cdf4b8 100644
--- a/libstdc++-v3/testsuite/Makefile.in
+++ b/libstdc++-v3/testsuite/Makefile.in
@@ -598,7 +598,7 @@ $(check_DEJAGNU_normal_targets): check-DEJAGNUnormal%: normal%/site.exp
check-DEJAGNU $(check_DEJAGNU_normal_targets): check-DEJAGNU%: site.exp
$(if $*,@)AR="$(AR)"; export AR; \
RANLIB="$(RANLIB)"; export RANLIB; \
- if [ -z "$*" ] && [ "$(filter -j, $(MFLAGS))" = "-j" ]; then \
+ if [ -z "$*" ] && [ -n "$(filter -j%, $(MFLAGS))" ]; then \
rm -rf normal-parallel || true; \
mkdir normal-parallel; \
$(MAKE) $(AM_MAKEFLAGS) $(check_DEJAGNU_normal_targets); \
More information about the Libstdc++
mailing list