From: Stefano Lattarini Date: Thu, 2 May 2013 17:41:24 +0000 (+0200) Subject: make flags analysis: be more robust X-Git-Tag: v1.13.1d~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b62616b3bc7dfcd1b260b0369ecf0d67eef3d00e;p=platform%2Fupstream%2Fautomake.git make flags analysis: be more robust 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 --- diff --git a/lib/am/header-vars.am b/lib/am/header-vars.am index 64d014ca2..72a187797 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;\