automake-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-commit] [SCM] GNU Automake branch, master, updated. v1.13.1b-2


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, master, updated. v1.13.1b-220-ge2fd8f5
Date: Sat, 04 May 2013 11:56:00 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=e2fd8f5c0c90d9894713e34be7ae8e8774c471da

The branch, master has been updated
       via  e2fd8f5c0c90d9894713e34be7ae8e8774c471da (commit)
       via  2d3a2e36b595cd740894823d060e31c6c483f569 (commit)
       via  f5f75eef28a32493258047eb3060478395a42120 (commit)
       via  b993a265e6af722c2d4cea69d1782ffde33d6d80 (commit)
       via  eddba1ccc124aaed5a613260b259f73e2aedf825 (commit)
       via  dc3cdb1d53c51c95981dbf77b05f70e4040075b9 (commit)
       via  57925b6707d9d6ae0afe92539b019bdd3c062305 (commit)
       via  1adb0570cb5badd8bb569d2d243fcedd103f0b94 (commit)
       via  6d643e93182d50d236ccfeacffad55576cf51d99 (commit)
       via  5c4aaae2b0978ebdc1e1bf950917b82e6f7ad8d5 (commit)
       via  b62616b3bc7dfcd1b260b0369ecf0d67eef3d00e (commit)
       via  c93bc3d4e6d12068f0d9b32b67ec63b3ca3313bd (commit)
       via  7aa99186d1c5fb31d3fd39beb129fc4cb44f2c7c (commit)
       via  d017b54baba7d6eadab6394da6ee62f0a83b1238 (commit)
       via  e242b44eedb39afa0dbd72a74f56b2863c2aaf55 (commit)
       via  425fe1e87a78985c0d51ebb185793e57cdd433da (commit)
       via  d432f067fb1569c4127b86c8d7e157e3687115f2 (commit)
       via  e5e3a629e01c7642a46217817c32cfa86e9bd708 (commit)
       via  6d3ffeb90d64fe060c8ce6aa57b1cc69321bf994 (commit)
       via  8430d41254e03ff3d79f682b4abab6c967db633d (commit)
       via  5a29f7aa6fdc2aa1cb8fccfc917dbd5f579c1e7b (commit)
       via  02ead48eb3043b1cfa9eb8072d8270cf5cc66c84 (commit)
       via  69f7791509c523fe8b199a432b72dca6a5ce3caa (commit)
       via  e432b0d3f7deffd3468e7b32ab6760bc7f3148f2 (commit)
       via  c97218a54271bdcc59a0a7b67704feb5344b89d9 (commit)
       via  6eedee4c85c9817e46ed3de9df912ebe0fc9baa4 (commit)
       via  cbf23cebcb8fdeb02b5a69a6741af2507d3ded57 (commit)
      from  d90001e3a90ea37fe6866120eb96be7bed8ba66c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit e2fd8f5c0c90d9894713e34be7ae8e8774c471da
Merge: d90001e 2d3a2e3
Author: Stefano Lattarini <address@hidden>
Date:   Sat May 4 12:11:40 2013 +0200

    Merge branch 'maint'
    
    * maint:
      maint: targets and recipes to simplify testing on real-world packages
      build: preparatory refactoring
      build: tiny reduction in code duplication
      make flags analysis: handle more options with args
      make flags analysis: use simpler variable names
      make flags analysis: whitespace changes
      make flags analysis: embed in a subshell
      make flags analysis: be more robust
      make flags analysis: cater to GNU make 3.83 (still unreleased as of now)
      tests: expose weaknesses in make flags analysis
      tests: improve debugging output in checks on make flags analysis
      make flags analysis: refactor, to reduce code duplication
      tests: avoid one tricky use of "make -e"
      cosmetics: remove few trailing whitespace occurrences
      typofix: in NEWS (extra whitespace)
      tests: avoid a spurious error with Solaris make
      subdirs: don't return false positives for the '-k' option's presence
      header-vars: recognize more make flags ('-k' in particular)
      header-vars: simplify how make flags are determined
      tests: remove dead code from t/make-dryrun.tap
      header-vars: new variable $(am__running_with_option)
      tests: expose bug#12554 (false positives for presence of '-k' make option)

