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.11-524-


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11-524-gd7d84c9
Date: Thu, 16 Dec 2010 12:11:49 +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=d7d84c92014b480bc8ba11d082efe6131c68d629

The branch, master has been updated
       via  d7d84c92014b480bc8ba11d082efe6131c68d629 (commit)
       via  013981827ffb914bb4d17a198b13ec7fd524d16f (commit)
       via  df9f6bf48ecc1459bb9fe5a1f1921c27669fbba7 (commit)
       via  c712ddd9710cb59565e8802132d1dd387bb05eb6 (commit)
       via  2f89d222178904ce5ec956926db73d0dbd44a21b (commit)
       via  36a58826182f44d25e765816c6a51c3afc8d3f12 (commit)
       via  49ac3def6a658c77b113cca89925ed91700c61c9 (commit)
       via  3a5f8cc69e6687d2f074522cf9d69be4eea6d8f8 (commit)
       via  ddc5c084bf1e2736e5c6e600ae40b29d953e84ac (commit)
      from  423f2f8bcbbcc5936341521d9bf9a352cda994c7 (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 d7d84c92014b480bc8ba11d082efe6131c68d629
Author: Stefano Lattarini <address@hidden>
Date:   Sun Dec 12 14:17:41 2010 +0100

    More uses of AS_HELP_STRING in automake macros.
    
    * m4/depend.m4 (AM_DEP_TRACK): Use `AS_HELP_STRING' to format
    the help message added to the generated configure.
    * m4/dmalloc.m4 (AM_WITH_DMALLOC): Likewise.
    * m4/lispdir.m4 (AM_PATH_LISPDIR): Likewise.
    * m4/maintainer.m4 (AM_MAINTAINER_MODE): Likewise.
    * m4/multi.m4 (AM_ENABLE_MULTILIB): Likewise.
    Also, bumped all serial numbers of the modified m4 files.

commit 013981827ffb914bb4d17a198b13ec7fd524d16f
Merge: df9f6bf 3a5f8cc
Author: Stefano Lattarini <address@hidden>
Date:   Thu Dec 16 12:22:22 2010 +0100

    Merge branch 'maint'

commit df9f6bf48ecc1459bb9fe5a1f1921c27669fbba7
Merge: c712ddd 49ac3de
Author: Stefano Lattarini <address@hidden>
Date:   Thu Dec 16 12:20:47 2010 +0100

    Merge branch 'auxdir-tests'

commit c712ddd9710cb59565e8802132d1dd387bb05eb6
Merge: 2f89d22 36a5882
Author: Stefano Lattarini <address@hidden>
Date:   Thu Dec 16 12:16:01 2010 +0100

    Merge branch 'tests-remake-extend'

commit 2f89d222178904ce5ec956926db73d0dbd44a21b
Merge: 423f2f8 ddc5c08
Author: Stefano Lattarini <address@hidden>
Date:   Thu Dec 16 12:07:18 2010 +0100

    Merge branch 'tests-canon-fixes'

commit 36a58826182f44d25e765816c6a51c3afc8d3f12
Author: Stefano Lattarini <address@hidden>
Date:   Fri Aug 13 11:50:31 2010 +0200

    Tests: extend checks on remake rules.
    
    This adds proper semantical tests (i.e. run make to check the
    rebuild rules are correctly triggered) in addition to tentative
    grepping of the generated Makefile.in(s).
    
    * tests/remake.test: Enable `errexit' shell flag, and related
    changes.  Modernize `configure.in'.  Add trailing `:' command.
    Improve heading comments, and add a reference to new sister test
    remake1a.test.
    * tests/remake3.test: Likewise (but with sister test being
    remake3a.test).
    * tests/remake2.test: Improve heading comments.  Enable `errexit'
    shell flag, and related changes.  Modernize `configure.in'.  Make
    grepping of `Makefile.in' slightly stricter.  Add trailing `:'
    command.
    * tests/remake5.test: Also run the `distcheck' target.  Add
    trailing `:' command.  Use proper m4 quoting in configure.in.
    * tests/remake4.test: Prefer `$me' over hard-coded test name.
    * tests/remake7.test: Use the `configure.in' stub created by
    ./defs, rather than writing it from scratch.
    * tests/remake6.test: Likewise.  Also, add trailing `:' command,
    and ensure verbose printing of captured make output.
    * tests/remake1a.test: New test, sister of remake.test.
    * tests/remake3a.test: New test, sister of remake3.test.
    * tests/remake8a.test: New test.
    * tests/remake8b.test: Likewise.
    * tests/remake9a.test: Likewise.
    * tests/remake9b.test: Likewise.
    * tests/remake9c.test: Likewise.
    * tests/remake9d.test: Likewise.
    * tests/remake10a.test: Likewise.
    * tests/remake10b.test: Likewise.
    * tests/remake10c.test: Likewise.
    * tests/remake11.test: Likewise.
    * tests/remake12.test: Likewise.
    * tests/Makefile.am (TESTS): Updated.

commit 49ac3def6a658c77b113cca89925ed91700c61c9
Author: Stefano Lattarini <address@hidden>
Date:   Sat May 8 00:32:22 2010 +0200

    Extended tests on AC_CONFIG_AUX_DIR.
    
    * tests/auxdir.test: Enable `errexit' shell flag.  Prefer `$me'
    over hard-coded test name.  Use proper m4 quoting.  Add trailing
    `:' command.
    * tests/auxdir2.test: Likewise.  Try to call automake also with
    the `-a' option, so that it will not fail for spurious reasons.
    * tests/auxdir3.test: Add an explanatory comment and a trailing
    `:' command.
    * tests/auxdir4.test: Prefer `$me' over hard-coded test name.
    Make grepping of automake stderr slightly stricter.  Also, now
    this test just checks about Automake's reaction to unportable
    auxiliary directory names (and it has been extended in this
    respect).  Moved the checks about non-existent auxiliary
    directories to ...
    * tests/auxdir5.test: ... this new test.
    * tests/auxdir6.test: New test.
    * tests/auxdir7.test: Likewise.
    * tests/auxdir8.test: Likewise.
    * tests/auxdir9.test: Likewise.
    * tests/Makefile.am (TESTS): Updated.

commit ddc5c084bf1e2736e5c6e600ae40b29d953e84ac
Author: Stefano Lattarini <address@hidden>
Date:   Mon Jun 28 12:40:55 2010 +0200

    Improve and extend tests on canonicalization.
    
    * tests/canon-name.test: Add trailing `:' command.  When writing
    configure.in, prefer to use $me instead of hard-coding the test
    name.
    * tests/canon3.test: Prefer trailing `:' over trailing `Exit 0'.
    * tests/canon4.test: Likewise.  Make grepping of Makefile.in
    stricter.  Improve heading comment, and add reference to ...
    * tests/canon6.test: ... this new test (sister test of the
    previous one).
    * tests/canon.test: Prefer cat + here-doc over echo to append
    text to configure.in.  Extend grepping of Automake stderr.  Add
    trailing `:' command.
    * tests/canon5.test: Likewise.
    * tests/canon7.test: New file, stress test on canonicalization.
    * tests/canon8.test: New test, for better coverage (check that
    the `@' character is not transliterated in canonicalizations).
    * tests/Makefile.am: Updated.

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

Summary of changes:
 ChangeLog                                 |  108 ++++++++++++++++
 m4/depend.m4                              |   12 ++-
 m4/dmalloc.m4                             |    7 +-
 m4/lispdir.m4                             |    5 +-
 m4/maintainer.m4                          |   11 +-
 m4/multi.m4                               |    8 +-
 tests/Makefile.am                         |   21 +++
 tests/Makefile.in                         |   21 +++
 tests/auxdir.test                         |   14 ++-
 tests/auxdir2.test                        |   16 ++-
 tests/auxdir3.test                        |    4 +-
 tests/auxdir4.test                        |   16 ++-
 tests/{output3.test => auxdir5.test}      |   17 +--
 tests/{help-depend2.test => auxdir6.test} |   34 ++++--
 tests/{help-init.test => auxdir7.test}    |   30 +++--
 tests/{depcomp2.test => auxdir8.test}     |   38 +++---
 tests/auxdir9.test                        |  132 +++++++++++++++++++
 tests/canon-name.test                     |    6 +-
 tests/canon.test                          |   12 ++-
 tests/canon3.test                         |    3 +-
 tests/canon4.test                         |    8 +-
 tests/canon5.test                         |    9 +-
 tests/{implicit.test => canon6.test}      |   15 ++-
 tests/canon7.test                         |   93 ++++++++++++++
 tests/{canon2.test => canon8.test}        |   18 ++--
 tests/help-depend.test                    |    6 +-
 tests/help-depend2.test                   |    6 +-
 tests/help-dmalloc.test                   |    2 +-
 tests/help-init.test                      |    6 +-
 tests/help-lispdir.test                   |    8 +-
 tests/help-maintainer.test                |    9 +-
 tests/help-multilib.test                  |    2 +-
 tests/help-silent.test                    |    6 +-
 tests/help-upc.test                       |    4 +-
 tests/remake.test                         |   24 +++--
 tests/remake10a.test                      |  108 ++++++++++++++++
 tests/remake10b.test                      |  107 ++++++++++++++++
 tests/remake10c.test                      |  112 +++++++++++++++++
 tests/remake11.test                       |   84 ++++++++++++
 tests/remake12.test                       |  122 ++++++++++++++++++
 tests/{help-init.test => remake1a.test}   |   36 ++++--
 tests/remake2.test                        |   26 +++--
 tests/remake3.test                        |   21 ++--
 tests/{man8.test => remake3a.test}        |   53 +++++---
 tests/remake4.test                        |    6 +-
 tests/remake5.test                        |    9 +-
 tests/remake6.test                        |   20 ++--
 tests/remake7.test                        |   11 +-
 tests/remake8a.test                       |  193 ++++++++++++++++++++++++++++
 tests/remake8b.test                       |  195 +++++++++++++++++++++++++++++
 tests/remake9a.test                       |  106 ++++++++++++++++
 tests/remake9b.test                       |  108 ++++++++++++++++
 tests/remake9c.test                       |  109 ++++++++++++++++
 tests/remake9d.test                       |  109 ++++++++++++++++
 54 files changed, 2065 insertions(+), 201 deletions(-)
 copy tests/{output3.test => auxdir5.test} (75%)
 copy tests/{help-depend2.test => auxdir6.test} (55%)
 copy tests/{help-init.test => auxdir7.test} (58%)
 copy tests/{depcomp2.test => auxdir8.test} (55%)
 create mode 100755 tests/auxdir9.test
 copy tests/{implicit.test => canon6.test} (73%)
 create mode 100755 tests/canon7.test
 copy tests/{canon2.test => canon8.test} (73%)
 create mode 100755 tests/remake10a.test
 create mode 100755 tests/remake10b.test
 create mode 100755 tests/remake10c.test
 create mode 100755 tests/remake11.test
 create mode 100755 tests/remake12.test
 copy tests/{help-init.test => remake1a.test} (55%)
 copy tests/{man8.test => remake3a.test} (51%)
 create mode 100755 tests/remake8a.test
 create mode 100755 tests/remake8b.test
 create mode 100755 tests/remake9a.test
 create mode 100755 tests/remake9b.test
 create mode 100755 tests/remake9c.test
 create mode 100755 tests/remake9d.test

diff --git a/ChangeLog b/ChangeLog
index d61bbf5..7e1b563 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,111 @@
+2010-12-14  Stefano Lattarini  <address@hidden>
+
+       More uses of AS_HELP_STRING in automake macros.
+       * m4/depend.m4 (AM_DEP_TRACK): Use `AS_HELP_STRING' to format
+       the help message added to the generated configure.
+       * m4/dmalloc.m4 (AM_WITH_DMALLOC): Likewise.
+       * m4/lispdir.m4 (AM_PATH_LISPDIR): Likewise.
+       * m4/maintainer.m4 (AM_MAINTAINER_MODE): Likewise.
+       * m4/multi.m4 (AM_ENABLE_MULTILIB): Likewise.
+       Also, bumped all serial numbers of the modified m4 files.
+
+2010-12-14  Stefano Lattarini  <address@hidden>
+
+       Improve tests on generated portions of configure help screen.
+       * tests/help-depend.test: Grepping of configure help screen
+       relaxed to cater for possible line wrapping, and tightened in
+       other respects.
+       * tests/help-depend2.test: Likewise.
+       * tests/help-dmalloc.test: Likewise.
+       * tests/help-lispdir.test: Likewise.
+       * tests/help-maintainer.test: Likewise.
+       * tests/help-multilib.test: Likewise.
+       * tests/help-silent.test: Likewise.
+       * tests/help-upc.test: Likewise.
+       * tests/help-init.test: Grepping of configure help screen
+       tightened.
+
+2010-12-15  Stefano Lattarini  <address@hidden>
+
+       Extended tests on AC_CONFIG_AUX_DIR.
+       * tests/auxdir.test: Enable `errexit' shell flag.  Prefer `$me'
+       over hard-coded test name.  Use proper m4 quoting.  Add trailing
+       `:' command.
+       * tests/auxdir2.test: Likewise.  Try to call automake also with
+       the `-a' option, so that it will not fail for spurious reasons.
+       * tests/auxdir3.test: Add an explanatory comment and a trailing
+       `:' command.
+       * tests/auxdir4.test: Prefer `$me' over hard-coded test name.
+       Make grepping of automake stderr slightly stricter.  Also, now
+       this test just checks about Automake's reaction to unportable
+       auxiliary directory names (and it has been extended in this
+       respect).  Moved the checks about non-existent auxiliary
+       directories to ...
+       * tests/auxdir5.test: ... this new test.
+       * tests/auxdir6.test: New test.
+       * tests/auxdir7.test: Likewise.
+       * tests/auxdir8.test: Likewise.
+       * tests/auxdir9.test: Likewise.
+       * tests/Makefile.am (TESTS): Updated.
+
+2010-12-06  Stefano Lattarini  <address@hidden>
+
+       Tests: extend checks on remake rules.
+       This adds proper semantical tests (i.e. run make to check the
+       rebuild rules are correctly triggered) in addition to tentative
+       grepping of the generated Makefile.in(s).
+       * tests/remake.test: Enable `errexit' shell flag, and related
+       changes.  Modernize `configure.in'.  Add trailing `:' command.
+       Improve heading comments, and add a reference to new sister test
+       remake1a.test.
+       * tests/remake3.test: Likewise (but with sister test being
+       remake3a.test).
+       * tests/remake2.test: Improve heading comments.  Enable `errexit'
+       shell flag, and related changes.  Modernize `configure.in'.  Make
+       grepping of `Makefile.in' slightly stricter.  Add trailing `:'
+       command.
+       * tests/remake5.test: Also run the `distcheck' target.  Add
+       trailing `:' command.  Use proper m4 quoting in configure.in.
+       * tests/remake4.test: Prefer `$me' over hard-coded test name.
+       * tests/remake7.test: Use the `configure.in' stub created by
+       ./defs, rather than writing it from scratch.
+       * tests/remake6.test: Likewise.  Also, add trailing `:' command,
+       and ensure verbose printing of captured make output.
+       * tests/remake1a.test: New test, sister of remake.test.
+       * tests/remake3a.test: New test, sister of remake3.test.
+       * tests/remake8a.test: New test.
+       * tests/remake8b.test: Likewise.
+       * tests/remake9a.test: Likewise.
+       * tests/remake9b.test: Likewise.
+       * tests/remake9c.test: Likewise.
+       * tests/remake9d.test: Likewise.
+       * tests/remake10a.test: Likewise.
+       * tests/remake10b.test: Likewise.
+       * tests/remake10c.test: Likewise.
+       * tests/remake11.test: Likewise.
+       * tests/remake12.test: Likewise.
+       * tests/Makefile.am (TESTS): Updated.
+
+2010-12-11  Stefano Lattarini  <address@hidden>
+
+       Improve and extend tests on canonicalization.
+       * tests/canon-name.test: Add trailing `:' command.  When writing
+       configure.in, prefer to use $me instead of hard-coding the test
+       name.
+       * tests/canon3.test: Prefer trailing `:' over trailing `Exit 0'.
+       * tests/canon4.test: Likewise.  Make grepping of Makefile.in
+       stricter.  Improve heading comment, and add reference to ...
+       * tests/canon6.test: ... this new test (sister test of the
+       previous one).
+       * tests/canon.test: Prefer cat + here-doc over echo to append
+       text to configure.in.  Extend grepping of Automake stderr.  Add
+       trailing `:' command.
+       * tests/canon5.test: Likewise.
+       * tests/canon7.test: New file, stress test on canonicalization.
+       * tests/canon8.test: New test, for better coverage (check that
+       the `@' character is not transliterated in canonicalizations).
+       * tests/Makefile.am: Updated.
+
 2010-12-13  Stefano Lattarini  <address@hidden>
 
        Libobj tests: refer to automake bug tracker for limitations.
diff --git a/m4/depend.m4 b/m4/depend.m4
index 652c4c0..714bc9c 100644
--- a/m4/depend.m4
+++ b/m4/depend.m4
@@ -6,7 +6,7 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 11
+# serial 12
 
 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
 # written in clear, in which case automake, when reading aclocal.m4,
@@ -169,9 +169,13 @@ AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
 # AM_DEP_TRACK
 # ------------
 AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[  --disable-dependency-tracking  speeds up one-time build
-  --enable-dependency-tracking   do not reject slow dependency extractors])
+[AC_ARG_ENABLE([dependency-tracking], [dnl
+AS_HELP_STRING(
+  [--enable-dependency-tracking],
+  [do not reject slow dependency extractors])
+AS_HELP_STRING(
+  [--disable-dependency-tracking],
+  [speeds up one-time build])])
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
diff --git a/m4/dmalloc.m4 b/m4/dmalloc.m4
index aea5f9d..5d48a24 100644
--- a/m4/dmalloc.m4
+++ b/m4/dmalloc.m4
@@ -10,12 +10,13 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 4
+# serial 5
 
 AC_DEFUN([AM_WITH_DMALLOC],
 [AC_MSG_CHECKING([if malloc debugging is wanted])
-AC_ARG_WITH(dmalloc,
-[  --with-dmalloc          use dmalloc, as in http://www.dmalloc.com],
+AC_ARG_WITH([dmalloc],
+[AS_HELP_STRING([--with-dmalloc],
+                [use dmalloc, as in http://www.dmalloc.com])],
 [if test "$withval" = yes; then
   AC_MSG_RESULT(yes)
   AC_DEFINE(WITH_DMALLOC,1,
diff --git a/m4/lispdir.m4 b/m4/lispdir.m4
index 62c2daf..bc1c831 100644
--- a/m4/lispdir.m4
+++ b/m4/lispdir.m4
@@ -10,7 +10,7 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 10
+# serial 11
 
 # AM_PATH_LISPDIR
 # ---------------
@@ -23,7 +23,8 @@ AC_DEFUN([AM_PATH_LISPDIR],
  AC_ARG_VAR([EMACS], [the Emacs editor command])
  AC_ARG_VAR([EMACSLOADPATH], [the Emacs library search path])
  AC_ARG_WITH([lispdir],
- [  --with-lispdir          override the default lisp directory],
+ [AS_HELP_STRING([--with-lispdir],
+                 [override the default lisp directory])],
  [ lispdir="$withval"
    AC_MSG_CHECKING([where .elc files should go])
    AC_MSG_RESULT([$lispdir])],
diff --git a/m4/maintainer.m4 b/m4/maintainer.m4
index 0b54e67..0d0bf7f 100644
--- a/m4/maintainer.m4
+++ b/m4/maintainer.m4
@@ -8,7 +8,7 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 5
+# serial 6
 
 # AM_MAINTAINER_MODE([DEFAULT-MODE])
 # ----------------------------------
@@ -25,10 +25,11 @@ AC_DEFUN([AM_MAINTAINER_MODE],
 AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions 
of Makefiles])
   dnl maintainer-mode's default is 'disable' unless 'enable' is passed
   AC_ARG_ENABLE([maintainer-mode],
-[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules 
and dependencies not useful
-                         (and sometimes confusing) to the casual installer],
-      [USE_MAINTAINER_MODE=$enableval],
-      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+    [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
+      am_maintainer_other[ make rules and dependencies not useful
+      (and sometimes confusing) to the casual installer])],
+    [USE_MAINTAINER_MODE=$enableval],
+    [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
   AC_MSG_RESULT([$USE_MAINTAINER_MODE])
   AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
   MAINT=$MAINTAINER_MODE_TRUE
diff --git a/m4/multi.m4 b/m4/multi.m4
index 9841767..dce3675 100644
--- a/m4/multi.m4
+++ b/m4/multi.m4
@@ -6,15 +6,17 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 6
+# serial 7
 
 # AM_ENABLE_MULTILIB([MAKEFILE], [REL-TO-TOP-SRCDIR])
 # ---------------------------------------------------
 # Add --enable-multilib to configure.
 AC_DEFUN([AM_ENABLE_MULTILIB],
 [# Default to --enable-multilib
-AC_ARG_ENABLE(multilib,
-[  --enable-multilib       build many library versions (default)],
+AC_ARG_ENABLE([multilib],
+[AS_HELP_STRING(
+   [--enable-multilib],
+   [build many library versions (default)])],
 [case "$enableval" in
   yes) multilib=yes ;;
   no)  multilib=no ;;
diff --git a/tests/Makefile.am b/tests/Makefile.am
index cbcad44..9059102 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -162,6 +162,11 @@ auxdir.test \
 auxdir2.test \
 auxdir3.test \
 auxdir4.test \
+auxdir5.test \
+auxdir6.test \
+auxdir7.test \
+auxdir8.test \
+auxdir9.test \
 backcompat.test \
 backcompat2.test \
 backcompat3.test \
@@ -183,6 +188,9 @@ canon2.test \
 canon3.test \
 canon4.test \
 canon5.test \
+canon6.test \
+canon7.test \
+canon8.test \
 canon-name.test \
 ccnoco.test \
 ccnoco2.test \
@@ -719,12 +727,25 @@ python12.test \
 recurs.test \
 recurs2.test \
 remake.test \
+remake1a.test \
 remake2.test \
 remake3.test \
+remake3a.test \
 remake4.test \
 remake5.test \
 remake6.test \
 remake7.test \
+remake8a.test \
+remake8b.test \
+remake9a.test \
+remake9b.test \
+remake9c.test \
+remake9d.test \
+remake10a.test \
+remake10b.test \
+remake10c.test \
+remake11.test \
+remake12.test \
 regex.test \
 regex-obsolete.test \
 req.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 7691165..4f4eb50 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -425,6 +425,11 @@ auxdir.test \
 auxdir2.test \
 auxdir3.test \
 auxdir4.test \
+auxdir5.test \
+auxdir6.test \
+auxdir7.test \
+auxdir8.test \
+auxdir9.test \
 backcompat.test \
 backcompat2.test \
 backcompat3.test \
@@ -446,6 +451,9 @@ canon2.test \
 canon3.test \
 canon4.test \
 canon5.test \
+canon6.test \
+canon7.test \
+canon8.test \
 canon-name.test \
 ccnoco.test \
 ccnoco2.test \
@@ -982,12 +990,25 @@ python12.test \
 recurs.test \
 recurs2.test \
 remake.test \
+remake1a.test \
 remake2.test \
 remake3.test \
+remake3a.test \
 remake4.test \
 remake5.test \
 remake6.test \
 remake7.test \
+remake8a.test \
+remake8b.test \
+remake9a.test \
+remake9b.test \
+remake9c.test \
+remake9d.test \
+remake10a.test \
+remake10b.test \
+remake10c.test \
+remake11.test \
+remake12.test \
 regex.test \
 regex-obsolete.test \
 req.test \
diff --git a/tests/auxdir.test b/tests/auxdir.test
index 74f6e6c..f795450 100755
--- a/tests/auxdir.test
+++ b/tests/auxdir.test
@@ -19,10 +19,12 @@
 
 . ./defs || Exit 1
 
+set -e
+
 # The "./." is here so we don't have to mess with subdirs.
-cat > configure.in << 'END'
-AC_INIT([auxdir], [1.0])
-AC_CONFIG_AUX_DIR(./.)
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AC_CONFIG_AUX_DIR([./.])
 AM_INIT_AUTOMAKE
 AC_CONFIG_FILES([Makefile])
 END
@@ -35,7 +37,9 @@ cp "$top_testsrcdir/lib/mkinstalldirs" .
 
 # The "././" prefix confuses Automake into thinking it is doing a
 # subdir build.  Yes, this is hacky.
-$ACLOCAL || Exit 1
-$AUTOMAKE ././Makefile || Exit 1
+$ACLOCAL
+$AUTOMAKE ././Makefile
 
 grep '/\./\./mkinstalldirs' Makefile.in
+
+:
diff --git a/tests/auxdir2.test b/tests/auxdir2.test
index 590a5df..430abad 100755
--- a/tests/auxdir2.test
+++ b/tests/auxdir2.test
@@ -19,15 +19,21 @@
 
 . ./defs || Exit 1
 
-# The "./." is here so we don't have to mess with subdirs.
-cat > configure.in << 'END'
-AC_INIT([auxdir2], [1.0])
-AC_CONFIG_AUX_DIR($foo)
+set -e
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AC_CONFIG_AUX_DIR([\$foo)
 AM_INIT_AUTOMAKE
 AC_CONFIG_FILES([Makefile])
 END
 
 : > Makefile.am
 
-$ACLOCAL || Exit 1
+$ACLOCAL
+# Both these two invocations are meant.
+# They exercise both code paths concerning auxiliary files.
+$AUTOMAKE -a
 $AUTOMAKE
+
+:
diff --git a/tests/auxdir3.test b/tests/auxdir3.test
index c828051..64fbd6a 100755
--- a/tests/auxdir3.test
+++ b/tests/auxdir3.test
@@ -21,7 +21,7 @@
 set -e
 
 cat >> configure.in << 'END'
-AC_CONFIG_AUX_DIR(.)
+AC_CONFIG_AUX_DIR([.]) dnl this will appear after AM_INIT_AUTOMAKE
 END
 
 : > Makefile.am
@@ -29,3 +29,5 @@ END
 $ACLOCAL
 AUTOMAKE_fails
 grep 'AC_CONFIG_AUX_DIR.*AM_INIT_AUTOMAKE' stderr
+
+:
diff --git a/tests/auxdir4.test b/tests/auxdir4.test
index 0447809..38bf28f 100755
--- a/tests/auxdir4.test
+++ b/tests/auxdir4.test
@@ -14,14 +14,14 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Make sure we diagnose dangerous AC_CONFIG_AUX_DIR names.
+# Make sure we diagnose unportable AC_CONFIG_AUX_DIR names.
 
 . ./defs || Exit 1
 
 set -e
 
-cat >configure.in <<'END'
-AC_INIT([auxdir4], [1.0])
+cat >configure.in <<END
+AC_INIT([$me], [1.0])
 AC_CONFIG_AUX_DIR([aux])
 AM_INIT_AUTOMAKE
 AC_CONFIG_FILES([Makefile])
@@ -31,5 +31,11 @@ END
 
 $ACLOCAL
 AUTOMAKE_fails
-grep 'configure.in:2:.*aux.*does not exist' stderr
-grep 'configure.in:2:.*aux.*W32' stderr
+grep '^configure\.in:2:.*aux.*W32' stderr
+
+if mkdir aux; then
+  AUTOMAKE_fails
+  grep '^configure\.in:2:.*aux.*W32' stderr
+fi
+
+:
diff --git a/tests/output3.test b/tests/auxdir5.test
similarity index 75%
copy from tests/output3.test
copy to tests/auxdir5.test
index 3c8e79b..e44b8fb 100755
--- a/tests/output3.test
+++ b/tests/auxdir5.test
@@ -1,6 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1996, 2000, 2001, 2002, 2010 Free Software Foundation,
-# Inc.
+# Copyright (C) 2010 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
@@ -15,7 +14,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Yet another AC_OUTPUT test.
+# Make sure we diagnose non-existent AC_CONFIG_AUX_DIR names.
 
 . ./defs || Exit 1
 
@@ -23,19 +22,15 @@ set -e
 
 cat > configure.in <<END
 AC_INIT([$me], [1.0])
+AC_CONFIG_AUX_DIR([nonesuch])
 AM_INIT_AUTOMAKE
-AC_OUTPUT([Makefile
-tests/Makefile tests/defs],
-[blah])
+AC_CONFIG_FILES([Makefile])
 END
 
 : > Makefile.am
 
-mkdir tests
-: > tests/Makefile.am
-: > tests/defs.in
-
 $ACLOCAL
-$AUTOMAKE
+AUTOMAKE_fails
+grep '^configure\.in:2:.*nonesuch.* not exist' stderr
 
 :
diff --git a/tests/help-depend2.test b/tests/auxdir6.test
similarity index 55%
copy from tests/help-depend2.test
copy to tests/auxdir6.test
index b4133b4..4b3565a 100755
--- a/tests/help-depend2.test
+++ b/tests/auxdir6.test
@@ -14,9 +14,11 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Make sure that when automake automatically activates support for
-# dependency tracking, it adds proper text to the configure help screen.
-# Keep this in sync with sister test `help-depend.test'
+# Test to make sure AC_CONFIG_AUX_DIR works correctly.
+# This test calls AC_CONFIG_AUX_DIR with an explicit literal argument,
+# thus explicitly making the directory named by that argument the
+# config auxdir.
+# Keep this in sync with sister tests auxdir7.test and auxdir8.test.
 
 . ./defs || Exit 1
 
@@ -24,19 +26,27 @@ set -e
 
 cat > configure.in <<END
 AC_INIT([$me], [1.0])
+AC_CONFIG_AUX_DIR([auxdir])
 AM_INIT_AUTOMAKE
-AC_PROG_CC
+AC_CONFIG_FILES([Makefile subdir/Makefile])
 END
 
-$ACLOCAL
-$AUTOCONF
+mkdir subdir auxdir
+
+cat > Makefile.am << 'END'
+pkgdata_DATA =
+END
 
-./configure --help >stdout || { cat stdout; Exit 1; }
-cat stdout
+cp Makefile.am subdir/Makefile.am
+
+: > auxdir/mkinstalldirs
+: > auxdir/install-sh
+: > auxdir/missing
+
+$ACLOCAL
+$AUTOMAKE
 
-$FGREP ' --enable-dependency-tracking ' stdout
-$FGREP ' --disable-dependency-tracking ' stdout
-$FGREP ' one-time build' stdout
-$FGREP ' slow dependency extract' stdout
+$FGREP '$(top_srcdir)/auxdir/mkinstalldirs' Makefile.in
+$FGREP '$(top_srcdir)/auxdir/mkinstalldirs' subdir/Makefile.in
 
 :
diff --git a/tests/help-init.test b/tests/auxdir7.test
similarity index 58%
copy from tests/help-init.test
copy to tests/auxdir7.test
index a3af271..67710b6 100755
--- a/tests/help-init.test
+++ b/tests/auxdir7.test
@@ -14,8 +14,10 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Make sure that our grand macro `AM_INIT_AUTOMAKE' add proper text
-# to the configure help screen.
+# Test to make sure AC_CONFIG_AUX_DIR works correctly.
+# This test calls AC_CONFIG_AUX_DIR with a `.' argument, thus explicitly
+# making the top-level directory the config auxdir.
+# Keep this in sync with sister tests auxdir6.test and auxdir8.test.
 
 . ./defs || Exit 1
 
@@ -23,17 +25,27 @@ set -e
 
 cat > configure.in <<END
 AC_INIT([$me], [1.0])
+AC_CONFIG_AUX_DIR([.])
 AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile subdir/Makefile])
 END
 
-$ACLOCAL
-$AUTOCONF
+mkdir subdir
+
+cat > Makefile.am << 'END'
+pkgdata_DATA =
+END
 
-./configure --help >stdout || { cat stdout; Exit 1; }
-cat stdout
+cp Makefile.am subdir/Makefile.am
+
+: > mkinstalldirs
+: > install-sh
+: > missing
+
+$ACLOCAL
+$AUTOMAKE
 
-grep ' --program-prefix[= ]' stdout
-grep ' --program-suffix[= ]' stdout
-grep ' --program-transform-name[= ]' stdout
+$FGREP '$(top_srcdir)/mkinstalldirs' Makefile.in
+$FGREP '$(top_srcdir)/mkinstalldirs' subdir/Makefile.in
 
 :
diff --git a/tests/depcomp2.test b/tests/auxdir8.test
similarity index 55%
copy from tests/depcomp2.test
copy to tests/auxdir8.test
index e8e4a67..7d0c1ae 100755
--- a/tests/depcomp2.test
+++ b/tests/auxdir8.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2010 Free Software Foundation, Inc.
+# Copyright (C) 1996, 2001, 2002, 2003, 2004, 2007  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
@@ -14,41 +14,37 @@
 # 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 depcomp is not used when it's not installed
-# From Pavel Roskin.
+# Test to make sure AC_CONFIG_AUX_DIR works correctly.
+# This test tries without an explicit call to AC_CONFIG_AUX_DIR;
+# the config auxdir should be implicitly defined to `.' since
+# the install-sh, mkinstalldirs, etc., scripts are in the top-level
+# directory.
+# Keep this in sync with sister tests auxdir6.test and auxdir7.test.
 
-required=gcc
 . ./defs || Exit 1
 
 set -e
 
 cat >> configure.in << 'END'
 AC_CONFIG_FILES([subdir/Makefile])
-AC_PROG_CC
-AC_OUTPUT
 END
 
-cat > Makefile.am << 'END'
-SUBDIRS = subdir
-END
-
-rm -f depcomp
 mkdir subdir
 
-cat > subdir/Makefile.in << 'END'
-foo:
-       $(CC) -o foo foo.c
+cat > Makefile.am << 'END'
+pkgdata_DATA =
 END
 
-: > subdir/foo.c
+cp Makefile.am subdir/Makefile.am
 
-# Ignore user CFLAGS.
-unset CFLAGS || :
+: > mkinstalldirs
+: > install-sh
+: > missing
 
 $ACLOCAL
-$AUTOMAKE --add-missing
-$AUTOCONF
-./configure 2>stderr || { cat stderr >&2; Exit 1; }
-test ! -s stderr
+$AUTOMAKE
+
+$FGREP '$(top_srcdir)/mkinstalldirs' Makefile.in
+$FGREP '$(top_srcdir)/mkinstalldirs' subdir/Makefile.in
 
 :
diff --git a/tests/auxdir9.test b/tests/auxdir9.test
new file mode 100755
index 0000000..db85ac1
--- /dev/null
+++ b/tests/auxdir9.test
@@ -0,0 +1,132 @@
+#! /bin/sh
+# Copyright (C) 2010 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/>.
+
+# Make sure that, if AC_CONFIG_AUX_DIR is not specified, Automake tries
+# to use `.', `..' and `../..', in precisely that order.
+
+. ./defs || Exit 1
+
+set -e
+
+nil=__no_such_program
+
+unset NONESUCH || :
+
+cat >>configure.in << END
+AM_MISSING_PROG([NONESUCH],[$nil])
+AC_OUTPUT
+END
+
+mkdir d3
+mkdir d3/d2
+mkdir d3/d2/d1
+mkdir d3/d2/d1/d0
+
+echo 'echo %%d3%% $*' > d3/missing
+chmod +x d3/missing
+echo 'echo %%d2%% $*' > d3/d2/missing
+chmod +x d3/d2/missing
+echo 'echo %%d1%% $*' > d3/d2/d1/missing
+chmod +x d3/d2/d1/missing
+echo 'echo %%d0%% $*' > d3/d2/d1/d0/missing
+chmod +x d3/d2/d1/d0/missing
+
+mv configure.in d3/d2/d1/d0/
+
+cd d3/d2/d1/d0
+
+cat > Makefile.am << 'EOF'
+.PHONY: test
+test:
+       $(NONESUCH) >$(out)
+EOF
+
+$ACLOCAL
+$AUTOCONF
+
+# ------------------------------------------- #
+:  We must end up with AC_CONFIG_AUX_DIR = .  #
+# ------------------------------------------- #
+
+: > install-sh
+$AUTOMAKE
+./configure
+out=out0 $MAKE test
+cat out0
+grep "%%d0%%.*$nil" out0
+grep '%%d[123]' out0 && Exit 1
+
+rm -f missing install-sh
+
+# -------------------------------------------- #
+:  We must end up with AC_CONFIG_AUX_DIR = ..  #
+# -------------------------------------------- #
+
+# Automake finds `install-sh' in `.', so it assumes that auxdir is `.';
+# but it won't find `missing' in `.', so it will fail.
+: > install-sh
+AUTOMAKE_fails
+grep 'required file.*[^.]\./missing.*not found' stderr
+rm -f install-sh
+
+# Now things should work.
+: > ../install-sh
+$AUTOMAKE
+./configure
+out=out1 $MAKE test
+cat out1
+grep "%%d1%%.*$nil" out1
+grep '%%d[023]' out1 && Exit 1
+
+rm -f ../missing ../install-sh
+
+# ----------------------------------------------- #
+:  We must end up with AC_CONFIG_AUX_DIR = ../..  #
+# ----------------------------------------------- #
+
+# Automake finds `install-sh' in `.', so it assumes that auxdir is `.';
+# but it won't find `missing' in `.', so it will fail.
+: > install-sh
+AUTOMAKE_fails
+grep 'required file.*[^.]\./missing.*not found' stderr
+rm -f install-sh
+
+# Automake finds `install-sh' in `..', so it assumes that auxdir is `..';
+# but it won't find `missing' in `.', so it will fail.
+: > ../install-sh
+AUTOMAKE_fails
+grep 'required file.*[^.]\.\./missing.*not found' stderr
+rm -f ../install-sh
+
+# Now things should work.
+: > ../../install-sh
+$AUTOMAKE
+./configure
+out=out2 $MAKE test
+cat out2
+grep "%%d2%%.*$nil" out2
+grep '%%d[013]' out2 && Exit 1
+
+rm -f ../../missing ../../install-sh
+
+# --------------------------------------------------------- #
+:  AC_CONFIG_AUX_DIR will not be found: automake must fail  #
+# --------------------------------------------------------- #
+
+AUTOMAKE_fails
+grep 'required file.*missing.*not found' stderr
+
+:
diff --git a/tests/canon-name.test b/tests/canon-name.test
index aecda17..b8e5331 100755
--- a/tests/canon-name.test
+++ b/tests/canon-name.test
@@ -21,8 +21,8 @@
 
 set -e
 
-cat > configure.in << 'END'
-AC_INIT([canon-name], [1.0])
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
 AM_INIT_AUTOMAKE
 AC_CONFIG_FILES([./gmakefile ./sub/gmakefile])
 AC_OUTPUT
@@ -36,3 +36,5 @@ $ACLOCAL
 AUTOMAKE_fails
 grep 'leading.*\./.*\./gmakefile' stderr
 grep 'leading.*\./.*\./sub/gmakefile' stderr
+
+:
diff --git a/tests/canon.test b/tests/canon.test
index 2b035d0..fc524fd 100755
--- a/tests/canon.test
+++ b/tests/canon.test
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1996, 1997, 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 2001, 2002, 2003, 2010 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
@@ -20,7 +21,9 @@
 
 set -e
 
-echo AC_PROG_CC >> configure.in
+cat >> configure.in << 'END'
+AC_PROG_CC
+END
 
 cat > Makefile.am << 'END'
 bin_PROGRAMS = sniff-glue
@@ -29,4 +32,7 @@ END
 
 $ACLOCAL
 AUTOMAKE_fails
-grep 'Makefile.am:2:.*sniff_glue_SOURCES' stderr
+grep 'Makefile\.am:2:.* bad .*variable.*sniff-glue_SOURCES' stderr
+grep 'Makefile\.am:2:.* use .*sniff_glue_SOURCES' stderr
+
+:
diff --git a/tests/canon3.test b/tests/canon3.test
index 9d5a172..ce5876a 100755
--- a/tests/canon3.test
+++ b/tests/canon3.test
@@ -34,4 +34,5 @@ $ACLOCAL
 $AUTOMAKE
 
 $FGREP 'perm_number.c' Makefile.in && Exit 1
-Exit 0
+
+:
diff --git a/tests/canon4.test b/tests/canon4.test
index 52e968d..454b4ef 100755
--- a/tests/canon4.test
+++ b/tests/canon4.test
@@ -14,7 +14,8 @@
 # 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 name canonicalization happens for libraries.
+# Test to make sure name canonicalization happens for static libraries.
+# Keep this in sync with sister test `canon6.test'.
 
 . ./defs || Exit 1
 
@@ -33,5 +34,6 @@ END
 $ACLOCAL
 $AUTOMAKE
 
-grep '^libx-y.*=' Makefile.in && Exit 1
-Exit 0
+grep '^ *libx-y.*=' Makefile.in && Exit 1
+
+:
diff --git a/tests/canon5.test b/tests/canon5.test
index 53cdeb2..3bd99ab 100755
--- a/tests/canon5.test
+++ b/tests/canon5.test
@@ -22,7 +22,9 @@
 
 set -e
 
-echo AC_PROG_CC >> configure.in
+cat >> configure.in << 'END'
+AC_PROG_CC
+END
 
 $ACLOCAL
 
@@ -46,7 +48,8 @@ bin_PROGRAMS = ,foo
 END
 
 AUTOMAKE_fails
-grep 'Makefile.am:2:.*_foo_SOURCES' stderr
+grep 'Makefile\.am:2:.* bad .*variable.*,foo_SOURCES' stderr
+grep 'Makefile\.am:2:.* use .*_foo_SOURCES' stderr
 
 cat > Makefile.am << 'END'
 bin_PROGRAMS = ,foo
@@ -54,3 +57,5 @@ _foo_SOURCES = foo.c
 END
 
 $AUTOMAKE -Wno-portability
+
+:
diff --git a/tests/implicit.test b/tests/canon6.test
similarity index 73%
copy from tests/implicit.test
copy to tests/canon6.test
index c1c3479..d103996 100755
--- a/tests/implicit.test
+++ b/tests/canon6.test
@@ -14,24 +14,29 @@
 # 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 implicit .o's are listed as appropriate.  Report
-# from Henrik Frystyk Nielsen.
+# Test to make sure name canonicalization happens for libtool libraries.
+# Keep this in sync with sister test `canon4.test'.
 
+required='libtoolize'
 . ./defs || Exit 1
 
 set -e
 
 cat >> configure.in << 'END'
 AC_PROG_CC
+AC_PROG_LIBTOOL
 END
 
 cat > Makefile.am << 'END'
-noinst_PROGRAMS = libapp_1
+noinst_LTLIBRARIES = libx-y.la
+libx_y_la_SOURCES = xy.c
 END
 
+: > ltmain.sh
+
 $ACLOCAL
-$AUTOMAKE
+$AUTOMAKE -a
 
-grep '^libapp_1_OBJECTS' Makefile.in | $FGREP '.$(OBJEXT)'
+grep '^ *libx-y.*=' Makefile.in && Exit 1
 
 :
diff --git a/tests/canon7.test b/tests/canon7.test
new file mode 100755
index 0000000..9b3d8d0
--- /dev/null
+++ b/tests/canon7.test
@@ -0,0 +1,93 @@
+#! /bin/sh
+# Copyright (C) 2010 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/>.
+
+# Stress test on canonicalization.
+
+required='libtool libtoolize'
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_CXX
+AC_PROG_RANLIB  dnl: for static libraries
+AC_PROG_LIBTOOL dnl: for libtool libraries
+AC_OUTPUT
+END
+
+touch ,foo-bar libb.az+baz lib~zardoz,, || Exit 77
+rm -f ,foo-bar libb.az+baz lib~zardoz,,
+
+cat > Makefile.am << 'END'
+noinst_PROGRAMS = dummy_static dummy_dynamic ,foo-bar
+noinst_LIBRARIES = libb.az+baz.a
+noinst_LTLIBRARIES = lib~zardoz,,.la
+
+dummy_static_SOURCES = dummy.c lib.h
+dummy_dynamic_SOURCES = $(dummy_static_SOURCES)
+
+dummy_static_LDADD = $(noinst_LIBRARIES)
+dummy_dynamic_LDADD = $(noinst_LTLIBRARIES)
+
+_foo_bar_SOURCES = libs.c
+libb_az_baz_a_SOURCES = libs.c
+lib_zardoz___la_SOURCES = libd.c
+
+check-local:
+       ls -l
+       ./,foo-bar
+       ./dummy_static
+       ./dummy_dynamic
+       ./,foo-bar | grep 'Hello, FooBar!'
+       ./dummy_static | grep 'Hello from Static!'
+       ./dummy_dynamic | grep 'Hello from Dynamic!'
+END
+
+cat > foobar.c << 'END'
+#include <stdio.h>
+int main(void)
+{
+  printf("Hello, FooBar!\n");
+  return 0;
+}
+END
+
+cat > dummy.c << 'END'
+#include <stdio.h>
+#include "lib.h"
+int main(void)
+{
+  printf("Hello from %s!\n", dummy_func());
+  return 0;
+}
+END
+
+echo 'char *dummy_func(void);' > lib.h
+echo 'char *dummy_func(void) { return "Dynamic"; }' > libd.c
+echo 'char *dummy_func(void) { return "Static"; }' > libs.c
+
+libtoolize
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+
+$MAKE check
+$MAKE distcheck
+
+:
diff --git a/tests/canon2.test b/tests/canon8.test
similarity index 73%
copy from tests/canon2.test
copy to tests/canon8.test
index ab28617..2ae47dd 100755
--- a/tests/canon2.test
+++ b/tests/canon8.test
@@ -15,24 +15,26 @@
 # 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 name canonicalization happens for texinfo.
+# Check that canonicalization does not transliterate the `@' charactrer.
 
 . ./defs || Exit 1
 
 set -e
 
-cat > Makefile.am << 'END'
-info_TEXINFOS = zar-doz.texi
-zar_doz_TEXINFOS = frob.texi
+cat >> configure.in << 'END'
+AC_PROG_CC
 END
 
-: > texinfo.tex
-echo '@setfilename zar-doz.info' > zar-doz.texi
-echo '@setfilename frob' > frob.texi
+cat > Makefile.am << 'END'
+bin_PROGRAMS = address@hidden
+END
 
 $ACLOCAL
 $AUTOMAKE
 
-grep zar-doz_TEXINFOS Makefile.in && Exit 1
+# The first grep is here mostly for debugging.
+grep foob.rquux Makefile.in
+grep address@hidden Makefile.in
+grep 'address@hidden' Makefile.in && Exit 1
 
 :
diff --git a/tests/help-depend.test b/tests/help-depend.test
index ed9447e..e676e5e 100755
--- a/tests/help-depend.test
+++ b/tests/help-depend.test
@@ -33,9 +33,9 @@ $AUTOCONF
 ./configure --help >stdout || { cat stdout; Exit 1; }
 cat stdout
 
-$FGREP ' --enable-dependency-tracking ' stdout
-$FGREP ' --disable-dependency-tracking ' stdout
-$FGREP ' one-time build' stdout
+$EGREP '^  *--enable-dependency-tracking( |$)' stdout
+$EGREP '^  *--disable-dependency-tracking( |$)' stdout
+$FGREP ' speeds up one-time build' stdout
 $FGREP ' slow dependency extract' stdout
 
 :
diff --git a/tests/help-depend2.test b/tests/help-depend2.test
index b4133b4..6bad661 100755
--- a/tests/help-depend2.test
+++ b/tests/help-depend2.test
@@ -34,9 +34,9 @@ $AUTOCONF
 ./configure --help >stdout || { cat stdout; Exit 1; }
 cat stdout
 
-$FGREP ' --enable-dependency-tracking ' stdout
-$FGREP ' --disable-dependency-tracking ' stdout
-$FGREP ' one-time build' stdout
+$EGREP '^  *--enable-dependency-tracking( |$)' stdout
+$EGREP '^  *--disable-dependency-tracking( |$)' stdout
+$FGREP ' speeds up one-time build' stdout
 $FGREP ' slow dependency extract' stdout
 
 :
diff --git a/tests/help-dmalloc.test b/tests/help-dmalloc.test
index c20288d..51b3ba4 100755
--- a/tests/help-dmalloc.test
+++ b/tests/help-dmalloc.test
@@ -32,7 +32,7 @@ $AUTOCONF
 ./configure --help >stdout || { cat stdout; Exit 1; }
 cat stdout
 
-$FGREP ' --with-dmalloc ' stdout
+$EGREP '^   *--with-dmalloc( |$) ' stdout
 $FGREP ' use dmalloc' stdout
 $FGREP 'www.dmalloc.com' stdout
 
diff --git a/tests/help-init.test b/tests/help-init.test
index a3af271..fdd9fa0 100755
--- a/tests/help-init.test
+++ b/tests/help-init.test
@@ -32,8 +32,8 @@ $AUTOCONF
 ./configure --help >stdout || { cat stdout; Exit 1; }
 cat stdout
 
-grep ' --program-prefix[= ]' stdout
-grep ' --program-suffix[= ]' stdout
-grep ' --program-transform-name[= ]' stdout
+grep '^  *--program-prefix[= ]' stdout
+grep '^  *--program-suffix[= ]' stdout
+grep '^  *--program-transform-name[= ]' stdout
 
 :
diff --git a/tests/help-lispdir.test b/tests/help-lispdir.test
index 3d82074..5eb7ab9 100755
--- a/tests/help-lispdir.test
+++ b/tests/help-lispdir.test
@@ -32,9 +32,11 @@ $AUTOCONF
 ./configure --help >stdout || { cat stdout; Exit 1; }
 cat stdout
 
-grep ' --with-lispdir .*override.*lisp directory' stdout
-grep ' EMACS .*[eE]macs editor' stdout
-grep ' EMACSLOADPATH' stdout
+$EGREP '^  *--with-lispdir( |$)' stdout
+grep ' override.*lisp directory' stdout
+$EGREP '^  *EMACS( |$)' stdout
+grep ' .*[eE]macs editor' stdout
+$EGREP '^  *EMACSLOADPATH( |$)' stdout
 grep ' .*[eE]macs library search path' stdout
 
 :
diff --git a/tests/help-maintainer.test b/tests/help-maintainer.test
index 72fc98a..6933d0c 100755
--- a/tests/help-maintainer.test
+++ b/tests/help-maintainer.test
@@ -31,7 +31,8 @@ $ACLOCAL
 $AUTOCONF --force
 ./configure --help >stdout || { cat stdout; Exit 1; }
 cat stdout
-grep ' --enable-maintainer-mode.*enable make rules' stdout
+$EGREP '^  *--enable-maintainer-mode( |$)' stdout
+$FGREP ' enable make rules' stdout
 
 rm -rf autom4te*.cache # just to be sure
 sed 's/\(AM_MAINTAINER_MODE\).*/\1([disable])/' configure.in >t
@@ -42,7 +43,8 @@ $ACLOCAL
 $AUTOCONF --force
 ./configure --help >stdout || { cat stdout; Exit 1; }
 cat stdout
-grep ' --enable-maintainer-mode.*enable make rules' stdout
+$EGREP '^  *--enable-maintainer-mode( |$)' stdout
+$FGREP ' enable make rules' stdout
 
 rm -rf autom4te*.cache # just to be sure
 sed 's/\(AM_MAINTAINER_MODE\).*/\1([enable])/' configure.in >t
@@ -53,6 +55,7 @@ $ACLOCAL
 $AUTOCONF --force
 ./configure --help >stdout || { cat stdout; Exit 1; }
 cat stdout
-grep ' --disable-maintainer-mode.*disable make rules' stdout
+$EGREP '^  *--disable-maintainer-mode( |$)' stdout
+$FGREP ' disable make rules' stdout
 
 :
diff --git a/tests/help-multilib.test b/tests/help-multilib.test
index 0016c76..1657c34 100755
--- a/tests/help-multilib.test
+++ b/tests/help-multilib.test
@@ -32,7 +32,7 @@ $AUTOCONF
 ./configure --help >stdout || { cat stdout; Exit 1; }
 cat stdout
 
-$FGREP ' --enable-multilib ' stdout
+$EGREP '^  *--enable-multilib( |$)' stdout
 $FGREP ' many library versions (default)' stdout
 
 :
diff --git a/tests/help-silent.test b/tests/help-silent.test
index b338907..e59f2f1 100755
--- a/tests/help-silent.test
+++ b/tests/help-silent.test
@@ -36,8 +36,10 @@ for args in '' '([])' '([yes])' '([no])'; do
   $AUTOCONF --force
   ./configure --help >stdout || { cat stdout; Exit 1; }
   cat stdout
-  grep ' --enable-silent-rules  *less verbose build.*undo.*make V=1' stdout
-  grep ' --disable-silent-rules  *verbose build.*undo.*make V=0' stdout
+  $EGREP '^  *--enable-silent-rules( |$)' stdout
+  grep ' less verbose build.*undo.*make V=1' stdout
+  $EGREP '^  *--disable-silent-rules ( |$)' stdout
+  grep ' verbose build.*undo.*make V=0' stdout
 done
 
 :
diff --git a/tests/help-upc.test b/tests/help-upc.test
index 586299b..8f5ff5f 100755
--- a/tests/help-upc.test
+++ b/tests/help-upc.test
@@ -32,7 +32,7 @@ $AUTOCONF
 ./configure --help >stdout || { cat stdout; Exit 1; }
 cat stdout
 
-grep ' UPCFLAGS .*Unified Parallel C compiler flags' stdout
-grep ' UPC .*Unified Parallel C compiler command' stdout
+grep '^  *UPCFLAGS .*Unified Parallel C compiler flags' stdout
+grep '^  *UPC .*Unified Parallel C compiler command' stdout
 
 :
diff --git a/tests/remake.test b/tests/remake.test
index 9c86b1b..4d3036b 100755
--- a/tests/remake.test
+++ b/tests/remake.test
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1996, 2000, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 2000, 2001, 2002, 2010 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
@@ -14,20 +15,27 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Make sure remaking rules in subdir are correctly generated.
+# Weak "grepping" test trying to ensure that remaking rules in a subdir
+# are correctly generated.
+# See also sister functional test `remake1a.test'.
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-AC_OUTPUT(sub/Makefile)
+set -e
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
 END
 
 mkdir sub
 : > sub/Makefile.am
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 grep '^Makefile' sub/Makefile.in
+
+:
diff --git a/tests/remake10a.test b/tests/remake10a.test
new file mode 100755
index 0000000..cda72b0
--- /dev/null
+++ b/tests/remake10a.test
@@ -0,0 +1,108 @@
+#! /bin/sh
+# Copyright (C) 2010 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/>.
+
+# Test remake rules for m4 files included (also recursively) by
+# configure.ac.
+# Keep in sync with sister tests `remake10b.test' and `remake10c.test'.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+magic1=::MagicStringOne::
+magic2=__MagicStringTwo__
+magic3=%%MagicStringThree%%
+
+cat >> configure.in <<END
+m4_include([foo.m4])
+AC_SUBST([FINGERPRINT], [my_fingerprint])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+.PHONY: nil
+nil:
+## Used by "make distcheck" later.
+check-local:
+       test -f $(top_srcdir)/foo.m4
+       test ! -r $(top_srcdir)/bar.m4
+       test x'$(FINGERPRINT)' = x'DummyValue'
+END
+
+echo 'm4_define([my_fingerprint], [BadBadBad])' > foo.m4
+
+$sleep # so that generated autotools files will be newer than prerequisites
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+for vpath in : false; do
+
+  if $vpath; then
+    mkdir build
+    cd build
+    top_srcdir=..
+  else
+    top_srcdir=.
+  fi
+
+  $top_srcdir/configure
+  $MAKE # should be no-op
+
+  $sleep
+  echo "m4_define([my_fingerprint], [$magic1])" > $top_srcdir/foo.m4
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile
+
+  $sleep
+  echo "m4_define([my_fingerprint], [$magic2])" > $top_srcdir/foo.m4
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile && Exit 1
+  $FGREP $magic2 Makefile
+
+  $sleep
+  echo "m4_include([bar.m4])" > $top_srcdir/foo.m4
+  echo "m4_define([my_fingerprint], [$magic3])" > $top_srcdir/bar.m4
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile && Exit 1
+  $FGREP $magic2 Makefile && Exit 1
+  $FGREP $magic3 Makefile
+
+  $sleep
+  echo "m4_define([my_fingerprint], [$magic1])" > $top_srcdir/bar.m4
+  $MAKE nil
+  $FGREP $magic2 Makefile && Exit 1
+  $FGREP $magic3 Makefile && Exit 1
+  $FGREP $magic1 Makefile
+
+  $sleep
+  echo "m4_define([my_fingerprint], [DummyValue])" > $top_srcdir/foo.m4
+  $MAKE distcheck
+  $FGREP $magic1 Makefile && Exit 1 # sanity check
+  $FGREP $magic2 Makefile && Exit 1 # likewise
+  $FGREP $magic3 Makefile && Exit 1 # likewise
+
+  $MAKE distclean
+
+  cd $top_srcdir
+
+done
+
+:
diff --git a/tests/remake10b.test b/tests/remake10b.test
new file mode 100755
index 0000000..53a7d13
--- /dev/null
+++ b/tests/remake10b.test
@@ -0,0 +1,107 @@
+#! /bin/sh
+# Copyright (C) 2010 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/>.
+
+# Test remake rules for am files included (also recursively) by
+# Makefile.am.
+# Keep in sync with sister tests `remake10a.test' and `remake10c.test'.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+magic1=::MagicStringOne::
+magic2=__MagicStringTwo__
+magic3=%%MagicStringThree%%
+
+cat >> configure.in <<'END'
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+.PHONY: nil
+nil:
+include foo.am
+## Used by "make distcheck" later.
+check-local:
+       test -f $(top_srcdir)/foo.am
+       test ! -r $(top_srcdir)/bar.am
+       test x'$(FINGERPRINT)' = x'DummyValue'
+END
+
+echo 'FINGERPRINT = BadBadBad' > foo.am
+
+$sleep # so that generated autotools files will be newer than prerequisites
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+for vpath in : false; do
+
+  if $vpath; then
+    mkdir build
+    cd build
+    top_srcdir=..
+  else
+    top_srcdir=.
+  fi
+
+  $top_srcdir/configure
+  $MAKE # should be no-op
+
+  $sleep
+  echo "FINGERPRINT = $magic1" > $top_srcdir/foo.am
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile
+
+  $sleep
+  echo "FINGERPRINT = $magic2" > $top_srcdir/foo.am
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile && Exit 1
+  $FGREP $magic2 Makefile
+
+  $sleep
+  echo 'include $(top_srcdir)/bar.am' > $top_srcdir/foo.am
+  echo "FINGERPRINT = $magic3" > $top_srcdir/bar.am
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile && Exit 1
+  $FGREP $magic2 Makefile && Exit 1
+  $FGREP $magic3 Makefile
+
+  $sleep
+  echo "FINGERPRINT = $magic1" > $top_srcdir/bar.am
+  $MAKE nil
+  $FGREP $magic2 Makefile && Exit 1
+  $FGREP $magic3 Makefile && Exit 1
+  $FGREP $magic1 Makefile
+
+  $sleep
+  echo "FINGERPRINT = DummyValue" > $top_srcdir/foo.am
+  $MAKE distcheck
+  $FGREP $magic1 Makefile && Exit 1 # sanity check
+  $FGREP $magic2 Makefile && Exit 1 # likewise
+  $FGREP $magic3 Makefile && Exit 1 # likewise
+
+  $MAKE distclean
+
+  cd $top_srcdir
+
+done
+
+:
diff --git a/tests/remake10c.test b/tests/remake10c.test
new file mode 100755
index 0000000..96e2c0d
--- /dev/null
+++ b/tests/remake10c.test
@@ -0,0 +1,112 @@
+#! /bin/sh
+# Copyright (C) 2010 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/>.
+
+# Test remake rules for m4 files included (also recursively) by
+# aclocal.m4.
+# Keep in sync with sister tests `remake10a.test' and `remake10b.test'.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+magic1=::MagicStringOne::
+magic2=__MagicStringTwo__
+magic3=%%MagicStringThree%%
+
+cat >> configure.in <<END
+FINGERPRINT='my_fingerprint'
+AC_SUBST([FINGERPRINT])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+ACLOCAL_AMFLAGS = -I m4
+.PHONY: nil
+nil:
+## Used by "make distcheck" later.
+check-local:
+       test -f $(top_srcdir)/m4/foo.m4
+       test ! -r $(top_srcdir)/m4/bar.m4
+       test x'$(FINGERPRINT)' = x'DummyValue'
+END
+
+mkdir m4
+echo 'AC_DEFUN([my_fingerprint], [BadBadBad])' > m4/foo.m4
+
+$sleep # so that generated autotools files will be newer than prerequisites
+$ACLOCAL -I m4
+$AUTOCONF
+$AUTOMAKE
+
+for vpath in : false; do
+
+  if $vpath; then
+    mkdir build
+    cd build
+    top_srcdir=..
+  else
+    top_srcdir=.
+  fi
+
+  $top_srcdir/configure
+  $MAKE # should be no-op
+
+  $sleep
+  echo "AC_DEFUN([my_fingerprint], [$magic1])" > $top_srcdir/m4/foo.m4
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile
+
+  $sleep
+  echo "AC_DEFUN([my_fingerprint], [$magic2])" > $top_srcdir/m4/foo.m4
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile && Exit 1
+  $FGREP $magic2 Makefile
+
+  $sleep
+  echo "m4_include([m4/bar.m4])" > $top_srcdir/m4/foo.m4
+  echo "AC_DEFUN([my_fingerprint], [$magic3])" > $top_srcdir/m4/bar.m4
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile && Exit 1
+  $FGREP $magic2 Makefile && Exit 1
+  $FGREP $magic3 Makefile
+
+  $sleep
+  echo "AC_DEFUN([my_fingerprint], [$magic1])" > $top_srcdir/m4/bar.m4
+  $MAKE nil
+  $FGREP $magic2 Makefile && Exit 1
+  $FGREP $magic3 Makefile && Exit 1
+  $FGREP $magic1 Makefile
+
+  $sleep
+  echo "AC_DEFUN([my_fingerprint], [DummyValue])" > $top_srcdir/m4/foo.m4
+  echo "AC_DEFUN([AM_UNUSED], [NoSuchMacro])" > $top_srcdir/m4/bar.m4
+  $MAKE nil # required to work around limitation of GNU make 3.82
+  $MAKE distcheck
+  $FGREP $magic1 Makefile && Exit 1 # sanity check
+  $FGREP $magic2 Makefile && Exit 1 # likewise
+  $FGREP $magic3 Makefile && Exit 1 # likewise
+
+  $MAKE distclean
+
+  cd $top_srcdir
+
+done
+
+:
diff --git a/tests/remake11.test b/tests/remake11.test
new file mode 100755
index 0000000..7eaad6c
--- /dev/null
+++ b/tests/remake11.test
@@ -0,0 +1,84 @@
+#! /bin/sh
+# Copyright (C) 2010 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/>.
+
+# Test remake rules in deeply nested subdirectories, and with a lot
+# of files.  This is basically a mild stress test, ensuring that rebuild
+# rules don't break in obvious ways in a slightly "heavier than usual"
+# setup.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+ocwd=`pwd` || Exit 1
+
+magic1=::MagicStringOne::
+magic2=__MagicStringTwo__
+
+echo "AC_SUBST([FOO], [$magic1])" >> configure.in
+
+echo "@FOO@" > bar.in
+echo "AC_CONFIG_FILES([bar])" >> configure.in
+for i in 0 1 2 3 4 5 6 7 8 9; do
+  d=${d+"$d/"}sub$i
+  echo "SUBDIRS = sub$i" > Makefile.am
+  echo "AC_CONFIG_FILES([$d/Makefile])" >> "$ocwd"/configure.in
+  echo "AC_CONFIG_FILES([$d/bar])" >> "$ocwd"/configure.in
+  mkdir sub$i
+  cd sub$i
+  echo "$d: @FOO@" > bar.in
+done
+echo AC_OUTPUT >> "$ocwd"/configure.in
+: > Makefile.am
+unset d i
+bottom=`pwd`
+
+cd "$ocwd"
+
+makefiles_am_list=`find . -name Makefile.am | LC_ALL=C sort`
+makefiles_list=`echo "$makefiles_am_list" | sed 's/\.am$//'`
+bar_in_list=`find . -name bar.in | LC_ALL=C sort`
+bar_list=`echo "$bar_in_list" | sed 's/\.in$//'`
+
+cat configure.in # useful for debugging
+
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
+
+./configure
+
+for f in configure config.status $makefiles_list $bar_list; do
+  $FGREP "$magic1" $f
+done
+
+$sleep
+sed "s/$magic1/$magic2/" configure.in >configure.tmp
+mv -f configure.tmp configure.in
+
+cd "$bottom"
+$MAKE
+cd "$ocwd"
+
+for f in configure config.status $makefiles_list $bar_list; do
+  $FGREP "$magic2" $f
+done
+$FGREP "$magic1" configure config.status $makefiles_list $bar_list && Exit 1
+
+$MAKE distcheck
+
+:
diff --git a/tests/remake12.test b/tests/remake12.test
new file mode 100755
index 0000000..63ea39d
--- /dev/null
+++ b/tests/remake12.test
@@ -0,0 +1,122 @@
+#! /bin/sh
+# Copyright (C) 2010 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/>.
+
+# Test basic remake rules for Makefiles with non-default names
+# and/or with multiple sources.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+magic1=::MagicStringOne::
+magic2=__MagicStringTwo__
+magic3=%%MagicStringThree%%
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([zardoz])
+AC_CONFIG_LINKS([Makefile:Makefile])
+AC_OUTPUT
+END
+
+cat > zardoz.am <<END
+EXTRA_DIST = Makefile
+#H: $magic1
+END
+
+cat > Makefile <<END
+include zardoz
+nil:
+.PHONY: nil
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+
+$MAKE nil
+grep '^#H:' zardoz.in # for debugging
+$FGREP $magic1 zardoz
+$FGREP $magic1 zardoz.in
+$MAKE distcheck
+$MAKE distclean # this shouldn't remove Makefile
+ls -l
+test -f Makefile
+
+./configure
+
+$sleep
+sed "s/%MAGIC3%/$magic3/" >> Makefile <<'END'
+my-check:
+       ls -l . $(srcdir) ;: for debugging
+       test -f $(srcdir)/quux.am
+       test -f $(srcdir)/quux.in
+       test -f $(srcdir)/bot.in
+       test -f $(srcdir)/top.in
+       test ! -r $(srcdir)/zardoz.am
+       test ! -r $(srcdir)/zardoz.in
+       grep FOO zardoz ;: for debugging
+       test x'$(FOO)' = x'%MAGIC3%'
+test:
+       ls -l ;: for debugging
+       test x'$(FOO)' = x'dummy'
+.PHONY: test my-check
+END
+sed "s/^#H:.*/#H: $magic2/" zardoz.am > t
+cat >> t <<'END'
+# used by "make distcheck" below
+check-local: my-check
+END
+mv -f t zardoz.am
+cat zardoz.am # for debugging
+$MAKE nil
+$FGREP my-check zardoz # sanity check
+$FGREP $magic1 zardoz zardoz.in && Exit 1
+$FGREP $magic2 zardoz
+$FGREP $magic2 zardoz.in
+
+./configure
+
+$sleep
+sed 's/^\(AC_CONFIG_FILES\)(.*/\1([zardoz:top.in:quux.in:bot.in])/' \
+  <configure.in >t
+mv -f t configure.in
+cat configure.in # for debugging
+sed '/^#H:/d' zardoz.am > quux.am
+echo 'FOO = dummy' >> quux.am
+echo 'BAR = $(BAZ)' > top.in
+echo "BAZ = $magic3" > bot.in
+$MAKE test
+$FGREP my-check zardoz # sanity check
+$FGREP $magic3 quux.in && Exit 1
+$FGREP $magic3 zardoz
+$FGREP $magic1 zardoz && Exit 1
+$FGREP $magic2 zardoz && Exit 1
+# After the remake above, the files `zardoz.am' and `zardoz.in'
+# should be no more needed
+echo 'endif' > zardoz.am # put in syntax error
+$MAKE test
+rm -f zardoz.in zardoz.am # get rid of them
+$MAKE test
+
+echo 'FOO = $(BAR)' >> quux.am
+$MAKE distcheck
+
+:
diff --git a/tests/help-init.test b/tests/remake1a.test
similarity index 55%
copy from tests/help-init.test
copy to tests/remake1a.test
index a3af271..ce80c19 100755
--- a/tests/help-init.test
+++ b/tests/remake1a.test
@@ -14,26 +14,44 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Make sure that our grand macro `AM_INIT_AUTOMAKE' add proper text
-# to the configure help screen.
+# Make sure remaking rules in subdir are correctly generated.
+# See also sister "grepping" test `remake.test'.
 
 . ./defs || Exit 1
 
+fingerprint='=/FiNgErPrInT/='
+
 set -e
 
 cat > configure.in <<END
 AC_INIT([$me], [1.0])
 AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
 END
 
+mkdir sub
+: > sub/Makefile.am
+
 $ACLOCAL
 $AUTOCONF
-
-./configure --help >stdout || { cat stdout; Exit 1; }
-cat stdout
-
-grep ' --program-prefix[= ]' stdout
-grep ' --program-suffix[= ]' stdout
-grep ' --program-transform-name[= ]' stdout
+$AUTOMAKE
+
+./configure
+
+# Rebuild rules should work even if there is no top-level
+# makefiles, if we are careful enough to trigger them only
+# in proper subdirs
+$sleep
+echo "# $fingerprint" > sub/Makefile.am
+cd sub
+$MAKE Makefile
+cd ..
+# Check that no spurious Makefile has been created in the
+# top-level directory.
+test ! -r Makefile
+# Check that the Makefile in the subdirectory has been properly
+# updated.
+$FGREP "$fingerprint" sub/Makefile
 
 :
diff --git a/tests/remake2.test b/tests/remake2.test
index 3b63dea..452e951 100755
--- a/tests/remake2.test
+++ b/tests/remake2.test
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1996, 1997, 2000, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 2000, 2001, 2002, 2010 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
@@ -14,20 +15,27 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Make sure remaking rules in subdir are correct.
+# Weak "grepping" test trying to ensure that remaking rules in subdir
+# are correct even when there is no upper-level Makefile.
+# TODO: we should really add also functional tests for this!
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-AC_OUTPUT(sub/Makefile)
+set -e
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
 END
 
 mkdir sub
 : > sub/Makefile.am
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
+
+grep '\$(AUTOMAKE).*sub/Makefile' sub/Makefile.in
 
-grep 'AUTOMAKE.*sub/Makefile' sub/Makefile.in
+:
diff --git a/tests/remake3.test b/tests/remake3.test
index 08ec16a..708dca8 100755
--- a/tests/remake3.test
+++ b/tests/remake3.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2010 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
@@ -14,14 +14,17 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Make sure remaking rules work when there is no subdir Makefile.
+# Weak "grepping" test trying to ensure that remake rules work for files
+# in a subdirectory even when there is no Makefile for that subdirectory.
+# See also sister functional test `remake3a.test'.
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-AC_OUTPUT(Makefile sub/foo)
+set -e
+
+cat >> configure.in << 'END'
+AC_CONFIG_FILES([sub/foo])
+AC_OUTPUT
 END
 
 : > Makefile.am
@@ -29,7 +32,9 @@ END
 mkdir sub
 : > sub/foo.in
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 grep '^sub/foo' Makefile.in
+
+:
diff --git a/tests/man8.test b/tests/remake3a.test
similarity index 51%
copy from tests/man8.test
copy to tests/remake3a.test
index 2ef52b4..a58c462 100755
--- a/tests/man8.test
+++ b/tests/remake3a.test
@@ -14,45 +14,62 @@
 # 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 for a bug in distcheck w.r.t. generated manpages.
+# Ensure that remake rules work for files in a subdirectory even when
+# there is no Makefile for that subdirectory.
+# See also sister "grepping" test `remake3.test'.
 
 . ./defs || Exit 1
 
 set -e
 
-cat > Makefile.am << 'END'
-dist_man_MANS = foo.1
-foo.1:
-       rm -f $(srcdir)/$@  # fails if $(srcdir) is unwritable
-       : > $(srcdir)/$@
+cat >> configure.in << 'END'
+AC_CONFIG_FILES([sub/foo])
+AC_OUTPUT
 END
 
-cat >> configure.in <<'END'
-AC_OUTPUT
+cat > Makefile.am <<'END'
+all-local: sub/foo
 END
 
+mkdir sub
+: > sub/foo.in
+
 $ACLOCAL
-$AUTOMAKE
 $AUTOCONF
+$AUTOMAKE
 
+# First a VPATH build.
 mkdir build
 cd build
 ../configure
-
+$sleep
+test -f sub/foo
+test ! -s sub/foo
+echo '#GrepMe#' > ../sub/foo.in
 $MAKE
-test -f ../foo.1
-$MAKE distdir
-test -f $me-1.0/foo.1
-$MAKE distcheck
+grep '#GrepMe#' sub/foo
 
 cd ..
-rm -f foo.1
+
+# Now try an in-tree build.
+: > sub/foo.in # restore its original (empty) content
 ./configure
+$sleep
+test -f sub/foo
+test ! -s sub/foo
+echo '#GrepMe#' > sub/foo.in
+$MAKE
+grep '#GrepMe#' sub/foo
 
+# Finally try to check the distribution.
+$sleep
+echo '%GrepMe%' > sub/foo.in
+cat >>Makefile.am <<END
+check-local:
+       grep '%GrepMe%' sub/foo
+END
 $MAKE
-test -f foo.1
-$MAKE distdir
-test -f $me-1.0/foo.1
+grep "grep '%GrepMe%' sub/foo" Makefile.in # sanity check
 $MAKE distcheck
 
 :
diff --git a/tests/remake4.test b/tests/remake4.test
index d6dbed7..0621c90 100755
--- a/tests/remake4.test
+++ b/tests/remake4.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2010 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
@@ -50,7 +50,9 @@ $MAKE
 $sleep
 touch aclocal.m4
 $MAKE distdir
-cd remake4-1.0
+cd $me-1.0
 test ! -f rebuild_ok
 ./configure
 $MAKE
+
+:
diff --git a/tests/remake5.test b/tests/remake5.test
index d353632..133f9a0 100755
--- a/tests/remake5.test
+++ b/tests/remake5.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2010 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
@@ -25,7 +25,7 @@ set -e
 
 cat >>configure.in <<'EOF'
 AM_MAINTAINER_MODE
-m4_include(foo.m4)
+m4_include([foo.m4])
 if test ! -f rebuild_ok; then
   ACLOCAL=false
   AUTOMAKE=false
@@ -70,3 +70,8 @@ $sleep
 echo 'AC_SUBST([YIPPY_YIPPY_YEAH])' >foo.m4
 $MAKE
 grep YIPPY_YIPPY_YEAH Makefile
+
+# Try the distribution, for completeness.
+$MAKE distcheck
+
+:
diff --git a/tests/remake6.test b/tests/remake6.test
index a25e486..885bcb4 100755
--- a/tests/remake6.test
+++ b/tests/remake6.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2008  Free Software Foundation, Inc.
+# Copyright (C) 2008, 2010 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
@@ -17,12 +17,12 @@
 # Make sure remaking rules work when subdir Makefile.in has been removed.
 
 . ./defs || Exit 1
+
 set -e
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-AC_OUTPUT(Makefile sub/Makefile)
+cat >> configure.in << 'END'
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
 END
 
 cat > Makefile.am <<'END'
@@ -42,23 +42,25 @@ $MAKE
 # only.
 
 rm -f Makefile.in
-$MAKE >stdout
+$MAKE >stdout || { cat stdout; Exit 1; }
 cat stdout
 test `grep -c " --run " stdout` -eq 1
 
 rm -f sub/Makefile.in
-$MAKE >stdout
+$MAKE >stdout || { cat stdout; Exit 1; }
 cat stdout
 test `grep -c " --run " stdout` -eq 1
 
 $sleep  # Let touched files appear newer.
 
 touch Makefile.am
-$MAKE >stdout
+$MAKE >stdout || { cat stdout; Exit 1; }
 cat stdout
 test `grep -c " --run " stdout` -eq 1
 
 touch sub/Makefile.am
-$MAKE >stdout
+$MAKE >stdout || { cat stdout; Exit 1; }
 cat stdout
 test `grep -c " --run " stdout` -eq 1
+
+:
diff --git a/tests/remake7.test b/tests/remake7.test
index 670f60b..66d4b9c 100755
--- a/tests/remake7.test
+++ b/tests/remake7.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2008  Free Software Foundation, Inc.
+# Copyright (C) 2008, 2010 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
@@ -17,12 +17,12 @@
 # Make sure remaking rules fail when they should.
 
 . ./defs || Exit 1
+
 set -e
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-AC_OUTPUT(Makefile sub/Makefile)
+cat >> configure.in << 'END'
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
 END
 
 cat > Makefile.am <<'END'
@@ -67,4 +67,5 @@ $MAKE && Exit 1
 
 rm -f Makefile.in
 $MAKE && Exit 1
+
 :
diff --git a/tests/remake8a.test b/tests/remake8a.test
new file mode 100755
index 0000000..9e66540
--- /dev/null
+++ b/tests/remake8a.test
@@ -0,0 +1,193 @@
+#! /bin/sh
+# Copyright (C) 2010 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/>.
+
+# Test basic remake rules for Makefiles, for an *in-tree build*.
+# This testcase checks dependency of generated Makefile from Makefile.am,
+# configure.ac, acinclude.m4, aclocal.m4, and extra m4 files considered
+# by aclocal.
+# Keep this in sync with sister test `remake8b.test', which performs the
+# same checks for a VPATH build.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+mv -f configure.in configure.stub
+
+cat > Makefile.am <<'END'
+all-local: foo
+foo:
+       echo '!Foo!' >$@
+check-local:
+       cat foo
+       grep '!Foo!' foo
+CLEANFILES = foo
+END
+
+cat configure.stub - > configure.in <<'END'
+AC_OUTPUT
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+srcdir='.' # to make syncing with remake8b.test easier.
+
+$srcdir/configure
+
+$MAKE
+cat foo
+grep '!Foo!' foo
+$MAKE distcheck
+
+rm -f foo
+
+# Modify just Makefile.am.
+
+$sleep
+
+cat > $srcdir/Makefile.am <<'END'
+all-local: bar
+bar:
+       echo '!Baz!' >$@
+check-local:
+       cat bar
+       grep '!Baz!' bar
+       test ! -r $(srcdir)/foo
+       test ! -r foo
+CLEANFILES = bar
+END
+
+$MAKE
+cat bar
+grep '!Baz!' bar
+test ! -r foo
+$MAKE distcheck
+
+rm -f bar
+
+# Modify Makefile.am and configure.in.
+
+$sleep
+
+cat > $srcdir/Makefile.am <<'END'
+all-local: quux
+check-local:
+       cat quux
+       grep '!Zardoz!' quux
+       test ! -r $(srcdir)/bar
+       test ! -r bar
+END
+
+cat $srcdir/configure.stub - > $srcdir/configure.in <<'END'
+AC_CONFIG_FILES([quux])
+AC_SUBST([QUUX], [Zardoz])
+AC_OUTPUT
+END
+
+cat > $srcdir/quux.in <<'END'
address@hidden@!
+END
+
+$MAKE
+cat quux
+grep '!Zardoz!' quux
+test ! -r bar
+$MAKE distcheck
+
+rm -f quux
+
+# Modify Makefile.am to add a directory of extra m4 files
+# considered by aclocal.
+
+$sleep
+
+mkdir $srcdir/m4
+
+cat > $srcdir/Makefile.am <<'END'
+ACLOCAL_AMFLAGS = -I m4
+all-local: quux
+check-local:
+       cat quux
+       grep '%Foo%' quux
+       test x'$(QUUX)' = x'%Foo%'
+END
+
+$MAKE # this should place aclocal flags in Makefile
+grep '.*-I m4' Makefile # sanity check
+
+# Modify configure.in and aclocal.m4.
+
+$sleep
+
+cat $srcdir/configure.stub - > $srcdir/configure.in <<'END'
+AC_CONFIG_FILES([quux])
+MY_CUSTOM_MACRO
+AC_OUTPUT
+END
+
+cat >> $srcdir/aclocal.m4 <<'END'
+AC_DEFUN([MY_CUSTOM_MACRO], [AC_SUBST([QUUX], [%Foo%])])
+END
+
+$MAKE
+cat quux
+grep '%Foo%' quux
+$MAKE distcheck
+
+# Modify Makefile.am, remove aclocal.m4, and add a new m4 file to
+# the directory of extra m4 files considered by aclocal.  This new
+# file should now provide a macro required by configure.in and that
+# was previously provided by aclocal.m4.
+
+$sleep
+
+sed 's/%Foo%/%Bar%/g' $srcdir/Makefile.am > t
+mv -f t $srcdir/Makefile.am
+cat $srcdir/Makefile.am
+rm -f $srcdir/aclocal.m4
+cat > $srcdir/m4/blah.m4 <<'END'
+AC_DEFUN([MY_CUSTOM_MACRO], [AC_SUBST([QUUX], [%Bar%])])
+END
+
+$MAKE
+cat quux
+grep '%Bar%' quux
+$MAKE distcheck
+
+# Modify Makefile.am, remove all the extra m4 files to considered
+# by aclocal, and add an acinclude.m4 file.  This last file should
+# now provide a macro required by configure.in, and that was
+# previously provided by the extra m4 files considered by aclocal.
+
+$sleep
+
+rm -f $srcdir/m4/*.m4
+sed 's/%Bar%/%Quux%/g' $srcdir/Makefile.am > t
+mv -f t $srcdir/Makefile.am
+cat $srcdir/Makefile.am
+cat > $srcdir/acinclude.m4 <<'END'
+AC_DEFUN([MY_CUSTOM_MACRO], [AC_SUBST([QUUX], [%Quux%])])
+END
+
+$MAKE
+cat quux
+grep '%Quux%' quux
+$MAKE distcheck
+
+:
diff --git a/tests/remake8b.test b/tests/remake8b.test
new file mode 100755
index 0000000..3773aac
--- /dev/null
+++ b/tests/remake8b.test
@@ -0,0 +1,195 @@
+#! /bin/sh
+# Copyright (C) 2010 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/>.
+
+# Test basic remake rules for Makefiles, for a *VPATH build*.
+# This testcase checks dependency of generated Makefile from Makefile.am,
+# configure.ac, acinclude.m4, aclocal.m4, and extra m4 files considered
+# by aclocal.
+# Keep this in sync with sister test `remake8a.test', which performs the
+# same checks for a in-tree build.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+mv -f configure.in configure.stub
+
+cat > Makefile.am <<'END'
+all-local: foo
+foo:
+       echo '!Foo!' >$@
+check-local:
+       cat foo
+       grep '!Foo!' foo
+CLEANFILES = foo
+END
+
+cat configure.stub - > configure.in <<'END'
+AC_OUTPUT
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+mkdir build
+cd build
+srcdir='..' # to make syncing with remake8a.test easier.
+
+$srcdir/configure
+
+$MAKE
+cat foo
+grep '!Foo!' foo
+$MAKE distcheck
+
+rm -f foo
+
+# Modify just Makefile.am.
+
+$sleep
+
+cat > $srcdir/Makefile.am <<'END'
+all-local: bar
+bar:
+       echo '!Baz!' >$@
+check-local:
+       cat bar
+       grep '!Baz!' bar
+       test ! -r $(srcdir)/foo
+       test ! -r foo
+CLEANFILES = bar
+END
+
+$MAKE
+cat bar
+grep '!Baz!' bar
+test ! -r foo
+$MAKE distcheck
+
+rm -f bar
+
+# Modify Makefile.am and configure.in.
+
+$sleep
+
+cat > $srcdir/Makefile.am <<'END'
+all-local: quux
+check-local:
+       cat quux
+       grep '!Zardoz!' quux
+       test ! -r $(srcdir)/bar
+       test ! -r bar
+END
+
+cat $srcdir/configure.stub - > $srcdir/configure.in <<'END'
+AC_CONFIG_FILES([quux])
+AC_SUBST([QUUX], [Zardoz])
+AC_OUTPUT
+END
+
+cat > $srcdir/quux.in <<'END'
address@hidden@!
+END
+
+$MAKE
+cat quux
+grep '!Zardoz!' quux
+test ! -r bar
+$MAKE distcheck
+
+rm -f quux
+
+# Modify Makefile.am to add a directory of extra m4 files
+# considered by aclocal.
+
+$sleep
+
+mkdir $srcdir/m4
+
+cat > $srcdir/Makefile.am <<'END'
+ACLOCAL_AMFLAGS = -I m4
+all-local: quux
+check-local:
+       cat quux
+       grep '%Foo%' quux
+       test x'$(QUUX)' = x'%Foo%'
+END
+
+$MAKE # this should place aclocal flags in Makefile
+grep '.*-I m4' Makefile # sanity check
+
+# Modify configure.in and aclocal.m4.
+
+$sleep
+
+cat $srcdir/configure.stub - > $srcdir/configure.in <<'END'
+AC_CONFIG_FILES([quux])
+MY_CUSTOM_MACRO
+AC_OUTPUT
+END
+
+cat >> $srcdir/aclocal.m4 <<'END'
+AC_DEFUN([MY_CUSTOM_MACRO], [AC_SUBST([QUUX], [%Foo%])])
+END
+
+$MAKE
+cat quux
+grep '%Foo%' quux
+$MAKE distcheck
+
+# Modify Makefile.am, remove aclocal.m4, and add a new m4 file to
+# the directory of extra m4 files considered by aclocal.  This new
+# file should now provide a macro required by configure.in and that
+# was previously provided by aclocal.m4.
+
+$sleep
+
+sed 's/%Foo%/%Bar%/g' $srcdir/Makefile.am > t
+mv -f t $srcdir/Makefile.am
+cat $srcdir/Makefile.am
+rm -f $srcdir/aclocal.m4
+cat > $srcdir/m4/blah.m4 <<'END'
+AC_DEFUN([MY_CUSTOM_MACRO], [AC_SUBST([QUUX], [%Bar%])])
+END
+
+$MAKE
+cat quux
+grep '%Bar%' quux
+$MAKE distcheck
+
+# Modify Makefile.am, remove all the extra m4 files to considered
+# by aclocal, and add an acinclude.m4 file.  This last file should
+# now provide a macro required by configure.in, and that was
+# previously provided by the extra m4 files considered by aclocal.
+
+$sleep
+
+rm -f $srcdir/m4/*.m4
+sed 's/%Bar%/%Quux%/g' $srcdir/Makefile.am > t
+mv -f t $srcdir/Makefile.am
+cat $srcdir/Makefile.am
+cat > $srcdir/acinclude.m4 <<'END'
+AC_DEFUN([MY_CUSTOM_MACRO], [AC_SUBST([QUUX], [%Quux%])])
+END
+
+$MAKE
+cat quux
+grep '%Quux%' quux
+$MAKE distcheck
+
+:
diff --git a/tests/remake9a.test b/tests/remake9a.test
new file mode 100755
index 0000000..9cd2d9f
--- /dev/null
+++ b/tests/remake9a.test
@@ -0,0 +1,106 @@
+#! /bin/sh
+# Copyright (C) 2010 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/>.
+
+# Test remake rules when configure.in or its prerequisites change.
+# Keep in sync with the other sister tests `remake9*.test'.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+magic1=::MagicStringOne::
+magic2=__MagicStringTwo__
+
+cat >> configure.in <<END
+FINGERPRINT=BadBadBad
+AC_SUBST([FINGERPRINT])
+AC_CONFIG_FILES([foo.sh:foo.in], [chmod a+x foo.sh])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+nil:
+.PHONY: nil
+
+$(srcdir)/configure.in: $(srcdir)/tweak-configure-in
+       $(SHELL) $(srcdir)/tweak-configure-in <$@ >address@hidden
+       mv -f address@hidden $@
+EXTRA_DIST = $(srcdir)/tweak-configure-in
+
+# Used by "make distcheck" later.
+check-local:
+       test x'$(FINGERPRINT)' = x'DummyValue'
+       test x"`./foo.sh`" = x"DummyValue"
+END
+
+cat > foo.in <<END
+#!/bin/sh
+echo '@FINGERPRINT@'
+END
+
+echo cat > tweak-configure-in # no-op by default
+
+$sleep # so that generated autotools files will be newer than prerequisites
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+for vpath in : false; do
+
+  if $vpath; then
+    mkdir build
+    cd build
+    srcdir=..
+  else
+    srcdir=.
+  fi
+
+  $srcdir/configure
+  $MAKE # should be no-op
+
+  $sleep
+  sed "s/^\\(FINGERPRINT\\)=.*/\\1=$magic1/" $srcdir/configure.in >t
+  mv -f t $srcdir/configure.in
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile
+  test x"`./foo.sh`" = x"$magic1"
+
+  $sleep
+  echo 'sed "s/^\\(FINGERPRINT\\)=.*/\\1='$magic2'/"' \
+    > $srcdir/tweak-configure-in
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile && Exit 1
+  $FGREP $magic2 Makefile
+  test x"`./foo.sh`" = x"$magic2"
+
+  $sleep
+  echo cat > $srcdir/tweak-configure-in # no-op again
+  sed "s/^\\(FINGERPRINT\\)=.*/\\1=DummyValue/" $srcdir/configure.in >t
+  mv -f t $srcdir/configure.in
+  $MAKE distcheck
+  $FGREP $magic1 Makefile && Exit 1 # sanity check
+  $FGREP $magic2 Makefile && Exit 1 # likewise
+
+  $MAKE distclean
+
+  cd $srcdir
+
+done
+
+:
diff --git a/tests/remake9b.test b/tests/remake9b.test
new file mode 100755
index 0000000..636cc5f
--- /dev/null
+++ b/tests/remake9b.test
@@ -0,0 +1,108 @@
+#! /bin/sh
+# Copyright (C) 2010 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/>.
+
+# Test remake rules when Makefile.am or its prerequisites change.
+# Keep in sync with the other sister tests `remake9*.test'.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+magic1=::MagicStringOne::
+magic2=__MagicStringTwo__
+
+cat >> configure.in <<END
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+FINGERPRINT = BadBadBad
+
+all-local: nil
+nil: foo.sh
+.PHONY: nil
+
+$(srcdir)/Makefile.am: $(srcdir)/tweak-makefile-am
+       $(SHELL) $(srcdir)/tweak-makefile-am <$@ >address@hidden
+       mv -f address@hidden $@
+EXTRA_DIST = $(srcdir)/tweak-makefile-am
+
+foo.sh: Makefile
+       rm -f $@ address@hidden
+       echo '#!/bin/sh' > address@hidden
+       echo "echo '$(FINGERPRINT)'" >> address@hidden
+       chmod a+x address@hidden && mv -f address@hidden $@
+CLEANFILES = foo.sh
+
+# Used by "make distcheck" later.
+check-local:
+       test x'$(FINGERPRINT)' = x'DummyValue'
+       test x"`./foo.sh`" = x"DummyValue"
+END
+
+echo cat > tweak-makefile-am # no-op by default
+
+$sleep # so that generated autotools files will be newer than prerequisites
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+for vpath in : false; do
+
+  if $vpath; then
+    mkdir build
+    cd build
+    srcdir=..
+  else
+    srcdir=.
+  fi
+
+  $srcdir/configure
+  $MAKE # should be no-op
+
+  $sleep
+  sed "s/^\\(FINGERPRINT\\) *=.*/\\1 = $magic1/" $srcdir/Makefile.am >t
+  mv -f t $srcdir/Makefile.am
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile
+  test x"`./foo.sh`" = x"$magic1"
+
+  $sleep
+  echo 'sed "s/^\\(FINGERPRINT\\) *=.*/\\1 = '$magic2'/"' \
+    > $srcdir/tweak-makefile-am
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile && Exit 1
+  $FGREP $magic2 Makefile
+  test x"`./foo.sh`" = x"$magic2"
+
+  $sleep
+  echo cat > $srcdir/tweak-makefile-am # no-op again
+  sed "s/^\\(FINGERPRINT\\) *=.*/\\1 = DummyValue/" $srcdir/Makefile.am >t
+  mv -f t $srcdir/Makefile.am
+  $MAKE distcheck
+  $FGREP $magic1 Makefile && Exit 1 # sanity check
+  $FGREP $magic2 Makefile && Exit 1 # likewise
+
+  $MAKE distclean
+
+  cd $srcdir
+
+done
+
+:
diff --git a/tests/remake9c.test b/tests/remake9c.test
new file mode 100755
index 0000000..4514371
--- /dev/null
+++ b/tests/remake9c.test
@@ -0,0 +1,109 @@
+#! /bin/sh
+# Copyright (C) 2010 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/>.
+
+# Test remake rules when acinclude.m4 or its prerequisites change.
+# Keep in sync with the other sister tests `remake9*.test'.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+magic1=::MagicStringOne::
+magic2=__MagicStringTwo__
+
+cat >> configure.in <<END
+FINGERPRINT='my_fingerprint'
+AC_SUBST([FINGERPRINT])
+AC_CONFIG_FILES([foo.sh:foo.in], [chmod a+x foo.sh])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+nil:
+.PHONY: nil
+
+# The right way to extend an autogenerated aclocal.m4 is to provide
+# an acinclude.m4 file.
+$(srcdir)/acinclude.m4: $(srcdir)/tweak-acinclude-m4
+       $(SHELL) $(srcdir)/tweak-acinclude-m4 <$@ >address@hidden
+       mv -f address@hidden $@
+       touch $@
+EXTRA_DIST = $(srcdir)/tweak-acinclude-m4
+
+# Used by "make distcheck" later.
+check-local:
+       test x'$(FINGERPRINT)' = x'DummyValue'
+       test x"`./foo.sh`" = x"DummyValue"
+END
+
+cat > foo.in <<END
+#!/bin/sh
+echo '@FINGERPRINT@'
+END
+
+echo "AC_DEFUN([my_fingerprint], [BadBadBad])" > acinclude.m4
+
+echo : > tweak-acinclude-m4 # no-op by default
+
+$sleep # so that generated autotools files will be newer than prerequisites
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+for vpath in : false; do
+
+  if $vpath; then
+    mkdir build
+    cd build
+    srcdir=..
+  else
+    srcdir=.
+  fi
+
+  $srcdir/configure
+  $MAKE # should be no-op
+
+  $sleep
+  echo "AC_DEFUN([my_fingerprint], [$magic1])" > $srcdir/acinclude.m4
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile
+  test x"`./foo.sh`" = x"$magic1"
+
+  $sleep
+  echo "echo 'AC_DEFUN([my_fingerprint], [$magic2])'" \
+    > $srcdir/tweak-acinclude-m4
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile && Exit 1
+  $FGREP $magic2 Makefile
+  test x"`./foo.sh`" = x"$magic2"
+
+  $sleep
+  echo : > $srcdir/tweak-acinclude-m4 # no-op again
+  echo "AC_DEFUN([my_fingerprint], [DummyValue])" > $srcdir/acinclude.m4
+  $MAKE distcheck
+  $FGREP $magic1 Makefile && Exit 1 # sanity check
+  $FGREP $magic2 Makefile && Exit 1 # likewise
+
+  $MAKE distclean
+
+  cd $srcdir
+
+done
+
+:
diff --git a/tests/remake9d.test b/tests/remake9d.test
new file mode 100755
index 0000000..b83dd89
--- /dev/null
+++ b/tests/remake9d.test
@@ -0,0 +1,109 @@
+#! /bin/sh
+# Copyright (C) 2010 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/>.
+
+# Test remake rules when aclocal.m4 or its prerequisites change.
+# Keep in sync with the other sister tests `remake9*.test'.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+magic1=::MagicStringOne::
+magic2=__MagicStringTwo__
+
+cat >> configure.in <<END
+FINGERPRINT='my_fingerprint'
+AC_SUBST([FINGERPRINT])
+AC_CONFIG_FILES([foo.sh:foo.in], [chmod a+x foo.sh])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+nil:
+.PHONY: nil
+
+# A non-autogenerated aclocal.m4 can be extended by hand.
+$(srcdir)/aclocal.m4: $(srcdir)/tweak-aclocal-m4
+       $(SHELL) $(srcdir)/tweak-aclocal-m4 <$@ >address@hidden
+       mv -f address@hidden $@
+       touch $@
+EXTRA_DIST = $(srcdir)/tweak-aclocal-m4
+
+# Used by "make distcheck" later.
+check-local:
+       test x'$(FINGERPRINT)' = x'DummyValue'
+       test x"`./foo.sh`" = x"DummyValue"
+END
+
+cat > foo.in <<END
+#!/bin/sh
+echo '@FINGERPRINT@'
+END
+
+echo cat > tweak-aclocal-m4 # no-op by default
+
+$sleep # so that generated autotools files will be newer than prerequisites
+$ACLOCAL
+# Cheatingly mark aclocal.m4 as non auto-generated.
+sed '/^ *#.*generated automatically/d' aclocal.m4 > t
+mv -f t aclocal.m4
+$AUTOCONF
+$AUTOMAKE
+
+for vpath in : false; do
+
+  if $vpath; then
+    mkdir build
+    cd build
+    srcdir=..
+  else
+    srcdir=.
+  fi
+
+  $srcdir/configure
+  $MAKE # should be no-op
+
+  $sleep
+  echo "AC_DEFUN([my_fingerprint], [$magic1])dnl %%%" >> $srcdir/aclocal.m4
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile
+  test x"`./foo.sh`" = x"$magic1"
+
+  $sleep
+  echo "sed 's/.*dnl *%%%.*/AC_DEFUN([my_fingerprint], [$magic2])/'" \
+    > $srcdir/tweak-aclocal-m4
+  $MAKE nil
+  $FGREP FINGERPRINT Makefile # for debugging
+  $FGREP $magic1 Makefile && Exit 1
+  $FGREP $magic2 Makefile
+  test x"`./foo.sh`" = x"$magic2"
+
+  $sleep
+  echo cat > $srcdir/tweak-aclocal-m4 # no-op again
+  echo 'AC_DEFUN([my_fingerprint], [DummyValue])' >> $srcdir/aclocal.m4
+  $MAKE distcheck
+  $FGREP $magic1 Makefile && Exit 1 # sanity check
+  $FGREP $magic2 Makefile && Exit 1 # likewise
+
+  $MAKE distclean
+
+  cd $srcdir
+
+done
+
+:


hooks/post-receive
-- 
GNU Automake



reply via email to

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