In particular, catering to option-with-argument bundled together with options-without-arguments, as in:
# With GNU make 3.82: $ make -f- <<<'all:; echo "$$MFLAGS"' -s -k -I none -skiI none # With development version of GNU make (Git commit b5ea49b): $ make -f- <<<'all:; @echo "$$MFLAGS"' -I none -skiI none This fixes some lingering failures in the testsuite; precisely, in tests 'make-dryrun.tap' and 'make-keepgoing.tap'. * t/header-vars.am (am__make_running_with_option): Enhance. Signed-off-by: Stefano Lattarini <stefano.lattar...@gmail.com> --- lib/am/header-vars.am | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/am/header-vars.am b/lib/am/header-vars.am index 64d014c..72a1877 100644 --- a/lib/am/header-vars.am +++ b/lib/am/header-vars.am @@ -67,20 +67,26 @@ am__make_running_with_option = \ esac; \ fi; \ am__skip_next=no; \ + am__strip_trailopt () \ + { \ + am__flg=`printf '%s\n' "$$am__flg" | sed "s/$$1.*$$//"`; \ + }; \ for am__flg in $$am__flags; do \ if test $$am__skip_next = yes; then \ am__skip_next=no; \ continue; \ fi; \ case $$am__flg in \ - *=*|--*) ;; \ + *=*|--*) continue;; \ ## GNU make 3.83 has changed the format of $MFLAGS, and removed the space ## between an option and its argument (e.g., from "-I dir" to "-Idir"). ## So we need to handle both formats. ## TODO: we might need to handle similar other cases as well; but let's -## wait until the need arises. - -I) am__skip_next=yes;; \ - -I*) continue;; \ +## wait until the need arises. + -*I) am__strip_trailopt 'I'; am__skip_next=yes;; \ + -*I?*) am__strip_trailopt 'I';; \ + esac; \ + case $$am__flg in \ *$$am__target_option*) am__has_opt=yes; break;; \ esac; \ done;\ -- 1.8.3.rc0.19.g7e6a0cc