-----------------------------------------------------------------------

Summary of changes:
 Makefile.am                    |   33 ++++++----
 NEWS                           |    2 +-
 THANKS                         |    1 +
 lib/am/header-vars.am          |  120 ++++++++++++++++++++++-------------
 lib/am/subdirs.am              |   13 ++--
 m4/tar.m4                      |    2 +-
 maintainer/maint.mk            |   97 +++++++++++++++++++++++++++-
 t/cxx-lt-demo.sh               |    4 +-
 t/list-of-tests.mk             |    2 +
 t/make-dryrun.tap              |   42 +++++++------
 t/make-is-gnu.sh               |    2 +-
 t/make-keepgoing.tap           |  137 ++++++++++++++++++++++++++++++++++++++++
 t/nodep.sh                     |    6 +-
 t/subdir-keep-going-pr12554.sh |   70 ++++++++++++++++++++
 14 files changed, 439 insertions(+), 92 deletions(-)
 create mode 100755 t/make-keepgoing.tap
 create mode 100755 t/subdir-keep-going-pr12554.sh

diff --git a/Makefile.am b/Makefile.am
index e481726..3933497 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -72,6 +72,11 @@ EXTRA_DIST += \
   HACKING \
   PLANS
 
+# For some tests or targets, we need to have the just-build automake and
+# aclocal scripts avaiable on PATH.
+extend_PATH = \
+  { PATH='$(abs_builddir)/t/wrap'$(PATH_SEPARATOR)$$PATH && export PATH; }
+
 # Make versioned links.  We only run the transform on the root name;
 # then we make a versioned link with the transformed base name.  This
 # seemed like the most reasonable approach.
@@ -598,8 +603,7 @@ EXTRA_DIST += doc/help2man
 update_mans = \
   $(AM_V_GEN): \
     && $(MKDIR_P) doc \
-    && PATH="$(abs_builddir)/t/wrap$(PATH_SEPARATOR)$$PATH" \
-    && export PATH \
+    && $(extend_PATH) \
     && $(PERL) $(srcdir)/doc/help2man --output=$@
 
 doc/aclocal.1 doc/automake.1:
@@ -639,22 +643,25 @@ amhello_configury = \
 dist_noinst_DATA += $(amhello_sources)
 dist_doc_DATA = $(srcdir)/doc/amhello-1.0.tar.gz
 
+setup_autotools_paths = { \
+  $(extend_PATH) \
+    && ACLOCAL=aclocal-$(APIVERSION) && export ACLOCAL \
+    && AUTOMAKE=automake-$(APIVERSION) && export AUTOMAKE \
+    && AUTOCONF='$(am_AUTOCONF)' && export AUTOCONF \
+    && AUTOM4TE='$(am_AUTOM4TE)' && export AUTOM4TE \
+    && AUTORECONF='$(am_AUTORECONF)' && export AUTORECONF \
+    && AUTOHEADER='$(am_AUTOHEADER)' && export AUTOHEADER \
+    && AUTOUPDATE='$(am_AUTOUPDATE)' && export AUTOUPDATE \
+    && true; \
+}
+
 # We depend on configure.ac so that we regenerate the tarball
 # whenever the Automake version changes.
-# aclocal-$(APIVERSION) and automake-$(APIVERSION) are generated by
-# configure in 't/wrap'.
 $(srcdir)/doc/amhello-1.0.tar.gz: $(amhello_sources) $(srcdir)/configure.ac
        $(AM_V_GEN)tmp=amhello-output.tmp \
-         && PATH="$(abs_top_builddir)/t/wrap$(PATH_SEPARATOR)$$PATH" \
-         && export PATH \
          && $(am__cd) $(srcdir)/doc/amhello \
