GNU bug report logs - #14313
[PATCH 4/7] header-vars: simplify how make flags are determined

Previous Next

Package: automake;

Reported by: Stefano Lattarini <stefano.lattarini <at> gmail.com>

Date: Mon, 29 Apr 2013 21:02:05 UTC

Severity: normal

Tags: notabug, patch

Merged with 14309, 14310, 14311, 14312, 14314, 14315, 14316

Done: Stefano Lattarini <stefano.lattarini <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 14313 in the body.
You can then email your comments to 14313 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-automake <at> gnu.org:
bug#14313; Package automake. (Mon, 29 Apr 2013 21:02:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefano Lattarini <stefano.lattarini <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-automake <at> gnu.org. (Mon, 29 Apr 2013 21:02:05 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stefano Lattarini <stefano.lattarini <at> gmail.com>
To: automake-patches <at> gnu.org
Cc: mdaniels <at> rim.com, bug-automake <at> gnu.org, 12554 <at> debbugs.gnu.org
Subject: [PATCH 4/7] header-vars: simplify how make flags are determined
Date: Mon, 29 Apr 2013 23:00:32 +0200
Actually, son far only the '-n' option ("dry mode") was detected,
but this change will allow us to soon detect more options.

* lib/am/header-vars.am (am__running_with_option): Even when $MAKEFLAGS
appears to contain definition of variables with embedded whitespace,
use simple textual pre-processing over $MAKEFLAGS rather than tricky
recursive invocations of make to determine whether the '-n' option was
given.  This is enough to correctly handle all the tricky usages covered
in the testsuite.
* t/nodep.sh: Adjust to avoid a spurious failure.

Signed-off-by: Stefano Lattarini <stefano.lattarini <at> gmail.com>
---
 lib/am/header-vars.am | 45 +++++++++++++++++++++++++--------------------
 t/nodep.sh            |  6 ++++--
 2 files changed, 29 insertions(+), 22 deletions(-)

diff --git a/lib/am/header-vars.am b/lib/am/header-vars.am
index 8426dcb..c0a5f0c 100644
--- a/lib/am/header-vars.am
+++ b/lib/am/header-vars.am
@@ -40,7 +40,7 @@ am__make_running_with_option = \
     case $${am__target_option-} in \
         n) ;; \
         *) echo "am__make_running_with_option: internal error: invalid" \
-	        "target option '$${am__target_option-}' specified" >&2; \
+                "target option '$${am__target_option-}' specified" >&2; \
            exit 1;; \
     esac; \
     am__has_opt=no; \
@@ -54,8 +54,8 @@ am__make_running_with_option = \
         esac; \
       done; \
     else \
-## Non-GNU make: we must rely on $(MAKEFLAGS).  This is tricky and brittle,
-## but is the best we can do.
+## Non-GNU make: we must rely on $(MAKEFLAGS).  This is tricker and more
+## brittle, but is the best we can do.
       case $$MAKEFLAGS in \
 ## If we run "make TESTS='snooze nap'", FreeBSD make will export MAKEFLAGS
 ## to " TESTS=foo\ nap", so that the simpler loop below (on word-splitted
@@ -63,25 +63,30 @@ am__make_running_with_option = \
 ## misinterpret that as and indication that make is running in dry mode.
 ## This has already happened in practice.  So we need this unpleasant hack.
          *\\[\ \	]*) \
-           echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-             | grep '^AM OK$$' >/dev/null || am__has_opt=yes ;; \
+## Extra indirection with ${am__bs} required by FreeBSD 8.x make.
+## Not sure why (so sorry for the cargo-cult programming here).
+           am__bs=\\; \
+           am__flags=`printf '%s\n' "$$MAKEFLAGS" \
+            | sed "s/$$am__bs$$am__bs[$$am__bs $$am__bs	]*//g"`;; \
          *) \
-	   am__skip_next=no; \
-           for am__flg in $$MAKEFLAGS; do \
-	     if test $$am__skip_next = yes; then \
-	       am__skip_next=no; \
-	       continue; \
-	     fi; \
-             case $$am__flg in \
-               *=*|--*) ;; \
-## Quite ugly special-casing.  We might need other similar, but let's
-## wait until the need arises.
-	       -I) am__skip_next=yes;; \
-               *$$am__target_option*) am__has_opt=yes; break;; \
-             esac; \
-           done ;;\
-       esac; \
+           am__flags=$$MAKEFLAGS;; \
+      esac; \
+      am__skip_next=no; \
+      for am__flg in $$am__flags; do \
+        if test $$am__skip_next = yes; then \
+          am__skip_next=no; \
+          continue; \
+        fi; \
+        case $$am__flg in \
+          *=*|--*) ;; \
+## Quite ugly special-casing.  We might need other similar ones actually,
+## but let's wait until the need arises.
+          -I) am__skip_next=yes;; \
+          *$$am__target_option*) am__has_opt=yes; break;; \
+        esac; \
+      done;\
     fi; \
