automake-commit
[Top][All Lists]
Advanced

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

[Automake-commit] [SCM] GNU Automake branch, testsuite-work, updated. v1


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, testsuite-work, updated. v1.11-906-g13c1b9e
Date: Thu, 02 Jun 2011 16:46:46 +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=13c1b9e61bf30678a707229d52e05b3ae6a30f9c

The branch, testsuite-work has been updated
       via  13c1b9e61bf30678a707229d52e05b3ae6a30f9c (commit)
       via  f977d00e0a3ab9af3555bb3bc8ea78726cb7a143 (commit)
       via  ad5d0be02dd42c200be2ffebb1e062e96a06f80c (commit)
       via  57576b60c67f8c3c69a1724d4f34736f5a9fd3ce (commit)
       via  50036b32c5257c558a28fd054f1d2df6f000ebe2 (commit)
       via  e1017337a19e16c47783405bfe9670f5cf936ffe (commit)
       via  3453b8e73828ecbc96658dbf94ea10885480951c (commit)
       via  8f28c111d5114351e61fde825c65204a52b332ea (commit)
       via  07d878b42df4a4d197d8f586be108666a26a0ba1 (commit)
       via  8217b623472412d35d5b90445dadc3d2e2440aa7 (commit)
       via  24b9022b753b129d9a2832904fbd9b7a7bbb17d6 (commit)
       via  5e62b9623217fd5c23934c7d62b0f02ee6829c70 (commit)
       via  1f703d92432c1f6a9014d7f632e06493d4768e22 (commit)
       via  2aa8c8e8829c255a20030cc8dd1e02e930d63698 (commit)
       via  67ca6940688ed14d84642b34df4f28a07b9d9f00 (commit)
       via  bee9871d6a8743b7f01789f196c214354e7f612a (commit)
      from  f35c9794b0a98bfe696e4002dc403ea76a9e4d63 (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 13c1b9e61bf30678a707229d52e05b3ae6a30f9c
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jun 2 17:54:25 2011 +0200

    self tests: fix another spurious failure
    
    Our ad-hoc usage of `tests/defs' in the testsuite's self tests
    stopped working properly when we made the test scripts re-execute
    themselves with the configure-time $SHELL.  Fix this.
    
    Fixes a regression introduced by commit 'v1.11-874-g1321be7'.
    
    * tests/self-check-exit.test: Export `AM_TESTS_REEXEC' to "no"
    before running the self tests.  This fixes a spurious failure
    present only when the test was run by hand.

commit f977d00e0a3ab9af3555bb3bc8ea78726cb7a143
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jun 2 17:05:51 2011 +0200

    tests: use `$SHELL' to run the shell scripts from `lib/'
    
    This should offer greater testsuite coverage for those developers
    that override CONFIG_SHELL at configure time in order to test more
    shells on a single system, instead of just the default `/bin/sh'.
    
    This change also fixes few spurious failures in tests using the
    `xsi-shell' requirement, where inconsistencies could crop up if
    the shell probed for XSI features (which, by default, is $SHELL)
    was not the same shell later used to run the scripts using those
    features (which was hard-coded to `/bin/sh').  Such failures have
    already occurred in practice, for examples on Solaris systems
    which had also GNU Bash installed.
    
    * tests/ar-lib.test: Run the `ar-lib' script with `$SHELL', rather
    than directly with `./ar-lib', which would make run unconditionally
    with `/bin/sh'.
    * tests/compile.test: Likewise, but for the `compile' script.
    * tests/compile2.test: Likewise.
    * tests/compile3.test: Likewise.
    * tests/compile4.test: Likewise.
    * tests/compile5.test: Likewise.
    * tests/compile6.test: Likewise.
    * tests/instsh2.test: Likewise, but for the `install' script.
    * tests/instsh3.test: Likewise.
    * tests/mkinst3.test: Likewise, but for the `mkinstalldirs' script.
    * tests/missing.test: Likewise, but for the `missing' script.
    * tests/missing2.test: Likewise.
    * tests/missing3.test: Likewise.
    * tests/missing5.test: Likewise.

commit ad5d0be02dd42c200be2ffebb1e062e96a06f80c
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jun 2 15:35:03 2011 +0200

    silent-rules tests: fix spurious failures with Sun Studio C++
    
    * tests/silentcxx.test: The C++ compiler from Sun Studio is named
    `CC'.  Account for this in our grepping checks on the make output.
    Since we are at it, throw in a couple of improvements to comments
    and formatting.
    * tests/silent-many-generic.test: The C++ compiler from Sun Studio
    is named `CC', and this can cause spurious failures in our grepping
    of the make output.  Work around this by using a wrapper script
    around the C++ compiler (generated on the fly), since filtering the
    make output proved to be too fragile.

commit 57576b60c67f8c3c69a1724d4f34736f5a9fd3ce
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jun 2 14:40:19 2011 +0200

    tests: fix spurious failure in backcompat2.test on NetBSD
    
    * tests/backcompat2.test: Add trailing `:' in the body of a `for'
    loop, in case the last command there might have an exit status
    different 0.  This work around `set -e' issues in some BSD shells,
    e.g., NetBSD /bin/ksh.

commit 50036b32c5257c558a28fd054f1d2df6f000ebe2
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jun 2 14:14:28 2011 +0200

    tests: fix spurious failure in autohdr3.test
    
    * tests/autohder3.test (Makefile.am): Let `test' depend on `all',
    so that config.h header is truly remade.
    Remove now useless call to `$MAKE' when non-GNU make is in use.
    
    Failure introduced by commit `v1.11-895-g5e62b96'.

commit e1017337a19e16c47783405bfe9670f5cf936ffe
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jun 2 14:13:18 2011 +0200

    tests: fix spurious failure of cond29.test on NetBSD
    
    * tests/cond29.test: Skip if we cannot safely limit the maximal
    size of used virtual memory to 20K.  This fixes a spurious failure
    on NetBSD.
    
    Bug introduced in commit `v1.11-885-g908d335'.

commit 3453b8e73828ecbc96658dbf94ea10885480951c
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jun 2 12:58:37 2011 +0200

    maintcheck: fix again few more failures
    
    * tests/cond29.test: To please the `sc_tests_Exit_not_exit'
    maintainer check, avoid using `sh -c "exit 0"' where a simple
    `sh -c :' will do.
    * tests/depmod-data.test: Use creative quoting to avoid
    spuriously triggering the `sc_tests_Exit_not_exit' maintainer
    check.

commit 8f28c111d5114351e61fde825c65204a52b332ea
Merge: 5e62b96 07d878b
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jun 2 12:54:03 2011 +0200

    Merge branch 'master' into testsuite-work
    
    * master:
      maintcheck: fix some more failures
      maintcheck: fix some failures, extend some checks

commit 5e62b9623217fd5c23934c7d62b0f02ee6829c70
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jun 2 11:22:32 2011 +0200

    tests: don't require GNU make where it's not strictly needed
    
    * tests/autohdr3.test: Rewrite to be stricter when make is GNU
    make.  Drop the requirement of GNU make.
    * tests/aclocal5.test: Drop GNU make requirement, it's not truly
    needed.  Add reference to similar tests `remake-subdir*.test'.
    * remake-subdir-gnu.test, remake-subdir-from-subdir.test,
    remake-subdir.test, remake-subdir2.test: Add reference to
    each other, and to related test `aclocal5.test'.
    * tests/aclocal6.test: Drop GNU make requirement, it's not
    truly needed.
    * tests/confh6.test: Likewise.
    * tests/lex3.test: Likewise.
    * tests/remake11.test: Likewise.
    * tests/subdir5.test: Likewise.
    * tests/subdir8.test: Likewise.
    * tests/werror2.test: Likewise.
    * tests/conff.test: Likewise, and ensure verbose printing of
    captured make output.
    * tests/lex5.test: Tweak so that GNU make is no more required.
    * tests/version7.test: Likewise.
    * tests/maken2.test: Add explicative comment for why this test
    required GNU make.
    * tests/maken4.test: Let it run also with BSD makes supporting
    the `.MAKE' special target.
    * tests/output6.test: Use proper m4 quoting in configure.in.
    Expand make macros with one-character name using `$(x)', not
    `$x', for portability.  Move checks in the makefiles, rather
    than relying on grepping the output from make.  Drop the now
    unneeded GNU make requirement.

commit 1f703d92432c1f6a9014d7f632e06493d4768e22
Merge: f35c979 2aa8c8e
Author: Stefano Lattarini <address@hidden>
Date:   Wed Jun 1 20:23:45 2011 +0200

    Merge branch 'master' into testsuite-work
    
    * master:
      remake: behave better with non-GNU make in subdirectories

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

Summary of changes:
 ChangeLog                                          |  166 ++++++++++++++++++++
 Makefile.am                                        |   22 ++-
 Makefile.in                                        |   15 ++-
 doc/automake.texi                                  |    2 +-
 lib/am/configure.am                                |    2 +-
 tests/Makefile.am                                  |    4 +
 tests/Makefile.in                                  |    4 +
 tests/aclocal5.test                                |    7 +-
 tests/aclocal6.test                                |    1 -
 tests/ar-lib.test                                  |   22 ++--
 tests/autohdr3.test                                |   19 ++-
 tests/backcompat2.test                             |    5 +
 tests/compile.test                                 |    6 +-
 tests/compile2.test                                |    4 +-
 tests/compile3.test                                |   10 +-
 tests/compile4.test                                |    4 +-
 tests/compile5.test                                |    2 +-
 tests/compile6.test                                |   20 ++--
 tests/cond29.test                                  |    5 +-
 tests/conff.test                                   |   13 +-
 tests/confh6.test                                  |    1 -
 tests/depcomp8a.test                               |    4 +-
 tests/depcomp8b.test                               |    4 +-
 tests/depmod-data.test                             |    4 +-
 tests/instdir-ltlib.test                           |    6 +-
 tests/instdir-prog.test                            |    6 +-
 tests/instsh2.test                                 |   46 +++---
 tests/instsh3.test                                 |   12 +-
 tests/instspc-data.test                            |    6 +-
 tests/lex3.test                                    |    2 +-
 tests/lex5.test                                    |    3 +-
 tests/maken2.test                                  |    5 +-
 tests/maken4.test                                  |   17 ++-
 tests/missing.test                                 |    2 +-
 tests/missing2.test                                |    2 +-
 tests/missing3.test                                |   25 ++-
 tests/missing5.test                                |   16 +-
 tests/mkinst3.test                                 |    8 +-
 tests/output6.test                                 |   18 ++-
 .../{gcj6.test => remake-subdir-from-subdir.test}  |   47 +++---
 tests/remake-subdir-gnu.test                       |   82 ++++++++++
 tests/remake-subdir.test                           |   83 ++++++++++
 tests/remake-subdir2.test                          |   84 ++++++++++
 tests/remake11.test                                |    1 -
 tests/self-check-exit.test                         |    1 +
 tests/silent-many-generic.test                     |   22 +++-
 tests/silentcxx.test                               |    6 +-
 tests/subdir5.test                                 |    8 +-
 tests/subdir8.test                                 |    8 +-
 tests/version7.test                                |    3 +-
 tests/werror2.test                                 |    3 +-
 51 files changed, 690 insertions(+), 178 deletions(-)
 copy tests/{gcj6.test => remake-subdir-from-subdir.test} (54%)
 create mode 100755 tests/remake-subdir-gnu.test
 create mode 100755 tests/remake-subdir.test
 create mode 100755 tests/remake-subdir2.test

diff --git a/ChangeLog b/ChangeLog
index d719a78..6d8f4b8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,169 @@
+2011-06-02  Stefano Lattarini  <address@hidden>
+
+       self tests: fix another spurious failure
+       Our ad-hoc usage of `tests/defs' in the testsuite's self tests
+       stopped working properly when we made the test scripts re-execute
+       themselves with the configure-time $SHELL.  Fix this.
+       Fixes a regression introduced by commit 'v1.11-874-g1321be7'.
+       * tests/self-check-exit.test: Export `AM_TESTS_REEXEC' to "no"
+       before running the self tests.  This fixes a spurious failure
+       present only when the test was run by hand.
+
+2011-06-02  Stefano Lattarini  <address@hidden>
+
+       tests: use `$SHELL' to run the shell scripts from `lib/'
+       This should offer greater testsuite coverage for those developers
+       that override CONFIG_SHELL at configure time in order to test more
+       shells on a single system, instead of just the default `/bin/sh'.
+       This change also fixes few spurious failures in tests using the
+       `xsi-shell' requirement, where inconsistencies could crop up if
+       the shell probed for XSI features (which, by default, is $SHELL)
+       was not the same shell later used to run the scripts using those
+       features (which was hard-coded to `/bin/sh').  Such failures have
+       already occurred in practice, for examples on Solaris systems
+       which had also GNU Bash installed.
+       * tests/ar-lib.test: Run the `ar-lib' script with `$SHELL', rather
+       than directly with `./ar-lib', which would make run unconditionally
+       with `/bin/sh'.
+       * tests/compile.test: Likewise, but for the `compile' script.
+       * tests/compile2.test: Likewise.
+       * tests/compile3.test: Likewise.
+       * tests/compile4.test: Likewise.
+       * tests/compile5.test: Likewise.
+       * tests/compile6.test: Likewise.
+       * tests/instsh2.test: Likewise, but for the `install' script.
+       * tests/instsh3.test: Likewise.
+       * tests/mkinst3.test: Likewise, but for the `mkinstalldirs' script.
+       * tests/missing.test: Likewise, but for the `missing' script.
+       * tests/missing2.test: Likewise.
+       * tests/missing3.test: Likewise.
+       * tests/missing5.test: Likewise.
+
+2011-06-02  Stefano Lattarini  <address@hidden>
+
+       silent-rules tests: fix spurious failures with Sun Studio C++
+       * tests/silentcxx.test: The C++ compiler from Sun Studio is named
+       `CC'.  Account for this in our grepping checks on the make output.
+       Since we are at it, throw in a couple of improvements to comments
+       and formatting.
+       * tests/silent-many-generic.test: The C++ compiler from Sun Studio
+       is named `CC', and this can cause spurious failures in our grepping
+       of the make output.  Work around this by using a wrapper script
+       around the C++ compiler (generated on the fly), since filtering the
+       make output proved to be too fragile.
+
+2011-06-02  Stefano Lattarini  <address@hidden>
+
+       tests: fix spurious failure in backcompat2.test on NetBSD
+       * tests/backcompat2.test: Add trailing `:' in the body of a `for'
+       loop, in case the last command there might have an exit status
+       different 0.  This work around `set -e' issues in some BSD shells,
+       e.g., NetBSD /bin/ksh.
+
+2011-06-02  Stefano Lattarini  <address@hidden>
+
+       tests: fix spurious failure in autohdr3.test
+       * tests/autohder3.test (Makefile.am): Let `test' depend on `all',
+       so that config.h header is truly remade.
+       Remove now useless call to `$MAKE' when non-GNU make is in use.
+       Failure introduced by commit `v1.11-895-g5e62b96'.
+
+2011-06-02  Stefano Lattarini  <address@hidden>
+
+       tests: fix spurious failure of cond29.test on NetBSD
+       * tests/cond29.test: Skip if we cannot safely limit the maximal
+       size of used virtual memory to 20K.  This fixes a spurious failure
+       on NetBSD.
+       Bug introduced in commit `v1.11-885-g908d335'.
+
+2011-06-02  Stefano Lattarini  <address@hidden>
+
+       maintcheck: fix again few more failures
+       * tests/cond29.test: To please the `sc_tests_Exit_not_exit'
+       maintainer check, avoid using `sh -c "exit 0"' where a simple
+       `sh -c :' will do.
+       * tests/depmod-data.test: Use creative quoting to avoid
+       spuriously triggering the `sc_tests_Exit_not_exit' maintainer
+       check.
+
+2011-06-02  Stefano Lattarini  <address@hidden>
+
+       maintcheck: fix some more failures
+       * tests/instdir-ltlib.test: Use creative quoting to avoid
+       spuriously triggering the `sc_rm_minus_f' maintainer check.
+       * tests/instdir-prog.test: Likewise.
+       * tests/instspc-data.test: Use creative quoting to avoid
+       spuriously triggering the `sc_tests_Exit_not_exit' maintainer
+       check.
+
+2011-06-02  Stefano Lattarini  <address@hidden>
+
+       maintcheck: fix some failures, extend some checks
+       * Makefile.am (sc_diff_automake_in_automake): Update, as we
+       now expect 9 lines, not 8, to be changed from `automake.in'
+       to `automake'.
+       (sc_diff_aclocal_in_aclocal): New maintainer check, similar to
+       the above, and checking that only 10 lines are changed from
+       `aclocal.in' to `aclocal'.
+       (syntax_check_rules): Update.
+       (sc_tests_Exit_not_exit): Exempt self tests `self-check-*.test'
+       from this check, as they can legitimately use the bare `exit'
+       builtin in various places.
+       * doc/automake.texi (Python): Remove stray `@' from the end of
+       a line.  Typo introduced in commit `v1.11-312-g5bf7af6'.
+       * tests/depcomp8a.test: Pass DISTCHECK_CONFIGURE_FLAGS to make
+       from the environment rather than from the command line, to
+       pacify the `sc_tests_overriding_macros_on_cmdline' maintainer
+       check.
+       * tests/depcomp8b.test: Likewise.
+
+2011-06-02  Stefano Lattarini  <address@hidden>
+
+       tests: don't require GNU make where it's not strictly needed
+       * tests/autohdr3.test: Rewrite to be stricter when make is GNU
+       make.  Drop the requirement of GNU make.
+       * tests/aclocal5.test: Drop GNU make requirement, it's not truly
+       needed.  Add reference to similar tests `remake-subdir*.test'.
+       * remake-subdir-gnu.test, remake-subdir-from-subdir.test,
+       remake-subdir.test, remake-subdir2.test: Add reference to
+       each other, and to related test `aclocal5.test'.
+       * tests/aclocal6.test: Drop GNU make requirement, it's not
+       truly needed.
+       * tests/confh6.test: Likewise.
+       * tests/lex3.test: Likewise.
+       * tests/remake11.test: Likewise.
+       * tests/subdir5.test: Likewise.
+       * tests/subdir8.test: Likewise.
+       * tests/werror2.test: Likewise.
+       * tests/conff.test: Likewise, and ensure verbose printing of
+       captured make output.
+       * tests/lex5.test: Tweak so that GNU make is no more required.
+       * tests/version7.test: Likewise.
+       * tests/maken2.test: Add explicative comment for why this test
+       requires GNU make.
+       * tests/maken4.test: Let it run also with BSD makes supporting
+       the `.MAKE' special target.
+       * tests/output6.test: Use proper m4 quoting in configure.in.
+       Expand make macros with one-character name using `$(x)', not
+       `$x', for portability.  Move checks in the makefiles, rather
+       than relying on grepping the output from make.  Drop the now
+       unneeded GNU make requirement.
+
+2011-05-29  Stefano Lattarini  <address@hidden>
+
+       remake: behave better with non-GNU make in subdirectories
+       Currently, with every decent make program, it is possible to
+       rebuild out-of-date autotools-generated files with a simple
+       "make Makefile" -- but for this to work reliably with non-GNU
+       make implementations, the command must be issued from the
+       top-level directory.  This patch removes such limitation.
+       * lib/am/configure.am (am--refresh): Depend on `%MAKEFILE%'.
+       * tests/remake-subdir.test: New test.
+       * tests/remake-subdir2.test: Likewise.
+       * tests/remake-subdir-gnu.test: Likewise.
+       * tests/remake-subdir-from-subdir.test: Likewise.
+       * tests/Makefile.am (TESTS): Update.
+
 2011-06-01  Stefano Lattarini  <address@hidden>
 
        lex tests: fix spurious failures with Solaris lex
diff --git a/Makefile.am b/Makefile.am
index 2d4d443..adf965f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,7 +3,8 @@
 ## Makefile for Automake.
 
 # Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
+# 2005, 2006, 2007, 2008, 2009, 2010, 2011 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
@@ -168,6 +169,7 @@ clean-local: clean-coverage
 syntax_check_rules = \
 sc_test_names \
 sc_diff_automake_in_automake \
+sc_diff_aclocal_in_automake \
 sc_perl_syntax \
 sc_no_brace_variable_expansions \
 sc_rm_minus_f \
@@ -286,15 +288,22 @@ sc_test_names:
           exit 1; \
         fi
 
-## This check avoids accidental configure substitutions in the source.
-## There are exactly 8 lines that should be modified.  This works out
-## to 28 lines of diffs.
+## These check avoids accidental configure substitutions in the source.
+## There are exactly 9 lines that should be modified from automake.in to
+## automake, and 10 lines that should be modified from aclocal.in to
+## aclocal; these wors out to 32 and 34 lines of diffs, respectively.
 sc_diff_automake_in_automake:
-       @if test `diff $(srcdir)/automake.in automake | wc -l` -ne 28; then \
+       @if test `diff $(srcdir)/automake.in automake | wc -l` -ne 32; then \
          echo "found too many diffs between automake.in and automake" 1>&2; \
          diff -c $(srcdir)/automake.in automake; \
          exit 1; \
        fi
+sc_diff_aclocal_in_aclocal:
+       @if test `diff $(srcdir)/aclocal.in aclocal | wc -l` -ne 34; then \
+         echo "found too many diffs between aclocal.in and aclocal" 1>&2; \
+         diff -c $(srcdir)/aclocal.in aclocal; \
+         exit 1; \
+       fi
 
 ## Syntax check with default Perl (on my machine, Perl 5).
 sc_perl_syntax:
@@ -458,9 +467,10 @@ sc_tests_here_document_format:
 
 ## Tests should never call exit directly, but use Exit.
 ## This is so that the exit status is transported correctly across the 0 trap.
-## Ignore comments, and ignore one perl line in ext2.test.
+## Ignore comments, testsuite self tests, and one perl line in ext2.test.
 sc_tests_Exit_not_exit:
        @found=false; for file in $(srcdir)/tests/*.test; do \
+         case $$file in */self-check-*.test) continue;; esac; \
          res=`sed -n -e '/^#/d; /^\$$PERL/d' -e '/<<.*END/,/^END/b' \
                      -e '/<<.*EOF/,/^EOF/b' -e '/exit [$$0-9]/p' $$file`; \
          if test -n "$$res"; then \
diff --git a/Makefile.in b/Makefile.in
index 1a179ab..a8ebc86 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -16,7 +16,8 @@
 @SET_MAKE@
 
 # Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
+# 2005, 2006, 2007, 2008, 2009, 2010, 2011 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
@@ -297,6 +298,7 @@ PERL_COVER = cover
 syntax_check_rules = \
 sc_test_names \
 sc_diff_automake_in_automake \
+sc_diff_aclocal_in_automake \
 sc_perl_syntax \
 sc_no_brace_variable_expansions \
 sc_rm_minus_f \
@@ -400,7 +402,7 @@ texinfo.tex
 all: all-recursive
 
 .SUFFIXES:
-am--refresh:
+am--refresh: Makefile
        @:
 $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
        @for dep in $?; do \
@@ -1060,11 +1062,17 @@ sc_test_names:
         fi
 
 sc_diff_automake_in_automake:
-       @if test `diff $(srcdir)/automake.in automake | wc -l` -ne 28; then \
+       @if test `diff $(srcdir)/automake.in automake | wc -l` -ne 32; then \
          echo "found too many diffs between automake.in and automake" 1>&2; \
          diff -c $(srcdir)/automake.in automake; \
          exit 1; \
        fi
+sc_diff_aclocal_in_aclocal:
+       @if test `diff $(srcdir)/aclocal.in aclocal | wc -l` -ne 34; then \
+         echo "found too many diffs between aclocal.in and aclocal" 1>&2; \
+         diff -c $(srcdir)/aclocal.in aclocal; \
+         exit 1; \
+       fi
 
 sc_perl_syntax:
        perllibdir="./lib$(PATH_SEPARATOR)$(srcdir)/lib" $(PERL) -c -w automake
@@ -1203,6 +1211,7 @@ sc_tests_here_document_format:
 
 sc_tests_Exit_not_exit:
        @found=false; for file in $(srcdir)/tests/*.test; do \
+         case $$file in */self-check-*.test) continue;; esac; \
          res=`sed -n -e '/^#/d; /^\$$PERL/d' -e '/<<.*END/,/^END/b' \
                      -e '/<<.*EOF/,/^EOF/b' -e '/exit [$$0-9]/p' $$file`; \
          if test -n "$$res"; then \
diff --git a/doc/automake.texi b/doc/automake.texi
index 5dd1099..032e9ec 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -7633,7 +7633,7 @@ files in your @file{Makefile.am}, depending on where you 
want your files
 installed (see the definitions of @code{pythondir} and
 @code{pkgpythondir} below).
 
address@hidden AM_PATH_PYTHON (@ovar{version}, @ovar{action-if-found}, @
address@hidden AM_PATH_PYTHON (@ovar{version}, @ovar{action-if-found},
   @ovar{action-if-not-found})
 
 Search for a Python interpreter on the system.  This macro takes three
diff --git a/lib/am/configure.am b/lib/am/configure.am
index e9299d6..d00846a 100644
--- a/lib/am/configure.am
+++ b/lib/am/configure.am
@@ -22,7 +22,7 @@
 ## %MAKEFILE% is updated before considering the am--refresh target.
 if %?TOPDIR_P%
 .PHONY: am--refresh
-am--refresh:
+am--refresh: %MAKEFILE%
        @:
 endif %?TOPDIR_P%
 
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 02a99b6..d863b28 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -826,6 +826,10 @@ remake11.test \
 remake12.test \
 remake-all-1.test \
 remake-all-2.test \
+remake-subdir-from-subdir.test \
+remake-subdir-gnu.test \
+remake-subdir.test \
+remake-subdir2.test \
 remake-gnulib-add-acsubst.test \
 remake-gnulib-add-header.test \
 remake-gnulib-remove-header.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 4e4d4a9..d2975d7 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -1114,6 +1114,10 @@ remake11.test \
 remake12.test \
 remake-all-1.test \
 remake-all-2.test \
+remake-subdir-from-subdir.test \
+remake-subdir-gnu.test \
+remake-subdir.test \
+remake-subdir2.test \
 remake-gnulib-add-acsubst.test \
 remake-gnulib-add-header.test \
 remake-gnulib-remove-header.test \
diff --git a/tests/aclocal5.test b/tests/aclocal5.test
index 0f87e00..ab06607 100755
--- a/tests/aclocal5.test
+++ b/tests/aclocal5.test
@@ -14,12 +14,9 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Test to make sure that aclocal.m4's dependencies are honored
-# in sub-directories.
+# Test to make sure that aclocal.m4's dependencies are honored in
+# sub-directories.  See also related tests `remake-subdir*.test'.
 
-# This test assumes that the `make' utility is able to start
-# over and reload Makefiles which have been remade (a non-POSIX feature).
-required='GNUmake'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/aclocal6.test b/tests/aclocal6.test
index 905608c..c631e64 100755
--- a/tests/aclocal6.test
+++ b/tests/aclocal6.test
@@ -17,7 +17,6 @@
 # Make sure aclocal.m4 is rebuilt whenever a configure
 # dependency changes.  Test for acinclude.m4 and VPATH too.
 
-required='GNUmake'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/ar-lib.test b/tests/ar-lib.test
index 7168ecd..06c9c00 100755
--- a/tests/ar-lib.test
+++ b/tests/ar-lib.test
@@ -36,51 +36,51 @@ END
 chmod +x ./lib
 
 # Check if ar-lib can create an archive with "cr"
-opts=`./ar-lib ./lib cr foo.lib foo.obj`
+opts=`$SHELL ar-lib ./lib cr foo.lib foo.obj`
 test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.obj"
 
 # Check if ar-lib can update an existing archive with "r"
 touch foo.lib
-opts=`./ar-lib ./lib r foo.lib foo.obj`
+opts=`$SHELL ar-lib ./lib r foo.lib foo.obj`
 test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib foo.obj"
 
 # Check if ar-lib passes on @FILE with "r"
-opts=`./ar-lib ./lib r foo.lib @list`
+opts=`$SHELL ar-lib ./lib r foo.lib @list`
 test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib @list"
 
 # Check if ar-lib can delete a member from an archive with "d"
-opts=`./ar-lib ./lib d foo.lib foo.obj`
+opts=`$SHELL ar-lib ./lib d foo.lib foo.obj`
 test x"$opts" = x"lib -NOLOGO -REMOVE:foo.obj foo.lib"
 
 # Check if ar-lib can delete members in an @FILE
 echo foo.obj > foolist
-opts=`./ar-lib ./lib d foo.lib @foolist`
+opts=`$SHELL ar-lib ./lib d foo.lib @foolist`
 test x"$opts" = x"lib -NOLOGO -REMOVE:foo.obj foo.lib"
 
 # Check if ar-lib can list archive members with "t"
-opts=`./ar-lib ./lib t foo.lib`
+opts=`$SHELL ar-lib ./lib t foo.lib`
 test x"$opts" = x"lib -NOLOGO -LIST foo.lib"
 
 # Check if ar-lib can extract archive members with "x"
 touch fake.lib
-opts=`./ar-lib ./lib x fake.lib`
+opts=`$SHELL ar-lib ./lib x fake.lib`
 test x"$opts" = x"lib -NOLOGO -EXTRACT:fake.obj fake.lib"
 
 # Check if ar-lib can extract specified archive members with "x"
-opts=`./ar-lib ./lib x foo.lib foo.obj`
+opts=`$SHELL ar-lib ./lib x foo.lib foo.obj`
 test x"$opts" = x"lib -NOLOGO -EXTRACT:foo.obj foo.lib"
 
 # Check if ar-lib can extract members in an @FILE
-opts=`./ar-lib ./lib x foo.lib @foolist`
+opts=`$SHELL ar-lib ./lib x foo.lib @foolist`
 test x"$opts" = x"lib -NOLOGO -EXTRACT:foo.obj foo.lib"
 
 # Check if ar-lib passes -lib and -LTCG through to the wrappee
-opts=`./ar-lib ./lib -lib -LTCG x foo.lib foo.obj`
+opts=`$SHELL ar-lib ./lib -lib -LTCG x foo.lib foo.obj`
 test x"$opts" = x"lib -lib -LTCG -NOLOGO -EXTRACT:foo.obj foo.lib"
 
 # Check if ar-lib can extract backslashed members
 touch fake2.lib
-opts=`./ar-lib ./lib x fake2.lib`
+opts=`$SHELL ar-lib ./lib x fake2.lib`
 test x"$opts" = x"lib -NOLOGO -EXTRACT:dir\\fake2.obj fake2.lib"
 
 :
diff --git a/tests/autohdr3.test b/tests/autohdr3.test
index b75506b..88e3c0f 100755
--- a/tests/autohdr3.test
+++ b/tests/autohdr3.test
@@ -16,7 +16,6 @@
 
 # Check rebuild rules for autoheader.
 
-required=GNUmake
 . ./defs || Exit 1
 
 cat >>configure.in <<EOF
@@ -25,9 +24,18 @@ AC_CONFIG_HEADERS([config.h:config.hin])
 AC_OUTPUT
 EOF
 
-: > Makefile.am
 : > foo.m4
 
+cat > Makefile.am <<'END'
+.PHONY: test
+check-local: test
+test: all
+       cat $(srcdir)/config.hin ;: For debugging.
+       cat config.h             ;: Likewise.
+       grep '#.*GREPME' $(srcdir)/config.hin
+       grep '#.*define.*GREPME' config.h
+END
+
 $ACLOCAL
 $AUTOCONF
 $AUTOHEADER
@@ -39,8 +47,7 @@ $MAKE
 $sleep
 echo 'AC_DEFINE([GREPME], 1, [Doc for GREPME])' > foo.m4
 
-$MAKE
-grep GREPME config.hin
-grep GREPME config.h
-
+$MAKE test
 $MAKE distcheck
+
+:
diff --git a/tests/backcompat2.test b/tests/backcompat2.test
index 98336ea..5be6aec 100755
--- a/tests/backcompat2.test
+++ b/tests/backcompat2.test
@@ -45,6 +45,11 @@ END
   # The non-empty third argument should prevent PACKAGE and VERSION
   # from being AC_DEFINE'd.
   $EGREP 'pkg(name|version)' config.h && Exit 1
+  # This is required because even relatively-recent versions of the
+  # BSD shell wrongly exit when the `errexit' shell flag is active if
+  # the last command of a compound statement fails, even if it should
+  # be protected by the use of "&&".
+  :
 done
 
 for am_extra_args in '' ',' ', []'; do
diff --git a/tests/compile.test b/tests/compile.test
index 8427bad..59717fb 100755
--- a/tests/compile.test
+++ b/tests/compile.test
@@ -22,7 +22,7 @@ cp "$top_testsrcdir/lib/compile" .
 
 # -o 'a  c' should not be stripped because 'a  c' is not an object
 # (it does not matter whether touch creates ./-- or not)
-./compile touch a.o -- -o 'a  c' a.c
+$SHELL compile touch a.o -- -o 'a  c' a.c
 test -f 'a  c'
 test -f ./-o
 test -f a.o
@@ -30,14 +30,14 @@ test -f a.c
 
 rm -f 'a  c' ./-o a.o a.c
 
-./compile touch a.o -- -o 'a  c.o' a.c
+$SHELL compile touch a.o -- -o 'a  c.o' a.c
 test -f 'a  c.o'
 test ! -f ./-o
 test ! -f a.o
 test -f a.c
 
 # Make sure `compile' works for .obj too.
-./compile touch a.obj -- -o ac.obj a.c
+$SHELL compile touch a.obj -- -o ac.obj a.c
 test ! -f a.obj
 test ac.obj
 
diff --git a/tests/compile2.test b/tests/compile2.test
index a466dc4..35c3d46 100755
--- a/tests/compile2.test
+++ b/tests/compile2.test
@@ -57,7 +57,7 @@ amtest_lock='slist_o.d'
 export amtest_source amtest_object amtest_obj amtest_lock
 
 : > "$amtest_source"
-./compile ./mycc -c "$amtest_source" -o "$amtest_object"
+$SHELL compile ./mycc -c "$amtest_source" -o "$amtest_object"
 test -f "$amtest_object"
 
 
@@ -78,7 +78,7 @@ amtest_lock='slist_o.d'
 export amtest_source amtest_object amtest_obj amtest_lock
 
 : > "$amtest_source"
-./compile ./mycc -c "$amtest_source" -o "$amtest_object"
+$SHELL compile ./mycc -c "$amtest_source" -o "$amtest_object"
 test -f "$amtest_object"
 
 :
diff --git a/tests/compile3.test b/tests/compile3.test
index f949d1c..141a17a 100755
--- a/tests/compile3.test
+++ b/tests/compile3.test
@@ -30,23 +30,23 @@ END
 chmod +x ./cl
 
 # Check if compile handles "-o foo", -I, -l, -L, -Xlinker -Wl,
-opts=`LIB= ./compile ./cl foo.c -o foo -lbar -Lgazonk -Ibaz -Xlinker foobar 
-Wl,-foo,bar`
+opts=`LIB='' $SHELL compile ./cl foo.c -o foo -lbar -Lgazonk -Ibaz -Xlinker 
foobar -Wl,-foo,bar`
 test x"$opts" = x"foo.c -Fefoo bar.lib -Ibaz -link -LIBPATH:gazonk foobar -foo 
bar"
 
 # Check if compile handles "-o foo.obj"
-opts=`./compile ./cl -c foo.c -o foo.obj -Ibaz`
+opts=`$SHELL compile ./cl -c foo.c -o foo.obj -Ibaz`
 test x"$opts" = x"-c foo.c -Fofoo.obj -Ibaz"
 
 # Check if compile handles "-o foo.o"
-opts=`./compile ./cl -c foo.c -o foo.o -Ibaz`
+opts=`$SHELL compile ./cl -c foo.c -o foo.o -Ibaz`
 test x"$opts" = x"-c foo.c -Fofoo.o -Ibaz"
 
 # Check if compile handles "foo.cc" as C++.
-opts=`./compile ./cl -c foo.cc -o foo.o -Ibaz`
+opts=`$SHELL compile ./cl -c foo.cc -o foo.o -Ibaz`
 test x"$opts" = x"-c -Tpfoo.cc -Fofoo.o -Ibaz"
 
 # Check if compile clears the "eat" variable properly.
-opts=`eat=1 ./compile ./cl -c foo.c -o foo.obj -Ibaz`
+opts=`eat=1 $SHELL compile ./cl -c foo.c -o foo.obj -Ibaz`
 test x"$opts" = x"-c foo.c -Fofoo.obj -Ibaz"
 
 :
diff --git a/tests/compile4.test b/tests/compile4.test
index cf8d6cb..a54a272 100755
--- a/tests/compile4.test
+++ b/tests/compile4.test
@@ -66,7 +66,7 @@ $AUTOMAKE -a
 ./configure
 $MAKE
 
-./compile cl $CPPFLAGS $CFLAGS -c -o "$absmainobj" "$absmainc"
+$SHELL compile cl $CPPFLAGS $CFLAGS -c -o "$absmainobj" "$absmainc"
 
 # cl expects archives to be named foo.lib, not libfoo.a so
 # make a simple copy here if needed. This is a severe case
@@ -76,7 +76,7 @@ if test -f sub/libfoo.a; then
   cp sub/libfoo.a sub/foo.lib
 fi
 
-./compile cl $CFLAGS $LDFLAGS -L"$absfoodir" "$absmainobj" -o main -lfoo
+$SHELL compile cl $CFLAGS $LDFLAGS -L"$absfoodir" "$absmainobj" -o main -lfoo
 
 ./main
 
diff --git a/tests/compile5.test b/tests/compile5.test
index cd8baee..d2aa210 100755
--- a/tests/compile5.test
+++ b/tests/compile5.test
@@ -67,7 +67,7 @@ pwd=`pwd`
 # Check if "compile cl" transforms absolute file names to
 # host format (e.g /somewhere -> c:/msys/1.0/somewhere).
 
-res=`./compile ./cl -L"$pwd" | sed -e 's/-link -LIBPATH://'`
+res=`$SHELL ./compile ./cl -L"$pwd" | sed -e 's/-link -LIBPATH://'`
 
 case $res in
   ?:[\\/]*)
diff --git a/tests/compile6.test b/tests/compile6.test
index 02feb4b..fc39f10 100755
--- a/tests/compile6.test
+++ b/tests/compile6.test
@@ -41,42 +41,42 @@ mkdir lib
 :> lib/bar.dll.lib
 
 # Check if compile library search correctly
-opts=`./compile ./cl foo.c -o foo -Llib -lbar -lfoo`
+opts=`$SHELL compile ./cl foo.c -o foo -Llib -lbar -lfoo`
 test x"$opts" = x"foo.c -Fefoo lib/bar.dll.lib $syslib/foo.lib -link 
-LIBPATH:lib"
 
 # Check if -static makes compile avoid bar.dll.lib
-opts=`./compile ./cl foo.c -o foo -Llib -static -lbar -lfoo`
+opts=`$SHELL compile ./cl foo.c -o foo -Llib -static -lbar -lfoo`
 test x"$opts" = x"foo.c -Fefoo lib/bar.lib $syslib/foo.lib -link -LIBPATH:lib"
 
 :> syslib/bar.lib
 :> syslib/bar.dll.lib
 
 # Check if compile finds bar.dll.lib in syslib
-opts=`./compile ./cl foo.c -o foo -lbar -lfoo`
+opts=`$SHELL compile ./cl foo.c -o foo -lbar -lfoo`
 test x"$opts" = x"foo.c -Fefoo $syslib/bar.dll.lib $syslib/foo.lib"
 
 # Check if compile prefers -L over $LIB
-opts=`./compile ./cl foo.c -o foo -Llib -lbar -lfoo`
+opts=`$SHELL compile ./cl foo.c -o foo -Llib -lbar -lfoo`
 test x"$opts" = x"foo.c -Fefoo lib/bar.dll.lib $syslib/foo.lib -link 
-LIBPATH:lib"
 
 mkdir lib2
 :> lib2/bar.dll.lib
 
 # Check if compile avoids bar.dll.lib in lib2 when -static
-opts=`./compile ./cl foo.c -o foo -Llib2 -static -lbar -lfoo`
+opts=`$SHELL compile ./cl foo.c -o foo -Llib2 -static -lbar -lfoo`
 test x"$opts" = x"foo.c -Fefoo $syslib/bar.lib $syslib/foo.lib -link 
-LIBPATH:lib2"
 
 # Check if compile gets two different bar libraries when -static
 # is added in the middle
-opts=`./compile ./cl foo.c -o foo -Llib2 -Llib -lbar -static -lbar`
+opts=`$SHELL compile ./cl foo.c -o foo -Llib2 -Llib -lbar -static -lbar`
 test x"$opts" = x"foo.c -Fefoo lib2/bar.dll.lib lib/bar.lib -link 
-LIBPATH:lib2 -LIBPATH:lib"
 
 # Check if compile gets the correct bar.dll.lib
-opts=`./compile ./cl foo.c -o foo -Llib -Llib2 -lbar -lfoo`
+opts=`$SHELL compile ./cl foo.c -o foo -Llib -Llib2 -lbar -lfoo`
 test x"$opts" = x"foo.c -Fefoo lib/bar.dll.lib $syslib/foo.lib -link 
-LIBPATH:lib -LIBPATH:lib2"
 
 # Check if compile gets the correct bar.dll.lib
-opts=`./compile ./cl foo.c -o foo -Llib2 -Llib -lbar -lfoo`
+opts=`$SHELL compile ./cl foo.c -o foo -Llib2 -Llib -lbar -lfoo`
 test x"$opts" = x"foo.c -Fefoo lib2/bar.dll.lib $syslib/foo.lib -link 
-LIBPATH:lib2 -LIBPATH:lib"
 
 mkdir "sys  lib2"
@@ -87,11 +87,11 @@ LIB="$syslib2;$LIB"
 
 # Check if compile handles spaces in $LIB and that it prefers the order
 # in a multi-component $LIB.
-opts=`./compile ./cl foo.c -o foo -lfoo`
+opts=`$SHELL compile ./cl foo.c -o foo -lfoo`
 test x"$opts" = x"foo.c -Fefoo $syslib2/foo.dll.lib"
 
 # Check if compile handles the 2nd directory in a multi-component $LIB.
-opts=`./compile ./cl foo.c -o foo -static -lfoo`
+opts=`$SHELL compile ./cl foo.c -o foo -static -lfoo`
 test x"$opts" = x"foo.c -Fefoo $syslib/foo.lib"
 
 :
diff --git a/tests/cond29.test b/tests/cond29.test
index b07a7a9..3361081 100755
--- a/tests/cond29.test
+++ b/tests/cond29.test
@@ -32,8 +32,9 @@ EOF
 # to define a01_DEPENDENCIES, a02_DEPENDENCIES, a03_OBJECTS,
 # a04_OBJECTS, and to rewrite bin_PROGRAM), eating all memory, swap,
 # or cpu time it can found.
-ulimit -v 20000 || skip_ "no adequate 'ulimit' builtin found"
-(ulimit -v 1; sh -c 'exit 0') && skip_ "no adequate 'ulimit' builtin found"
+(ulimit -v 1; sh -c ":") && skip_ "no adequate 'ulimit' builtin found"
+(ulimit -v 20000; sh -c ":") || skip_ "no adequate 'ulimit' builtin found"
+ulimit -v 20000
 
 for i in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22; do
   unindent >>Makefile.am <<EOF
diff --git a/tests/conff.test b/tests/conff.test
index 1565271..2f0214a 100755
--- a/tests/conff.test
+++ b/tests/conff.test
@@ -17,7 +17,6 @@
 # Make sure rebuild rules work even when AC_CONFIG_FILES uses colons.
 # Report from Alexander Turbov.
 
-required=GNUmake
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
@@ -48,10 +47,10 @@ $AUTOMAKE
 $MAKE
 
 cd bar
-$MAKE top-rule >stdout
+$MAKE top-rule >stdout || { cat stdout; Exit 1; }
 cat stdout
 grep 'top rule' stdout
-$MAKE bot-rule >stdout
+$MAKE bot-rule >stdout || { cat stdout; Exit 1; }
 cat stdout
 grep 'bot rule' stdout
 cd ..
@@ -65,10 +64,10 @@ END
 $MAKE
 
 cd bar
-$MAKE top-rule >stdout
+$MAKE top-rule >stdout || { cat stdout; Exit 1; }
 cat stdout
 grep 'top2 rule' stdout
-$MAKE bot-rule >stdout
+$MAKE bot-rule >stdout || { cat stdout; Exit 1; }
 cat stdout
 grep 'bot rule' stdout
 cd ..
@@ -82,10 +81,10 @@ END
 $MAKE
 
 cd bar
-$MAKE top-rule >stdout
+$MAKE top-rule >stdout || { cat stdout; Exit 1; }
 cat stdout
 grep 'top2 rule' stdout
-$MAKE bot-rule >stdout
+$MAKE bot-rule >stdout || { cat stdout; Exit 1; }
 cat stdout
 grep 'bot2 rule' stdout
 cd ..
diff --git a/tests/confh6.test b/tests/confh6.test
index c00190f..c03880b 100755
--- a/tests/confh6.test
+++ b/tests/confh6.test
@@ -19,7 +19,6 @@
 # idea is that if config.h is in a subdir, and there is no Makefile in
 # that subdir, then we want to build config.h as the top level.
 
-required=GNUmake
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/depcomp8a.test b/tests/depcomp8a.test
index 9866cfd..5b20304 100755
--- a/tests/depcomp8a.test
+++ b/tests/depcomp8a.test
@@ -56,7 +56,7 @@ $AUTOCONF
 ./configure --enable-dependency-tracking
 $MAKE
 cross_compiling || ./zardoz
-$MAKE DISTCHECK_CONFIGURE_FLAGS='--enable-dependency-tracking' distcheck
+DISTCHECK_CONFIGURE_FLAGS='--enable-dependency-tracking' $MAKE distcheck
 
 # Try again with subdir-objects option.
 
@@ -75,6 +75,6 @@ $AUTOCONF
 ./configure --enable-dependency-tracking
 $MAKE
 cross_compiling || ./zardoz
-$MAKE DISTCHECK_CONFIGURE_FLAGS='--enable-dependency-tracking' distcheck
+DISTCHECK_CONFIGURE_FLAGS='--enable-dependency-tracking' $MAKE distcheck
 
 :
diff --git a/tests/depcomp8b.test b/tests/depcomp8b.test
index 15dd109..509bcb2 100755
--- a/tests/depcomp8b.test
+++ b/tests/depcomp8b.test
@@ -50,7 +50,7 @@ $AUTOCONF
 # Don't reject slower dependency extractors, for better coverage.
 ./configure --enable-dependency-tracking
 $MAKE
-$MAKE DISTCHECK_CONFIGURE_FLAGS='--enable-dependency-tracking' distcheck
+DISTCHECK_CONFIGURE_FLAGS='--enable-dependency-tracking' $MAKE distcheck
 
 # Try again with subdir-objects option.
 
@@ -68,6 +68,6 @@ $AUTOCONF
 # Don't reject slower dependency extractors, for better coverage.
 ./configure --enable-dependency-tracking
 $MAKE
-$MAKE DISTCHECK_CONFIGURE_FLAGS='--enable-dependency-tracking' distcheck
+DISTCHECK_CONFIGURE_FLAGS='--enable-dependency-tracking' $MAKE distcheck
 
 :
diff --git a/tests/depmod-data.test b/tests/depmod-data.test
index fdaa52b..18c26eb 100755
--- a/tests/depmod-data.test
+++ b/tests/depmod-data.test
@@ -19,12 +19,14 @@
 # `depmod-test.sh'.
 
 # Ensure proper definition of $testsrcdir.
+# FIXME: we employ useless quoting below to please maintainer-check.
 . ./defs-static || exit 99
 
 # Sanity check.
 if test x"$testsrcdir" = x; then
   echo "$0: \$testsrcdir not set after sourcing of ./defs-static" >&2
-  exit 99
+  # FIXME: we employ useless quoting below to please maintainer-check.
+  'exit' 99
 fi
 
 exec $SHELL $testsrcdir/depmod-tests.sh --generate-data
diff --git a/tests/instdir-ltlib.test b/tests/instdir-ltlib.test
index 0d9afd6..d84ae3c 100755
--- a/tests/instdir-ltlib.test
+++ b/tests/instdir-ltlib.test
@@ -76,9 +76,11 @@ test ! -d "$instdir"
 test ! -d "$destdir"
 $MAKE -e uninstall > stdout || { cat stdout; Exit 1; }
 cat stdout
-grep 'rm ' stdout && Exit 1
+# FIXME: creative quoting below to please maintainer-check.
+grep 'rm'' ' stdout && Exit 1
 $MAKE -e uninstall DESTDIR="$destdir" > stdout || { cat stdout; Exit 1; }
 cat stdout
-grep 'rm ' stdout && Exit 1
+# FIXME: creative quoting below to please maintainer-check.
+grep 'rm'' ' stdout && Exit 1
 
 :
diff --git a/tests/instdir-prog.test b/tests/instdir-prog.test
index 9ca67ad..cd591fb 100755
--- a/tests/instdir-prog.test
+++ b/tests/instdir-prog.test
@@ -75,9 +75,11 @@ test ! -d "$instdir"
 test ! -d "$destdir"
 $MAKE -e uninstall > stdout || { cat stdout; Exit 1; }
 cat stdout
-grep 'rm ' stdout && Exit 1
+# FIXME: creative quoting below to please maintainer-check.
+grep 'rm'' ' stdout && Exit 1
 $MAKE -e uninstall DESTDIR="$destdir" > stdout || { cat stdout; Exit 1; }
 cat stdout
-grep 'rm ' stdout && Exit 1
+# FIXME: creative quoting below to please maintainer-check.
+grep 'rm'' ' stdout && Exit 1
 
 :
diff --git a/tests/instsh2.test b/tests/instsh2.test
index 2019b35..294e1fa 100755
--- a/tests/instsh2.test
+++ b/tests/instsh2.test
@@ -19,95 +19,95 @@
 
 . ./defs || Exit 1
 # Basic errors
-./install-sh && Exit 1
-./install-sh -m 644 dest && Exit 1
+$SHELL install-sh && Exit 1
+$SHELL install-sh -m 644 dest && Exit 1
 
 # Directories
 
 # It should be OK to create no directory.  We sometimes need
 # this when directory are conditionally defined.
-./install-sh -d
+$SHELL install-sh -d
 # One directory.
-./install-sh -d d0
+$SHELL install-sh -d d0
 test -d d0
 # Multiple directories (for make installdirs).
-./install-sh -d d1 d2 d3 d4
+$SHELL install-sh -d d1 d2 d3 d4
 test -d d1
 test -d d2
 test -d d3
 test -d d4
 # Subdirectories
-./install-sh -d p1/p2/p3 p4//p5//p6//
+$SHELL install-sh -d p1/p2/p3 p4//p5//p6//
 test -d p1/p2/p3
 test -d p4/p5/p6
 
 # Files.
 : > x
-./install-sh -c -m 644 x y
+$SHELL install-sh -c -m 644 x y
 test -f x
 test -f y
-./install-sh -m 644 y z
+$SHELL install-sh -m 644 y z
 test -f y
 test -f z
 # Multiple files
-./install-sh -m 644 -c x z d1
+$SHELL install-sh -m 644 -c x z d1
 test -f x
 test -f z
 test -f d1/x
 test -f d1/z
-./install-sh -m 644 x z d2//
+$SHELL install-sh -m 644 x z d2//
 test -f x
 test -f z
 test -f d2/x
 test -f d2/z
-./install-sh -t d3 -m 644 x z
+$SHELL install-sh -t d3 -m 644 x z
 test -f x
 test -f z
 test -f d3/x
 test -f d3/z
-./install-sh -t d4// -m 644 x z
+$SHELL install-sh -t d4// -m 644 x z
 test -f x
 test -f z
 test -f d4/x
 test -f d4/z
-./install-sh -T x d3/y
+$SHELL install-sh -T x d3/y
 test -f x
 test -f d3/y
-./install-sh -T x d3 && Exit 1
-./install-sh -T x d4// && Exit 1
+$SHELL install-sh -T x d3 && Exit 1
+$SHELL install-sh -T x d4// && Exit 1
 
 # Ensure that install-sh works with names that include spaces.
 touch 'a  b'
 mkdir 'x  y'
-./install-sh 'a  b' 'x  y'
+$SHELL install-sh 'a  b' 'x  y'
 test -f x\ \ y/a\ \ b
 test -f 'a  b'
 
 # Ensure we do not run into `test' operator precedence bugs with Tru64 sh.
 for c in = '(' ')' '!'; do
-  ./install-sh $c 2>stderr && { cat stderr >&2; Exit 1; }
+  $SHELL install-sh $c 2>stderr && { cat stderr >&2; Exit 1; }
   cat stderr >&2
   grep 'test: ' stderr && Exit 1
   # Skip tests if the file system is not capable.
   mkdir ./$c || continue
   rmdir ./$c
-  ./install-sh -d $c/$c/$c
+  $SHELL install-sh -d $c/$c/$c
   rm -rf ./$c
-  ./install-sh -d $c d5/$c/$c
+  $SHELL install-sh -d $c d5/$c/$c
   test -d ./$c
   test -d d5/$c/$c
-  ./install-sh x $c
+  $SHELL install-sh x $c
   test -f ./$c/x
   rm -f ./$c/x
-  ./install-sh -t $c x
+  $SHELL install-sh -t $c x
   test -f ./$c/x
   rm -rf ./$c
   ( : > ./$c ) || continue
-  ./install-sh $c x d5/$c/$c
+  $SHELL install-sh $c x d5/$c/$c
   test -f d5/$c/$c/x
   test -f d5/$c/$c/$c
   rm -f d5/$c/$c/?
-  ./install-sh -t d5/$c/$c $c x
+  $SHELL install-sh -t d5/$c/$c $c x
   test -f d5/$c/$c/x
   test -f d5/$c/$c/$c
 done
diff --git a/tests/instsh3.test b/tests/instsh3.test
index da50419..788cf1d 100755
--- a/tests/instsh3.test
+++ b/tests/instsh3.test
@@ -23,18 +23,20 @@ required=non-root
 touch -t $old_timestamp foo \
   || skip_ "touch utility doesn't accept '-t' option"
 
-./install-sh -d d1
+$SHELL install-sh -d d1
 
 # Do not change the timestamps when using -C.
 echo foo >file
-./install-sh -C file d1
+$SHELL install-sh -C file d1
 TZ=UTC0 touch -t $old_timestamp d1/file
-./install-sh -C file d1
+$SHELL install-sh -C file d1
 is_newest file d1/file
 echo foo1 >file
-./install-sh -C file d1
+$SHELL install-sh -C file d1
 diff file d1/file
 # Rights must be updated.
-./install-sh -C -m 444 file d1
+$SHELL install-sh -C -m 444 file d1
 test -r d1/file
 test ! -w d1/file
+
+:
diff --git a/tests/instspc-data.test b/tests/instspc-data.test
index 54f796c..7b222ff 100755
--- a/tests/instspc-data.test
+++ b/tests/instspc-data.test
@@ -18,12 +18,14 @@
 # It basically delegates the work to the driver script `instspc-test.sh'.
 
 # Ensure proper definition of $testsrcdir.
-. ./defs-static || exit 99
+# FIXME: we employ useless quoting below to please maintainer-check.
+. ./defs-static || 'exit' 99
 
 # Sanity check.
 if test x"$testsrcdir" = x; then
   echo "$0: \$testsrcdir not set after sourcing of ./defs-static" >&2
-  exit 99
+  # FIXME: we employ useless quoting below to please maintainer-check.
+  'exit' 99
 fi
 
 exec $SHELL $testsrcdir/instspc-tests.sh --generate-data
diff --git a/tests/lex3.test b/tests/lex3.test
index ae79796..dca98ba 100755
--- a/tests/lex3.test
+++ b/tests/lex3.test
@@ -19,7 +19,7 @@
 # Test associated with PR 19.
 # From Matthew D. Langston.
 
-required='cc flex GNUmake'
+required='cc flex'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/lex5.test b/tests/lex5.test
index ee4306f..932a374 100755
--- a/tests/lex5.test
+++ b/tests/lex5.test
@@ -17,7 +17,7 @@
 
 # Test for subdir lexers.
 
-required='cc GNUmake flex'
+required='cc flex'
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
@@ -85,6 +85,7 @@ $AUTOMAKE -a --no-force
 test -f ./ylwrap
 
 cd sub
+using_gmake || $MAKE Makefile
 $MAKE foo/foo2.o
 test -f foo/foo2.c
 test -f foo/foo2.o
diff --git a/tests/maken2.test b/tests/maken2.test
index eb330a2..a6625e2 100755
--- a/tests/maken2.test
+++ b/tests/maken2.test
@@ -14,8 +14,9 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Ensure that `make -n dist' and `make -n distcheck' show what would happen.
-# This currently works for GNU make only.
+# Ensure that `make -n dist' and `make -n distcheck' show what would
+# happen.  This currently works for GNU make, but might fail with other
+# make implementations (e.g., FreeBSD's or NetBSD's).
 
 # Please keep this test in sync with sister test maken.test.
 
diff --git a/tests/maken4.test b/tests/maken4.test
index 5c21943..bef1389 100755
--- a/tests/maken4.test
+++ b/tests/maken4.test
@@ -23,9 +23,24 @@
 
 # Please keep this test in sync with sister test maken3.test.
 
-required=GNUmake
 . ./defs || Exit 1
 
+if using_gmake; then
+  : Good, make is GNU make.
+else
+  unindent > mk.tmp << 'END'
+    targ.tmp:
+       : > $@
+    .MAKE: targ.tmp
+END
+  if $MAKE -n -f mk.tmp targ.tmp && test -f targ.tmp; then
+    : Good, make supports the '.MAKE' special target.
+  else
+    skip_ "GNU or BSD make required"
+  fi
+  rm -f *.tmp
+fi
+
 mkdir sub sub2
 
 cat >> configure.in << 'END'
diff --git a/tests/missing.test b/tests/missing.test
index 2e6d8d3..0e6d0ea 100755
--- a/tests/missing.test
+++ b/tests/missing.test
@@ -32,7 +32,7 @@ $AUTOMAKE --add-missing
 # Make sure we do use missing, even if the user exported AUTOCONF.
 # (We cannot export this new value, because it would be used by Automake
 # when tracing, and missing is no good for this.)
-MYAUTOCONF="./missing --run $AUTOCONF"
+MYAUTOCONF="$SHELL ./missing --run $AUTOCONF"
 unset AUTOCONF
 
 ./configure AUTOCONF="$MYAUTOCONF"
diff --git a/tests/missing2.test b/tests/missing2.test
index 88e6b27..304c3a6 100755
--- a/tests/missing2.test
+++ b/tests/missing2.test
@@ -33,7 +33,7 @@ $AUTOCONF
 $AUTOMAKE --add-missing
 
 # See missing.test for explanations about this.
-MYAUTOCONF="./missing --run $AUTOCONF"
+MYAUTOCONF="$SHELL missing --run $AUTOCONF"
 unset AUTOCONF
 
 ./configure AUTOCONF="$MYAUTOCONF"
diff --git a/tests/missing3.test b/tests/missing3.test
index 21b5e4f..f0b6907 100755
--- a/tests/missing3.test
+++ b/tests/missing3.test
@@ -20,31 +20,40 @@
 
 # b7cb8259 assumed not to exist.
 
-./missing b7cb8259 --version 2>stderr && { cat stderr >&2; Exit 1; }
+$SHELL missing b7cb8259 --version 2>stderr \
+  && { cat stderr >&2; Exit 1; }
 cat stderr >&2
 grep . stderr && Exit 1
-./missing b7cb8259 --grep 2>stderr && { cat stderr >&2; Exit 1; }
+$SHELL missing b7cb8259 --grep 2>stderr \
+  && { cat stderr >&2; Exit 1; }
 cat stderr >&2
 grep WARNING stderr
 
-./missing --run b7cb8259 --version && Exit 1
-./missing --run b7cb8259 --grep 2>stderr && { cat stderr >&2; Exit 1; }
+$SHELL missing --run b7cb8259 --version && Exit 1
+$SHELL missing --run b7cb8259 --grep 2>stderr \
+  && { cat stderr >&2; Exit 1; }
 cat stderr >&2
 grep WARNING stderr
 
 # missing itself it known to exist :)
 
-./missing ./missing --version 2>stderr && { cat stderr >&2; Exit 1; }
+$SHELL missing ./missing --version 2>stderr \
+  && { cat stderr >&2; Exit 1; }
 cat stderr >&2
 grep . stderr && Exit 1
-./missing ./missing --grep 2>stderr && { cat stderr >&2; Exit 1; }
+$SHELL missing ./missing --grep 2>stderr \
+  && { cat stderr >&2; Exit 1; }
 cat stderr >&2
 grep WARNING stderr
 
-./missing --run ./missing --version 2>stderr || { cat stderr >&2; Exit 1; }
+$SHELL missing --run ./missing --version 2>stderr \
+  || { cat stderr >&2; Exit 1; }
 cat stderr >&2
 grep . stderr && Exit 1
-./missing --run ./missing --grep 2>stderr && { cat stderr >&2; Exit 1; }
+$SHELL missing --run ./missing --grep 2>stderr \
+  && { cat stderr >&2; Exit 1; }
 cat stderr >&2
 grep WARNING stderr && Exit 1
 grep Unknown stderr
+
+:
diff --git a/tests/missing5.test b/tests/missing5.test
index 010b344..91e5857 100755
--- a/tests/missing5.test
+++ b/tests/missing5.test
@@ -33,9 +33,9 @@ AC_OUTPUT
 EOF
 
 for tool in $needed_tools; do
-  cat >$tool.in <<EOF
-#! /bin/sh
-exec @$tool@ "\$@"
+  unindent >$tool.in <<EOF
+    #! /bin/sh
+    exec @$tool@ "\$@"
 EOF
 done
 
@@ -48,14 +48,16 @@ cp output-file my--output--file-o
 save_PATH=$PATH
 PATH=.
 export PATH
-missing --help
-missing --version
+$SHELL missing --help
+$SHELL missing --version
 for tool in autom4te help2man makeinfo; do
-  missing --run $tool -o my--output--file-o input
-  missing --run $tool --output my--output--file-o input
+  $SHELL missing --run $tool -o my--output--file-o input
+  $SHELL missing --run $tool --output my--output--file-o input
 done
 PATH=$save_PATH
 export PATH
 diff output-file my--output--file-o
 test ! -f ./--file-o
 test ! -f input
+
+:
diff --git a/tests/mkinst3.test b/tests/mkinst3.test
index 0082b53..d24f5ae 100755
--- a/tests/mkinst3.test
+++ b/tests/mkinst3.test
@@ -27,7 +27,7 @@ cp "$top_testsrcdir/lib/mkinstalldirs" .
 
 # Test mkinstalldirs with the installed mkdir.
 
-./mkinstalldirs '~a b/-x  y'
+$SHELL mkinstalldirs '~a b/-x  y'
 test -d '~a b/-x  y'
 rm -rf '~a b'
 
@@ -55,10 +55,12 @@ export PATH
 
 # Test mkinstalldirs without mkdir -p.
 
-./mkinstalldirs '~a b/-x  y'
+$SHELL mkinstalldirs '~a b/-x  y'
 test -d '~a b/-x  y'
 rm -rf '~a b'
 
-./mkinstalldirs "`pwd`///~a b//-x  y"
+$SHELL mkinstalldirs "`pwd`///~a b//-x  y"
 test -d "`pwd`/~a b/-x  y"
 rm -rf '~a b'
+
+:
diff --git a/tests/output6.test b/tests/output6.test
index 483de80..e283919 100755
--- a/tests/output6.test
+++ b/tests/output6.test
@@ -16,13 +16,12 @@
 
 # Check for support for colon separated input files in AC_CONFIG_FILES
 
-required=GNUmake
 . ./defs || Exit 1
 
 cat > configure.in << END
 AC_INIT([$me], [1.0])
 AM_INIT_AUTOMAKE
-AC_CONFIG_FILES(foo:a.in:b.in:c.in:d.in)
+AC_CONFIG_FILES([foo:a.in:b.in:c.in:d.in])
 AC_OUTPUT
 END
 
@@ -43,8 +42,11 @@ cat >c.am <<'EOF'
 c = C
 d = C
 
-print:
-       @echo $a$b$c$d
+.PHONY: test1 test2
+test1:
+       test $(a)$(b)$(c)$(d) = ABCD
+test2:
+       test $(a)$(b)$(c)$(d) = GFCD
 EOF
 
 echo 'd = D' > d.in
@@ -54,7 +56,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 ./configure
-$MAKE -f foo print | grep 'ABCD'
+$MAKE -f foo test1
 
 $sleep
 cat >b.in <<'EOF'
@@ -64,5 +66,7 @@ c = F
 d = F
 EOF
 
-# This involves the rebuild rule, hence it requires GNUmake
-$MAKE -f foo print | grep 'GFCD'
+using_gmake || $MAKE -f foo
+$MAKE -f foo test2
+
+:
diff --git a/tests/gcj6.test b/tests/remake-subdir-from-subdir.test
similarity index 54%
copy from tests/gcj6.test
copy to tests/remake-subdir-from-subdir.test
index 347afd1..f844550 100755
--- a/tests/gcj6.test
+++ b/tests/remake-subdir-from-subdir.test
@@ -14,38 +14,45 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# AM_PROG_GCJ should cause OBJEXT and EXEEXT to be set.
+# Check that remake rules works for adding a new subdirectory from a
+# pre-existing subdirectory.
+# See also the other similar tests `remake-subdir*.test', and the
+# related test `aclocal5.test'.
 
-required='gcj'
 . ./defs || Exit 1
 
-cat >> configure.in << 'END'
-AM_PROG_GCJ
+set -e
+
+cat >> configure.in <<'END'
+m4_include([subdirs.m4])
+AC_SUBST([MAGIC], [magic])
 AC_OUTPUT
 END
 
-cat > Makefile.am << 'END'
-noinst_PROGRAMS = test
-test_SOURCES = Test.java
-test_LDFLAGS = --main=Test
-END
+echo 'AC_CONFIG_FILES([sub/Makefile])' > subdirs.m4
+echo 'SUBDIRS = sub' > Makefile.am
 
-cat >Test.java << 'END'
-public class Test {
-    public static void main(String[] argv) {
-        System.out.println("Hello, automake!");
-    }
-}
-END
+mkdir sub
+: > sub/Makefile.am
 
 $ACLOCAL
-$AUTOMAKE
 $AUTOCONF
+$AUTOMAKE
+
 ./configure
+$MAKE
 
-# These fail without e.g., AC_PROG_CC.
+cd sub
+$sleep
+echo 'AC_CONFIG_FILES([sub/subsub/Makefile])' >> ../subdirs.m4
+echo 'SUBDIRS = subsub' >> Makefile.am
+mkdir subsub
+cat > subsub/Makefile.am <<'END'
+all-local:
+       : > ok-it-works
+END
+using_gmake || $MAKE Makefile
 $MAKE
-grep "OBJEXT = " Makefile
-grep "EXEEXT = " Makefile
+test -f subsub/ok-it-works
 
 :
diff --git a/tests/remake-subdir-gnu.test b/tests/remake-subdir-gnu.test
new file mode 100755
index 0000000..7865c20
--- /dev/null
+++ b/tests/remake-subdir-gnu.test
@@ -0,0 +1,82 @@
+#! /bin/sh
+# Copyright (C) 2011 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 remake rules works from subdirectories, even using
+# `GNUmakefile' as makefiles name.  This obviously requires GNU
+# make.
+# See also the other similar tests `remake-subdir*.test', and the
+# related test `aclocal5.test'
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+magic1='::MagicString::One::'
+magic2='__MagicString__Two__'
+
+debug_info ()
+{
+  grep -i magic configure GNUmakefile.in GNUmakefile \
+                sub/GNUmakefile.in sub/GNUmakefile
+}
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([GNUmakefile sub/GNUmakefile])
+AC_SUBST([MAGIC], [magic])
+AC_OUTPUT
+END
+
+cat > GNUmakefile.am <<'END'
+SUBDIRS = sub
+END
+
+mkdir sub
+: > sub/GNUmakefile.am
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+$MAKE
+debug_info
+
+$sleep
+sed "s|magic|$magic1|" configure.in > t
+mv -f t configure.in
+cd sub
+$MAKE
+cd ..
+debug_info
+$FGREP $magic1 configure
+$FGREP $magic1 GNUmakefile
+$FGREP $magic1 sub/GNUmakefile
+
+$sleep
+cd sub
+echo MAGIC = $magic2 >> GNUmakefile.am
+$MAKE
+cd ..
+debug_info
+$FGREP $magic2 sub/GNUmakefile
+$FGREP $magic2 sub/GNUmakefile.in
+$FGREP $magic1 sub/GNUmakefile sub/GNUmakefile.in && Exit 1
+$FGREP $magic2 GNUmakefile GNUmakefile.in && Exit 1
+
+:
diff --git a/tests/remake-subdir.test b/tests/remake-subdir.test
new file mode 100755
index 0000000..3ccfee5
--- /dev/null
+++ b/tests/remake-subdir.test
@@ -0,0 +1,83 @@
+#! /bin/sh
+# Copyright (C) 2011 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 remake rules works from subdirectories, even with non-GNU
+# make implementations.
+# See also the other similar tests `remake-subdir*.test', and the
+# related test `aclocal5.test'
+
+. ./defs || Exit 1
+
+set -e
+
+if using_gmake; then
+  remake=$MAKE
+else
+  remake="$MAKE Makefile"
+fi
+
+magic1='::MagicString::One::'
+magic2='__MagicString__Two__'
+
+debug_info ()
+{
+  grep -i magic configure Makefile.in Makefile sub/Makefile.in sub/Makefile
+}
+
+cat >> configure.in <<'END'
+AC_CONFIG_FILES([sub/Makefile])
+AC_SUBST([MAGIC], [magic])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+SUBDIRS = sub
+END
+
+mkdir sub
+: > sub/Makefile.am
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+$MAKE
+debug_info
+
+$sleep
+sed "s|magic|$magic1|" configure.in > t
+mv -f t configure.in
+cd sub
+$remake
+cd ..
+debug_info
+$FGREP $magic1 configure
+$FGREP $magic1 Makefile
+$FGREP $magic1 sub/Makefile
+
+$sleep
+cd sub
+echo MAGIC = $magic2 >> Makefile.am
+$remake
+cd ..
+debug_info
+$FGREP $magic2 sub/Makefile
+$FGREP $magic2 sub/Makefile.in
+$FGREP $magic1 sub/Makefile sub/Makefile.in && Exit 1
+$FGREP $magic2 Makefile Makefile.in && Exit 1
+
+:
diff --git a/tests/remake-subdir2.test b/tests/remake-subdir2.test
new file mode 100755
index 0000000..dcf306e
--- /dev/null
+++ b/tests/remake-subdir2.test
@@ -0,0 +1,84 @@
+#! /bin/sh
+# Copyright (C) 2011 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 remake rules works from subdirectories, even when makefiles
+# are not named "Makefile".
+# See also the other similar tests `remake-subdir*.test', and the
+# related test `aclocal5.test'
+
+. ./defs || Exit 1
+
+set -e
+
+magic1='::MagicString::One::'
+magic2='__MagicString__Two__'
+
+debug_info ()
+{
+  grep -i magic configure build.in build.mk sub/build.in sub/build.mk
+}
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([build.mk:build.in])
+AC_CONFIG_FILES([sub/build.mk:sub/build.in])
+AC_SUBST([MAGIC], [magic])
+AC_OUTPUT
+END
+
+cat > build.am <<'END'
+AM_MAKEFLAGS = -f build.mk
+SUBDIRS = sub
+END
+
+mkdir sub
+cat > sub/build.am <<'END'
+AM_MAKEFLAGS = -f build.mk
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+ls -l # For debugging.
+
+$MAKE -f build.mk
+debug_info
+
+$sleep
+sed "s|magic|$magic1|" configure.in > t
+mv -f t configure.in
+cd sub
+$MAKE -f build.mk build.mk
+cd ..
+debug_info
+$FGREP $magic1 configure
+$FGREP $magic1 build.mk
+$FGREP $magic1 sub/build.mk
+
+$sleep
+cd sub
+echo MAGIC = $magic2 >> build.am
+$MAKE -f build.mk build.mk
+cd ..
+debug_info
+$FGREP $magic2 sub/build.mk
+$FGREP $magic2 sub/build.in
+$FGREP $magic1 sub/build.in sub/build.mk && Exit 1
+$FGREP $magic2 build.in build.mk && Exit 1
+
+:
diff --git a/tests/remake11.test b/tests/remake11.test
index bfd682e..493fcf3 100755
--- a/tests/remake11.test
+++ b/tests/remake11.test
@@ -19,7 +19,6 @@
 # rules don't break in obvious ways in a slightly "heavier than usual"
 # setup.
 
-required=GNUmake
 . ./defs || Exit 1
 
 ocwd=`pwd` || Exit 1
diff --git a/tests/self-check-exit.test b/tests/self-check-exit.test
index f8c5334..04c27fd 100755
--- a/tests/self-check-exit.test
+++ b/tests/self-check-exit.test
@@ -22,6 +22,7 @@
 . ./defs-static || exit 99
 
 unset am_explicit_skips
+AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC
 
 for st in 1 2 3 4 5 77 99 126 127 128 129 130 255; do
 
diff --git a/tests/silent-many-generic.test b/tests/silent-many-generic.test
index 17dea2c..b2c7e89 100755
--- a/tests/silent-many-generic.test
+++ b/tests/silent-many-generic.test
@@ -99,11 +99,27 @@ mkdir sub
 cat >>configure.in <<'EOF'
 AM_SILENT_RULES
 AM_PROG_CC_C_O
-AC_PROG_CXX
 AC_PROG_F77
 AC_PROG_FC
 AC_PROG_LEX
 AC_PROG_YACC
+AC_PROG_CXX
+
+# The SunStudio C++ compiler is unfortunately named `CC' (yuck!),
+# and this can cause problems with our grepping checks on the
+# output from make.  Avoid these problems by invoking a wrapper
+# script, as filtering the make output proved too fragile.
+case " $CXX " in
+  *' CC '*|*'/CC '*)
+    AC_MSG_WARN([the C++ compiler '$CXX' seems to be named 'CC'])
+    AC_MSG_WARN([it will be wrapped with the custom script 'am--cxx'])
+    echo '#!/bin/sh' > bin/am--cxx
+    echo 'PATH=$saved_PATH; export PATH' >> bin/am--cxx
+    echo "exec $CXX \${1+"\$@"}" >> bin/am--cxx
+    chmod a+x bin/am--cxx
+    CXX=am--cxx
+esac
+
 AC_CONFIG_FILES([sub/Makefile])
 AC_OUTPUT
 EOF
@@ -182,6 +198,10 @@ cp foo3.f sub/baz3.f
 cp foo5.l sub/baz5.l
 cp foo6.y sub/baz6.y
 
+mkdir bin
+saved_PATH=$PATH; export saved_PATH
+PATH=`pwd`/bin$PATH_SEPARATOR$PATH; export PATH
+
 $ACLOCAL
 $AUTOMAKE --add-missing
 $AUTOCONF
diff --git a/tests/silentcxx.test b/tests/silentcxx.test
index 14825db..f6eab3d 100755
--- a/tests/silentcxx.test
+++ b/tests/silentcxx.test
@@ -51,10 +51,10 @@ EOF
 
 cat > foo.cpp <<'EOF'
 using namespace std; /* C compilers fail on this. */
-int main() { return 0; }
+int main (void) { return 0; }
 EOF
 
-# let's try out other extensions too
+# Let's try out other extensions too.
 echo 'class Baz  { public: int i;  };' > baz.cxx
 echo 'class Quux { public: bool b; };' > quux.cc
 
@@ -99,7 +99,7 @@ do
   grep ' -c ' stdout
   grep ' -o ' stdout
 
-  $EGREP '(CC|CXX|LD) ' stdout && Exit 1
+  $EGREP '(CXX|LD) ' stdout && Exit 1
 
   # Ensure a clean reconfiguration/rebuild.
   $MAKE clean
diff --git a/tests/subdir5.test b/tests/subdir5.test
index 42c9ad6..f9865b6 100755
--- a/tests/subdir5.test
+++ b/tests/subdir5.test
@@ -16,14 +16,10 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Test to make sure that adding a new directory works.
-# This test runs `make' from the top-level directory, subdir8.test
-# do it from a subdirectory.
+# This test runs `make' from the top-level directory, the sister test
+# `subdir8.test' do it from a subdirectory.
 # PR automake/46
 
-# This test assumes that the `make' utility is able to start
-# over and reload Makefiles which have been remade (a non-POSIX feature).
-# See also the related test subdir8.test.
-required=GNUmake
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/subdir8.test b/tests/subdir8.test
index dc13c2b..502c9e4 100755
--- a/tests/subdir8.test
+++ b/tests/subdir8.test
@@ -16,14 +16,10 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Test to make sure that adding a new directory works, even from
-# subdirectories.  (subdir5.test makes sure it works when make
-# is run from the top-level directory.)
+# subdirectories.  The sister test `subdir5.test' makes sure it works
+# when make is run from the top-level directory.
 # PR automake/46
 
-# This test assumes that the `make' utility is able to start
-# over and reload Makefiles which have been remade (a non-POSIX feature).
-# See also the related test subdir5.test.
-required=GNUmake
 . ./defs || Exit 1
 
 cat >> configure.in << 'END'
diff --git a/tests/version7.test b/tests/version7.test
index 2385b07..fe5dd02 100755
--- a/tests/version7.test
+++ b/tests/version7.test
@@ -19,7 +19,7 @@
 # is to make sure Makefile.ins get rebuilt when a m4_included file
 # changes -- we don't support this feature on non-GNU Makes).
 
-required='makeinfo tex texi2dvi GNUmake'
+required='makeinfo tex texi2dvi'
 . ./defs || Exit 1
 
 cat >configure.in <<END
@@ -59,6 +59,7 @@ grep '2\.718' version.texi
 
 $sleep
 echo 'm4_define([THE_VERSION], [3.141])' > version.m4
+using_gmake || $MAKE Makefile
 $MAKE distcheck
 ./configure --version | grep '3\.141'
 grep '3\.141' version.texi
diff --git a/tests/werror2.test b/tests/werror2.test
index c3c46a5..bb5851e 100755
--- a/tests/werror2.test
+++ b/tests/werror2.test
@@ -19,7 +19,6 @@
 # succeed if make is run a second time immediately afterwards.
 # Report from Harlan Stenn.
 
-required=GNUmake
 . ./defs || Exit 1
 
 echo AC_OUTPUT>>configure.in
@@ -42,8 +41,8 @@ INCLUDES = -Ifoo
 foo_SOURCES = unused
 END
 
+# This repetition is deliberate; see heading comments.
 $MAKE && Exit 1
-
 $MAKE && Exit 1
 
 :


hooks/post-receive
-- 
GNU Automake



reply via email to

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