-         && ACLOCAL=aclocal-$(APIVERSION) && export ACLOCAL \
-         && AUTOMAKE=automake-$(APIVERSION) && export AUTOMAKE \
-         && AUTOCONF='$(am_AUTOCONF)' && export AUTOCONF \
-         && AUTOM4TE='$(am_AUTOM4TE)' && export AUTOM4TE \
-         && AUTORECONF='$(am_AUTORECONF)' && export AUTORECONF \
-         && AUTOHEADER='$(am_AUTOHEADER)' && export AUTOHEADER \
-         && AUTOUPDATE='$(am_AUTOUPDATE)' && export AUTOUPDATE \
+         && : Make our aclocal and automake avaiable before system ones. \
+         && $(setup_autotools_paths) \
          && ( \
            { $(AM_V_P) || exec 5>&2 >$$tmp 2>&1; } \
              && $(am_AUTORECONF) -vfi \
diff --git a/NEWS b/NEWS
index 1bbb0fb..8866502 100644
--- a/NEWS
+++ b/NEWS
@@ -57,7 +57,7 @@ New in 2.0:
       documentation updates and bug and regression fixes; they will
       not introduce new features, nor any backward-incompatibility (any
       such incompatibility would be considered a bug, to be fixed with
-      a further  micro release).
+      a further micro release).
 
     + Minor versions (e.g., 1.14, 2.1) can introduce new backward
       compatible features; the only backward-incompatibilities allowed
diff --git a/THANKS b/THANKS
index 6f82e93..fd023e2 100644
--- a/THANKS
+++ b/THANKS
@@ -258,6 +258,7 @@ Maxim Sinev                     address@hidden
 Maynard Johnson                 address@hidden
 Merijn de Jonge                 address@hidden
 Michael Brantley                address@hidden
+Michael Daniels                 address@hidden
 Michael Hofmann                 address@hidden
 Michael Ploujnikov              address@hidden
 Michel de Ruiter                address@hidden
diff --git a/lib/am/header-vars.am b/lib/am/header-vars.am
index d2f0984..4b9cc04 100644
--- a/lib/am/header-vars.am
+++ b/lib/am/header-vars.am
@@ -31,54 +31,88 @@ VPATH = @srcdir@
 ## enough for now.
 am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
 
+## Shell code that determines whether the current make instance is
+## running with a given one-letter option (e.g., -k, -n) that takes
+## no argument.  Actually, the only supported option at the moment
+## is '-n' (support for '-k' will be added soon).
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+## The format of $(MAKEFLAGS) is quite tricky with GNU make; the
+## variable $(MFLAGS) behaves much better in that regard.  So use it.
+    sane_makeflags=$$MFLAGS; \
+  else \
+## 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
+## $$MAKEFLAGS) would see a "make flag" equal to "nap", and would wrongly
+## misinterpret that as and indication that make is running in dry mode.
+## This has already happened in practice.  So we need this hack.
+      *\\[\ \  ]*) \
+## Extra indirection with ${bs} required by FreeBSD 8.x make.
+## Not sure why (so sorry for the cargo-cult programming here).
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$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, at least for options valid in GNU
+## make.  OTOH, BSD make formats $(MAKEFLAGS) by separating all options,
+## and separating any option from its argument, so things are easier
+## there.
+##
+## For GNU make and BSD make.
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+## For GNU make >= 3.83.
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+## For GNU make (possibly overkill, this one).
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+## For BSD make.
+      -[dEDm]) skip_next=yes;; \
+## For NetBSD make.
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+
 ## Shell code that determines whether make is running in "dry mode"
 ## ("make -n") or not.  Useful in rules that invoke make recursively,
 ## and are thus executed also with "make -n" -- either because they
 ## are declared as dependencies to '.MAKE' (NetBSD make), or because
 ## their recipes contain the "$(MAKE)" string (GNU and Solaris make).