+    unset am__skip_next am__flg am__flags am__target_option; \
     test $$am__has_opt = yes; \
   }
 
diff --git a/t/nodep.sh b/t/nodep.sh
index c36405d..b0b29f6 100755
--- a/t/nodep.sh
+++ b/t/nodep.sh
@@ -36,5 +36,7 @@ mkdir x
 $ACLOCAL
 $AUTOMAKE
 
-grep '%' Makefile.in && exit 1
-exit 0
+sed 's/printf .*%s//' Makefile.in > Makefile.tmp
+grep '%' Makefile.tmp && exit 1
+
+:
-- 
1.8.2.1.610.g562af5b





Forcibly Merged 14310 14311 14312 14313 14315. Request was from Stefano Lattarini <stefano.lattarini <at> gmail.com> to control <at> debbugs.gnu.org. (Mon, 29 Apr 2013 21:10:03 GMT) Full text and rfc822 format available.

Forcibly Merged 14310 14311 14312 14313 14314 14315. Request was from Stefano Lattarini <stefano.lattarini <at> gmail.com> to control <at> debbugs.gnu.org. (Mon, 29 Apr 2013 21:10:03 GMT) Full text and rfc822 format available.

Forcibly Merged 14310 14311 14312 14313 14314 14315 14316. Request was from Stefano Lattarini <stefano.lattarini <at> gmail.com> to control <at> debbugs.gnu.org. (Mon, 29 Apr 2013 21:10:03 GMT) Full text and rfc822 format available.

Forcibly Merged 14309 14310 14311 14312 14313 14314 14315 14316. Request was from Stefano Lattarini <stefano.lattarini <at> gmail.com> to control <at> debbugs.gnu.org. (Mon, 29 Apr 2013 21:14:01 GMT) Full text and rfc822 format available.

Forcibly Merged 14309 14310 14311 14312 14313 14314 14315 14316. Request was from Stefano Lattarini <stefano.lattarini <at> gmail.com> to control <at> debbugs.gnu.org. (Mon, 29 Apr 2013 21:14:02 GMT) Full text and rfc822 format available.

Forcibly Merged 14309 14310 14311 14312 14313 14314 14315 14316. Request was from Stefano Lattarini <stefano.lattarini <at> gmail.com> to control <at> debbugs.gnu.org. (Mon, 29 Apr 2013 21:14:02 GMT) Full text and rfc822 format available.

Forcibly Merged 14309 14310 14311 14312 14313 14314 14315 14316. Request was from Stefano Lattarini <stefano.lattarini <at> gmail.com> to control <at> debbugs.gnu.org. (Mon, 29 Apr 2013 21:14:02 GMT) Full text and rfc822 format available.

Forcibly Merged 14309 14310 14311 14312 14313 14314 14315 14316. Request was from Stefano Lattarini <stefano.lattarini <at> gmail.com> to control <at> debbugs.gnu.org. (Mon, 29 Apr 2013 21:14:02 GMT) Full text and rfc822 format available.

Forcibly Merged 14309 14310 14311 14312 14313 14314 14315 14316. Request was from Stefano Lattarini <stefano.lattarini <at> gmail.com> to control <at> debbugs.gnu.org. (Mon, 29 Apr 2013 21:14:02 GMT) Full text and rfc822 format available.

Forcibly Merged 14309 14310 14311 14312 14313 14314 14315 14316. Request was from Stefano Lattarini <stefano.lattarini <at> gmail.com> to control <at> debbugs.gnu.org. (Mon, 29 Apr 2013 21:14:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-automake <at> gnu.org:
bug#14313; Package automake. (Mon, 29 Apr 2013 21:19:04 GMT) Full text and rfc822 format available.

Message #28 received at 14313 <at> debbugs.gnu.org (full text, mbox):

From: Stefano Lattarini <stefano.lattarini <at> gmail.com>
To: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Subject: Spurious bug report, ignore
Date: Mon, 29 Apr 2013 23:17:39 +0200
Oops, erroneously created while dealing with bug#12254.  Please ignore,
and sorry for the noise,

  Stefano




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 30 May 2013 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 24 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.