-am__make_dryrun = \
-  { \
-    am__dry=no; \
-    if $(am__is_gnu_make); then \
-## GNU make: $(MAKEFLAGS) is quite tricky there, and the older
-## $(MFLAGS) variable behaves much better.
-      for am__flg in $$MFLAGS; do \
-        case $$am__flg in \
-          *=*|--*) ;; \
-          -*n*) am__dry=yes; break;; \
-        esac; \
-      done; \
-    else \
-## Non-GNU make: we must rely on $(MAKEFLAGS).  This is tricky and 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
-## $$MAKEFLAGS) would see a "make flag" equal to "nap", and would wrongly
-## 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__dry=yes ;; \
-         *) \
-          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;; \
-               *n*) am__dry=yes; break;; \
-             esac; \
-           done ;;\
-       esac; \
-    fi; \
-    test $$am__dry = yes; \
-  }
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+
+## Shell code that determines whether make is running in "keep-going mode"
+## ("make -k") or not.  Useful in rules that must recursively descend into
+## subdirectories, and decide whther to stop at the first error or not.
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 
 ## Some derived variables that have been found to be useful.
 pkgdatadir = $(datadir)/@PACKAGE@
diff --git a/lib/am/subdirs.am b/lib/am/subdirs.am
index c4c3694..999aa78 100644
--- a/lib/am/subdirs.am
+++ b/lib/am/subdirs.am
@@ -39,13 +39,12 @@ AM_RECURSIVE_TARGETS += $(am__recursive_targets:-recursive=)
 $(am__recursive_targets):
 ## Using $failcom allows "-k" to keep its natural meaning when running a
 ## recursive rule.
-       @fail= failcom='exit 1'; \
-       for f in x $$MAKEFLAGS; do \
-         case $$f in \
-           *=* | --[!k]*);; \
-           *k*) failcom='fail=yes';; \
-         esac; \
-       done; \
+       @fail=; \
+       if $(am__make_keepgoing); then \
+         failcom='fail=yes'; \
+       else \
+         failcom='exit 1'; \
+       fi; \
        dot_seen=no; \
        target=`echo $@ | sed s/-recursive//`; \
 ## For distclean and maintainer-clean we make sure to use the full
diff --git a/m4/tar.m4 b/m4/tar.m4
index aac6d8f..539aa3a 100644
--- a/m4/tar.m4
+++ b/m4/tar.m4
@@ -126,7 +126,7 @@ m4_if([$1], [v7],
 
   AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
   AC_MSG_RESULT([$am_cv_prog_tar_$1])])
-  
+
 AC_SUBST([am__tar])
 AC_SUBST([am__untar])
 ]) # _AM_PROG_TAR
diff --git a/maintainer/maint.mk b/maintainer/maint.mk
index 1ea10a2..56c52be 100644
--- a/maintainer/maint.mk
+++ b/maintainer/maint.mk
@@ -302,11 +302,14 @@ CLEANFILES += announcement
 # Program to use to fetch files.
 WGET = wget
 
+# Git repositories on Savannah.
+git-sv-host = git.savannah.gnu.org
+
 # Some repositories we sync files from.
 SV_CVS    = 'http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/'
-SV_GIT_CF = 
'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;hb=HEAD;f='
-SV_GIT_AC = 
'http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=blob_plain;hb=HEAD;f='
-SV_GIT_GL = 
'http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;hb=HEAD;f='
+SV_GIT_CF = 
'http://$(git-sv-host)/gitweb/?p=config.git;a=blob_plain;hb=HEAD;f='
+SV_GIT_AC = 
'http://$(git-sv-host)/gitweb/?p=autoconf.git;a=blob_plain;hb=HEAD;f='
+SV_GIT_GL = 
'http://$(git-sv-host)/gitweb/?p=gnulib.git;a=blob_plain;hb=HEAD;f='
 
 # Files that we fetch and which we compare against.
 # Note that the 'lib/COPYING' file must still be synced by hand.
@@ -472,3 +475,91 @@ update-copyright:
          | grep -Ev '^PLANS(/|$$)' \
          | grep -Ev "^($$excluded_re)$$" \
          | $(update_copyright_env) xargs $(srcdir)/lib/$@
+
+# --------------------------------------------------------------- #
+#  Testing on real-world packages can help us avoid regressions.  #
+# --------------------------------------------------------------- #
+
+#
+# NOTE (from Stefano Lattarini):
+# 
+# This section is mostly hacky and ad-hoc, but works for me and
+# on my system.  And while far from clean, it should help catching
+# real regressions on real world packages, which is important.
+# Ideas about how to improve this and make it more generic, portable,
+# clean, etc., are welcome.
+#
+
+# Tiny sample package.
+FEW_PACKAGES += hello
+# Smallish package using recursive make setup.
+FEW_PACKAGES += make
+# Medium-size package using non-recursive make setup.
+FEW_PACKAGES += coreutils
+
+ALL_PACKAGES = \
+  $(FEW_PACKAGES) \
+  autoconf \
+  bison \
+  grep \
+  tar \
+  diffutils \
+  smalltalk
+
+pkg-targets = check dist
+
+# Note: "ttp" stays for "Third Party Package".
+
+ttp-check ttp-check-all: do-clone = $(GIT) clone --verbose
+ttp-check: ttp-packages = $(FEW_PACKAGES)
+ttp-check-all: ttp-packages = $(ALL_PACKAGES)
+
+# Note: some packages depend on pkg-config, and its provided macros.
+ttp-check ttp-check-all: t/pkg-config-macros.log
+       @set -e; \
+       $(setup_autotools_paths); \
+       skip_all_ () \
+       { \
+         echo "***" >&2; \
+         echo "*** $@: WARNING: $$@" >&2; \
+         echo "*** $@: WARNING: some packages might fail to bootstrap" >&2; \
+         echo "***" >&2;  \
+       }; \
+       . t/pkg-config-macros.dir/get.sh || exit 1; \
+       mkdir address@hidden && cd address@hidden || exit 1; \
+       for p in $(ttp-packages); do \
+           echo; \
+           echo ========  BEGIN TTP $$p  =========; \
+           echo; \
+           set -x; \
+           $(do-clone) git://$(git-sv-host)/$$p.git || exit 1; \
+           ( \
+             cd $$p \
+               && ls -l \
+               && if test -f bootstrap; then \
+                    ./bootstrap --no-git; \
+                  else \
+                    $$AUTORECONF -fvi; \
+                  fi \
+               && ./configure \
+               && if test $$p = make; then \
+                    $(MAKE) update; \
+                  else :; fi \
+               && for t in $(pkg-targets); do \
+                    $(MAKE) $$t WERROR_CFLAGS= || exit 1; \
+                  done \
+           ) || exit 1; \
+           set +x; \
+           echo; \
+           echo ========  END TTP $$p  =========; \
+           echo; \
+        done
+ifndef keep-ttp-dir
+       rm -rf address@hidden
+endif
+
+# Alias for lazy typists.
+ttp: ttp-check
+ttp-all: ttp-check-all
+
+.PHONY: ttp ttp-check ttp-all ttp-check-all
diff --git a/t/cxx-lt-demo.sh b/t/cxx-lt-demo.sh
index 3a87cfd..bbdb93b 100755
--- a/t/cxx-lt-demo.sh
+++ b/t/cxx-lt-demo.sh
@@ -124,7 +124,9 @@ std::string target (void)
 END
 
 ./configure
-CC=false $MAKE -e
+# Creative quoting and redundant use of eval to avoid spurious
+# 'maintainer-check' failures.
+eval \$'MAKE CC=false AM_MAKEFLAGS=CC=false'
 ls -l . src lib # For debugging.
 $MAKE test-objs
 VERBOSE=yes $MAKE check-TESTS
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index 5a35b7f..d494ef6 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -669,6 +669,7 @@ t/maken.sh \
 t/maken3.sh \
 t/makevars.sh \
 t/make-dryrun.tap \
+t/make-keepgoing.tap \
 t/make-is-gnu.sh \
 t/man.sh \
 t/man2.sh \
@@ -1022,6 +1023,7 @@ t/subdir-order.sh \
 t/subdir-with-slash.sh \
 t/subdir-subsub.sh \
 t/subdir-distclean.sh \
+t/subdir-keep-going-pr12554.sh \
 t/subobj.sh \
 t/subobj2.sh \
 t/subobj4.sh \
diff --git a/t/make-dryrun.tap b/t/make-dryrun.tap
index 208b421..0dbe3bb 100755
--- a/t/make-dryrun.tap
+++ b/t/make-dryrun.tap
@@ -18,7 +18,7 @@
 
 . test-init.sh
 
-plan_ 18
+plan_ 60
 
 if echo "all: ; address@hidden %sbb%s aa cc" | $MAKE -n -f - | grep aabbcc; 
then
   make_plus_silence () { return 0; }
@@ -26,7 +26,7 @@ else
   make_plus_silence () { return 1; }
 fi
 
-mkdir none
+mkdir none # Also used later.
 if echo nil: | $MAKE -I none -f -; then
   make_supports_option_I () { return 0; }
 else
@@ -38,19 +38,17 @@ echo AC_OUTPUT >> configure.ac
 cat > Makefile.am <<'END'
 all:
        : Dummy, nothing to do.
-foo:
-       $(MAKE) all
 run:
-       @echo ":: $$MAKEFLAGS ::"; : For debugging.
+       @echo ":: $$MAKEFLAGS :: $$MFLAGS ::" ;: For debugging.
        $(am__make_dryrun) && exit 1; echo ok > from-run
 dry:
-       address@hidden ":: $$MAKEFLAGS ::"; : For debugging.
+       address@hidden ":: $$MAKEFLAGS :: $$MFLAGS ::" ;: For debugging.
        +$(am__make_dryrun) || exit 1; echo ok > from-dry
 END
 
 check_make ()
 {
-  r=ok msg= mode= condition=: directive= reason= skip_reason=
+  msg= mode= condition=: directive= reason= skip_reason=
   case $1 in
     --dry) mode=dry;;
     --run) mode=run;;
@@ -61,23 +59,25 @@ check_make ()
     case $1 in
       -C) condition=$2 skip_reason=$3; shift; shift;;
       -M) msg=$2; shift;;
-      -X) directive=TODO;;
       --) shift; break;;
        *) break;;
     esac
     shift
   done
-  msg=${mode}${msg:+" [$msg]"}
-  if $condition; then
-    $MAKE "$mode" ${1+"$@"} || r='not ok'
-    test -f from-$mode      || r='not ok'
-    test ! -e bad           || r='not ok'
-    rm -f bad from-*        || fatal_ "cleaning up"
-  else
-    directive=SKIP reason=$skip_reason
-  fi
-  result_ "$r" -D "$directive" -r "$reason" "$msg"
-  unset r msg mode condition directive reason skip_reason
+  for opts in '' '-s'  '-s -r'; do
+    r=ok
+    pmsg=${mode}${msg:+" [$msg]"}${opts:+" ($opts)"}
+    if $condition; then
+      $MAKE $opts "$mode" ${1+"$@"} || r='not ok'
+      test -f from-$mode            || r='not ok'
+      test ! -e bad                 || r='not ok'
+      rm -f bad from-*              || fatal_ "cleaning up"
+    else
+      directive=SKIP reason=$skip_reason
+    fi
+    result_ "$r" -D "$directive" -r "$reason" "$pmsg"
+  done
+  unset r msg pmsg opts mode condition directive reason skip_reason
 }
 
 # ----------------------------------------------------------------------
@@ -116,7 +116,7 @@ check_make --run -C make_supports_option_I "-I make option 
unsupported" \
                  -M "$pr" -I none
 
 check_make --run -C using_gmake "\$MAKE is not GNU make" \
-                 -M "$pr" -I none --include dry-run 
+                 -M "$pr" -I none --include dry-run
 
 check_make --dry -C make_supports_option_I "-I make option unsupported" \
                  -M "$pr" -I none -n
@@ -138,7 +138,9 @@ check_metachars MYFLAGS='-knf2\ n\ \\n'
 check_metachars MYFLAGS="(&) | ; \" \` '"
 check_metachars MYFLAGS=" ' # ' "
 check_metachars MYFLAGS='$(foo)'
+check_metachars MYFLAGS='$(foo -n)'
 check_metachars MYFLAGS='`touch bad`'
+check_metachars MYFLAGS='`touch --dry-run bad`'
 
 # ----------------------------------------------------------------------
 
diff --git a/t/make-is-gnu.sh b/t/make-is-gnu.sh
index c37cc17..79397da 100755
--- a/t/make-is-gnu.sh
+++ b/t/make-is-gnu.sh
@@ -31,7 +31,7 @@ cat > Makefile.am <<'END'
 all: file
        $(am__is_gnu_make)
 file:
-       if $(am__is_gnu_make); then : > ok; else : > ko; fi 
+       if $(am__is_gnu_make); then : > ok; else : > ko; fi
 END
 
 $ACLOCAL
diff --git a/t/make-keepgoing.tap b/t/make-keepgoing.tap
new file mode 100755
index 0000000..f9db028
--- /dev/null
+++ b/t/make-keepgoing.tap
@@ -0,0 +1,137 @@
+#! /bin/sh
+# Copyright (C) 2013 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check that $(am__make_keepgoing) works as expected.
+
+. test-init.sh
+
+plan_ 60
+
+mkdir kool # Also used later.
+if echo nil: | $MAKE -I kool -f -; then
+  make_supports_option_I () { return 0; }
+else
+  make_supports_option_I () { return 1; }
+fi
+
+echo AC_OUTPUT >> configure.ac
+
+cat > Makefile.am <<'END'
+all:
+       @echo 'Default target $@ should not be called'>&2; exit 1;
+k-y:
+       @echo ":: $$MAKEFLAGS :: $$MFLAGS ::" ;: For debugging.
+       $(am__make_keepgoing)
+k-n:
+       @echo ":: $$MAKEFLAGS :: $$MFLAGS ::" ;: For debugging.
+       $(am__make_keepgoing) && exit 1; exit 0
+END
+
+check_make ()
+{
+  msg= mode= condition=: directive= reason= skip_reason=
+  case $1 in
+    k-[yn]) mode=$1;;
+    *) fatal_ "check_run: invalid usage";;
+  esac
+  shift
+  while test $# -gt 0; do
+    case $1 in
+      -C) condition=$2 skip_reason=$3; shift; shift;;
+      -M) msg=$2; shift;;
+      -X) directive=TODO;;
+      --) shift; break;;
+       *) break;;
+    esac
+    shift
+  done
+  for opts in '' '-s'  '-s -r'; do
+    r=ok
+    pmsg=${mode}${msg:+" [$msg]"}${opts:+" ($opts)"}
+    if $condition; then
+      $MAKE $opts "$mode" ${1+"$@"} || r='not ok'
+    else
+      directive=SKIP reason=$skip_reason
+    fi
+    result_ "$r" -D "$directive" -r "$reason" "$pmsg"
+  done
+  unset r msg pmsg opts mode condition directive reason skip_reason
+}
+
+# ----------------------------------------------------------------------
+
+$ACLOCAL    || fatal_ "aclocal failed"
+$AUTOCONF   || fatal_ "autoconf failed"
+$AUTOMAKE   || fatal_ "automake failed"
+./configure || fatal_ "configure failed"
+
+# ----------------------------------------------------------------------
+
+check_make k-n
+
+# Test against a possible regressions similar to those that affected
+# detection of dry mode ("make -n").
+check_make k-n TESTS="k.test k2.test"
+check_make k-n TESTS="k1 k k2" AM_MAKEFLAGS="TESTS='k1 k2'"
+check_make k-n TESTS="k1 k k2" AM_MAKEFLAGS='TESTS="k1 k k2"'
+check_make k-n FOOFLAGS="-k -k -nkf2 k -ks --keep -k"
+check_make k-n MYFLAGS="-k --keepgoing -k --keep-run -k"
+
+# ----------------------------------------------------------------------
+
+check_make k-y -k
+check_make k-y -C using_gmake "\$MAKE is not GNU make" --keep-going
+
+# ----------------------------------------------------------------------
+
+# Related to automake bug#12554: the "k" in "kool" used to confound
+# am__make_keepgoing into thinking the '-k' option had been passed.
+
+pr='bug#12554'
+
+check_make k-n -C make_supports_option_I "-I make option unsupported" \
+               -M "$pr" -I kool
+
+check_make k-n -C using_gmake "\$MAKE is not GNU make" \
+               -M "$pr" -I kool --include keep-going
+
+check_make k-y -C make_supports_option_I "-I make option unsupported" \
+               -M "$pr" -I kool -k
+
+check_make k-y -C using_gmake "\$MAKE is not GNU make" \
+               -M "$pr" --keep-going -I kool --include keep-going
+
+# ----------------------------------------------------------------------
+
+# Test for when shell metacharacters or backslashes are in $(MAKEFLAGS).
+
+check_metachars ()
+{
+  check_make k-n -M "metachars" "$@"
+}
+
+check_metachars MYFLAGS="-k \"k\" '-k' --keep-going -k"
+check_metachars MYFLAGS='-knf2\ k\ \\k'
+check_metachars MYFLAGS="(&) | ; \" \` '"
+check_metachars MYFLAGS=" ' # ' "
+check_metachars MYFLAGS='$(foo)'
+check_metachars MYFLAGS='$(foo -k)'
+check_metachars MYFLAGS='`touch bad`'
+check_metachars MYFLAGS='`touch --keep-going bad`'
+
+# ----------------------------------------------------------------------
+
+:
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
+
+:
diff --git a/t/subdir-keep-going-pr12554.sh b/t/subdir-keep-going-pr12554.sh
new file mode 100755
index 0000000..03d5cb0
--- /dev/null
+++ b/t/subdir-keep-going-pr12554.sh
@@ -0,0 +1,70 @@
+#! /bin/sh
+# Copyright (C) 2013 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check that the Automake-generated recursive rules are resilient against
+# false positives in deciding whether make is running with the '-k'
+# option, and thus whether a failure into one of the $(SUBDIRS) should
+# still prevent recursion in the following $(SUBDIRS) entries.  See
+# automake bug#12544.
+
+. test-init.sh
+
+echo nil: | $MAKE -I . -f - || skip_ "$MAKE doesn't support the -I option"
+
+cat >> configure.ac <<'END'
+AC_CONFIG_FILES([sub1/Makefile sub2/Makefile])
+AC_OUTPUT
+END
+
+mkdir k ./--keep-going sub1 sub2
+
+cat > Makefile.am <<'END'
+SUBDIRS = sub1 sub2
+END
+
+cat > sub1/Makefile.am <<'END'
+all-local:
+       touch ko
+       false
+END
+cat > sub2/Makefile.am <<'END'
+all-local:
+       test -f ../sub1/ko
+       touch ok
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+
+st=0
+$MAKE -I k -I --keep-going \
+  TESTS='k --keep-going -k' AM_MAKEFLAGS="TESTS='k --keep-going -k'" \
+  || st=$?
+# Don't trust the exit status of "make -k" for non-GNU make.
+if using_gmake; then
+  test $st -gt 0 || exit 1
+fi
+test ! -r sub2/ok
+
+# Sanity check.
+st=0; $MAKE -k || st=$?
+if { using_gmake && test $st -eq 0; } || test ! -f sub2/ok; then
+  fatal_ '"make -k" not working as expected'
+fi
+
+:


hooks/post-receive
-- 
GNU Automake



reply via email to

[Prev in Thread] Current Thread [Next in Thread]