automake-commit
[Top][All Lists]
Advanced

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

[Automake-commit] [SCM] GNU Automake branch, yacc-work, updated. v1.11-3


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, yacc-work, updated. v1.11-361-g2b1609f
Date: Mon, 11 Apr 2011 15:34:15 +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=2b1609fc05d829fa8bf10dda48de81396515ddc1

The branch, yacc-work has been updated
       via  2b1609fc05d829fa8bf10dda48de81396515ddc1 (commit)
       via  ac6764da0c0ad499e51a36db0a818b03b697ef37 (commit)
       via  9ada18be77d81c1e79ac360bb7a57810b2b6f546 (commit)
       via  1ae0d32e09b89de68955485fbc906202832f7d74 (commit)
       via  df9b3bc2212dff5edea3dc60abe93ee61e5283f9 (commit)
       via  744705d420e809cc3da27a253892aa69defec4ce (commit)
       via  38f41a03549259cc1a70d5da10b082b1ba86d04b (commit)
       via  7953494a128593bf74d2849f488f593c4d4fea9c (commit)
       via  6a85bc48aa9691574053a153d79cc79cd28e311f (commit)
       via  d4df619bfa53ef0bd81fbbbe03b3672711defe2f (commit)
       via  e87c030d838a0c649239c9d2a632c1b2415852a0 (commit)
       via  0a6a45503a44d149da77e1b3b35aa16592c1a258 (commit)
       via  e72a1b007f3ae165ded1af8a00dce83448c2ff2c (commit)
       via  8d3571b9dddfcab822f7b62832070b2214a11ac9 (commit)
       via  1dd55a48e354e57686879ea9900c8daf0402a10a (commit)
       via  34c1c2d884774ae91f82e1c5027d1502b3112c6a (commit)
       via  32975c638af3628283ba0fe6080729acbc898acb (commit)
       via  e36003d0cf689ab737e774ea5faa07b2375e0d0a (commit)
       via  68694a871f05fcb33a3efb6aada7c084365ca272 (commit)
       via  ef95da1f6a426e26b5f6b3c219ec4d27f982ffc5 (commit)
       via  1325a8ada5e11f19ff41094e8c2f86fe0952e425 (commit)
       via  b532317d8b7f779a45a070fd10012a204cf4ee72 (commit)
       via  78992b3411196a4e9e66bffed5a6ab96aa9d648f (commit)
       via  d51e7b79713f909c235c9880f7f62c4b0c0910d0 (commit)
       via  e6ca61c1a1bf601cfde4b67c33fe861cafff7450 (commit)
       via  a118732d1138b169e3c41759b8e3e03945994172 (commit)
       via  5bf7af6e1e5fa63bc192ed972ef8c83dd6faec2b (commit)
       via  5cc6a5a3835fe98b23e4dae86ba7228f977e50a2 (commit)
       via  5ed043ad03d36be44500501ec0d69f3ba736911d (commit)
       via  e12be9450726e26136a6bc64f7df47ced18f6671 (commit)
       via  9095d6b98f6d9d3755e8b592f336011aef11d61f (commit)
       via  06b46e1f8f307d2f6d0af6a9d73f7003171d0745 (commit)
       via  fcb15300772146dfcb8d2f232a32989e2d24fefa (commit)
       via  e1a4d87a050607367de05054e069d6f3ddcfca84 (commit)
       via  ead12d3f08f5a04db3fef1a70ee62e1835ce2633 (commit)
       via  e9cb6db11693a39051b43574405c651ce91ab37d (commit)
       via  92c4c0c0a073fee1497ae70b8d269fc81f3884c7 (commit)
       via  4a492566abfbecd896073dc62e4099e182e5e69c (commit)
       via  7e2e93d82b46e743c68a821684fc5afc54bfef54 (commit)
       via  e9b44d82fd9d4d55223f11a4fff011c2c7036175 (commit)
       via  4e1ab202ca72822803463aa71e676b938210f0f5 (commit)
       via  15a6e56f4a8f9e262631419dbfc46483c0b69428 (commit)
       via  10315b6dc8fe65f86a901ee9692271b2e8e4f541 (commit)
       via  d652a1c0a5bf2f973c5328eed983b4df9ccd284f (commit)
       via  e8e533e2f5039a34c7c13c9cdd88cfbf0ba2f3ec (commit)
       via  599a8f5ef7241b23ed96b18f32f745d028d26c11 (commit)
       via  80fdae8e515f85b1000bea1ee1823d88d392f659 (commit)
       via  080efc945a834569156c2fc11e7623853e1bdd04 (commit)
       via  87073880107cef3f162305b8681f1cb4826ce623 (commit)
       via  e5fb6dce45aae3a3bc403cd3f3e0d4e3babf2f75 (commit)
       via  09c55b721e4236c694e00ec35d3b4e25a51e5478 (commit)
       via  719d10784ff5a7c5a2f83b6908581911c8bd153e (commit)
       via  7a42b52f626f3b713196b5946b9bfbb3e173226b (commit)
       via  104926af9da5c73470a048342de9349cb86c89e2 (commit)
       via  44eb24d65ca6db445a40535067683418a3760c1f (commit)
       via  6615a9c3195f8e17c7dbfd052ca528019739a517 (commit)
       via  21fec67175f26976a04a7ab29e01536d5f9fc464 (commit)
       via  cf65e60d20f66e867af51f55426e93d1f3c6c328 (commit)
       via  2872bbbde068b45b4788f3998fe3d80146f5442b (commit)
       via  3d8d5ec1c85f43aaa78e373dfe30f5d397cd5819 (commit)
       via  c8c0a64515e4ed1e08c8eddb9e5dfd06ce987577 (commit)
       via  51b68122c3abc0503e8eddfc188645c9109d76c4 (commit)
       via  36bd45346b317c5cc45ae9f35b710d206ffa05c0 (commit)
       via  73b74f839340b94dad94f090e7d8291064104d0d (commit)
       via  a115c7c75580f71dd6c123bb1cdaa07f742fd3a3 (commit)
       via  6318add07d8f2f8507edcfd85461afea77f68a90 (commit)
       via  ece3872f817855afd265b3a2187116b253439de0 (commit)
       via  bb528a71d97ba1b529c314e391253c3b6e2be078 (commit)
       via  638f21a12eaad4de414f2ee3b5c7d8230da66c38 (commit)
       via  201ee99071fa515e097b5be00cbda2f139da7f65 (commit)
       via  0d93356e18f12daaddb0118d19d1e45df9d4db44 (commit)
       via  dcc0f400e92d994a77dc3228d90ab9fbfd0590e8 (commit)
       via  6880ecb207efdd869ab2a8bcdbd0cd24e36bf9f1 (commit)
      from  4ed586c011158cb60ba310fb20604184c5b25ebc (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 2b1609fc05d829fa8bf10dda48de81396515ddc1
Merge: 4ed586c ac6764d
Author: Stefano Lattarini <address@hidden>
Date:   Mon Apr 11 17:25:34 2011 +0200

    Merge branch 'maint' into yacc-work
    
    Conflicts:
        ChangeLog
        NEWS
        tests/Makefile.am
        tests/Makefile.in
        tests/cond36.test
        tests/yacc5.test

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

Summary of changes:
 ChangeLog                                          |  577 ++++++++++++++++++++
 ChangeLog.03                                       |    6 +-
 ChangeLog.96                                       |   30 +-
 ChangeLog.98                                       |   12 +-
 Makefile.am                                        |   61 ++
 Makefile.in                                        |   58 ++
 NEWS                                               |   15 +-
 README                                             |    2 +-
 THANKS                                             |    5 +-
 TODO                                               |    6 +-
 automake.in                                        |   30 +-
 doc/automake.texi                                  |   81 +++-
 lib/Automake/Rule.pm                               |   19 +-
 lib/Automake/Variable.pm                           |    2 +-
 lib/Automake/tests/Makefile.in                     |    7 +-
 lib/am/check.am                                    |   15 +-
 lib/depcomp                                        |   16 +-
 lib/install-sh                                     |   23 +-
 m4/depend.m4                                       |    5 +-
 m4/python.m4                                       |    2 +
 tests/Makefile.am                                  |   37 ++-
 tests/Makefile.in                                  |   47 ++-
 tests/aclocal6.test                                |   22 +-
 tests/alloca.test                                  |   12 +-
 tests/alloca2.test                                 |   12 +-
 ...lpha2.test => autodist-acconfig-no-subdir.test} |   49 +-
 tests/{extra10.test => autodist-acconfig.test}     |   26 +-
 ...orce-override.test => autodist-aclocal-m4.test} |   57 +--
 tests/autodist-config-headers.test                 |   61 ++
 tests/autodist-configure-no-subdir.test            |   72 +++
 tests/{vtexi2.test => autodist-stamp-vti.test}     |   41 +-
 tests/autodist-subdir.test                         |  147 +++++
 tests/autodist.test                                |  136 +++++
 ...-weirdnames.test => check-exported-srcdir.test} |   51 +-
 tests/check-tests-in-builddir.test                 |   83 +++
 .../{check11.test => check-tests_environment.test} |   22 +-
 tests/{txinfo18.test => comments-in-var-def.test}  |   55 +-
 tests/compile_f_c_cxx.test                         |    2 +
 tests/cond13.test                                  |    2 +-
 tests/cond14.test                                  |    2 +-
 tests/cond36.test                                  |    3 +-
 tests/defs.in                                      |   56 ++-
 tests/depcomp10.test                               |   90 +++
 tests/depcomp6.test                                |   43 +-
 tests/depcomp7.test                                |   32 +-
 tests/depcomp9.test                                |   92 ++++
 ...include2.test => dist-included-parent-dir.test} |    0
 tests/flibs.test                                   |    2 +
 tests/fn99.test                                    |    5 +-
 tests/fn99subdir.test                              |    5 +-
 tests/fort4.test                                   |    4 +-
 tests/fort5.test                                   |    2 +-
 tests/{include.test => hdr-vars-defined-once.test} |    0
 tests/{help-regex.test => help-python.test}        |   11 +-
 tests/instdir-java.test                            |    3 +-
 tests/instdir-texi.test                            |    9 +-
 tests/instfail-java.test                           |    3 +-
 tests/instsh2.test                                 |   36 ++-
 tests/instspc.test                                 |    8 +-
 tests/{yacc-weirdnames.test => java-check.test}    |   52 +-
 tests/java.test                                    |    3 +-
 .../{target-cflags.test => lex-subobj-nodep.test}  |   67 ++--
 tests/libtool4.test                                |    9 +-
 tests/ltinit.test                                  |   64 +++
 tests/{sinclude.test => m4-inclusion.test}         |    8 +-
 tests/{maintclean.test => maintclean-vpath.test}   |   50 ++-
 tests/maintclean.test                              |   36 +-
 tests/{check6.test => parallel-tests-subdir.test}  |   33 +-
 ...ts4.test => parallel-tests-unreadable-log.test} |   55 +--
 tests/parallel-tests.test                          |    5 +
 tests/parallel-tests8.test                         |    4 +-
 tests/pr8365-remake-timing.test                    |  110 ++++
 tests/specflg-dummy.test                           |  248 +++++++++
 tests/spy.test                                     |   20 +-
 tests/subdir5.test                                 |   25 +-
 tests/subdir8.test                                 |   23 +-
 tests/substref.test                                |    4 +-
 tests/suffix13.test                                |    6 +-
 tests/suffix7.test                                 |    2 +-
 tests/txinfo.test                                  |   32 +-
 tests/txinfo16.test                                |   11 +-
 tests/txinfo18.test                                |   16 +-
 tests/txinfo2.test                                 |   22 +-
 tests/txinfo22.test                                |   20 +-
 tests/txinfo23.test                                |   14 +-
 tests/txinfo24.test                                |   10 +-
 tests/txinfo25.test                                |   15 +-
 tests/txinfo29.test                                |   17 +-
 tests/txinfo3.test                                 |   14 +-
 tests/txinfo4.test                                 |    7 +-
 tests/txinfo5.test                                 |   13 +-
 tests/{txinfo5.test => txinfo5b.test}              |   16 +-
 tests/txinfo6.test                                 |   13 +-
 tests/txinfo7.test                                 |   12 +-
 tests/txinfo8.test                                 |   49 +-
 tests/txinfo9.test                                 |   22 +-
 tests/vtexi.test                                   |   34 +-
 tests/vtexi2.test                                  |    8 +-
 tests/vtexi3.test                                  |  124 +++++
 tests/vtexi4.test                                  |  118 ++++
 tests/yacc5.test                                   |   10 +-
 101 files changed, 3114 insertions(+), 619 deletions(-)
 copy tests/{alpha2.test => autodist-acconfig-no-subdir.test} (55%)
 copy tests/{extra10.test => autodist-acconfig.test} (68%)
 copy tests/{yflags-force-override.test => autodist-aclocal-m4.test} (54%)
 create mode 100755 tests/autodist-config-headers.test
 create mode 100755 tests/autodist-configure-no-subdir.test
 copy tests/{vtexi2.test => autodist-stamp-vti.test} (56%)
 create mode 100755 tests/autodist-subdir.test
 create mode 100755 tests/autodist.test
 copy tests/{yacc-weirdnames.test => check-exported-srcdir.test} (57%)
 create mode 100755 tests/check-tests-in-builddir.test
 copy tests/{check11.test => check-tests_environment.test} (70%)
 copy tests/{txinfo18.test => comments-in-var-def.test} (54%)
 create mode 100755 tests/depcomp10.test
 create mode 100755 tests/depcomp9.test
 rename tests/{include2.test => dist-included-parent-dir.test} (100%)
 rename tests/{include.test => hdr-vars-defined-once.test} (100%)
 copy tests/{help-regex.test => help-python.test} (77%)
 copy tests/{yacc-weirdnames.test => java-check.test} (53%)
 copy tests/{target-cflags.test => lex-subobj-nodep.test} (55%)
 create mode 100755 tests/ltinit.test
 rename tests/{sinclude.test => m4-inclusion.test} (83%)
 copy tests/{maintclean.test => maintclean-vpath.test} (64%)
 copy tests/{check6.test => parallel-tests-subdir.test} (66%)
 copy tests/{parallel-tests4.test => parallel-tests-unreadable-log.test} (55%)
 create mode 100755 tests/pr8365-remake-timing.test
 create mode 100755 tests/specflg-dummy.test
 copy tests/{txinfo5.test => txinfo5b.test} (75%)
 create mode 100755 tests/vtexi3.test
 create mode 100755 tests/vtexi4.test

diff --git a/ChangeLog b/ChangeLog
index 6462d5c..c0495d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -334,6 +334,583 @@
        * tests/Makefile.am (TESTS): Update.
        * NEWS: Update.
 
+2011-04-11  Stefano Lattarini  <address@hidden>
+
+       depcomp: fix bugs in tests and in the depcomp script
+       * lib/depcomp (gcc): Remove duplicated `-e' from sed invocation.
+       * tests/depcomp10.test: Make it executable.  Fix a blunder that
+       has left part of an intended comment not prefixed by `#', thus
+       causing shell syntax errors.  In this same comment, break a
+       too-long reported error message on multiple lines, for clarity.
+       Add reference to the relevant bug report.  Add a comment which
+       explains why the test result 'skipped' if the first "make" call
+       fails.  Add other useful comments.
+       * tests/depcomp9.test: Slightly improve comments.
+
+2011-04-11  Ralf Wildenhues  <address@hidden>
+
+       Fix hp depmode for VPATH builds with GNU make.
+       * lib/depcomp: Be sure to remove VPATH-prefixed object from
+       dependency output when creating stub rule.
+       * tests/depcomp10.test: New test.
+       * tests/Makefile.am (TESTS): Update.
+       * NEWS: Update.
+       Report by Bruno Haible.
+
+2011-04-10  Stefano Lattarini  <address@hidden>
+
+       test defs: fix 'javac' requirement for older JDK versions
+       The Java compiler from JDK 1.5 (and presumably earlier versions)
+       cannot handle the `-version' option by itself; and while it does
+       print the version number, it then errors out with an usage error:
+         $ javac -version
+         javac 1.5.0_22
+         javac: no source files
+         Usage: javac <options> <source files>
+         ...
+       Luckily, adding the `-help' option to the `javac' invocation
+       seems to fix this problem.
+       * tests/defs.in (javac): Pass also the `-help' option to the
+       `javac' program.  Add a comment explaining why it is needed.
+       Report from Ralf Wildenhues.
+
+2011-04-10  Stefano Lattarini  <address@hidden>
+
+       test defs: new requirement for the default java compiler
+       * tests/defs.in (for tool in $required): New requirement 'javac'.
+       * tests/java.test: Use it instead of ad-hoc configure check.
+       * tests/java-check.test: Likewise.
+       * tests/instfail-java.test: Likewise.
+       * tests/instdir-java.test: Likewise.
+
+2011-04-09  Stefano Lattarini  <address@hidden>
+
+       java: check_JAVA does not cause compilation by "make all" anymore
+       Fixes automake bug#8234.
+       * automake.in (handle_java): Make stamp of class files built from
+       java sources in $(check_JAVA) a dependency of `check' target, not
+       `all' target.
+       * tests/java-check.test: New test.
+       * tests/Makefile.am (TESTS): Update.
+       * NEWS: Update.
+       * THANKS: Update.
+       Report from Petteri Räty.
+
+2011-04-09  Ralf Wildenhues  <address@hidden>
+
+       Clarify regex code in depcomp.
+       * lib/depcomp: Add comment why we don't need regex-escaping here.
+       Suggested by Stefano Lattarini.
+
+2011-04-08  Ralf Wildenhues  <address@hidden>
+
+       Fix makedepend depmode for VPATH builds.
+       * lib/depcomp [makedepend]: Remove any VPATH prefix from the
+       object file name, so a rebuild doesn't attempt to update the
+       .Po files in the source tree.
+       * tests/depcomp9.test: New test.
+       * tests/Makefile.am (TESTS): Update.
+       * NEWS: Update.
+
+2011-04-02  Stefano Lattarini  <address@hidden>
+
+       tests: fix timestamp-related failures
+       Fixes automake bug#8365.
+       * tests/aclocal6.test: Sleep before modifying m4 files that should
+       trigger remake rules.  Remove incorrect/obsoleted comments.
+       * tests/subdir5.test: Likewise, and extend a bit.
+       * tests/subdir8.test: Likewise.
+       * tests/pr8365-remake-timing.test: New xfailing test.
+       * tests/Makefile.am (TESTS): Update.
+       Report from Sam Steingold.
+
+2011-04-02  Ralf Wildenhues  <address@hidden>
+
+       Create subdirs for generated sources even when not dep tracking.
+       * automake.in (handle_single_transform): If $object is derived
+       and lands in subdir, be sure to output a dirstamp dependency.
+       * tests/yacc5.test: Avoid falsely matching the dirstamp
+       dependency when grepping for a rule.
+       * tests/lex-subobj-nodep.test: New test.
+       * tests/Makefile.am (TESTS): Update.
+       * THANKS: Update.
+       Report by Ignacy Gawedzki.
+
+       Fix locale issue in check-exported-srcdir.test.
+       * tests/check-exported-srcdir.test: Reformulate glob to not fail
+       in a locale that ignores or interleaves character case.
+
+2011-04-01  Stefano Lattarini  <address@hidden>
+
+       docs: better visibility for aclocal in the index
+       * doc/automake.texi (@menu): Rename title for entry 'configure'
+       from "Scanning configure.ac or configure.in" to the more precise
+       "Scanning configure.ac, using aclocal".
+       (@detailmenu): Adjust.
+       (@node configure): Adjust, and extend @cindex calls accordingly.
+       * THANKS: Update.
+       From a report by Maynard Johnson.
+
+2011-03-30  Stefano Lattarini  <address@hidden>
+
+       tests: improve tests on "maintainer-clean" target
+       * tests/aclocal6.test: Move checks related to "maintainer-clean"
+       functionalities into ...
+       * tests/maintclean-vpath.test: ... this new test.
+       * tests/maintclean.test: Update heading comments.  Extend to also
+       test subdirs.  Remove useless disabling of YACC.  Fix m4 quoting
+       in configure.in.  Add a trailing `:' command.  Remove extra blank
+       lines.
+       * tests/Makefile.am (TESTS): Update.
+
+2011-03-21  Ralf Wildenhues  <address@hidden>
+
+       tests: fix unindent to use printf not echo for script.
+       * tests/defs.in: Use printf rather than echo, as the latter may
+       interpret the backslashes in the sed script.  Fixes test
+       failures with dash as /bin/sh.
+
+2011-03-17  Stefano Lattarini  <address@hidden>
+           Ralf Wildenhues  <address@hidden>
+
+       maintcheck: look for problematic names of testcases
+       The configure.in stub created by default by `tests/defs' obtains
+       the first argument of AC_INIT from the test name, and this can
+       cause some supported autoconf versions to fail with a spurious
+       error if that test name contains the name of an m4 or m4sugar
+       builtin or macro (e.g., `defn' or `m4_undefine').
+       See for example the bug fixed by commit v1.11-287-g1325a8a.
+       This change add a maintainer check that warns about test names
+       which are possibly problematic in this regard.
+       * Makefile.am (sc_test_names): New maintainer-check target.
+       (syntax_check_rules): Add it.
+       (m4_builtins): New helper variable.
+       (TESTS): Updated according to the following renamings.
+       * tests/include.test: Renamed ...
+       * tests/hdr-vars-defined-once.test: ... to this.
+       * tests/sinclude.test: Renamed ...
+       * tests/m4-inclusion.test: ... to this, and simplified
+       accordingly.
+       * tests/include2.test: Renamed ...
+       * tests/dist-included-parent-dir.test: ... to this, for
+       consistency.
+
+2011-03-04  Stefano Lattarini  <address@hidden>
+
+       tests: fix bug in alloca*.test
+       * tests/alloca.test: Make grepping of automake stderr stricter,
+       add a trailing `:' command; also, add AC_PROG_CC to configure.in,
+       and create a dummy alloca.c file, to ensure that we fail for the
+       proper reason.
+       * tests/alloca2.test: Likewise.  Also, look for LT_INIT, not
+       AC_PROG_LIBTOOL, in the error message (bug introduced with commit
+       v1.11-315-gd51e7b7 "libtool: suggest LT_INIT if LTLIBRARIES
+       primary is used").
+       From a report by Patrick Welche.
+
+2011-03-04  Stefano Lattarini  <address@hidden>
+
+       tests: fix bug (comments-in-var-defn.test + autoconf 2.62)
+       * tests/comments-in-var-defn.test: The configure.in stub created
+       by default, which has the AC_INIT first argument obtained by the
+       test name, causes autoconf 2.62 to fail with a spurious error
+       message like: "configure.in:1: error: defn: undefined macro:".
+       Thus, to prevent this, the test is renamed to ...
+       * tests/comments-in-var-def.test: ... this.
+       * tests/Makefile.am (TESTS): Updated.
+
+2011-03-04  Stefano Lattarini  <address@hidden>
+
+       cosmetics: convert encoding from ISO-8859 to UTF-8
+       * ChangeLog.03: Convert encoding to UTF-8.
+       * ChangeLog.96: Likewise.
+       * ChangeLog.98: Likewise.
+       * NEWS: Likewise.
+       * TODO: Likewise.
+
+2011-03-01  Peter Rosin  <address@hidden>
+
+       test defs: unindent without temporary file
+       * tests/defs.in (commented_sed_unindent_prog): Commented Sed program
+       that strips the "proper" amount of leading whitespace.
+       (unindent): Lazily strip comments from the above program and use it
+       to unindent without using a temporary file.
+
+2011-02-26  Stefano Lattarini  <address@hidden>
+
+       libtool: suggest LT_INIT if LTLIBRARIES primary is used
+       When the LTLIBRARIES primary was used, but $(LIBTOOL) wasn't
+       defined, automake suggested to add a call to AC_PROG_LIBTOOL
+       in configure.ac.  But that macro is deprecated since Libtool
+       version 1.9b (2004-08-29), in favor of the newer LT_INIT.  So
+       suggest the use of this latter macro instead.
+       * lib/Automake/Variable.pm (%_am_macro_for_var): Pair 'LIBTOOL'
+       with 'LT_INIT', not with 'AC_PROG_LIBTOOL'.
+       * libtool4.test: Adjust and extend.  Also, add a call to macro
+       AC_PROG_CC in configure.in, to help ensuring that automake does
+       not fail for the wrong reasons.
+       * ltinit.test: New test, ensure that automake's libtool support
+       works with LT_INIT-based interface.
+       Thanks to Jack Kelly for the suggestion.
+
+2011-02-20  Stefano Lattarini  <address@hidden>
+
+       tests: tempdirs with restrictive permissions are cleaned correctly
+       Before this change, the removal of a temporary test directory
+       containing subdirectories with restrictive permissions (such as
+       'r--r--r--') could fail.
+       * tests/defs: Ensure that all the subdirectories of a temporary
+       test directory have the 'read', 'write' and 'execute' bits set,
+       before trying to remove it with `rm -rf'.
+       * tests/Makefile.am (clean-local-check): Likewise.
+
+2011-02-16  Stefano Lattarini  <address@hidden>
+           Ralf Wildenhues  <address@hidden>
+
+       test defs: add subroutine for input unindenting
+       * tests/defs.in (unindent): New subroutine.
+
+2011-02-15  Stefano Lattarini  <address@hidden>
+
+       python: report the 'PYTHON' influential environment variable
+       * m4/python.m4 (AM_PATH_PYTHON): Call AC_ARG_VAR on PYTHON.
+       * doc/automake.texi (Python): Update and extend.
+       * tests/help-python.test: New test.
+       * tests/Makefile.am (TESTS): Update.
+       * THANKS (Jack Kelly): Update e-mail address.
+       Suggestion by Jack Kelly.
+
+2011-02-10  Stefano Lattarini  <address@hidden>
+
+       tests defs: clear TESTS_ENVIRONMENT variable
+       * tests/defs.in (TESTS_ENVIRONMENT): Unset it, so that values
+       from environment won't interfere with the testcases.
+       Suggestion by Ralf Wildenhues.
+
+2011-02-06  Stefano Lattarini  <address@hidden>
+
+       tests: tweak few tests on simple and parallel test drivers
+       * tests/check-exported-srcdir.test: Improve heading comments.
+       * tests/check-tests-in-builddir.test: Likewise.  Also, unset the
+       `FOO_EXIT_STATUS' variable, so that any pre-existing value in the
+       environment won't risk to interfere with the test.
+       Suggestions by Ralf Wildenhues.
+
+2011-02-01  Stefano Lattarini  <address@hidden>
+
+       coverage: more tests on simple and parallel test drivers
+       * tests/parallel-tests-subdir.test: New test.
+       * tests/check-exported-srcdir.test: Likewise.
+       * tests/check-tests-in-builddir.test: Likewise.
+       * tests/check-tests_environment.test: Likewise.
+       * tests/Makefile.am (TESTS): Update.
+
+2011-01-29  Stefano Lattarini  <address@hidden>
+
+       tests: fix spurious failures in lflags*.test
+       * tests/lflags.test: Remove 'LEX' from the environment, so
+       that it won't be erroneously picked up by `make -e'.
+       * tests/lflags2.test: Likewise.
+
+2011-01-24  Stefano Lattarini  <address@hidden>
+
+       docs: color-tests issues with parallel make
+       * doc/automake.texi (Simple Tests): Document that automatic
+       recognition of a capable terminal attached to stdout can fail
+       with some make implementation when running in parallel mode,
+       thus causing colored test output not to be automatically
+       activated when it should.
+
+2011-01-23  Ralf Wildenhues  <address@hidden>
+
+       tests: avoid instspc.test failures due to make's whitespace trimming
+       * tests/instspc.test: Prepend './' when passing the test
+       characters, to avoid leading whitespace characters to be trimmed
+       from macros set from environment variables.  Fixes testsuite
+       failures with HP-UX, IRIX, and Tru64/OSF make.
+
+2011-01-23  Stefano Lattarini  <address@hidden>
+
+       coverage: test semantics of "dummy" per-target flags
+       * tests/specflg-dummy.test: New test, ensuring that even "dummy"
+       per-target flags triggers the use of renamed objects.
+       * tests/Makefile.am (TESTS): Update.
+       Suggestion by Ralf Wildenhues.
+
+2011-01-23  Stefano Lattarini  <address@hidden>
+
+       tests defs: sanitize IFS
+       * tests/defs.in ($IFS): Define to <space>, <tab>, <newline>.
+       ($sp): New variable, holding a single whitespace character.
+       ($tab): New variable, holding a tabulation character.
+       ($nl): New variable, holding a newline character.
+
+2011-01-22  Ralf Wildenhues  <address@hidden>
+
+       tests: fix VPATH auto-expansion workarounds.
+       * tests/parallel-tests8.test, tests/suffix13.test:
+       Ensure $< is not surrounded by white space, to prevent Solaris
+       make from applying automatic VPATH text expansion.
+
+2011-01-22  Stefano Lattarini  <address@hidden>
+
+       tests: fix spurious failures in yflags*.test
+       * tests/yflags.test: Remove 'YACC' from the environment, so
+       that it won't be erroneously picked up by `make -e'.
+       * tests/yflags2.test: Likewise.
+
+2011-01-22  Ralf Wildenhues  <address@hidden>
+
+       tests: avoid fn99*.test failures due to buggy AIX 5.3 cp -R.
+       * tests/fn99.test, tests/fn99subdir.test: Skip if an initial
+       `cp -R' of the subdir tree already fails; AIX 5.3 cp messes
+       up its internal memory when copying this tree.
+
+2011-01-22  Ralf Wildenhues  <address@hidden>
+           Stefano Lattarini  <address@hidden>
+
+       Add comment to check-TESTS rule working around make 3.80 bug.
+       * lib/am/check.am (check-TESTS): Update comment.
+
+2011-01-20  Ralf Wildenhues  <address@hidden>
+
+       tests: less strict double-colon spy.test again.
+       * tests/spy.test: We know BSD make doesn't invoke more than one
+       double-colon rule, so no need to expose that failure.
+
+2011-01-19  Ralf Wildenhues  <address@hidden>
+
+       install-sh: avoid Tru64 sh `test' operator precedence issues.
+       * lib/install-sh: Protect file names and directory components
+       that consist of `=', `(', `)', or `!'.  Move protection as early
+       as possible, to avoid errors such as with Tru64 sh `test -z ='.
+       * tests/instsh2.test: Extend test to cover more possibilities.
+       Fixes 1.12 instspc-equal-install.test failure on Tru64/OSF 5.1.
+
+2011-01-19  Stefano Lattarini  <address@hidden>
+           Ralf Wildenhues  <address@hidden>
+
+       docs: automake testsuite doesn't use TESTS_ENVIRONMENT anymore
+       * doc/automake.texi (Simple Tests): Do not claim Automake uses
+       TESTS_ENVIRONMENT for the perl driver.  Instead, point to the
+       parallel-tests driver.
+
+2011-01-19  Ralf Wildenhues  <address@hidden>
+
+       Allow _AM_DEPENDENCIES to be used later in configure.
+       * m4/depend.m4 (_AM_DEPENDENCIES): Remove a previously existing
+       conftest.dir before recreating it.
+       Fixes bug#7864.
+       Report by Eric Blake, from report by Scott McCreary against M4.
+
+2011-01-18  Ralf Wildenhues  <address@hidden>
+
+       tests: avoid failure on w32 file systems.
+       * tests/parallel-tests-unreadable-log.test: SKIP if file cannot
+       be turned unreadable.
+
+2011-01-17  Ralf Wildenhues  <address@hidden>
+
+       tests: allow double-colon spy.test to work with HP-UX make.
+       * tests/spy.test: Fix comment typos.  Ensure prerequisites we
+       do not want to depend on are strictly older than the target.
+       Also test with a target out of date wrt. more than one rule.
+
+2011-01-16  Stefano Lattarini  <address@hidden>
+
+       tests: remove useless requirements from cond36.test
+       * tests/cond36.test ($required): Remove.
+       Since we are at it, add a trailing `:' command.
+
+2011-01-16  Ralf Wildenhues  <address@hidden>
+           Stefano Lattarini  <address@hidden>
+
+       parallel-tests: work around Tru64/OSF 5.1 sh read bugs.
+       * lib/am/check.am ($(TEST_SUITE_LOG), recheck, recheck-html):
+       Test file readability before redirecting input from it, to avoid
+       exiting Tru64/OSF 5.1 sh which treats read as special builtin.
+       * tests/parallel-tests-unreadable-log.test: New test.
+       * tests/Makefile.am (TESTS): Update.
+       * NEWS: Update.
+
+2011-01-16  Ralf Wildenhues  <address@hidden>
+
+       * NEWS, README: Update copyright years.
+
+       Fix parallel-tests.test failure with HP-UX make.
+       * tests/parallel-tests.test: Sleep inside inner tests, so logs
+       are newer than logs of tests they depend on, for HP-UX make.
+
+2011-01-15  Ralf Wildenhues  <address@hidden>
+
+       docs: ensure example are separated with empty lines in the input
+       * doc/automake.texi (Extending aclocal, Emacs Lisp, Rebuilding)
+       (API Versioning, Renamed Objects, Multiple Outputs): Add empty
+       lines before address@hidden' and after address@hidden example' lines, 
so info
+       output is rendered correctly, and a following @noindent honored.
+       Report by Stefano Lattarini.
+
+2011-01-15  Jim Meyering <address@hidden>
+
+       tests: fix comment typo
+       * tests/substref.test: Fix grammar in a comment.
+
+2011-01-13  Stefano Lattarini  <address@hidden>
+
+       tests: fix spurious failures in two texinfo tests
+       * tests/txinfo.test ($required): Add 'makeinfo'.
+       * tests/txinfo8.test: Create a dummy 'textutils.info' file, so
+       that make won't try to run makeinfo (which could be unavailable)
+       to build it.
+       Found by NixOS Hydra, reported by Ralf Wildenhues.
+
+2011-01-13  Ralf Wildenhues  <address@hidden>
+
+       Avoid testsuite failures due to Autoconf Fortran change.
+       Autoconf v2.68-21-g727ce95 causes AC_F77_LIBRARY_LDFLAGS to
+       require computing the canonical host name.  Ensure config.guess
+       and config.sub files are present for respective checks.
+       * tests/compile_f_c_cxx.test: Add stub files.
+       * tests/flibs.test: Likewise.
+       * tests/fort4.test: Use $AUTOMAKE -a for installing files.
+
+2011-01-12   Stefano Lattarini  <address@hidden>
+
+       docs: clustered '-d' not recognized in YFLAGS
+       This change fixes automake bug#7828.
+       * doc/automake.texi (Yacc and Lex): Document that automake
+       recognizes '-d' in AM_YFLAGS only if it's not clustered with
+       other options.
+       From a report by Юрий Пухальский.
+
+2011-01-10   Stefano Lattarini  <address@hidden>
+
+       tests: add checks on automatically-distributed files
+       Related to automake bug#7819.
+       * tests/autodist.test: New test.
+       * tests/autodist-subdir.test: Likewise.
+       * tests/autodist-acconfig.test: Likewise.
+       * tests/autodist-acconfig-no-subdir.test: Likewise.
+       * tests/autodist-aclocal-m4.test: Likewise.
+       * tests/autodist-config-headers.test: Likewise.
+       * tests/autodist-configure-no-subdir.test: Likewise.
+       * tests/autodist-stamp-vti.test: Likewise.
+       * tests/Makefile.am (TESTS): Update.
+
+2011-01-11  Stefano Lattarini  <address@hidden>
+
+       tests: work around a texi+cygnus bug causing a spurious XFAIL
+       * tests/txinfo5b.test: New test, like txinfo5.test but calling
+       automake with the `-Wno-override' option to work around a bug
+       in the texinfo + cygnus interaction.
+       * tests/txinfo5.test: Update heading comments.
+       * tests/Makefile.am (TEST): Updated.
+
+2011-01-09  Dave Hart  <address@hidden>  (tiny change)
+
+       Fix another typo in Rule.pm comment.
+       * lib/Automake/Rule.pm: Fix typo.
+
+2011-01-11  Stefano Lattarini  <address@hidden>
+
+       Improve, extend and tweak tests on Texinfo support.
+       * tests/instdir-texi.test: Add a call to `ls -l' after that to
+       `make', for debugging.  When looking for required tools, do not
+       redirect the output of "$tool --help" to /dev/null, and do not
+       uselessly run it in a subshell.
+       * tests/txinfo.test: Rewritten to run autoconf, ./configure and
+       make.  All checks moved into Makefile.am.
+       * tests/txinfo8.test: Likewise, and modernize the generated
+       configure.in.
+       * tests/txinfo2.test: Moved checks into Makefile.am, and other
+       minor improvements.
+       * tests/txinfo5.test: Enable `errexit' shell flag, and related
+       changes.  Add trailing `:' command.
+       * tests/txinfo6.test: Likewise, and make grepping of generated
+       Makefile.in stricter.
+       * tests/txinfo7.test: Enable `errexit' shell flag, and related
+       changes.  Add trailing `:' command.  Do not add unnecessary stuff
+       to Makefile.am.
+       * tests/txinfo9.test: Verify that more targets which are expected
+       to be generated only once really are.  Make grepping less strict,
+       to avoid exposing too much internal details.  More minor changes.
+       * tests/txinfo16.test: Add trailing `:'.  Prefer cat over echo
+       for appending to configure.in.  Updated/fixed heading comments.
+       * tests/txinfo23.test: Likewise, and extended a little by making
+       it check that no info file is created in the $(srcdir).
+       * tests/txinfo24.test: Likewise.
+       * tests/txinfo25.test: Likewise.
+       * tests/txinfo18.test: Add trailing `:'.  Prefer cat over echo
+       for appending to configure.in.  Also, check that index files are
+       cleaned also by "make clean", not only by "make distclean".
+       * tests/txinfo22.test: Prefer `$me' over hard-coded test name,
+       and added trailing `:' command.  This testcase also used to check
+       that automake ignores in-line comments when using variables, but
+       preserves them in the output; these checks (added in commit
+       "Release-1-7f-4-g9177ef8") do not really pertain to this test,
+       so they have been moved ...
+       * tests/comments-in-var-defn.test: ... into this new test.
+       * tests/txinfo4.test: Escape literal dots in grep regexps.  Add
+       trailing `:' command.
+       * tests/txinfo29.test: Likewise.  Relax grepping of generated
+       Makefile.in w.r.t. whitespaces.  Prefer `cat' over `echo' to
+       append to configure.in.
+       * tests/txinfo3.test: Likewise.
+       * tests/vtexi.test: Improve grepping of Makefile.in (sometimes
+       make it stricter, sometimes laxer).  Move `set -e' setting just
+       after the inclusion of ./defs.  De-uglify a sed command.  Other
+       minor cosmetic improvements.
+       * tests/vtexi2.test: Make grepping of Makefile.in stricter.  Add
+       trailing `:' command.
+       * tests/vtexi3.test: New test on version.texi support.
+       * tests/vtexi4.test: Likewise.
+       * tests/Makefile.am (TESTS): Updated.
+
+2011-01-09  Peter Rosin  <address@hidden>
+
+       Fix another typo in Rule.pm comment.
+       * lib/Automake/Rule.pm: Fix typo.
+
+2011-01-09   Stefano Lattarini  <address@hidden>
+
+       cosmetics: remove trailing whitespaces
+       * doc/automake.texi: Remove trailing whitespaces.
+       * tests/cond13.test: Likewise.
+       * tests/cond14.test: Likewise.
+       * tests/fort4.test: Likewise.
+       * tests/fort5.test: Likewise.
+       * tests/suffix7.test: Likewise.
+       * tests/vtexi2.test: Likewise.
+
+       automake: minor fixes in comments
+       * automake.in: Some minor fixes and enhancements in comments.
+
+2011-01-09  Ralf Wildenhues  <address@hidden>
+
+       Add test coverage for deleted header files.
+       * tests/depcomp6.test, tests/depcomp7.test: Update tests to
+       also check for the deleted header bug.  If no dependency
+       tracking mechanism could be found, SKIP rather than exit
+       successfully.  Use GNU style spacing and ANSI C prototypes.
+
+       Fix typos in Rule.pm comments.
+       * lib/Automake/Rule.pm: Fix typos in comments.
+
+       docs: split 'amhello Explained' node.
+       * doc/automake.texi (amhello Explained): Split node ...
+       (amhello's configure.ac Setup Explained)
+       (amhello's Makefile.am Setup Explained) : ... into these two.
+       (Top, Hello World): Adjust, and add @anchor for stable URL links.
+       Suggestion by Karl Berry in automake bug#7766.
+
+2011-01-08  Karl Berry  <address@hidden>
+           Eric Blake  <address@hidden>
+
+       docs: reference defining directories in amhello node.
+       * doc/automake.texi (amhello Explained): Point to Autoconf
+       manual for how to convert directory values into macros.
+       (Optional): Fix grammar nit.
+
 2011-01-02   Stefano Lattarini  <address@hidden>
 
        * NEWS: Fix typo (forgotten word).
diff --git a/ChangeLog.03 b/ChangeLog.03
index eb5b251..0152d56 100644
--- a/ChangeLog.03
+++ b/ChangeLog.03
@@ -67,7 +67,7 @@
 
        * tests/txinfo24.test, tests/txinfo25.test, tests/txinfo28.test:
        Require texi2dvi-o.
-       Report from Václav Haisman.
+       Report from Václav Haisman.
 
 2003-12-10  Alexandre Duret-Lutz  <address@hidden>
 
@@ -1928,9 +1928,9 @@
 
 2003-05-22  Alexandre Duret-Lutz  <address@hidden>
 
-       * automake.texi (maintainer-mode): s/François/Fran@,{c}ois/.
+       * automake.texi (maintainer-mode): s/François/Fran@,{c}ois/.
 
-       * lib/elisp-comp: s/François/Franc,ois/.
+       * lib/elisp-comp: s/François/Franc,ois/.
        Suggested by Paul Eggert.
 
        * automake.in: Move the "main" code at the end.
diff --git a/ChangeLog.96 b/ChangeLog.96
index 33e6542..07f71c2 100644
--- a/ChangeLog.96
+++ b/ChangeLog.96
@@ -234,7 +234,7 @@ Sun Nov 24 00:33:50 1996  Tom Tromey  <address@hidden>
        * libtool.am (.c.lo): Set --mode=compile when running libtool.
        * progs.am: Set --mode=install when running libtool.
 
-       Fix for bug reported by François Pinard:
+       Fix for bug reported by François Pinard:
        * automake.in (do_check_merge_target): New sub.
        (do_one_merge_target): No longer handle `check'.
        (handle_merge_targets): Use do_check_merge_target.
@@ -914,7 +914,7 @@ Tue Sep  3 18:50:32 1996  Tom Tromey  <address@hidden>
        NORMAL_INSTALL defined.
 
        * m4/AM_PROG_INSTALL.m4: INSTALL_SCRIPT defaults to
-       ${INSTALL_PROGRAM}.  From François Pinard.
+       ${INSTALL_PROGRAM}.  From François Pinard.
 
 Tue Aug 27 08:25:05 1996  Tom Tromey  <address@hidden>
 
@@ -962,7 +962,7 @@ Sat Aug 24 09:30:46 1996  Tom Tromey  <address@hidden>
 
        * m4/AM_INIT_AUTOMAKE.m4: Define PACKAGE and VERSION.
 
-       * m4/AM_WITH_REGEX.m4: New version from François Pinard.
+       * m4/AM_WITH_REGEX.m4: New version from François Pinard.
 
        * m4/AM_TYPE_PTRDIFF_T.m4: Use am_cv, not ac_cv.
        * m4/AM_C_PROTOTYPES.m4: Ditto.
@@ -1222,7 +1222,7 @@ Sun Aug  4 12:52:43 1996  Tom Tromey  <address@hidden>
 
        * automake.in (handle_dist_worker): Use fgrep, not grep.
 
-       * m4/AM_C_PROTOTYPES.m4: Changes from François Pinard.
+       * m4/AM_C_PROTOTYPES.m4: Changes from François Pinard.
 
        * automake.in (handle_emacs_lisp): Include lisp-clean.am in
        output.
@@ -1272,7 +1272,7 @@ Sun Jul 28 11:14:52 1996  Tom Tromey  <address@hidden>
 Fri Jul 19 10:12:27 1996  Tom Tromey  <address@hidden>
 
        * automake.in (initialize_global_constants): Put ansi2knr.c and
-       ansi2knr.1 into common_files.  Bug report from François Pinard.
+       ansi2knr.1 into common_files.  Bug report from François Pinard.
 
 Mon Jul 15 10:28:29 1996  Tom Tromey  <address@hidden>
 
@@ -1730,7 +1730,7 @@ Thu Mar 14 09:28:21 1996  Tom Tromey  <address@hidden>
        * data.am (address@hidden@DATA): Allow empty list of data.
        (address@hidden@DATA): Ditto.
        * programs.am (address@hidden@PROGRAMS): Added missing semicolon.
-       From François Pinard.
+       From François Pinard.
        (address@hidden@PROGRAMS): Fixed bug when list of programs empty.
        (address@hidden@PROGRAMS): Ditto.
 
@@ -2273,7 +2273,7 @@ Fri Jan 19 00:50:29 1996  Tom Tromey  <address@hidden>
 
 Thu Jan 18 00:25:56 1996  Tom Tromey  <address@hidden>
 
-       From François Pinard:
+       From François Pinard:
        * automake.in (handle_source_transform): Transform $o file into .P
        file.
        (handle_dist_worker): Handle case where DISTFILES includes
@@ -2286,7 +2286,7 @@ Sun Jan 14 13:54:16 1996  Tom Tromey  <address@hidden>
 
        * automake.in (scan_configure): Look for NLS support.
 
-       Changes from François Pinard:
+       Changes from François Pinard:
        * texinfos.am (install-info): Correctly install when build dir is
        not srcdir.
        * tags-subd.am (ID): Indentation change.
@@ -2317,7 +2317,7 @@ Sat Jan 13 00:18:06 1996  Tom Tromey  <address@hidden>
        * texi-version.am (mostlyclean-vti): Remove version.tmp, not
        *.tmp.
 
-       * automake.in (handle_dist): Chmod distdir 777.  From François
+       * automake.in (handle_dist): Chmod distdir 777.  From François
        Pinard.
 
        * automake.in (scan_configure): New function.
@@ -2344,7 +2344,7 @@ Thu Jan 11 23:14:18 1996  Tom Tromey  <address@hidden>
 
 Tue Jan  9 11:24:14 1996  Tom Tromey  <address@hidden>
 
-       Fixes from François Pinard:
+       Fixes from François Pinard:
        * depend.am ($(srcdir)/.deps/%.P): Handle deansification.
        * automake.in (get_object_extension): Use $o, not $(kr)o.
        (handle_source_transform): Don't look for $(kr)c files.
@@ -2394,7 +2394,7 @@ Fri Jan  5 10:31:19 1996  Tom Tromey  <address@hidden>
 
        * Added copyright notice to each .am file.
 
-       * automake.in: Cleanups from François Pinard to avoid $#.
+       * automake.in: Cleanups from François Pinard to avoid $#.
        (require_argument): Fixed sense of test.
        (set_strictness): Bug fix.
 
@@ -2450,7 +2450,7 @@ Wed Jan  3 00:05:40 1996  Tom Tromey  <address@hidden>
        ABOUT-GNU.
        (check_gnu_standards): Require file COPYING.
 
-       From François Pinard:
+       From François Pinard:
        * automake.in (file_contents): Comment out "warn"s.
        (usage): Use 4 columns.
        (USAGE_FORMAT): Ditto.
@@ -2476,7 +2476,7 @@ Wed Jan  3 00:05:40 1996  Tom Tromey  <address@hidden>
 Tue Jan  2 23:33:24 1996  Tom Tromey  <address@hidden>
 
        * texinfos.am (install-info): Look in $d for info files.  From
-       François Pinard.
+       François Pinard.
 
        * depend.am ($(srcdir)/.deps/%.P): Fixed regexp.
 
@@ -2495,7 +2495,7 @@ Mon Jan  1 15:43:25 1996  Tom Tromey  <address@hidden>
        (read_am_file): Ditto.
        (do_one_clean_target): Removed spurious newline.
 
-       Some changes from François Pinard:
+       Some changes from François Pinard:
        * Removed trailing whitespace from all '.am' files.
        * tags-subd.am (ID): Use &&, not ;.
        (TAGS): Ditto.
@@ -2557,7 +2557,7 @@ Sun Dec 31 13:04:59 1995  Tom Tromey  <address@hidden>
        * automake.in (initialize_global_constants): Don't print body of
        loop at make time.
 
-       Changes from François Pinard:
+       Changes from François Pinard:
        * depend.am (MKDEP): Include DEFS, INCLUDES, CPPFLAGS, CFLAGS.
        (DEP_FILES): Put dependency files in $(srcdir).
        Look in $(srcdir) when including dependency files.
diff --git a/ChangeLog.98 b/ChangeLog.98
index bb719c3..1fcc56c 100644
--- a/ChangeLog.98
+++ b/ChangeLog.98
@@ -166,7 +166,7 @@ Fri Dec 11 10:23:17 1998  Matthew D. Langston  
<address@hidden>
 
        * Makefile.am (cvs-dist): Run `cvs tag' operation in srcdir.
 
-       Some bugs from François Pinard:
+       Some bugs from François Pinard:
        * automake.in (usage): Remove duplicates in file list.
 
        * automake.in (usage): Print files in column-major order.
@@ -1485,7 +1485,7 @@ Sun Jun 22 14:01:59 1997  Tom Tromey  <address@hidden>
        when actually installing.  From Gord Matzigkeit.
 
        * automake.in (handle_tests): Exit status `77' means `ignore
-       test'.  From François Pinard.
+       test'.  From François Pinard.
        (handle_tests) Also, make banner same size as text.
 
        * automake.in (handle_configure): Don't handle PRE_BUILT_SOURCES.
@@ -1579,7 +1579,7 @@ Sun May 11 13:59:14 1997  Tom Tromey  <address@hidden>
        * kr-extra.am (clean-krextra): Remove ansi2knr here, not in
        distclean-krextra.
 
-       * missing: Regularized grammar.  From François Pinard.
+       * missing: Regularized grammar.  From François Pinard.
 
 Sat May 10 16:48:47 1997  Tom Tromey  <address@hidden>
 
@@ -1641,7 +1641,7 @@ Wed Apr 30 14:46:37 1997  Ian Lance Taylor  
<address@hidden>
 
 Tue Apr 29 19:11:45 1997  Tom Tromey  <address@hidden>
 
-       * INSTALL, mkinstalldirs, install-sh: Update from François
+       * INSTALL, mkinstalldirs, install-sh: Update from François
        Pinard.
 
        * aclocal.in (add_macro): If AC_ macro was defined, then mark it
@@ -2001,7 +2001,7 @@ Tue Mar 18 17:20:03 1997  Tom Tromey  <address@hidden>
        * m4/init.m4 (missing_dir): Use AM_MISSING_PROG.
        * m4/missing.m4: New file.
 
-       `missing' changes from François Pinard:
+       `missing' changes from François Pinard:
        * Everywhere: Use ACLOCAL_M4 to name aclocal.m4 file; ACLOCAL now
        names aclocal program.
        * m4/init.m4: Replace programs with `missing' if not found.
@@ -2140,7 +2140,7 @@ Tue Feb  4 18:29:42 1997  Tom Tromey  <address@hidden>
        (handle_aclocal_m4): Use ACLOCAL_AMFLAGS.
        (handle_clean): Put -recursive target before -am target.
        (handle_merge_targets): Put basename of $config_name on @all.
-       Test confsub.test.  From Ramón García Fernández.
+       Test confsub.test.  From Ramón García Fernández.
 
 Tue Jan 28 22:19:04 1997  Tom Tromey  <address@hidden>
 
diff --git a/Makefile.am b/Makefile.am
index d19d974..316619f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -111,6 +111,7 @@ dist-hook:
 # Some simple checks, and then ordinary check.  These are only really
 # guaranteed to work on my machine.
 syntax_check_rules = \
+sc_test_names \
 sc_diff_automake_in_automake \
 sc_perl_syntax \
 sc_no_brace_variable_expansions \
@@ -151,6 +152,66 @@ sc_at_in_texi
 $(syntax_check_rules): automake aclocal
 maintainer-check: $(syntax_check_rules)
 
+## Look for test whose names can cause spurious failures when used as
+## first argument to AC_INIT (chiefly because they might contain an
+## m4/m4sugar builtin or macro name).
+m4_builtins = \
+  __gnu__ \
+  __unix__ \
+  bpatsubst \
+  bregexp \
+  builtin \
+  changecom \
+  changequote \
+  changeword \
+  debugfile \
+  debugmode \
+  decr \
+  define \
+  defn \
+  divert \
+  divnum \
+  dnl \
+  dumpdef \
+  errprint \
+  esyscmd \
+  eval \
+  format \
+  ifdef \
+  ifelse \
+  include \
+  incr \
+  index \
+  indir \
+  len \
+  m4exit \
+  m4wrap \
+  maketemp \
+  mkstemp \
+  patsubst \
+  popdef \
+  pushdef \
+  regexp \
+  shift \
+  sinclude \
+  substr \
+  symbols \
+  syscmd \
+  sysval \
+  traceoff \
+  traceon \
+  translit \
+  undefine \
+  undivert
+sc_test_names:
+       @m4_builtin_rx=`echo $(m4_builtins) | sed 's/ /|/g'`; \
+        m4_macro_rx="\\<($$m4_builtin_rx)\\>|\\<_?(A[CUMHS]|m4)_"; \
+        if ls tests/*.test | LC_ALL=C grep -E "$$m4_macro_rx"; then \
+          echo "the names of the tests above can be problematic" 1>&2; \
+          echo "Avoid test names that contain names of m4 macros" 1>&2; \
+          exit 1; \
+        fi
+
 ## This check avoids accidental configure substitutions in the source.
 ## There are exactly 8 lines that should be modified.  This works out
 ## to 28 lines of diffs.
diff --git a/Makefile.in b/Makefile.in
index 25d580d..ec327ed 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -269,6 +269,7 @@ do_subst = sed \
 # Some simple checks, and then ordinary check.  These are only really
 # guaranteed to work on my machine.
 syntax_check_rules = \
+sc_test_names \
 sc_diff_automake_in_automake \
 sc_perl_syntax \
 sc_no_brace_variable_expansions \
@@ -305,6 +306,55 @@ sc_unquoted_DESTDIR \
 sc_tabs_in_texi \
 sc_at_in_texi
 
+m4_builtins = \
+  __gnu__ \
+  __unix__ \
+  bpatsubst \
+  bregexp \
+  builtin \
+  changecom \
+  changequote \
+  changeword \
+  debugfile \
+  debugmode \
+  decr \
+  define \
+  defn \
+  divert \
+  divnum \
+  dnl \
+  dumpdef \
+  errprint \
+  esyscmd \
+  eval \
+  format \
+  ifdef \
+  ifelse \
+  include \
+  incr \
+  index \
+  indir \
+  len \
+  m4exit \
+  m4wrap \
+  maketemp \
+  mkstemp \
+  patsubst \
+  popdef \
+  pushdef \
+  regexp \
+  shift \
+  sinclude \
+  substr \
+  symbols \
+  syscmd \
+  sysval \
+  traceoff \
+  traceon \
+  translit \
+  undefine \
+  undivert
+
 WGET = wget
 WGET_SV_CVS = $(WGET) http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/
 WGET_SV_GIT_CF = $(WGET) 
'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;hb=HEAD;f='
@@ -879,6 +929,14 @@ dist-hook:
 .PHONY: $(syntax_check_rules)
 $(syntax_check_rules): automake aclocal
 maintainer-check: $(syntax_check_rules)
+sc_test_names:
+       @m4_builtin_rx=`echo $(m4_builtins) | sed 's/ /|/g'`; \
+        m4_macro_rx="\\<($$m4_builtin_rx)\\>|\\<_?(A[CUMHS]|m4)_"; \
+        if ls tests/*.test | LC_ALL=C grep -E "$$m4_macro_rx"; then \
+          echo "the names of the tests above can be problematic" 1>&2; \
+          echo "Avoid test names that contain names of m4 macros" 1>&2; \
+          exit 1; \
+        fi
 
 sc_diff_automake_in_automake:
        @if test `diff $(srcdir)/automake.in automake | wc -l` -ne 28; then \
diff --git a/NEWS b/NEWS
index b014749..80e0cfc 100644
--- a/NEWS
+++ b/NEWS
@@ -67,6 +67,14 @@ Bugs fixed in 1.11.0a:
     make bug triggered by sources containing repeated slashes when the
     `subdir-objects' option was used.
 
+  - The parallel-tests driver now does not produce erroneous results
+    with Tru64/OSF 5.1 sh upon unreadable log files any more.
+
+  - The makedepend and hp depmodes now works better with VPATH builds.
+
+  - Java sources specified with check_JAVA are not compiled anymore upon
+    "make all", but only upon "make check".
+
   - Automake now detects the presence of the `-d' flag in the various
     `*YFLAGS' variables even when their definitions involve indirections
     through other variables, such as in:
@@ -1447,7 +1455,7 @@ New in 0.32:
 
 New in 0.31:
 * Bug fixes
-* Documentation updates (many from François Pinard)
+* Documentation updates (many from François Pinard)
 * strictness `normal' now renamed to `foreign'
 * Renamed --install-missing to --add-missing
 * Now handles AC_CONFIG_AUX_DIR
@@ -1505,7 +1513,7 @@ New in 0.26:
 * Comments in Makefile.am are placed more intelligently in Makefile.in
 * Generates .PHONY target
 * Rule or macro in Makefile.am now overrides contents of Automake file
-* Substantial cleanups from François Pinard
+* Substantial cleanups from François Pinard
 
 New in 0.25:
 * Bug fixes.
@@ -1547,7 +1555,8 @@ New in 0.20:
 -----
 
 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-2004, 2005, 2006, 2007  Free Software Foundation, Inc.
+2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011  Free Software
+Foundation, Inc.
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
diff --git a/README b/README
index de361be..eb49e71 100644
--- a/README
+++ b/README
@@ -43,7 +43,7 @@ address@hidden if you want to receive them.
 
 -----
 
-Copyright (C) 1994, 1995, 1996, 1997, 1998, 2001, 2003
+Copyright (C) 1994, 1995, 1996, 1997, 1998, 2001, 2003, 2008, 2009, 2011
   Free Software Foundation, Inc.
 
 This program is free software; you can redistribute it and/or modify
diff --git a/THANKS b/THANKS
index 78da1de..593ebc5 100644
--- a/THANKS
+++ b/THANKS
@@ -131,10 +131,11 @@ Harlan Stenn              address@hidden
 He Li                  address@hidden
 Henrik Frystyk Nielsen address@hidden
 Ian Lance Taylor       address@hidden
+Ignacy Gawedzki                address@hidden
 Илья Н. Голубев            address@hidden
 Imacat                 address@hidden
 Inoue                  address@hidden
-Jack Kelly             address@hidden
+Jack Kelly             address@hidden
 James Amundson         address@hidden
 James Henstridge       address@hidden
 James R. Van Zandt     address@hidden
@@ -223,6 +224,7 @@ Matthias Andree             address@hidden
 Matthias Clasen                address@hidden
 Matthias Klose         address@hidden
 Maxim Sinev            address@hidden
+Maynard Johnson                address@hidden
 Merijn de Jonge                address@hidden
 Michael Brantley       address@hidden
 Michael Ploujnikov     address@hidden
@@ -277,6 +279,7 @@ Peter O'Gorman              address@hidden
 Peter Rosin            address@hidden
 Peter Seiderer         address@hidden
 Petter Reinholdtsen    address@hidden
+Petteri Räty          address@hidden
 Phil Edwards           address@hidden
 Phil Nelson            address@hidden
 Philip Fong            address@hidden
diff --git a/TODO b/TODO
index 0c28f49..79f298f 100644
--- a/TODO
+++ b/TODO
@@ -311,7 +311,7 @@ them in a directory)
 
 Handle dist-zoo.  Generally add more DOS support.  Maybe run "doschk"
 (why isn't this merged with "pathchk"?) when doing a dist.  Do
-whatever else François says here...
+whatever else François says here...
 
 Add support for html via an option.  Use texi2html.  Use
 "html_TEXINFOS", and htmldir = .../html.  Include html files in
@@ -373,7 +373,7 @@ Auto-distribute "ChangeLog.[0-9]+"?  "ChangeLog.[a-z]+"?
 Internationalize. [ gettext doesn't have the necessary machinery yet ]
 am_error should use printf-style arguments (for eventual gettext scheme)
 
-François says the ordering of files in a distribution should be as follows:
+François says the ordering of files in a distribution should be as follows:
 * README
 * source files
 * derived files
@@ -433,7 +433,7 @@ follow calc example in dejagnu docs
 
 document which variables are actually scanned and which are not.
 
-Document customary ordering of Makefile.am.  From François.
+Document customary ordering of Makefile.am.  From François.
 
 Should include extended version of diagram from Autoconf (suggested by
 Greg Woods)
diff --git a/automake.in b/automake.in
index e2e67b9..de0833c 100755
--- a/automake.in
+++ b/automake.in
@@ -1367,7 +1367,7 @@ sub handle_languages
 
     my %done;
 
-    # Is the c linker needed?
+    # Is the C linker needed?
     my $needs_c = 0;
     foreach my $ext (sort keys %extension_seen)
     {
@@ -2051,6 +2051,15 @@ sub handle_single_transform ($$$$$%)
            # derived from is not.
            &push_dist_common ($object)
              unless ($topparent =~ /^(?:nobase_)?nodist_/);
+
+           # If resulting derived source is in a subdir, we need to make
+           # sure the subdir exists at build time.
+           if ($object =~ /\//)
+             {
+               my $dirstamp = require_build_directory_maybe ($object);
+               depend ($object, $dirstamp)
+                 if ($dirstamp);
+             }
            next;
          }
 
@@ -2333,7 +2342,7 @@ sub handle_lib_objects
           if ($val !~ /^-[lL]/ &&
               # Skip -dlopen and -dlpreopen; these are explicitly allowed
               # for Libtool libraries or programs.  (Actually we are a bit
-              # laxe here since this code also applies to non-libtool
+              # lax here since this code also applies to non-libtool
               # libraries or programs, for which -dlopen and -dlopreopen
               # are pure nonsense.  Diagnosing this doesn't seem very
               # important: the developer will quickly get complaints from
@@ -2574,7 +2583,8 @@ sub handle_compile ()
            require_file ($ansi2knr_where, FOREIGN,
                          'ansi2knr.c', 'ansi2knr.1');
 
-           # ansi2knr needs to be built before subdirs, so unshift it.
+           # ansi2knr needs to be built before subdirs, so unshift it
+           # rather then pushing it.
            unshift (@all, '$(ANSI2KNR)');
          }
        else
@@ -3186,7 +3196,7 @@ sub scan_texinfo_file ($)
 # ------------------------------------------------------------------
 # SOURCE - the source Texinfo file
 # DEST - the destination Info file
-# INSRC - wether DEST should be built in the source tree
+# INSRC - whether DEST should be built in the source tree
 # DEPENDENCIES - known dependencies
 sub output_texinfo_build_rules ($$$@)
 {
@@ -4167,7 +4177,7 @@ sub prepend_srcdir (@)
 # Compute a list of dependencies appropriate for the rebuild
 # rule of
 #   AC_CONFIG_FILES($OUTPUT:$INPUT[0]:$INPUTS[1]:...)
-# Also distribute $INPUTs which are not built by another AC_CONFIG_FOOS.
+# Also distribute $INPUTs which are not built by another AC_CONFIG_FOOs.
 sub rewrite_inputs_into_dependencies ($@)
 {
   my ($file, @inputs) = @_;
@@ -5109,8 +5119,14 @@ sub handle_java
        $dir = $curs;
       }
 
-
-    push (@all, 'class' . $dir . '.stamp');
+    if ($dir eq 'check')
+      {
+        push (@check, "class$dir.stamp");
+      }
+    else
+      {
+        push (@all, "class$dir.stamp");
+      }
 }
 
 
diff --git a/doc/automake.texi b/doc/automake.texi
index 701a888..4e2d6c7 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -102,7 +102,7 @@ section entitled ``GNU Free Documentation License.''
 * Generalities::                General ideas
 * Examples::                    Some example packages
 * Invoking Automake::           Creating a Makefile.in
-* configure::                   Scanning configure.ac or configure.in
+* configure::                   Scanning configure.ac, using aclocal
 * Directories::                 Declaring subdirectories
 * Programs::                    Building programs and libraries
 * Other Objects::               Other derived objects
@@ -157,7 +157,8 @@ Use Cases for the GNU Build System
 A Small Hello World
 
 * Creating amhello::            Create @file{amhello-1.0.tar.gz} from scratch
-* amhello Explained::           @file{configure.ac} and @file{Makefile.am} 
explained
+* amhello's configure.ac Setup Explained::
+* amhello's Makefile.am Setup Explained::
 
 General ideas
 
@@ -174,7 +175,7 @@ Some example packages
 * Complete::                    A simple example, start to finish
 * true::                        Building true and false
 
-Scanning @file{configure.ac}
+Scanning @file{configure.ac}, using @command{aclocal}
 
 * Requirements::                Configuration requirements
 * Optional::                    Other things Automake recognizes
@@ -1392,9 +1393,11 @@ instantiate the GNU Build System, while the second 
explains the
 meaning of the @file{configure.ac} and @file{Makefile.am} files read
 by the Autotools.
 
address@hidden Explained}
 @menu
 * Creating amhello::            Create @file{amhello-1.0.tar.gz} from scratch
-* amhello Explained::           @file{configure.ac} and @file{Makefile.am} 
explained
+* amhello's configure.ac Setup Explained::
+* amhello's Makefile.am Setup Explained::
 @end menu
 
 @node Creating amhello
@@ -1555,8 +1558,10 @@ creating @file{configure} from @file{configure.ac}, while
 direct you to the right manual when seeking answers.
 
 
address@hidden amhello Explained
address@hidden @file{amhello-1.0} Explained
address@hidden amhello's configure.ac Setup Explained
address@hidden @code{amhello}'s @file{configure.ac} Setup Explained
+
address@hidden @file{configure.ac}, Hello World
 
 Let us begin with the contents of @file{configure.ac}.
 
@@ -1664,6 +1669,10 @@ your package may need (@pxref{autoscan Invocation, , 
Using
 @command{autoscan} to Create @file{configure.ac}, autoconf, The
 Autoconf Manual}).
 
+
address@hidden amhello's Makefile.am Setup Explained
address@hidden @code{amhello}'s @file{Makefile.am} Setup Explained
+
 @cindex @file{Makefile.am}, Hello World
 
 We now turn to @file{src/Makefile.am}.  This file contains
@@ -1736,6 +1745,11 @@ automatically distributed is presented by @code{automake 
--help}).
 The only important effect of this second line is therefore to install
 @file{README} during @code{make install}.
 
+One thing not covered in this example is accessing the installation
+directory values (@pxref{Standard Directory Variables}) from your
+program code, that is, converting them into defined macros.  For this,
address@hidden Directories,,, autoconf, The Autoconf Manual}.
+
 
 @node Generalities
 @chapter General ideas
@@ -2677,10 +2691,12 @@ concurrently.  This is an experimental feature.
 
 
 @node configure
address@hidden Scanning @file{configure.ac}
address@hidden Scanning @file{configure.ac}, using @command{aclocal}
 
 @cindex @file{configure.ac}, scanning
 @cindex Scanning @file{configure.ac}
address@hidden Using @command{aclocal}
address@hidden @command{aclocal}, using
 
 Automake scans the package's @file{configure.ac} to determine certain
 information about the package.  Some @command{autoconf} macros are required
@@ -2905,7 +2921,7 @@ Automake will generate rules to rebuild these headers.  
Older versions
 of Automake required the use of @code{AM_CONFIG_HEADER}
 (@pxref{Macros}); this is no longer the case.
 
-As for @code{AC_CONFIG_FILES} (@pxref{Requirements}), parts of the
+As with @code{AC_CONFIG_FILES} (@pxref{Requirements}), parts of the
 specification using shell variables will be ignored as far as
 cleaning, distributing, and rebuilding is concerned.
 
@@ -3442,6 +3458,7 @@ not actually needed.  Doing so should alleviate many 
problems of the
 current implementation, however it requires a stricter style from the
 macro authors.  Hopefully it is easy to revise the existing macros.
 For instance,
+
 @example
 # bad style
 AC_PREREQ(2.57)
@@ -3451,8 +3468,10 @@ AX_FOO
 AX_BAR
 ])
 @end example
+
 @noindent
 should be rewritten as
+
 @example
 AC_DEFUN([AX_FOOBAR],
 [AC_PREREQ([2.57])dnl
@@ -7445,18 +7464,20 @@ installation less nice for everybody else.
 
 There are two ways to avoid byte-compiling.  Historically, we have
 recommended the following construct.
+
 @example
 lisp_LISP = file1.el file2.el
 ELCFILES =
 @end example
+
 @noindent
 @code{ELCFILES} is an internal Automake variable that normally lists
 all @file{.elc} files that must be byte-compiled.  Automake defines
 @code{ELCFILES} automatically from @code{lisp_LISP}.  Emptying this
 variable explicitly prevents byte-compilation.
 
-Since Automake 1.8, we now recommend using @code{lisp_DATA} instead.  As
-in
+Since Automake 1.8, we now recommend using @code{lisp_DATA} instead:
+
 @example
 lisp_DATA = file1.el file2.el
 @end example
@@ -7588,7 +7609,8 @@ files in your @file{Makefile.am}, depending on where you 
want your files
 installed (see the definitions of @code{pythondir} and
 @code{pkgpythondir} below).
 
address@hidden AM_PATH_PYTHON (@ovar{version}, @ovar{action-if-found}, 
@ovar{action-if-not-found})
address@hidden AM_PATH_PYTHON (@ovar{version}, @ovar{action-if-found}, @
+  @ovar{action-if-not-found})
 
 Search for a Python interpreter on the system.  This macro takes three
 optional arguments.  The first argument, if present, is the minimum
@@ -7614,6 +7636,9 @@ If Python >= 2.5 was only @emph{optional} to the package,
 AM_PATH_PYTHON([2.5],, [:])
 @end example
 
+If the @env{PYTHON} variable is set when @code{AM_PATH_PYTHON} is
+called, then that will be the only Python interpreter that is tried.
+
 @code{AM_PATH_PYTHON} creates the following output variables based on
 the Python installation found during configuration.
 @end defmac
@@ -7629,8 +7654,8 @@ to setup a conditional in order to disable the relevant 
part of a build
 as follows.
 
 @example
-  AM_PATH_PYTHON(,, [:])
-  AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
+AM_PATH_PYTHON(,, [:])
+AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
 @end example
 
 @item PYTHON_VERSION
@@ -8574,6 +8599,12 @@ colored output by setting the @command{make} variable
 @samp{AM_COLOR_TESTS=no}, or force colored output even without a connecting
 terminal with @samp{AM_COLOR_TESTS=always}.
 
+Note that the semantics of some @command{make} implementations when used
+in parallel mode (@pxref{Parallel make,,, autoconf, The Autoconf Manual})
+can cause the automatic detection of a connection to a capable terminal
+to fail.  In that case, you can still resort to the use of
address@hidden
+
 @vindex TESTS
 @vindex TESTS_ENVIRONMENT
 The variable @code{TESTS_ENVIRONMENT} can be used to set environment
@@ -8581,13 +8612,19 @@ variables for the test run; the environment variable 
@env{srcdir} is
 set in the rule.  If all your test programs are scripts, you can also
 set @code{TESTS_ENVIRONMENT} to an invocation of the shell (e.g.
 @samp{$(SHELL) -x} can be useful for debugging the tests), or any other
-interpreter.  For instance the following setup is used by the Automake
-package to run four tests in Perl.
+interpreter.  For instance, the following setup may be used to run tests
+with Perl:
+
 @example
-TESTS_ENVIRONMENT = $(PERL) -Mstrict -I $(top_srcdir)/lib -w
-TESTS = Condition.pl DisjConditions.pl Version.pl Wrap.pl
+TESTS_ENVIRONMENT = $(PERL) -Mstrict -w
+TESTS = foo.pl bar.pl baz.pl
 @end example
 
+Note that the @option{parallel-tests} driver provides a more elegant
+way to achieve the same effect, freeing the @code{TESTS_ENVIRONMENT}
+variable for the user to override (@pxref{Simple Tests using
+parallel-tests}).
+
 
 @cindex Tests, expected failure
 @cindex Expected test failure
@@ -8915,9 +8952,11 @@ output in all them), so it is safer and easier to 
@code{AC_SUBST} them
 from @file{configure.ac}.  For instance, the following statement will
 cause @file{configure} to be rerun each time @file{version.sh} is
 changed.
+
 @example
 AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/version.sh'])
 @end example
+
 @noindent
 Note the @samp{$(top_srcdir)/} in the file name.  Since this variable
 is to be used in all @file{Makefile}s, its value must be sensible at
@@ -8943,12 +8982,14 @@ Speaking of @file{version.sh} scripts, we recommend 
against them
 today.  They are mainly used when the version of a package is updated
 automatically by a script (e.g., in daily builds).  Here is what some
 old-style @file{configure.ac}s may look like:
+
 @example
 AC_INIT
 . $srcdir/version.sh
 AM_INIT_AUTOMAKE([name], $VERSION_NUMBER)
 @dots{}
 @end example
+
 @noindent
 Here, @file{version.sh} is a shell fragment that sets
 @code{VERSION_NUMBER}.  The problem with this example is that
@@ -8959,12 +9000,14 @@ to the user), and that it uses the obsolete form of 
@code{AC_INIT} and
 straightforward, because shell variables are not allowed in
 @code{AC_INIT}'s arguments.  We recommend that @file{version.sh} be
 replaced by an M4 file that is included by @file{configure.ac}:
+
 @example
 m4_include([version.m4])
 AC_INIT([name], VERSION_NUMBER)
 AM_INIT_AUTOMAKE
 @dots{}
 @end example
+
 @noindent
 Here @file{version.m4} could contain something like
 @samp{m4_define([VERSION_NUMBER], [1.2])}.  The advantage of this
@@ -10290,12 +10333,14 @@ older releases will not be used.  For instance, use 
this in your
 @example
   AM_INIT_AUTOMAKE([1.6.1])    dnl Require Automake 1.6.1 or better.
 @end example
+
 @noindent
 or, in a particular @file{Makefile.am}:
 
 @example
   AUTOMAKE_OPTIONS = 1.6.1   # Require Automake 1.6.1 or better.
 @end example
+
 @noindent
 Automake will print an error message if its version is
 older than the requested version.
@@ -11182,6 +11227,7 @@ true_CPPFLAGS = -DEXIT_CODE=0
 false_SOURCES = generic.c
 false_CPPFLAGS = -DEXIT_CODE=1
 @end example
+
 @noindent
 Obviously the two programs are built from the same source, but it
 would be bad if they shared the same object, because @file{generic.o}
@@ -11351,6 +11397,7 @@ data.c: data.foo
 data.h: data.foo data.c
         foo data.foo
 @end example
+
 @noindent
 therefore a parallel @command{make} will have to serialize the builds
 of @file{data.c} and @file{data.h}, and will detect that the second is
diff --git a/lib/Automake/Rule.pm b/lib/Automake/Rule.pm
index 8fc5250..3184b24 100644
--- a/lib/Automake/Rule.pm
+++ b/lib/Automake/Rule.pm
@@ -1,4 +1,5 @@
-# Copyright (C) 2003, 2004, 2006, 2007, 2010  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004, 2006, 2007, 2010, 2011 Free Software
+# Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -126,7 +127,7 @@ use vars '%actions';
 
 =item <$suffix_rules>
 
-This maps the source extension for all suffix rule seen to
+This maps the source extension for all suffix rules seen to
 a C<hash> whose keys are the possible output extensions.
 
 Note that this is transitively closed by construction:
@@ -258,7 +259,7 @@ sub reject_rule ($$)
 =item C<accept_extensions (@exts)>
 
 Update C<$KNOWN_EXTENSIONS_PATTERN> to recognize the extensions
-listed C<@exts>.  Extensions should contain a dot if needed.
+listed in C<@exts>.  Extensions should contain a dot if needed.
 
 =cut
 
@@ -306,7 +307,7 @@ sub register_action ($$)
 
 =item C<Automake::Rule::reset>
 
-The I<forget all> function.  Clears all know rules and reset some
+The I<forget all> function.  Clears all known rules and resets some
 other internal data.
 
 =cut
@@ -374,7 +375,7 @@ sub reset()
      # Tarballing.
      'dist-all'             => [],
 
-     # Phoning.
+     # Phonying.
      '.PHONY'               => [],
      # Recursive install targets (so `make -n install' works for BSD Make).
      '.MAKE'               => [],
@@ -384,7 +385,7 @@ sub reset()
 
 =item C<register_suffix_rule ($where, $src, $dest)>
 
-Register a suffix rules defined on C<$where> that transform
+Register a suffix rule defined on C<$where> that transforms
 files ending in C<$src> into files ending in C<$dest>.
 
 This upgrades the C<$suffix_rules> variables.
@@ -406,11 +407,11 @@ sub register_suffix_rule ($$$)
   # CANNOT rewrite the target (i.e., automagically replace `.o'
   # and `.obj' by `.$(OBJEXT)' in the output), or warn the user
   # that (s)he'd better use `.$(OBJEXT)', because Automake itself
-  # output suffix rules for `.o' or `.obj'...
+  # output suffix rules for `.o' or `.obj' ...
   $dest = '.$(OBJEXT)' if ($dest eq '.o' || $dest eq '.obj');
 
   # Reading the comments near the declaration of $suffix_rules might
-  # help to understand the update of $suffix_rules that follows...
+  # help to understand the update of $suffix_rules that follows ...
 
   # Register $dest as a possible destination from $src.
   # We might have the create the \hash.
@@ -788,7 +789,7 @@ sub define ($$$$$)
     }
 
   # We honor inference rules with multiple targets because many
-  # make support this and people use it.  However this is disallowed
+  # makes support this and people use it.  However this is disallowed
   # by POSIX.  We'll print a warning later.
   my $target_count = 0;
   my $inference_rule_count = 0;
diff --git a/lib/Automake/Variable.pm b/lib/Automake/Variable.pm
index cb9d182..686847d 100644
--- a/lib/Automake/Variable.pm
+++ b/lib/Automake/Variable.pm
@@ -162,7 +162,7 @@ my %_am_macro_for_var =
    EMACS => 'AM_PATH_LISPDIR',
    GCJ => 'AM_PROG_GCJ',
    LEX => 'AM_PROG_LEX',
-   LIBTOOL => 'AC_PROG_LIBTOOL',
+   LIBTOOL => 'LT_INIT',
    lispdir => 'AM_PATH_LISPDIR',
    pkgpyexecdir => 'AM_PATH_PYTHON',
    pkgpythondir => 'AM_PATH_PYTHON',
diff --git a/lib/Automake/tests/Makefile.in b/lib/Automake/tests/Makefile.in
index 4b2c57f..b4940db 100644
--- a/lib/Automake/tests/Makefile.in
+++ b/lib/Automake/tests/Makefile.in
@@ -324,7 +324,8 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
        @$(am__sh_e_setup);                                             \
        list='$(TEST_LOGS)';                                            \
        results=`for f in $$list; do                                    \
-                  read line < $$f && echo "$$line" || echo FAIL;       \
+                  test -r $$f && read line < $$f && echo "$$line"      \
+                    || echo FAIL;                                      \
                 done`;                                                 \
        all=`echo "$$results" | sed '/^$$/d' | wc -l | sed -e 's/^[      
]*//'`; \
        fail=`echo "$$results" | grep -c '^FAIL'`;                      \
@@ -373,7 +374,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
          echo ".. contents:: :depth: 2";                               \
          echo;                                                         \
          for f in $$list; do                                           \
-           read line < $$f;                                            \
+           test -r $$f && read line < $$f || line=;                    \
            case $$line in                                              \
              PASS:*|XFAIL:*);;                                         \
              *) echo; cat $$f;;                                        \
@@ -437,7 +438,7 @@ recheck recheck-html:
        list='$(TEST_LOGS)';                                            \
        list=`for f in $$list; do                                       \
                test -f $$f || continue;                                \
-               if read line < $$f; then                                \
+               if test -r $$f && read line < $$f; then                 \
                  case $$line in FAIL*|XPASS*) echo $$f;; esac;         \
                else echo $$f; fi;                                      \
              done | tr '\012\015' '  '`;                               \
diff --git a/lib/am/check.am b/lib/am/check.am
index c953be8..4d10ce9 100644
--- a/lib/am/check.am
+++ b/lib/am/check.am
@@ -1,6 +1,6 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 2001, 2003, 2006, 2007, 2008, 2009, 2010 Free Software
-## Foundation, Inc.
+## Copyright (C) 2001, 2003, 2006, 2007, 2008, 2009, 2010, 2011 Free
+## Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -146,7 +146,8 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
        @$(am__sh_e_setup);                                             \
        list='$(TEST_LOGS)';                                            \
        results=`for f in $$list; do                                    \
-                  read line < $$f && echo "$$line" || echo FAIL;       \
+                  test -r $$f && read line < $$f && echo "$$line"      \
+                    || echo FAIL;                                      \
                 done`;                                                 \
        all=`echo "$$results" | sed '/^$$/d' | wc -l | sed -e 's/^[      
]*//'`; \
        fail=`echo "$$results" | grep -c '^FAIL'`;                      \
@@ -195,7 +196,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
          echo ".. contents:: :depth: 2";                               \
          echo;                                                         \
          for f in $$list; do                                           \
-           read line < $$f;                                            \
+           test -r $$f && read line < $$f || line=;                    \
            case $$line in                                              \
              PASS:*|XFAIL:*);;                                         \
              *) echo; cat $$f;;                                        \
@@ -234,6 +235,10 @@ check-TESTS:
 ## OTOH, this means that, in the rule for `$(TEST_SUITE_LOG)', we
 ## cannot use `$?' to compute the set of lazily rerun tests, lest
 ## we rely on .PHONY to work portably.
+##
+## Trailing whitespace in `TESTS = foo.test $(empty)' causes GNU make
+## 3.80 to erroneously expand $(TESTS_LOGS) to `foo.log .log'.
+## Work around this bug.
        @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
        @list='$(TEST_LOGS)';                                           \
        list=`for f in $$list; do                                       \
@@ -287,7 +292,7 @@ recheck recheck-html:
        list='$(TEST_LOGS)';                                            \
        list=`for f in $$list; do                                       \
                test -f $$f || continue;                                \
-               if read line < $$f; then                                \
+               if test -r $$f && read line < $$f; then                 \
                  case $$line in FAIL*|XPASS*) echo $$f;; esac;         \
                else echo $$f; fi;                                      \
              done | tr '\012\015' '  '`;                               \
diff --git a/lib/depcomp b/lib/depcomp
index df8eea7..82ebc75 100755
--- a/lib/depcomp
+++ b/lib/depcomp
@@ -1,10 +1,10 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2011-04-11-10; # UTC
 
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
-# Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2011,
+# Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -158,10 +158,12 @@ gcc)
 ' < "$tmpdepfile" |
 ## Some versions of gcc put a space before the `:'.  On the theory
 ## that the space means something, we add a space to the output as
-## well.
+## well.  hp depmode also adds that space, but also prefixes the VPATH
+## to the object.  Take care to not repeat it in the output.
 ## Some versions of the HPUX 10.20 sed can't process this invocation
 ## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+    sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" '/:$/d' \
+      | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -503,7 +505,9 @@ makedepend)
   touch "$tmpdepfile"
   ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
   rm -f "$depfile"
-  cat < "$tmpdepfile" > "$depfile"
+  # makedepend may prepend the VPATH from the source file name to the object.
+  # No need to regex-escape $object, excess matching of '.' is harmless.
+  sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
   sed '1,2d' "$tmpdepfile" | tr ' ' '
 ' | \
 ## Some versions of the HPUX 10.20 sed can't process this invocation
diff --git a/lib/install-sh b/lib/install-sh
index 3f83ce9..a9244eb 100755
--- a/lib/install-sh
+++ b/lib/install-sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2010-02-06.18; # UTC
+scriptversion=2011-01-19.21; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -156,6 +156,10 @@ while test $# -ne 0; do
     -s) stripcmd=$stripprog;;
 
     -t) dst_arg=$2
+       # Protect names problematic for `test' and other utilities.
+       case $dst_arg in
+         -* | [=\(\)!]) dst_arg=./$dst_arg;;
+       esac
        shift;;
 
     -T) no_target_directory=true;;
@@ -186,6 +190,10 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
     fi
     shift # arg
     dst_arg=$arg
+    # Protect names problematic for `test' and other utilities.
+    case $dst_arg in
+      -* | [=\(\)!]) dst_arg=./$dst_arg;;
+    esac
   done
 fi
 
@@ -232,9 +240,9 @@ fi
 
 for src
 do
-  # Protect names starting with `-'.
+  # Protect names problematic for `test' and other utilities.
   case $src in
-    -*) src=./$src;;
+    -* | [=\(\)!]) src=./$src;;
   esac
 
   if test -n "$dir_arg"; then
@@ -256,12 +264,7 @@ do
       echo "$0: no destination specified." >&2
       exit 1
     fi
-
     dst=$dst_arg
-    # Protect names starting with `-'.
-    case $dst in
-      -*) dst=./$dst;;
-    esac
 
     # If destination is a directory, append the input filename; won't work
     # if double slashes aren't ignored.
@@ -389,7 +392,7 @@ do
 
       case $dstdir in
        /*) prefix='/';;
-       -*) prefix='./';;
+       [-=\(\)!]*) prefix='./';;
        *)  prefix='';;
       esac
 
@@ -407,7 +410,7 @@ do
 
       for d
       do
-       test -z "$d" && continue
+       test X"$d" = X && continue
 
        prefix=$prefix$d
        if test -d "$prefix"; then
diff --git a/m4/depend.m4 b/m4/depend.m4
index 8304180..89d37b2 100644
--- a/m4/depend.m4
+++ b/m4/depend.m4
@@ -1,12 +1,12 @@
 ##                                                          -*- Autoconf -*-
 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
-# 2010  Free Software Foundation, Inc.
+# 2010, 2011 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # 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,
@@ -46,6 +46,7 @@ AC_CACHE_CHECK([dependency style of $depcc],
   # instance it was reported that on HP-UX the gcc test will end up
   # making a dummy file named `D' -- because `-MD' means `put the output
   # in D'.
+  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
diff --git a/m4/python.m4 b/m4/python.m4
index 50e1538..655dcf3 100644
--- a/m4/python.m4
+++ b/m4/python.m4
@@ -40,6 +40,8 @@ AC_DEFUN([AM_PATH_PYTHON],
 [python python2 python3 python3.2 python3.1 python3.0 python2.7 dnl
  python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0])
 
+  AC_ARG_VAR([PYTHON], [the Python interpreter])
+
   m4_if([$1],[],[
     dnl No version check is needed.
     # Find any Python interpreter.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 3794ef1..3878ac9 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,7 +1,7 @@
 ## Process this file with automake to create Makefile.in
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
+# 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -21,6 +21,7 @@ all.test \
 auxdir2.test \
 cond17.test \
 gcj6.test \
+pr8365-remake-timing.test \
 txinfo5.test
 
 include $(srcdir)/parallel-tests.am
@@ -94,6 +95,14 @@ ar2.test \
 asm.test \
 asm2.test \
 asm3.test \
+autodist.test \
+autodist-subdir.test \
+autodist-acconfig.test \
+autodist-acconfig-no-subdir.test \
+autodist-aclocal-m4.test \
+autodist-config-headers.test \
+autodist-configure-no-subdir.test \
+autodist-stamp-vti.test \
 autohdr.test \
 autohdr2.test \
 autohdr3.test \
@@ -133,6 +142,9 @@ check8.test \
 check9.test \
 check10.test \
 check11.test \
+check-exported-srcdir.test \
+check-tests-in-builddir.test \
+check-tests_environment.test \
 checkall.test \
 clean.test \
 clean2.test \
@@ -158,6 +170,7 @@ comment8.test \
 comment9.test \
 commen10.test \
 commen11.test \
+comments-in-var-def.test \
 compile.test \
 compile2.test \
 compile_f90_c_cxx.test \
@@ -264,6 +277,8 @@ depcomp6.test \
 depcomp7.test \
 depcomp8a.test \
 depcomp8b.test \
+depcomp9.test \
+depcomp10.test \
 depdist.test \
 depend.test \
 depend2.test \
@@ -276,6 +291,7 @@ dirforbid.test \
 dirlist.test \
 dirlist2.test \
 discover.test \
+dist-included-parent-dir.test \
 distcleancheck.test \
 distcom2.test \
 distcom3.test \
@@ -350,6 +366,7 @@ gnuwarn2.test \
 gnits.test \
 gnits2.test \
 gnits3.test \
+hdr-vars-defined-once.test \
 header.test \
 help.test \
 help2.test \
@@ -362,14 +379,13 @@ help-init.test \
 help-lispdir.test \
 help-maintainer.test \
 help-multilib.test \
+help-python.test \
 help-regex.test \
 help-silent.test \
 help-upc.test \
 hfs.test \
 hosts.test \
 implicit.test \
-include.test \
-include2.test \
 info.test \
 init.test \
 init2.test \
@@ -406,6 +422,7 @@ interp2.test \
 java.test \
 java2.test \
 java3.test \
+java-check.test \
 javaprim.test \
 javasubst.test \
 ldadd.test \
@@ -417,6 +434,7 @@ lex4.test \
 lex5.test \
 lexcpp.test \
 lexvpath.test \
+lex-subobj-nodep.test \
 lflags.test \
 lflags2.test \
 libexec.test \
@@ -470,12 +488,15 @@ ltcond.test \
 ltcond2.test \
 ltconv.test \
 ltdeps.test \
+ltinit.test \
 ltinstloc.test \
 ltlibobjs.test \
 ltlibsrc.test \
 ltorder.test \
 lzma.test \
+m4-inclusion.test \
 maintclean.test \
+maintclean-vpath.test \
 make.test \
 makej.test \
 makej2.test \
@@ -560,6 +581,8 @@ parallel-tests7.test \
 parallel-tests8.test \
 parallel-tests9.test \
 parallel-tests10.test \
+parallel-tests-unreadable-log.test \
+parallel-tests-subdir.test \
 parse.test \
 percent.test \
 percent2.test \
@@ -624,6 +647,7 @@ remake4.test \
 remake5.test \
 remake6.test \
 remake7.test \
+pr8365-remake-timing.test \
 regex.test \
 req.test \
 reqd.test \
@@ -647,7 +671,6 @@ silent-many-generic.test \
 silent-lex.test \
 silent-yacc.test \
 silent-yacc-headers.test \
-sinclude.test \
 srcsub.test \
 srcsub2.test \
 space.test \
@@ -659,6 +682,7 @@ specflg7.test \
 specflg8.test \
 specflg9.test \
 specflg10.test \
+specflg-dummy.test \
 spell.test \
 spell2.test \
 spell3.test \
@@ -738,6 +762,7 @@ txinfo2.test \
 txinfo3.test \
 txinfo4.test \
 txinfo5.test \
+txinfo5b.test \
 txinfo6.test \
 txinfo7.test \
 txinfo8.test \
@@ -787,6 +812,8 @@ version8.test \
 vpath.test \
 vtexi.test \
 vtexi2.test \
+vtexi3.test \
+vtexi4.test \
 warnopts.test \
 werror.test \
 werror2.test \
@@ -837,6 +864,6 @@ clean-local-check:
         if test "$$#,$$1" = "1,*.dir"; then \
           : there is no test directory to clean; \
         else \
-          find "$$@" -type d '!' -perm -200 -exec chmod u+w {} ';'; \
+          find "$$@" -type d ! -perm -700 -exec chmod u+rwx {} ';'; \
           rm -rf "$$@"; \
         fi;
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 519bdfc..ab0b4ee 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -16,7 +16,7 @@
 @SET_MAKE@
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
+# 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -277,9 +277,13 @@ all.test \
 auxdir2.test \
 cond17.test \
 gcj6.test \
+pr8365-remake-timing.test \
 txinfo5.test
 
 parallel_tests = \
+check-exported-srcdir-p.test \
+check-tests-in-builddir-p.test \
+check-tests_environment-p.test \
 check-p.test \
 check10-p.test \
 check11-p.test \
@@ -361,6 +365,14 @@ ar2.test \
 asm.test \
 asm2.test \
 asm3.test \
+autodist.test \
+autodist-subdir.test \
+autodist-acconfig.test \
+autodist-acconfig-no-subdir.test \
+autodist-aclocal-m4.test \
+autodist-config-headers.test \
+autodist-configure-no-subdir.test \
+autodist-stamp-vti.test \
 autohdr.test \
 autohdr2.test \
 autohdr3.test \
@@ -400,6 +412,9 @@ check8.test \
 check9.test \
 check10.test \
 check11.test \
+check-exported-srcdir.test \
+check-tests-in-builddir.test \
+check-tests_environment.test \
 checkall.test \
 clean.test \
 clean2.test \
@@ -425,6 +440,7 @@ comment8.test \
 comment9.test \
 commen10.test \
 commen11.test \
+comments-in-var-def.test \
 compile.test \
 compile2.test \
 compile_f90_c_cxx.test \
@@ -531,6 +547,8 @@ depcomp6.test \
 depcomp7.test \
 depcomp8a.test \
 depcomp8b.test \
+depcomp9.test \
+depcomp10.test \
 depdist.test \
 depend.test \
 depend2.test \
@@ -543,6 +561,7 @@ dirforbid.test \
 dirlist.test \
 dirlist2.test \
 discover.test \
+dist-included-parent-dir.test \
 distcleancheck.test \
 distcom2.test \
 distcom3.test \
@@ -617,6 +636,7 @@ gnuwarn2.test \
 gnits.test \
 gnits2.test \
 gnits3.test \
+hdr-vars-defined-once.test \
 header.test \
 help.test \
 help2.test \
@@ -629,14 +649,13 @@ help-init.test \
 help-lispdir.test \
 help-maintainer.test \
 help-multilib.test \
+help-python.test \
 help-regex.test \
 help-silent.test \
 help-upc.test \
 hfs.test \
 hosts.test \
 implicit.test \
-include.test \
-include2.test \
 info.test \
 init.test \
 init2.test \
@@ -673,6 +692,7 @@ interp2.test \
 java.test \
 java2.test \
 java3.test \
+java-check.test \
 javaprim.test \
 javasubst.test \
 ldadd.test \
@@ -684,6 +704,7 @@ lex4.test \
 lex5.test \
 lexcpp.test \
 lexvpath.test \
+lex-subobj-nodep.test \
 lflags.test \
 lflags2.test \
 libexec.test \
@@ -737,12 +758,15 @@ ltcond.test \
 ltcond2.test \
 ltconv.test \
 ltdeps.test \
+ltinit.test \
 ltinstloc.test \
 ltlibobjs.test \
 ltlibsrc.test \
 ltorder.test \
 lzma.test \
+m4-inclusion.test \
 maintclean.test \
+maintclean-vpath.test \
 make.test \
 makej.test \
 makej2.test \
@@ -827,6 +851,8 @@ parallel-tests7.test \
 parallel-tests8.test \
 parallel-tests9.test \
 parallel-tests10.test \
+parallel-tests-unreadable-log.test \
+parallel-tests-subdir.test \
 parse.test \
 percent.test \
 percent2.test \
@@ -891,6 +917,7 @@ remake4.test \
 remake5.test \
 remake6.test \
 remake7.test \
+pr8365-remake-timing.test \
 regex.test \
 req.test \
 reqd.test \
@@ -914,7 +941,6 @@ silent-many-generic.test \
 silent-lex.test \
 silent-yacc.test \
 silent-yacc-headers.test \
-sinclude.test \
 srcsub.test \
 srcsub2.test \
 space.test \
@@ -926,6 +952,7 @@ specflg7.test \
 specflg8.test \
 specflg9.test \
 specflg10.test \
+specflg-dummy.test \
 spell.test \
 spell2.test \
 spell3.test \
@@ -1005,6 +1032,7 @@ txinfo2.test \
 txinfo3.test \
 txinfo4.test \
 txinfo5.test \
+txinfo5b.test \
 txinfo6.test \
 txinfo7.test \
 txinfo8.test \
@@ -1054,6 +1082,8 @@ version8.test \
 vpath.test \
 vtexi.test \
 vtexi2.test \
+vtexi3.test \
+vtexi4.test \
 warnopts.test \
 werror.test \
 werror2.test \
@@ -1147,7 +1177,8 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
        @$(am__sh_e_setup);                                             \
        list='$(TEST_LOGS)';                                            \
        results=`for f in $$list; do                                    \
-                  read line < $$f && echo "$$line" || echo FAIL;       \
+                  test -r $$f && read line < $$f && echo "$$line"      \
+                    || echo FAIL;                                      \
                 done`;                                                 \
        all=`echo "$$results" | sed '/^$$/d' | wc -l | sed -e 's/^[      
]*//'`; \
        fail=`echo "$$results" | grep -c '^FAIL'`;                      \
@@ -1196,7 +1227,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
          echo ".. contents:: :depth: 2";                               \
          echo;                                                         \
          for f in $$list; do                                           \
-           read line < $$f;                                            \
+           test -r $$f && read line < $$f || line=;                    \
            case $$line in                                              \
              PASS:*|XFAIL:*);;                                         \
              *) echo; cat $$f;;                                        \
@@ -1260,7 +1291,7 @@ recheck recheck-html:
        list='$(TEST_LOGS)';                                            \
        list=`for f in $$list; do                                       \
                test -f $$f || continue;                                \
-               if read line < $$f; then                                \
+               if test -r $$f && read line < $$f; then                 \
                  case $$line in FAIL*|XPASS*) echo $$f;; esac;         \
                else echo $$f; fi;                                      \
              done | tr '\012\015' '  '`;                               \
@@ -1437,7 +1468,7 @@ clean-local-check:
         if test "$$#,$$1" = "1,*.dir"; then \
           : there is no test directory to clean; \
         else \
-          find "$$@" -type d '!' -perm -200 -exec chmod u+w {} ';'; \
+          find "$$@" -type d ! -perm -700 -exec chmod u+rwx {} ';'; \
           rm -rf "$$@"; \
         fi;
 
diff --git a/tests/aclocal6.test b/tests/aclocal6.test
index ea6bac3..ddf9401 100755
--- a/tests/aclocal6.test
+++ b/tests/aclocal6.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -44,19 +44,14 @@ $ACLOCAL -I m4
 $AUTOCONF
 $AUTOMAKE --copy --add-missing
 
-# Users can disable autom4te.cache.
-if test -d autom4te.cache; then
-  test_cache='test -d'
-else
-  test_cache=:
-fi
-
 mkdir build
 cd build
 
 ../configure
 $MAKE
 
+# Modified configure dependencies must be newer than config.status.
+$sleep
 # Update an aclocal.m4 dependency, then make sure all Makefiles
 # are updated, even from a sub-directory.
 echo 'AC_DEFUN([SOME_DEFS], [MORE_DEFS])' > ../m4/somedefs.m4
@@ -79,15 +74,4 @@ test -f $me-1.0/m4/moredefs.m4
 test -f $me-1.0/m4/somedefs.m4
 test -f $me-1.0/acinclude.m4
 
-# Make sure maintainer-clean works in VPATH builds.
-# (This is unrelated to the rest of this test.)
-$MAKE clean
-$test_cache ../autom4te.cache
-test -f Makefile
-test -f sub/Makefile
-$MAKE maintainer-clean
-test ! -d ../autom4te.cache
-test ! -f Makefile
-test ! -f sub/Makefile
-
 :
diff --git a/tests/alloca.test b/tests/alloca.test
index 6cf51bb..8a1e06e 100755
--- a/tests/alloca.test
+++ b/tests/alloca.test
@@ -20,13 +20,21 @@
 
 set -e
 
+cat >> configure.in <<'END'
+AC_PROG_CC
+END
+
 cat > Makefile.am << 'END'
 noinst_LIBRARIES = libtu.a
 libtu_a_SOURCES =
 libtu_a_LIBADD = @ALLOCA@
 END
 
+: > alloca.c
+
 $ACLOCAL
 AUTOMAKE_fails
-grep 'Makefile.am:1:.*AC_PROG_RANLIB' stderr
-grep 'Makefile.am:3:.*AC_FUNC_ALLOCA' stderr
+grep '^Makefile\.am:1:.*define .*RANLIB.* add .*AC_PROG_RANLIB' stderr
+grep '^Makefile\.am:3:.*define .*ALLOCA.* add .*AC_FUNC_ALLOCA' stderr
+
+:
diff --git a/tests/alloca2.test b/tests/alloca2.test
index 4ecd229..caf11a3 100755
--- a/tests/alloca2.test
+++ b/tests/alloca2.test
@@ -20,13 +20,21 @@
 
 set -e
 
+cat >> configure.in <<'END'
+AC_PROG_CC
+END
+
 cat > Makefile.am << 'END'
 noinst_LTLIBRARIES = libtu.la
 libtu_la_SOURCES =
 libtu_la_LIBADD = @LTALLOCA@
 END
 
+: > alloca.c
+
 $ACLOCAL
 AUTOMAKE_fails
-grep 'Makefile.am:1:.*AC_PROG_LIBTOOL' stderr
-grep 'Makefile.am:3:.*ALLOCA' stderr
+grep '^Makefile\.am:1:.*define.*LIBTOOL.* add .*LT_INIT' stderr
+grep '^Makefile\.am:3:.*LTALLOCA' stderr
+
+:
diff --git a/tests/alpha2.test b/tests/autodist-acconfig-no-subdir.test
similarity index 55%
copy from tests/alpha2.test
copy to tests/autodist-acconfig-no-subdir.test
index e125377..e6bd5a9 100755
--- a/tests/alpha2.test
+++ b/tests/autodist-acconfig-no-subdir.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -14,48 +14,45 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Another check for README-alpha support.  This time it is requested
-# from configure.in.  Report from Akim Demaille.
+# Check that `acconfig.h' is *not* automatically distributed when
+# placed in a subdirectory.
+# Related to automake bug#7819.
 
 . ./defs || Exit 1
 
 set -e
 
-cat > configure.in << 'END'
-AC_INIT([alpha], [1.0b])
-AM_INIT_AUTOMAKE([readme-alpha])
-AC_CONFIG_FILES([Makefile sub/Makefile])
+cat >> configure.in <<END
+AC_CONFIG_FILES([sub/Makefile])
 AC_OUTPUT
 END
 
-cat > Makefile.am << 'END'
+cat > Makefile.am <<'END'
 SUBDIRS = sub
+sub/acconfig.h:
+       echo target $@ should not be built >&2; exit 1
 check-local: distdir
-       test -f $(distdir)/README-alpha
-       test -f $(distdir)/sub/README
-       test ! -f $(distdir)/sub/README-alpha
-       : > works
+       ls -l $(distdir)/sub
+       test ! -f $(distdir)/sub/acconfig.h
 END
 
 mkdir sub
-: > sub/Makefile.am
 
-: > README-alpha
-: > sub/README-alpha
-: > sub/README
+cat > sub/Makefile.am <<'END'
+acconfig.h:
+       echo target $@ should not be built >&2; exit 1
+check-local:
+       echo $(DISTFILES) | grep 'acconfig\.h' && exit 1; :
+       echo $(DIST_COMMON) | grep 'acconfig\.h' && exit 1; :
+END
 
-# Gnits stuff.
-: > INSTALL
-: > NEWS
-: > README
-: > COPYING
-: > AUTHORS
-: > ChangeLog
-: > THANKS
+: > sub/acconfig.h
 
 $ACLOCAL
-$AUTOCONF
 $AUTOMAKE
+$AUTOCONF
+
 ./configure
 $MAKE check
-test -f works
+
+:
diff --git a/tests/extra10.test b/tests/autodist-acconfig.test
similarity index 68%
copy from tests/extra10.test
copy to tests/autodist-acconfig.test
index 7bd6556..49ab2f0 100755
--- a/tests/extra10.test
+++ b/tests/autodist-acconfig.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2010  Free Software Foundation, Inc.
+# Copyright (C) 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -14,31 +14,33 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Check that wildcards in EXTRA_DIST are honoured.
-# Suggested by observations from Braden McDaniel.
+# Check that `acconfig.h' is automatically distributed if it exists
+# (at automake runtime).
+# Related to automake bug#7819.
 
-required=GNUmake
 . ./defs || Exit 1
 
 set -e
 
-echo AC_OUTPUT >> configure.in
+cat >> configure.in <<END
+AC_OUTPUT
+END
 
 cat > Makefile.am <<'END'
-EXTRA_DIST=*.foo
 .PHONY: test
 test: distdir
-       diff a.foo $(distdir)/a.foo
-       diff b.foo $(distdir)/b.foo
-       test ! -r $(distdir)/c.bar
+       ls -l $(distdir)
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]acconfig\.h '
+       test -f $(distdir)/acconfig.h
 END
 
+: > acconfig.h
+
 $ACLOCAL
 $AUTOMAKE
 $AUTOCONF
 
-echo aaa > a.foo
-echo bbb > b.foo
-echo ccc > c.foo
 ./configure
 $MAKE test
+
+:
diff --git a/tests/yflags-force-override.test b/tests/autodist-aclocal-m4.test
similarity index 54%
copy from tests/yflags-force-override.test
copy to tests/autodist-aclocal-m4.test
index 7a3197f..3f53d59 100755
--- a/tests/yflags-force-override.test
+++ b/tests/autodist-aclocal-m4.test
@@ -14,53 +14,42 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Check that automake can cope with a definition of the $(YFLAGS) variable
-# in Makefile.am (even if that is extremely bad practice, because that
-# variable is user-reserved).
+# Check that `aclocal.m4' is not automatically distributed if not
+# required to build `configure'.  This is *really* a corner-case
+# check, and the behaviour it checks is not documented either, so
+# if that behaviour is deliberately changed in the future, just
+# remove this test.
+# Related to automake bug#7819.
 
-required=yacc
 . ./defs || Exit 1
 
 set -e
 
-cat >> configure.in <<'END'
-AC_PROG_CC
-AC_PROG_YACC
-AC_OUTPUT
-END
+{ echo 'm4_include([defs.m4])'
+  cat configure.in
+  echo 'AC_OUTPUT'
+} > t
+mv -f t configure.in
 
 cat > Makefile.am <<'END'
-bin_PROGRAMS = foo
-foo_SOURCES = foo.y
-# Don't do this in a real-life Makefile.am!
-YFLAGS = -d -v
-END
-
-cat > foo.y << 'END'
-%{
-int yylex () { return 0; }
-void yyerror (char *s) { return; }
-int main () { return 0; }
-%}
-%%
-foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
+.PHONY: test
+test: distdir
+       ls -l $(distdir)
+       test ! -f $(distdir)/aclocal.m4
+       echo $(DISTFILES) | grep 'aclocal\.m4' && exit 1; :
+       echo $(DIST_COMMON) | grep 'aclocal\.m4' && exit 1; :
+check-local: test
 END
 
+: > defs.m4
 $ACLOCAL
-$AUTOMAKE -a -Wno-gnu
-
-$EGREP '(foo|YFLAGS)' Makefile.in # for debugging
-grep '^foo.h *:' Makefile.in
+mv -f aclocal.m4 defs.m4
 
+$AUTOMAKE
 $AUTOCONF
-./configure
-
-$MAKE
-
-test -f foo.c
-test -f foo.h
-test -f foo.output
 
+./configure
+$MAKE test
 $MAKE distcheck
 
 :
diff --git a/tests/autodist-config-headers.test 
b/tests/autodist-config-headers.test
new file mode 100755
index 0000000..66c9bea
--- /dev/null
+++ b/tests/autodist-config-headers.test
@@ -0,0 +1,61 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check that config.h.bot and config.h.top are automatically
+# distributed if the AC_CONFIG_HADERS macro is used and they
+# exist at automake runtime.
+# Related to automake bug#7819.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in <<END
+AC_CONFIG_HEADERS([config.h sub/config.h cfg2.h:conf2.hin])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+.PHONY: test
+test: distdir
+       ls -l $(distdir) $(distdir)/sub
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]config\.h\.bot '
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]config\.h\.top '
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]cfg2\.h\.bot '
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]cfg2\.h\.top '
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]sub/config\.h\.bot '
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]sub/config\.h\.top '
+       test -f $(distdir)/config.h.bot
+       test -f $(distdir)/config.h.top
+       test -f $(distdir)/cfg2.h.bot
+       test -f $(distdir)/cfg2.h.top
+       test -f $(distdir)/sub/config.h.bot
+       test -f $(distdir)/sub/config.h.top
+END
+
+mkdir sub
+touch config.h.in config.h.top config.h.bot \
+      conf2.hin cfg2.h.top cfg2.h.bot \
+      sub/config.h.in sub/config.h.top sub/config.h.bot
+
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
+
+./configure
+$MAKE test
+
+:
diff --git a/tests/autodist-configure-no-subdir.test 
b/tests/autodist-configure-no-subdir.test
new file mode 100755
index 0000000..db640c4
--- /dev/null
+++ b/tests/autodist-configure-no-subdir.test
@@ -0,0 +1,72 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check that `configure', `configure.ac' and `configure.in' are *not*
+# automatically distributed when placed in a subdirectory.
+# Related to automake bug#7819.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in <<END
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+SUBDIRS = sub
+dontbuild = echo target $@ should not be built >&2; exit 1
+sub/configure:
+       $(dontbuild)
+sub/configure.ac:
+       $(dontbuild)
+sub/configure.in:
+       $(dontbuild)
+check-local: distdir
+       ls -l $(distdir)/sub
+       test ! -f $(distdir)/sub/configure
+       test ! -f $(distdir)/sub/configure.in
+       test ! -f $(distdir)/sub/configure.ac
+END
+
+mkdir sub
+
+cat > sub/Makefile.am <<'END'
+dontbuild = echo target $@ should not be built >&2; exit 1
+configure:
+       $(dontbuild)
+configure.ac:
+       $(dontbuild)
+configure.in:
+       $(dontbuild)
+check-local:
+       echo $(DISTFILES) | grep 'configure' && exit 1; :
+       echo $(DIST_COMMON) | grep 'configure' && exit 1; :
+END
+
+: > sub/configure.ac
+: > sub/configure.in
+: > sub/configure
+
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
+
+./configure
+$MAKE check
+
+:
diff --git a/tests/vtexi2.test b/tests/autodist-stamp-vti.test
similarity index 56%
copy from tests/vtexi2.test
copy to tests/autodist-stamp-vti.test
index e1a1b93..4f37e14 100755
--- a/tests/vtexi2.test
+++ b/tests/autodist-stamp-vti.test
@@ -1,6 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1996, 1997, 2001, 2002, 2010 Free Software Foundation,
-# Inc.
+# Copyright (C) 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -15,29 +14,47 @@
 # 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 for bug reported by Glenn Amerine:
-#   When automake sees version.texi is being included by a texi file,
-#   version.texi gets listed as a dependency for the .info file but
-#   not the .dvi file.
+# Check that `stamp-vti' is automatically distributed when info_TEXINFOS
+# and version.texi are involved.
+# Related to automake bug#7819.
 
+required=makeinfo
 . ./defs || Exit 1
 
 set -e
 
+cat >> configure.in << END
+AC_OUTPUT
+END
+
 cat > Makefile.am << 'END'
-info_TEXINFOS = zardoz.texi
+info_TEXINFOS = foo.texi
+.PHONY: test
+test: all distdir
+       ls -l $(distdir)
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]stamp-vti '
+       test -f $(distdir)/stamp-vti
 END
 
-cat > zardoz.texi << 'END'
address@hidden  zardoz  
+cat > foo.texi << 'END'
+\input texinfo
address@hidden foo.info
address@hidden Zardoz
address@hidden Top
 @include version.texi
+bar baz quux
address@hidden
 END
 
 # Required when using Texinfo.
-: > mdate-sh
 : > texinfo.tex
+cp "$testsrcdir/../lib/mdate-sh" .
 
 $ACLOCAL
-$AUTOMAKE
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+$MAKE test
 
-grep '^zardoz\.dvi:' Makefile.in
+:
diff --git a/tests/autodist-subdir.test b/tests/autodist-subdir.test
new file mode 100755
index 0000000..db694f8
--- /dev/null
+++ b/tests/autodist-subdir.test
@@ -0,0 +1,147 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check that automake really automatically distributes all the files
+# it advertises to do, even when in subdirectories.
+#
+# This behavior might be suboptimal, but it has been in place for quite
+# a long time, and it would be risky to change it now.  See also the
+# discussion of automake bug#7819:
+#  <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7819>
+#
+# Keep this test in sync with sister test `autodist.test'.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in <<'END'
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+END
+
+$ACLOCAL
+$AUTOCONF
+
+# The automake manual states that the list of automatically-distributed
+# files should be given by `automake --help'.
+list=`$AUTOMAKE --help \
+        | sed -n '/^Files .*automatically distributed.*if found/,/^ *$/p' \
+        | sed 1d`
+list=`for f in $list; do
+        case $f in
+          configure|configure.in|configure.ac)
+            # See test 'autodist-configure-no-subdir.test'.
+            ;;
+          aclocal.m4)
+            # This file should be distributed only when it is a real
+            # dependency for configure.  Anyway, not a check to be
+            # performed in this test.
+            ;;
+          acconfig.h)
+            # Works only when it really exists, not when it is a
+            # target in Makefile.am.
+            ;;
+          stamp-vti)
+            # Works only when using info_TEXINFOS and version.texi.
+            ;;
+          config.h.bot|config.h.top)
+            # Works only when the AC_CONFIG_HADERS macro is used.
+            ;;
+          *)
+            echo $f
+            ;;
+        esac
+      done`
+# Normalize whitespace, just in case.
+list=`echo $list`
+
+test -n "$list"
+
+cat > Makefile.am <<'END'
+SUBDIRS = sub
+check-local:
+## For debugging.
+       @echo DIST_COMMON:
+       @for f in $(DIST_COMMON); do echo "  $$f"; done
+       @echo DISTDIR:
+       @ls -l $(distdir) | sed 's/^/  /'
+## Now the checks.
+       @for f in $(autodist_list); do \
+         echo "file: sub/$$f"; \
+         test -f $(distdir)/sub/$$f \
+           || { echo $$f: distdir fail >&2; exit 1; }; \
+       done
+END
+
+mkdir sub
+
+cat > sub/Makefile.am <<'END'
+include distfiles.am
+check-local:
+## For debugging.
+       @echo DIST_COMMON:
+       @for f in $(DIST_COMMON); do echo "  $$f"; done
+       @echo DISTDIR:
+       @ls -l $(distdir) | sed 's/^/  /'
+## Now the checks.
+       @for f in $(autodist_list); do \
+         echo "file: $$f"; \
+         ## Some filenames might contain dots, but this won't cause spurious
+         ## failures, and "spurious successes" are so unlikely that they're
+         ## not worth worrying about.
+         echo ' ' $(DIST_COMMON) ' ' | grep "[ /]$$f " >/dev/null \
+           || { echo $$f: distcom fail >&2; exit 1; }; \
+       done
+END
+
+: First try listing the automatically-distributed files in proper
+: targets in Makefile.am
+
+echo "MAINTAINERCLEANFILES = $list" > sub/distfiles.am
+for f in $list; do echo "$f :; touch $f"; done >> sub/distfiles.am
+
+cat sub/distfiles.am # For debugging.
+
+$AUTOMAKE -a
+
+./configure
+
+$MAKE distdir
+autodist_list="$list" $MAKE check
+
+$MAKE maintainer-clean
+test ! -f sub/README    # Sanity check.
+rm -rf $me-1.0          # Remove $(distdir).
+
+: Now try creating the automatically-distributed files before
+: running automake.
+
+: > sub/distfiles.am
+for f in $list; do
+  echo dummy > sub/$f
+done
+
+ls -l # For debugging.
+
+$AUTOMAKE
+
+./configure
+
+$MAKE distdir
+autodist_list="$list" $MAKE check
+
+:
diff --git a/tests/autodist.test b/tests/autodist.test
new file mode 100755
index 0000000..34b9526
--- /dev/null
+++ b/tests/autodist.test
@@ -0,0 +1,136 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check that automake really automatically distributes all the files
+# it advertises to do.
+# Related to automake bug#7819.
+# Keep this test in sync with sister test `autodist-subdir.test'.
+
+. ./defs || Exit 1
+
+set -e
+
+# Ensure we are run from the right directory.
+# (The last thing we want is to delete some random user files.)
+test -f ../defs-static
+rm -f *
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AC_CONFIG_AUX_DIR([.])
+AM_INIT_AUTOMAKE
+## Will avoid useless regeneration of aclocal.m4, configure, etc.
+AM_MAINTAINER_MODE
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+$ACLOCAL
+$AUTOCONF
+
+# The automake manual states that the list of automatically-distributed
+# files should be given by `automake --help'.
+list=`$AUTOMAKE --help \
+        | sed -n '/^Files .*automatically distributed.*if found/,/^ *$/p' \
+        | sed 1d`
+list=`for f in $list; do
+        case $f in
+          configure|configure.in|configure.ac)
+            # See test 'autodist-configure-no-subdir.test'.
+            ;;
+          aclocal.m4)
+            # This file should be distributed only when it is a real
+            # dependency for configure.  Anyway, not a check to be
+            # performed in this test.
+            ;;
+          acconfig.h)
+            # Works only when it really exists, not when it is a
+            # target in Makefile.am.
+            ;;
+          stamp-vti)
+            # Works only when using info_TEXINFOS and version.texi.
+            ;;
+          config.h.bot|config.h.top)
+            # Works only when the AC_CONFIG_HADERS macro is used.
+            ;;
+          *)
+            echo $f
+            ;;
+        esac
+      done`
+# Normalize whitespace, just in case.
+list=`echo $list`
+
+test -n "$list"
+
+cat > Makefile.am <<'END'
+include distfiles.am
+check-local:
+## For debugging.
+       @echo DIST_COMMON:
+       @for f in $(DIST_COMMON); do echo "  $$f"; done
+       @echo DISTDIR:
+       @ls -l $(distdir) | sed 's/^/  /'
+## Now the checks.
+       @for f in $(autodist_list); do \
+         echo "file: $$f"; \
+         test -f $(distdir)/$$f \
+           || { echo $$f: distdir fail >&2; exit 1; }; \
+         ## Some filenames might contain dots, but this won't cause spurious
+         ## failures, and "spurious successes" are so unlikely that they're
+         ## not worth worrying about.
+         echo ' ' $(DIST_COMMON) ' ' | grep "[ /]$$f " >/dev/null \
+           || { echo $$f: distcom fail >&2; exit 1; }; \
+       done
+END
+
+: First try listing the automatically-distributed files in proper
+: targets in Makefile.am
+
+echo "MAINTAINERCLEANFILES = $list" > distfiles.am
+for f in $list; do echo "$f :; touch $f"; done >> distfiles.am
+
+cat distfiles.am # For debugging.
+
+$AUTOMAKE -a
+
+./configure
+
+$MAKE distdir
+autodist_list="$list" $MAKE check
+
+$MAKE maintainer-clean
+test ! -f README        # Sanity check.
+rm -rf $me-1.0          # Remove $(distdir).
+
+: Now try creating the automatically-distributed files before
+: running automake.
+
+: > distfiles.am
+for f in $list; do
+  echo dummy > $f
+done
+
+ls -l # For debugging.
+
+$AUTOMAKE
+
+./configure
+
+$MAKE distdir
+autodist_list="$list" $MAKE check
+
+:
diff --git a/tests/yacc-weirdnames.test b/tests/check-exported-srcdir.test
similarity index 57%
copy from tests/yacc-weirdnames.test
copy to tests/check-exported-srcdir.test
index 8f0424e..5cec7fc 100755
--- a/tests/yacc-weirdnames.test
+++ b/tests/check-exported-srcdir.test
@@ -14,43 +14,52 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Check that yacc sources with many dots in their name are handled
-# correctly.
+# Check that the testsuite driver (either with or without the
+# parallel-tests option enabled) exports the `srcdir' value in the
+# environment of the tests.  This is documented in the manual.
 
 . ./defs || Exit 1
 
 set -e
 
+show_info ()
+{
+  if test x"$parallel_tests" = x"yes"; then
+     cat foo.log
+     cat test-suite.log
+  else
+     :
+  fi
+}
+
+mkdir SrcDir
+mv [!S]* SrcDir
+mkdir BuildDir
+cd SrcDir
+
 cat >> configure.in << 'END'
-AC_PROG_CC
-AC_PROG_CXX
-AC_PROG_YACC
 AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
-bin_PROGRAMS = foo bar foo2 bar2
-
-foo_SOURCES = parse.y.y
-bar_SOURCES = parse.s.f..y
-bar_YFLAGS = -d
-
-foo2_SOURCES = parse..5.y++
-bar2_SOURCES = parse.yxx.yy
-bar2_YFLAGS = -d
+TESTS = foo.test
 END
 
-outputs=' parse.y.c      bar-parse.s.f..c   bar-parse.s.f..h
-          parse..5.c++   bar2-parse.yxx.cc  bar2-parse.yxx.hh '
+cat > foo.test <<'END'
+#!/bin/sh
+echo "foo.test: srcdir='$srcdir'"
+test x"$srcdir" = x"../SrcDir"
+END
+chmod a+x foo.test
 
 $ACLOCAL
+$AUTOCONF
 $AUTOMAKE -a
 
-$EGREP '(\.[ch]|parse)' Makefile.in # For debugging.
+cd ../BuildDir
+../SrcDir/configure
 
-# All expected files should be mentioned in the generated Makefile.in.
-for s in $outputs; do
-  $FGREP $s Makefile.in
-done
+$MAKE check || { show_info; Exit 1; }
+show_info
 
 :
diff --git a/tests/check-tests-in-builddir.test 
b/tests/check-tests-in-builddir.test
new file mode 100755
index 0000000..2d0e423
--- /dev/null
+++ b/tests/check-tests-in-builddir.test
@@ -0,0 +1,83 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check that the testsuite driver can find test in the srcdir as
+# well as in builddir, and that is prefers those in the builddir.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+TESTS = foo.test bar.test
+EXTRA_DIST = $(TESTS)
+END
+
+cat > foo.test << 'END'
+#! /bin/sh
+exit ${FOO_EXIT_STATUS-0}
+END
+chmod a+x foo.test
+
+unset FOO_EXIT_STATUS || :
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+mkdir build
+cd build
+
+../configure
+
+cat > bar.test << 'END'
+#! /bin/sh
+exit 0
+END
+chmod a+x bar.test
+
+$MAKE check >out 2>&1 || { cat out; Exit1; }
+cat out
+grep '\.\./foo' out && Exit 1
+grep '^PASS: foo.test *$' out
+grep '^PASS: bar.test *$' out
+
+rm -f test-suite.log foo.log bar.log
+
+FOO_EXIT_STATUS=1 $MAKE check >out 2>&1 && { cat out; Exit1; }
+cat out
+grep '\.\./foo' out && Exit 1
+grep '^FAIL: foo.test *$' out
+grep '^PASS: bar.test *$' out
+
+rm -f test-suite.log foo.log bar.log
+
+# Check that if the same test is present in srcdir and builddir,
+# the one in builddir is preferred.
+cp bar.test foo.test
+FOO_EXIT_STATUS=1 $MAKE check >out 2>&1 || { cat out; Exit1; }
+cat out
+grep '^PASS: foo.test *$' out
+grep '^PASS: bar.test *$' out
+
+# The tests in the builddir must be preferred also by "make dist".
+FOO_EXIT_STATUS=1 $MAKE distcheck
+
+:
diff --git a/tests/check11.test b/tests/check-tests_environment.test
similarity index 70%
copy from tests/check11.test
copy to tests/check-tests_environment.test
index 1fe6a4d..a07ab95 100755
--- a/tests/check11.test
+++ b/tests/check-tests_environment.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2009, 2010  Free Software Foundation, Inc.
+# Copyright (C) 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -14,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/>.
 
-# Check skip summary.
+# "Simple Tests" testsuite driver: check TESTS_ENVIRONMENT support.
 
 . ./defs || Exit 1
 
@@ -25,27 +25,23 @@ AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
-TESTS = skip skip2
+TESTS = foo.test
+EXTRA_DIST = $(TESTS)
 END
 
-cat >>skip <<'END'
+cat > foo.test << 'END'
 #! /bin/sh
-exit 77
+test x"$FOO" = x"ok"
 END
-chmod a+x skip
-cp skip skip2
+chmod a+x foo.test
 
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 
 ./configure
-env TESTS=skip $MAKE -e check >stdout
-cat stdout
-grep '1.*passed' stdout && Exit 1
 
-env TESTS="skip skip2" $MAKE -e check >stdout
-cat stdout
-grep '2.*passed' stdout && Exit 1
+FOO=bad TESTS_ENVIRONMENT='FOO=ok'  $MAKE check
+FOO=ok  TESTS_ENVIRONMENT='FOO=bad' $MAKE check && Exit 1
 
 :
diff --git a/tests/txinfo18.test b/tests/comments-in-var-def.test
similarity index 54%
copy from tests/txinfo18.test
copy to tests/comments-in-var-def.test
index 4df5257..b00ee6b 100755
--- a/tests/txinfo18.test
+++ b/tests/comments-in-var-def.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2002, 2008, 2009  Free Software Foundation, Inc.
+# Copyright (C) 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -14,52 +14,45 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Make sure we clean index files, even if they are not used at the top-level.
-# Only *new* indexes need to be declared at the top-level.
-# PR/375.
+# Make sure Automake ignores in-line comments when using variables,
+# but preserve them in the output.
 
-required='makeinfo tex texi2dvi'
 . ./defs || Exit 1
 
 set -e
 
-echo AC_OUTPUT >> configure.in
+cat >> configure.in <<'END'
+AC_OUTPUT
+END
 
+# Use a slash in the comment, because automake takes the dirname
+# of TEXINFO_TEX to compute $(am__TEXINFO_TEX_DIR).
 cat > Makefile.am << 'END'
+TEXINFO_TEX = tex/texinfo.tex    # some comment w/ a slash
 info_TEXINFOS = main.texi
-main_TEXINFOS = sub.texi
+.PHONY: test
+test:
+       test tex/texinfo.tex = $(TEXINFO_TEX)
+       test -d '$(am__TEXINFO_TEX_DIR)'
+       case '$(am__TEXINFO_TEX_DIR)' in tex|./tex) :;; *) exit 1;; esac
 END
 
 cat > main.texi << 'END'
 \input texinfo
 @setfilename main.info
address@hidden main
address@hidden au
address@hidden sa
address@hidden sb
address@hidden sa sb
address@hidden Top
-Hello walls.
address@hidden sub.texi
address@hidden
 END
 
-cat > sub.texi << 'END'
address@hidden foo
-foo
address@hidden bar
-bar
address@hidden baz
-baz
address@hidden sa
-sa
address@hidden sb
-sb
-END
+mkdir tex
+: > tex/texinfo.tex
 
 $ACLOCAL
-$AUTOMAKE --add-missing
-$AUTOCONF
+$AUTOMAKE
 
+grep TEX Makefile.in # for debugging
+grep '^TEXINFO_TEX *= *tex/texinfo\.tex  *# some comment w/ a slash *$' 
Makefile.in
+
+$AUTOCONF
 ./configure
-TAR_OPTIONS= $MAKE distcheck
+$MAKE test
+
+:
diff --git a/tests/compile_f_c_cxx.test b/tests/compile_f_c_cxx.test
index a995527..d1836fb 100755
--- a/tests/compile_f_c_cxx.test
+++ b/tests/compile_f_c_cxx.test
@@ -39,6 +39,8 @@ END
 : > foo.f
 : > bar.c
 : > baz.cc
+: > config.guess
+: > config.sub
 
 $ACLOCAL
 $AUTOMAKE
diff --git a/tests/cond13.test b/tests/cond13.test
index d8c4361..e5f6be9 100755
--- a/tests/cond13.test
+++ b/tests/cond13.test
@@ -33,7 +33,7 @@ cat > Makefile.am << 'END'
 noinst_LIBRARIES = libtest.a
 
 if COND1
-SOURCEVAR1 = 
+SOURCEVAR1 =
 SOURCEVAR2 = habla.cpp espanol.cpp
 else
 SOURCEVAR1 = dummy.cpp
diff --git a/tests/cond14.test b/tests/cond14.test
index 2779a3d..09701f7 100755
--- a/tests/cond14.test
+++ b/tests/cond14.test
@@ -33,7 +33,7 @@ BUILD_helldl = helldl
 helldl_SOURCES = dlmain.c
 helldl_DEPENDENCIES = libhello.la
 else
-BUILD_helldl = 
+BUILD_helldl =
 bin_SCRIPTS = helldl
 helldl$(EXEEXT):
        rm -f $@
diff --git a/tests/cond36.test b/tests/cond36.test
index 6f0df84..6826cd5 100755
--- a/tests/cond36.test
+++ b/tests/cond36.test
@@ -16,7 +16,6 @@
 
 # Check rules output for parser defined conditionally.
 
-required='lex yacc gcc'
 . ./defs || Exit 1
 
 set -e
@@ -59,3 +58,5 @@ $AUTOMAKE -Wno-error
 test `grep tparse.h: Makefile.in | wc -l` = 2
 grep '@address@hidden:' Makefile.in
 grep '@address@hidden:' Makefile.in
+
+:
diff --git a/tests/defs.in b/tests/defs.in
index 449e3e3..f7972d8 100644
--- a/tests/defs.in
+++ b/tests/defs.in
@@ -2,7 +2,7 @@
 # @configure_input@
 #
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
+# 2005, 2006, 2007, 2008, 2009, 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -34,6 +34,18 @@ else
   case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
 fi
 
+# A single whitespace character.
+sp=' '
+# A tabulation character.
+tab='  '
+# A newline character.
+nl='
+'
+
+# As autoconf-generated configure scripts do, ensure that IFS
+# is defined initially, so that saving and restoring $IFS works.
+IFS=$sp$tab$nl
+
 # Ensure we are running from the right directory.
 test -f ./defs || {
    echo "defs: not found in current directory" 1>&2
@@ -148,6 +160,14 @@ do
       echo "$me: running $CC -V -help"
       ( $CC -V -help ) || exit 77
       ;;
+    javac)
+      # The Java compiler from JDK 1.5 (and presumably earlier versions)
+      # cannot handle the `-version' option by itself: it bails out
+      # telling that source files are missing.  Adding also the `-help'
+      # option seems to solve the problem.
+      echo "$me: running javac -version -help"
+      javac -version -help || exit 77
+      ;;
     makedepend)
       echo "$me: running makedepend -f-"
       ( makedepend -f- ) || exit 77
@@ -262,7 +282,7 @@ Exit ()
 curdir=`pwd`
 testSubDir=$me.dir
 test ! -d $testSubDir || {
-  find $testSubDir -type d ! -perm -200 -exec chmod u+w {} ";"
+  find $testSubDir -type d ! -perm -700 -exec chmod u+rwx {} ";"
   rm -rf $testSubDir
 }
 mkdir $testSubDir
@@ -274,7 +294,7 @@ if test "$sh_errexit_works" = yes; then
     cd "$curdir"
     case $exit_status,$keep_testdirs in
     0,)
-      find $testSubDir -type d ! -perm -200 -exec chmod u+w {} ";"
+      find $testSubDir -type d ! -perm -700 -exec chmod u+rwx {} ";"
       rm -rf $testSubDir
       ;;
     esac
@@ -328,6 +348,7 @@ unset oldincludedir pdfdir psdir sbindir sharedstatedir 
sysconfdir
 # conceptually independent, they cause some changed semantics we
 # need to control (and test for) in some of the tests to ensure
 # backward-compatible behavior.
+unset TESTS_ENVIRONMENT
 unset DISABLE_HARD_ERRORS
 unset TESTS
 unset TEST_LOG_COMPILER
@@ -438,6 +459,35 @@ AUTOMAKE_fails ()
   AUTOMAKE_run 1 ${1+"$@"}
 }
 
+commented_sed_unindent_prog='
+  /^$/b                    # Nothing to do for empty lines.
+  x                        # Get x<indent> into pattern space.
+  /^$/{                    # No prior x<indent>, go prepare it.
+    g                      # Copy this 1st non-blank line into pattern space.
+    s/^\(['"$tab"' ]*\).*/x\1/   # Prepare x<indent> in pattern space.
+  }                        # Now: x<indent> in pattern and <line> in hold.
+  G                        # Build x<indent>\n<line> in pattern space, and
+  h                        # duplicate it into hold space.
+  s/\n.*$//                # Restore x<indent> in pattern space, and
+  x                        # exchange with the above duplicate in hold space.
+  s/^x\(.*\)\n\1//         # Remove leading <indent> from <line>.
+  s/^x.*\n//               # Restore <line> when there is no leading <indent>.
+'
+
+# unindent [input files...]
+# -------------------------
+# Remove the "proper" amount of leading whitespace from the given files,
+# and output the result on stdout.  That amount is determined by looking
+# at the leading whitespace of the first non-blank line in the input
+# files.  If no input file is specified, standard input is implied.
+unindent ()
+{
+  if test x"$sed_unindent_prog" = x; then
+    sed_unindent_prog=`printf '%s\n' "$commented_sed_unindent_prog" | sed -e 
"s/  *# .*//"`
+  fi
+  sed "$sed_unindent_prog" ${1+"$@"}
+}
+
 # Turn on shell traces.
 set -x
 
diff --git a/tests/depcomp10.test b/tests/depcomp10.test
new file mode 100755
index 0000000..0fa6c6a
--- /dev/null
+++ b/tests/depcomp10.test
@@ -0,0 +1,90 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# hp depmode should work with GNU make in VPATH mode (bug similar to
+# depcomp9.test).
+# For automake bug#8473.
+
+# Here's the bug: hp depmode will prefix VPATH to the object file name,
+# thus the second gmake will invoke depcomp with object='../../src/foo.o',
+# causing errors such as (broken on multiple lines for clarity):
+#   cpp: "", line 0: error 4066: Cannot create
+#        "../../gllib/.deps/nonblocking.TPo" file for
+#        "-M../../gllib/.deps/nonblocking.TPo" option.
+#        (No such file or directory[errno=2])
+
+required=GNUmake
+. ./defs || Exit 1
+
+mkdir src src/sub build
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_CONFIG_FILES([src/Makefile])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+SUBDIRS = src
+END
+
+cat > src/Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
+bin_PROGRAMS = foo
+foo_SOURCES = foo.c foo.h sub/subfoo.c
+END
+
+cat > src/foo.h <<EOF
+extern int subfoo (void);
+EOF
+
+cat >src/foo.c <<EOF
+#include "foo.h"
+int main (void)
+{
+  return subfoo ();
+}
+EOF
+
+cat >src/sub/subfoo.c <<EOF
+#include "foo.h"
+int subfoo (void)
+{
+  return 0;
+}
+EOF
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+cd build
+../configure am_cv_CC_dependencies_compiler_type=hp
+# Do not error out with the first make, as the forced 'hp' depmode might
+# not actually work, but we have overridden the _AM_DEPENDENCIES tests.
+$MAKE || Exit 77
+
+# We must clean and rebuild, as the actual error only happens the second
+# time the objects are built because 'depcomp' has silently messed up the
+# .Po files the first time.
+$MAKE clean
+
+$MAKE >out 2>&1 || { cat out; Exit 1; }
+cat out
+grep 'src/[._]deps' out && Exit 1
+
+:
diff --git a/tests/depcomp6.test b/tests/depcomp6.test
index 7fc651f..ea15e20 100755
--- a/tests/depcomp6.test
+++ b/tests/depcomp6.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2006, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2006, 2010, 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -47,7 +47,7 @@ cat >foo.c <<'END'
 #include "foo.h"
 #include "sub2/baz.h"
 #include <stdlib.h>
-int main() { printf("foo"); return bar() + baz(); }
+int main (void) { printf ("foo"); return bar () + baz (); }
 END
 
 cat >foo.h <<'END'
@@ -57,28 +57,28 @@ END
 
 cat >sub/bar.c <<'END'
 #include "sub/bar.h"
-int bar() { return 0; }
+int bar (void) { return 0; }
 END
 
 touch sub2/sub3/ba3.h
 
 cat >sub/bar.h <<'END'
 #include <stdio.h>
-extern int bar();
+extern int bar (void);
 END
 
 cat >sub2/baz.c <<'END'
 #include "baz.h"
-int baz() { return 0; }
+int baz (void) { return 0; }
 END
 
 cat >sub2/baz.h <<'END'
-extern int baz();
+extern int baz (void);
 END
 
 cat >sub2/sub3/ba3.c <<'END'
 #include "ba3.h"
-int ba3() { return 0; }
+int ba3 (void) { return 0; }
 END
 
 $ACLOCAL
@@ -88,17 +88,24 @@ $AUTOMAKE -a
 ./configure --enable-dependency-tracking
 $MAKE
 
-# check that dependency tracking works
-if grep 'depmode=none' Makefile; then :
-else
-  cd sub2
-  $sleep
-  echo 'choke me' > sub3/ba3.h
-  # Do not use `$MAKE && Exit 1' here, since even relatively-recent
-  # versions of the BSD shell wrongly exit when the `errexit' shell
-  # flag is active if a command within "&&" fails inside a compound
-  # statement.
-  if $MAKE; then Exit 1; else :; fi
+# Check that dependency tracking works.
+if grep 'depmode=none' Makefile; then
+  Exit 77
 fi
 
+cd sub2
+$sleep
+echo 'choke me' > sub3/ba3.h
+# Do not use `$MAKE && Exit 1' here, since even relatively-recent
+# versions of the BSD shell wrongly exit when the `errexit' shell
+# flag is active if a command within "&&" fails inside a compound
+# statement.
+if $MAKE; then Exit 1; else :; fi
+
+# Ensure the deleted header bug is fixed.
+rm -f sub3/ba3.h
+sed 1d sub3/ba3.c >sub3/ba3.t
+mv -f sub3/ba3.t sub3/ba3.c
+$MAKE
+
 :
diff --git a/tests/depcomp7.test b/tests/depcomp7.test
index 695041a..47f09fc 100755
--- a/tests/depcomp7.test
+++ b/tests/depcomp7.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2006, 2007, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2006, 2007, 2010, 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -48,7 +48,7 @@ cat >foo.c <<'END'
 #include "foo.h"
 #include "sub2/baz.h"
 #include <stdlib.h>
-int main() { printf("foo"); return bar() + baz(); }
+int main (void) { printf ("foo"); return bar () + baz (); }
 END
 
 cat >foo.h <<'END'
@@ -58,28 +58,28 @@ END
 
 cat >sub/bar.c <<'END'
 #include "sub/bar.h"
-int bar() { return 0; }
+int bar (void) { return 0; }
 END
 
 echo 'extern int x;' > sub2/sub3/ba3.h
 
 cat >sub/bar.h <<'END'
 #include <stdio.h>
-extern int bar();
+extern int bar (void);
 END
 
 cat >sub2/baz.c <<'END'
 #include "baz.h"
-int baz() { return 0; }
+int baz (void) { return 0; }
 END
 
 cat >sub2/baz.h <<'END'
-extern int baz();
+extern int baz (void);
 END
 
-cat >sub2/sub3/ba3.c <<'END'
+cat >sub2/sub3/ba3.in <<'END'
 #include "ba3.h"
-int ba3() { return 0; }
+int ba3 (void) { return 0; }
 END
 
 libtoolize
@@ -87,13 +87,18 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 
+st=0
 for staticshared in --disable-shared "" --disable-static; do
 
+  cp sub2/sub3/ba3.in sub2/sub3/ba3.c
   ./configure --enable-dependency-tracking $staticshared
   $MAKE
 
-  # check that dependency tracking works
-  if grep 'depmode=none' Makefile; then :
+  # If we cannot enable dependency tracking, perform only the most basic
+  # checks, and don't consider this test to be PASSed but SKIPped, because
+  # the main purpose of this test is exposing the depmode features.
+  if grep 'depmode=none' Makefile; then
+    st=77
   else
     cd sub2
     $sleep
@@ -103,6 +108,11 @@ for staticshared in --disable-shared "" --disable-static; 
do
     # flag is active if a command within "&&" fails inside a compound
     # statement.
     if $MAKE; then Exit 1; else :; fi
+
+    # Ensure the deleted header bug is fixed.
+    rm -f sub3/ba3.h
+    sed 1d sub3/ba3.in >sub3/ba3.c
+    $MAKE
     cd ..
   fi
 
@@ -114,4 +124,4 @@ for staticshared in --disable-shared "" --disable-static; do
 
 done
 
-:
+Exit $st
diff --git a/tests/depcomp9.test b/tests/depcomp9.test
new file mode 100755
index 0000000..9972c3d
--- /dev/null
+++ b/tests/depcomp9.test
@@ -0,0 +1,92 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# makedepend should work in VPATH mode.
+
+# Here's the bug: makedepend will prefix VPATH to the object file name,
+# thus the second make will invoke depcomp with object='../../src/foo.o',
+# causing errors such as:
+# touch: cannot touch `../../src/.deps/foo.TPo': No such file or directory
+# makedepend: error:  cannot open "../../src/.deps/foo.TPo"
+# ../../depcomp: line 560: ../../src/.deps/foo.TPo: No such file or directory
+
+# We include subfoo only to be sure that we don't remove too much
+# from the object file name.
+
+required='makedepend'
+. ./defs || Exit 1
+
+mkdir src src/sub build
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_CONFIG_FILES([src/Makefile])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+SUBDIRS = src
+END
+
+cat > src/Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
+bin_PROGRAMS = foo
+foo_SOURCES = foo.c foo.h sub/subfoo.c
+END
+
+cat > src/foo.h <<EOF
+extern int subfoo (void);
+EOF
+
+cat >src/foo.c <<EOF
+#include "foo.h"
+int main (void)
+{
+  return subfoo ();
+}
+EOF
+
+cat >src/sub/subfoo.c <<EOF
+#include "foo.h"
+int subfoo (void)
+{
+  return 0;
+}
+EOF
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+cd build
+../configure am_cv_CC_dependencies_compiler_type=makedepend
+
+# Do not error out with the first make, as the forced 'makedepend'
+# depmode might not actually work, but we have overridden the
+# _AM_DEPENDENCIES tests.
+$MAKE || Exit 77
+
+# We must clean and rebuild, as the actual error only happens the second
+# time the objects are built because 'makedepend' has silently messed up
+# the .Po files the first time.
+$MAKE clean
+
+$MAKE >out 2>&1 || { cat out; Exit 1; }
+cat out
+grep 'src/[._]deps' out && Exit 1
+
+:
diff --git a/tests/include2.test b/tests/dist-included-parent-dir.test
similarity index 100%
rename from tests/include2.test
rename to tests/dist-included-parent-dir.test
diff --git a/tests/flibs.test b/tests/flibs.test
index b9fe541..d35c4c6 100755
--- a/tests/flibs.test
+++ b/tests/flibs.test
@@ -48,6 +48,8 @@ zardoz_LDADD = @FLIBS@
 END
 
 : > zardoz.f
+: > config.guess
+: > config.sub
 
 $ACLOCAL
 $AUTOMAKE
diff --git a/tests/fn99.test b/tests/fn99.test
index 982a989..a63f2ca 100755
--- a/tests/fn99.test
+++ b/tests/fn99.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2004, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2004, 2008, 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -34,6 +34,9 @@ do
   touch x
 done) || Exit 77
 
+# AIX 5.3 `cp -R' is too buggy for `make dist'.
+cp -R 12345678 t || Exit 77
+
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
diff --git a/tests/fn99subdir.test b/tests/fn99subdir.test
index 465f2af..33ac663 100755
--- a/tests/fn99subdir.test
+++ b/tests/fn99subdir.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2006, 2008, 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -55,6 +55,9 @@ do
   touch x
 done)
 
+# AIX 5.3 `cp -R' is too buggy for `make dist'.
+cp -R ${subdirname} t || Exit 77
+
 for init_dir in ${subdirname} .; do
        (
                cd ${init_dir} || Exit 1
diff --git a/tests/fort4.test b/tests/fort4.test
index 605a377..84df399 100755
--- a/tests/fort4.test
+++ b/tests/fort4.test
@@ -62,12 +62,12 @@ cat >Makefile.am <<'END'
 bin_PROGRAMS = hello goodbye
 hello_SOURCES = hello.f foo.f90 sub/bar.f90
 goodbye_SOURCES = bye.f90 sub/baz.f
-goodbye_FCFLAGS = 
+goodbye_FCFLAGS =
 LDADD = $(FCLIBS)
 END
 
 $ACLOCAL
-$AUTOMAKE
+$AUTOMAKE -a
 # The Fortran 77 linker should be preferred:
 grep '.\$(FCLINK)' Makefile.in && Exit 1
 
diff --git a/tests/fort5.test b/tests/fort5.test
index cd2a7d5..d6151a7 100755
--- a/tests/fort5.test
+++ b/tests/fort5.test
@@ -70,7 +70,7 @@ hello_LDADD = libhello.la
 libhello_la_SOURCES = foo.f90 sub/bar.f90
 libhello_la_LIBADD = libgoodbye.la
 libgoodbye_la_SOURCES = bye.f90 sub/baz.f
-libgoodbye_la_FCFLAGS = 
+libgoodbye_la_FCFLAGS =
 LDADD = $(FCLIBS)
 END
 
diff --git a/tests/include.test b/tests/hdr-vars-defined-once.test
similarity index 100%
rename from tests/include.test
rename to tests/hdr-vars-defined-once.test
diff --git a/tests/help-regex.test b/tests/help-python.test
similarity index 77%
copy from tests/help-regex.test
copy to tests/help-python.test
index 3eff5f9..ba20013 100755
--- a/tests/help-regex.test
+++ b/tests/help-python.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2010 Free Software Foundation, Inc.
+# Copyright (C) 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -14,8 +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/>.
 
-# Make sure that obsolescent macro `AM_WITH_REGEX' adds proper text to
-# the configure help screen.
+# Make sure that macro `AM_PATH_PYTHON' adds proper text to the
+# configure help screen.
 
 . ./defs || Exit 1
 
@@ -23,7 +23,7 @@ set -e
 
 cat > configure.in <<END
 AC_INIT([$me], [1.0])
-AM_WITH_REGEX
+AM_PATH_PYTHON
 END
 
 $ACLOCAL
@@ -32,7 +32,6 @@ $AUTOCONF
 ./configure --help >stdout || { cat stdout; Exit 1; }
 cat stdout
 
-$FGREP ' --without-regex ' stdout
-$FGREP ' use GNU rx ' stdout
+grep '^  *PYTHON  *the Python interpreter$' stdout
 
 :
diff --git a/tests/instdir-java.test b/tests/instdir-java.test
index 6adc82e..9d9a03c 100755
--- a/tests/instdir-java.test
+++ b/tests/instdir-java.test
@@ -16,13 +16,12 @@
 
 # If $(javadir) is the empty string, then nothing should be installed there.
 
+required=javac
 . ./defs || Exit 1
 
 set -e
 
 cat >>configure.in <<'END'
-AC_CHECK_PROG([HAS_JAVAC], [javac], [:], [exit])
-($HAS_JAVAC 77); $HAS_JAVAC 77
 AC_OUTPUT
 END
 
diff --git a/tests/instdir-texi.test b/tests/instdir-texi.test
index 50617c8..8210535 100755
--- a/tests/instdir-texi.test
+++ b/tests/instdir-texi.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2009  Free Software Foundation, Inc.
+# Copyright (C) 2009, 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -20,9 +20,8 @@
 required='makeinfo-html tex texi2dvi'
 . ./defs || Exit 1
 
-(dvips --help 2>/dev/null >/dev/null) || Exit 77
-(pdfetex --help 2>/dev/null >/dev/null) ||
-  (pdftex --help 2>/dev/null >/dev/null) || Exit 77
+dvips --help || Exit 77
+pdfetex --help || pdftex --help || Exit 77
 
 set -e
 
@@ -54,6 +53,7 @@ mkdir build
 cd build
 ../configure --prefix="$instdir"
 $MAKE all dvi ps pdf html
+ls -l
 
 infodir= htmldir= dvidir= psdir= pdfdir=
 export infodir htmldir dvidir psdir pdfdir
@@ -67,4 +67,5 @@ $MAKE -e uninstall > stdout || { cat stdout; Exit 1; }
 cat stdout
 grep 'rm -f' stdout && Exit 1
 $MAKE -e uninstall DESTDIR="$destdir"
+
 :
diff --git a/tests/instfail-java.test b/tests/instfail-java.test
index 2cb8afb..8f527cf 100755
--- a/tests/instfail-java.test
+++ b/tests/instfail-java.test
@@ -19,13 +19,12 @@
 
 # This is the java sister test of instfail.test.
 
+required=javac
 . ./defs || Exit 1
 
 set -e
 
 cat >>configure.in <<'END'
-AC_CHECK_PROG([HAS_JAVAC], [javac], [:], [exit])
-($HAS_JAVAC 77); $HAS_JAVAC 77
 AC_OUTPUT
 END
 
diff --git a/tests/instsh2.test b/tests/instsh2.test
index 778c1a3..927edeb 100755
--- a/tests/instsh2.test
+++ b/tests/instsh2.test
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 2002, 2004, 2006, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2004, 2006, 2008, 2011 Free Software Foundation,
+# Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -77,9 +78,40 @@ test -f d3/y
 ./install-sh -T x d3 && Exit 1
 ./install-sh -T x d4// && Exit 1
 
-# Ensure that install-sh works with names that include spaces
+# Ensure that install-sh works with names that include spaces.
 touch 'a  b'
 mkdir 'x  y'
 ./install-sh 'a  b' 'x  y'
 test -f x\ \ y/a\ \ b
 test -f 'a  b'
+
+# Ensure we do not run into `test' operator precedence bugs with Tru64 sh.
+for c in = '(' ')' '!'; do
+  ./install-sh $c 2>stderr && { cat stderr >&2; Exit 1; }
+  cat stderr >&2
+  grep 'test: ' stderr && Exit 1
+  # Skip tests if the file system is not capable.
+  mkdir ./$c || continue
+  rmdir ./$c
+  ./install-sh -d $c/$c/$c
+  rm -rf ./$c
+  ./install-sh -d $c d5/$c/$c
+  test -d ./$c
+  test -d d5/$c/$c
+  ./install-sh x $c
+  test -f ./$c/x
+  rm -f ./$c/x
+  ./install-sh -t $c x
+  test -f ./$c/x
+  rm -rf ./$c
+  ( : > ./$c ) || continue
+  ./install-sh $c x d5/$c/$c
+  test -f d5/$c/$c/x
+  test -f d5/$c/$c/$c
+  rm -f d5/$c/$c/?
+  ./install-sh -t d5/$c/$c $c x
+  test -f d5/$c/$c/x
+  test -f d5/$c/$c/$c
+done
+
+:
diff --git a/tests/instspc.test b/tests/instspc.test
index 414b3e5..7d00788 100755
--- a/tests/instspc.test
+++ b/tests/instspc.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2004, 2005, 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -135,9 +135,13 @@ do
 
     cd "$build"
 
+    # Some make implementations eliminate leading and trailing whitespace
+    # from macros passed on the command line, and some eliminate leading
+    # whitespace from macros set from environment variables, so prepend
+    # './' and use the latter here.
     ../configure --prefix "/$file-prefix" &&
     $MAKE &&
-    DESTDIR=$dest file=$file $MAKE -e test-install-sep ||
+    DESTDIR=$dest file=./$file $MAKE -e test-install-sep ||
       eval "${test}_failures=\"\$${test}_failures$lf\$file\""
 
     cd ..
diff --git a/tests/yacc-weirdnames.test b/tests/java-check.test
similarity index 53%
copy from tests/yacc-weirdnames.test
copy to tests/java-check.test
index 8f0424e..a67b4e8 100755
--- a/tests/yacc-weirdnames.test
+++ b/tests/java-check.test
@@ -14,43 +14,53 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Check that yacc sources with many dots in their name are handled
-# correctly.
+# Make sure that check_JAVA causes *.class files to be built only with
+# "make check", and not also with "make all".
+# See automake bug#8234.
 
+required=javac
 . ./defs || Exit 1
 
 set -e
 
 cat >> configure.in << 'END'
-AC_PROG_CC
-AC_PROG_CXX
-AC_PROG_YACC
 AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
-bin_PROGRAMS = foo bar foo2 bar2
-
-foo_SOURCES = parse.y.y
-bar_SOURCES = parse.s.f..y
-bar_YFLAGS = -d
+check_JAVA = One.java Two.java
+END
 
-foo2_SOURCES = parse..5.y++
-bar2_SOURCES = parse.yxx.yy
-bar2_YFLAGS = -d
+cat > One.java <<'END'
+class One { }
 END
 
-outputs=' parse.y.c      bar-parse.s.f..c   bar-parse.s.f..h
-          parse..5.c++   bar2-parse.yxx.cc  bar2-parse.yxx.hh '
+cat > Two.java <<'END'
+class Two { // Deliberately missing closing bracket.
+END
 
 $ACLOCAL
-$AUTOMAKE -a
+$AUTOCONF
+$AUTOMAKE
+
+inst=`pwd`/_inst
+
+./configure --prefix="$inst"
+
+$MAKE
+ls | $EGREP '\.(class|stamp)$' && Exit 1
 
-$EGREP '(\.[ch]|parse)' Makefile.in # For debugging.
+# Make Two.java compilable.
+echo '}' >> Two.java
 
-# All expected files should be mentioned in the generated Makefile.in.
-for s in $outputs; do
-  $FGREP $s Makefile.in
-done
+# "make check" should compile files in $(check_JAVA) ...
+$MAKE check
+ls -l # for debugging
+test -f One.class
+test -f Two.class
+# ... but should *not* install them.
+$FGREP checkdir Makefile && Exit 1
+$MAKE install
+test -d _inst && Exit 1
 
 :
diff --git a/tests/java.test b/tests/java.test
index d5210cd..cae56dc 100755
--- a/tests/java.test
+++ b/tests/java.test
@@ -16,13 +16,12 @@
 
 # Minimal test of Java functionality.
 
+required=javac
 . ./defs || Exit 1
 
 set -e
 
 cat >>configure.in <<'EOF'
-AC_CHECK_PROG([HAS_JAVAC], [javac], [:], [exit])
-($HAS_JAVAC 77); $HAS_JAVAC 77
 AC_OUTPUT
 EOF
 
diff --git a/tests/target-cflags.test b/tests/lex-subobj-nodep.test
similarity index 55%
copy from tests/target-cflags.test
copy to tests/lex-subobj-nodep.test
index b324568..4449715 100755
--- a/tests/target-cflags.test
+++ b/tests/lex-subobj-nodep.test
@@ -1,6 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2000, 2001, 2002, 2004, 2010 Free Software Foundation,
-# Inc.
+# Copyright (C) 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -15,60 +14,60 @@
 # 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 target specific CFLAGS work
-# Assar Westerlund <address@hidden>
+# Ensure subdirs for subdir scanners are generated when subdir-objects
+# are used, even when dependency tracking is disabled.
 
-required=gcc
+required=flex
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT(foo.c)
-AM_INIT_AUTOMAKE(target-cflags,0.0)
+set -e
+
+cat >>configure.in <<\END
 AC_PROG_CC
 AM_PROG_CC_C_O
-AC_OUTPUT(Makefile)
+AC_PROG_LEX
+AC_OUTPUT
 END
 
-cat > Makefile.am << 'END'
-AUTOMAKE_OPTIONS = no-dependencies
-
-bin_PROGRAMS = foo bar
-foo_CFLAGS   = -DFOO
+cat >Makefile.am <<\END
+AUTOMAKE_OPTIONS = subdir-objects
+bin_PROGRAMS = p1 p2
+p1_SOURCES = sub1/s1.l
+p2_SOURCES = sub2/s2.l
+p2_CPPFLAGS = -DWHATEVER
 END
 
-cat > foo.c << 'END'
-#include <stdio.h>
-#ifdef FOO
-int main(void) {
+mkdir sub1 sub2
+
+cat >sub1/s1.l <<\END
+%%
+"END"   return EOF;
+.
+%%
+int main (void)
+{
+  while (yylex () != EOF)
+    ;
   return 0;
 }
-#endif
-END
 
-cat > bar.c << 'END'
-#ifndef FOO
-int main(void)
+int yywrap(void)
 {
   return 0;
 }
-#endif
 END
 
-set -e
+cp sub1/s1.l sub2/s2.l
 
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 mkdir build
-
 cd build
-../configure
+../configure --disable-dependency-tracking
+$MAKE sub1/s1.c
+$MAKE sub2/s2.c
+rm -rf sub1 sub2
 $MAKE
-./foo
-./bar
-cd ..
 
-./configure
-$MAKE
-./foo
-./bar
+:
diff --git a/tests/libtool4.test b/tests/libtool4.test
index bcc9b0f..9f6a730 100755
--- a/tests/libtool4.test
+++ b/tests/libtool4.test
@@ -20,10 +20,17 @@
 
 set -e
 
+cat >> configure.in <<'END'
+AC_PROG_CC
+END
+
 cat > Makefile.am << 'END'
 EXTRA_LTLIBRARIES = liblib.la
 END
 
 $ACLOCAL
 AUTOMAKE_fails
-grep AC_PROG_LIBTOOL stderr
+grep '[Ll]ibtool library .*LIBTOOL.* undefined' stderr
+grep 'define .*LIBTOOL.* add .*LT_INIT' stderr
+
+:
diff --git a/tests/ltinit.test b/tests/ltinit.test
new file mode 100755
index 0000000..b4eaad6
--- /dev/null
+++ b/tests/ltinit.test
@@ -0,0 +1,64 @@
+#!/bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Test that libtool support works correctly when "newer" libtool
+# interface (with LT_INIT etc.) is used (this interface has been
+# present since libtool 1.9b, circa 2004).
+
+required='libtoolize'
+. ./defs || Exit 1
+
+set -e
+
+cat >>configure.in <<'END'
+AC_PROG_CC
+dnl Older libtool versions don't define LT_PREREQ :-(
+m4_ifdef([LT_PREREQ],
+    [LT_PREREQ([2.0])],
+    [m4_fatal([Libtool version too old], [63])])
+LT_INIT([dlopen])
+AC_OUTPUT
+END
+
+cat >Makefile.am <<'END'
+lib_LTLIBRARIES = libfoo.la
+END
+
+cat > libfoo.c <<'END'
+int foo (void)
+{
+  return 1;
+}
+END
+
+libtoolize
+# Skip if older libtool (pre-2.0) is used.
+{ $ACLOCAL && $AUTOCONF; } || {
+  if test $? -eq 63; then Exit 77; else Exit 1; fi
+}
+$EGREP 'LT_(INIT|PREREQ)' configure && Exit 1 # Sanity check.
+$AUTOMAKE -a
+
+cwd=`pwd`
+./configure --prefix="$cwd/inst" >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep '^checking.*dlopen' stdout
+
+$MAKE
+$MAKE install
+$MAKE distcheck
+
+:
diff --git a/tests/sinclude.test b/tests/m4-inclusion.test
similarity index 83%
rename from tests/sinclude.test
rename to tests/m4-inclusion.test
index cc8898b..025d44f 100755
--- a/tests/sinclude.test
+++ b/tests/m4-inclusion.test
@@ -20,13 +20,7 @@
 
 set -e
 
-# Overwrite configure.in, because the default uses `sinclude' as package
-# name and this play havoc with Autoconf on some platforms (`sinclude'
-# is an m4 macro).
-cat > configure.in <<EOF
-AC_INIT([amsinclude], [1.0])
-AM_INIT_AUTOMAKE
-AC_CONFIG_FILES([Makefile])
+cat >> configure.in <<'EOF'
 sinclude([doesntexist.m4])
 EOF
 
diff --git a/tests/maintclean.test b/tests/maintclean-vpath.test
similarity index 64%
copy from tests/maintclean.test
copy to tests/maintclean-vpath.test
index a66464b..8dd2a95 100755
--- a/tests/maintclean.test
+++ b/tests/maintclean-vpath.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -15,27 +15,36 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Make sure distclean and maintainer-clean erase the right files.
+# This test is for VPATH builds; see sister test `maintclean-vpath.test'
+# for in-tree builds.
 
 . ./defs || Exit 1
 
 set -e
 
 cat >> configure.in << 'END'
-AC_CONFIG_FILES(bar)
+AC_CONFIG_FILES([bar sub/Makefile])
 AC_OUTPUT
 END
 
 cat > Makefile.am <<'END'
+SUBDIRS = sub
 noinst_DATA = foo.c
-
 foo.c:
        touch foo.c
-
 MAINTAINERCLEANFILES = foo.c
+END
 
+mkdir sub
+cat > sub/Makefile.am <<'END'
+noinst_SCRIPTS = zap
+zap: zap.sh
+       cp $(srcdir)/zap.sh $@ && chmod a+x $@
+MAINTAINERCLEANFILES = zap
 END
 
-touch bar.in
+: > bar.in
+: > sub/zap.sh
 
 $ACLOCAL
 $AUTOCONF
@@ -43,34 +52,55 @@ $AUTOMAKE
 
 # Users can disable autom4te.cache.
 if test -d autom4te.cache; then
-  test_cache='test -d autom4te.cache'
+  test_cache='test -d ../autom4te.cache'
 else
   test_cache=:
 fi
 
-# Since we don't require Yacc, make sure it's not used.
-./configure YACC=false
+mkdir build
+
+chmod a-w . sub
+
+cd build
+
+../configure
 test -f bar
 
 $MAKE
 test -f foo.c
+test -f sub/zap
+$test_cache
 
 $MAKE distclean
 test ! -f bar
 test ! -f Makefile
+test ! -f sub/Makefile
 test ! -f config.status
 test -f foo.c
+test -f sub/zap
+test -f ../sub/zap.sh
 $test_cache
 
-./configure
+../configure
 test -f bar
 
 $MAKE foo.c
 test -f foo.c
+cd sub
+$MAKE zap
+test -f zap
+cd ..
+
+chmod u+w ..
 
 $MAKE maintainer-clean
+test -f ../sub/zap.sh
 test ! -f bar
 test ! -f foo.c
+test ! -f sub/zap
 test ! -f Makefile
+test ! -f sub/Makefile
 test ! -f config.status
-test ! -d autom4te.cache
+test ! -d ../autom4te.cache
+
+:
diff --git a/tests/maintclean.test b/tests/maintclean.test
index a66464b..9e22463 100755
--- a/tests/maintclean.test
+++ b/tests/maintclean.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -15,27 +15,36 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Make sure distclean and maintainer-clean erase the right files.
+# This test is for in-tree builds; see sister test `maintclean-vpath.test'
+# for VPATH builds.
 
 . ./defs || Exit 1
 
 set -e
 
 cat >> configure.in << 'END'
-AC_CONFIG_FILES(bar)
+AC_CONFIG_FILES([bar sub/Makefile])
 AC_OUTPUT
 END
 
 cat > Makefile.am <<'END'
+SUBDIRS = sub
 noinst_DATA = foo.c
-
 foo.c:
        touch foo.c
-
 MAINTAINERCLEANFILES = foo.c
+END
 
+mkdir sub
+cat > sub/Makefile.am <<'END'
+noinst_SCRIPTS = zap
+zap: zap.sh
+       cp $(srcdir)/zap.sh $@ && chmod a+x $@
+MAINTAINERCLEANFILES = zap
 END
 
-touch bar.in
+: > bar.in
+: > sub/zap.sh
 
 $ACLOCAL
 $AUTOCONF
@@ -48,18 +57,22 @@ else
   test_cache=:
 fi
 
-# Since we don't require Yacc, make sure it's not used.
-./configure YACC=false
+./configure
 test -f bar
 
 $MAKE
 test -f foo.c
+test -f sub/zap
+$test_cache
 
 $MAKE distclean
 test ! -f bar
 test ! -f Makefile
+test ! -f sub/Makefile
 test ! -f config.status
 test -f foo.c
+test -f sub/zap
+test -f sub/zap.sh
 $test_cache
 
 ./configure
@@ -67,10 +80,19 @@ test -f bar
 
 $MAKE foo.c
 test -f foo.c
+cd sub
+$MAKE zap
+test -f zap
+cd ..
 
 $MAKE maintainer-clean
+test -f sub/zap.sh
 test ! -f bar
 test ! -f foo.c
+test ! -f sub/zap
 test ! -f Makefile
+test ! -f sub/Makefile
 test ! -f config.status
 test ! -d autom4te.cache
+
+:
diff --git a/tests/check6.test b/tests/parallel-tests-subdir.test
similarity index 66%
copy from tests/check6.test
copy to tests/parallel-tests-subdir.test
index e32499c..18695fe 100755
--- a/tests/check6.test
+++ b/tests/parallel-tests-subdir.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2006  Free Software Foundation, Inc.
+# Copyright (C) 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -14,41 +14,38 @@
 # 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 for PR 400: XFAIL_TESTS delimited by TABs.
-# Also test that Solaris make VPATH rewriting is honored
+# Check that the parallel-tests driver creates parent directories for
+# the log files when needed.
 
+parallel_tests=yes
 . ./defs || Exit 1
 
 set -e
 
 cat >> configure.in << 'END'
-AC_PROG_CC
 AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
-TESTS = $(XFAIL_TESTS)
-XFAIL_TESTS = a        b       c
+TESTS = dir1/foo.test dir2/dir3/foo.test
+TEST_LOG_COMPILER = sh
 END
 
-cat >>a <<'END'
-#! /bin/sh
-exit 1
-END
-
-cp a b
-cp a c
-
-chmod a+x a b c
+mkdir dir1 dir2 dir2/dir3
+echo : > dir1/foo.test
+echo : > dir2/dir3/foo.test
 
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 
-./configure
-$MAKE check
-$MAKE distclean
 mkdir build
 cd build
 ../configure
 $MAKE check
+find . # For debugging.
+test -f test-suite.log
+test -f dir1/foo.log
+test -f dir2/dir3/foo.log
+
+:
diff --git a/tests/parallel-tests4.test 
b/tests/parallel-tests-unreadable-log.test
similarity index 55%
copy from tests/parallel-tests4.test
copy to tests/parallel-tests-unreadable-log.test
index efe7e8d..572f03d 100755
--- a/tests/parallel-tests4.test
+++ b/tests/parallel-tests-unreadable-log.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2009, 2010  Free Software Foundation, Inc.
+# Copyright (C) 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -14,56 +14,47 @@
 # 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 parallel-tests features:
-# - suffix rules
+# Check that the testsuite driver copes well with unreadable test logs.
 
 parallel_tests=yes
 . ./defs || Exit 1
-set -e
 
 cat >> configure.in << 'END'
-AC_PROG_CC
 AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
-## Note that automake should not match the '/test' part
-## of 'sub/test' as '.test' suffix.
-TESTS = foo.chk bar.test $(check_PROGRAMS) sub/test
-check_PROGRAMS = baz bla.test bli.suff
-TEST_EXTENSIONS = .chk .test
+TESTS = foo.test bar.test
+XFAIL_TESTS = bar.test
 END
 
-mkdir sub
-
-cat >foo.chk << 'END'
+cat > foo.test << 'END'
 #! /bin/sh
 exit 0
 END
-chmod a+x foo.chk
-cp foo.chk bar.test
-cp foo.chk sub/test
-
-cat >baz.c << 'END'
-int main (void)
-{
-  return 0;
-}
+cat > bar.test << 'END'
+#! /bin/sh
+exit 1
 END
-cp baz.c bla.c
-cp baz.c bli.c
+chmod a+x foo.test bar.test
 
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 
+# The testsuite driver will use this variable, so ensure it sanitizes
+# it and do not allow in spurious values from the environment.
+line=PASS; export line
+
 ./configure
-$MAKE
-$MAKE check
-test -f foo.log
-test -f bar.log
-test -f baz.log
-test -f bla.log
-test -f bli.suff.log
-test -f sub/test.log
+
+$MAKE foo.log
+$MAKE bar.log
+chmod a-r foo.log bar.log
+test ! -r foo.log || Exit 77
+$MAKE test-suite.log >stdout && { cat stdout; Exit 1; }
+cat stdout
+grep '^2 of 2 tests failed *$' stdout
+grep '^2 of 2 tests failed\. *$' test-suite.log
+
 :
diff --git a/tests/parallel-tests.test b/tests/parallel-tests.test
index 29111c2..399b23b 100755
--- a/tests/parallel-tests.test
+++ b/tests/parallel-tests.test
@@ -41,14 +41,19 @@ foo.log: bar.log
 bar.log: baz.log
 END
 
+# foo.test and bar.test sleep to ensure their logs are always strictly newer
+# than the logs of their prerequisites, for HP-UX make.  The quoting pleases
+# maintainer-check.
 cat >>foo.test <<'END'
 #! /bin/sh
 echo "this is $0"
+sleep '1'
 exit 0
 END
 cat >>bar.test <<'END'
 #! /bin/sh
 echo "this is $0"
+sleep '1'
 exit 99
 END
 cat >>baz.test <<'END'
diff --git a/tests/parallel-tests8.test b/tests/parallel-tests8.test
index 43e67df..524b82b 100755
--- a/tests/parallel-tests8.test
+++ b/tests/parallel-tests8.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2009, 2010  Free Software Foundation, Inc.
+# Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -39,7 +39,7 @@ TESTS = foo.test
 TESTS += $(srcdir)/bar.test $(top_srcdir)/baz.test
 .in.test:
 ## Account for VPATH issues on weaker make implementations (e.g. IRIX 6.5)
-       cp `test -f $< || echo $(srcdir)/`$< $@
+       cp `test -f '$<' || echo $(srcdir)/`$< $@
        chmod +x $@
 check_SCRIPTS = $(TESTS)
 EXTRA_DIST = foo.in foo.test
diff --git a/tests/pr8365-remake-timing.test b/tests/pr8365-remake-timing.test
new file mode 100755
index 0000000..079b0c0
--- /dev/null
+++ b/tests/pr8365-remake-timing.test
@@ -0,0 +1,110 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Test for automake bug#8365, related to Makefile remake rules.
+# The bug is due to subtle timestamp issues and limitations in
+# make's behaviour, and is very unlikely to be triggered (we have
+# to resort to timestamp edit hacks to consistently expose it); in
+# any account, it is nigh to impossible to trigger it by running
+# make by hand.  Thus, fixing it would not be worth the hassle, but
+# we prefer to keep it exposed anyway.
+
+. ./defs || Exit 1
+
+set -e
+
+# We'll use calls to stat to get debugging information.
+if stat /dev/null; then stat=stat; else stat=:; fi
+
+cat >> configure.in << 'END'
+FOOBAR=zardoz
+AC_OUTPUT
+END
+
+: > Makefile.am
+
+$ACLOCAL
+# Run automake *before* autoconf, because we want to ensure that
+# Makefile.in is not newer than configure.
+$AUTOMAKE
+$AUTOCONF
+
+./configure
+$MAKE Makefile
+$EGREP 'FOOBAR|zardoz' Makefile && Exit 99 # Sanity check.
+
+echo 'AC_SUBST([FOOBAR])' >> configure.in
+
+# Modified configure dependencies must have the same timestamp of
+# config.status and Makefile in order to trigger the bug.
+# We also re-touch config.status, because "touch -r" can truncate
+# timestamps on file systems with sub-second resolutions (see the
+# autoconf manual).  Finally, we also sleep before touching, to ensure
+# that the (possibly truncated) timestamps of config.status etc. are
+# strictly newer than the non-truncated configure timestamp.
+$stat config.status Makefile configure.in
+$sleep
+touch config.status
+touch -r config.status config.status Makefile configure.in
+$stat config.status Makefile configure.in
+
+# Also, the race condition is triggered only when aclocal, automake
+# and aclocal run fast enough to keep the timestamp of the generated
+# aclocal.m4, Makefile.in and configure equal to the timestamp of
+# Makefile & config.status.  To reproduce this race consistently, we
+# need the following hackish wrappers.
+
+save_AUTOCONF=$AUTOCONF
+
+cat > aclocal-wrap <<END
+#!/bin/sh
+set -ex
+# aclocal shouldn't use our autoconf wrapper when extracting
+# the races from configure.in.
+AUTOCONF='$save_AUTOCONF'; export AUTOCONF
+$ACLOCAL "\$@"
+touch -r config.status aclocal.m4
+$stat aclocal.m4
+END
+
+cat > automake-wrap <<END
+#!/bin/sh
+set -ex
+# automake shouldn't use our autoconf wrapper when extracting
+# the races from configure.in.
+AUTOCONF='$save_AUTOCONF'; export AUTOCONF
+$AUTOMAKE "\$@"
+touch -r config.status Makefile.in
+$stat Makefile.in
+END
+
+cat > autoconf-wrap <<END
+#!/bin/sh
+set -ex
+$AUTOCONF "\$@"
+touch -r config.status configure
+$stat configure
+END
+
+chmod a+x aclocal-wrap automake-wrap autoconf-wrap
+
+env \
+  ACLOCAL=./aclocal-wrap AUTOMAKE=./automake-wrap AUTOCONF=./autoconf-wrap \
+  $MAKE -e Makefile
+grep '^FOOBAR =' Makefile.in
+grep '^FOOBAR *= *zardoz *$' Makefile
+
+:
diff --git a/tests/specflg-dummy.test b/tests/specflg-dummy.test
new file mode 100755
index 0000000..614d6c2
--- /dev/null
+++ b/tests/specflg-dummy.test
@@ -0,0 +1,248 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check that even "dummy" per-target flags triggers the use of renamed
+# objects.  I.e., a definition like `foo_CFLAGS = $(AM_CFLAGS)' should
+# always cause Automake to trigger the semantics for per-target CFLAGS,
+# even if AM_CFLAGS is undefined. Similarly for other *FLAGS variables
+# (CXXFLAGS, YFLAGS, LDFLAGS, ...)
+
+. ./defs || Exit 1
+
+set -e
+
+# Disable shell globbing if possible.
+(set +f) >/dev/null 2>&1 && set +f
+
+oIFS=$IFS
+nl='
+'
+
+matches=
+add_match ()
+{
+  matches="$matches$nl$1"
+}
+
+do_check ()
+{
+  IFS=$nl
+  for string in $matches; do
+    IFS=$oIFS
+    $FGREP "$string" Makefile.in
+  done
+  IFS=$oIFS
+}
+
+# Fake libtool presence, so that we won't have to require it.
+cat > acinclude.m4 <<END
+AC_DEFUN([AC_PROG_LIBTOOL], [AC_SUBST([LIBTOOL], [dummy])])
+END
+: > ltmain.sh
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_CXX
+AC_PROG_YACC
+AC_PROG_LEX
+AC_PROG_F77
+AC_PROG_FC
+AM_PROG_GCJ
+AC_PROG_RANLIB
+AC_PROG_LIBTOOL
+AM_PROG_UPC
+AC_PROG_OBJC
+AM_PROG_CC_C_O
+END
+
+cat > Makefile.am <<'END'
+bin_PROGRAMS =
+lib_LIBRARIES =
+lib_LTLIBRARIES =
+END
+
+$ACLOCAL
+
+cat >> Makefile.am <<'END'
+bin_PROGRAMS += prog1
+prog1_SOURCES = source1.c
+prog1_CFLAGS = $(AM_CFLAGS)
+END
+
+add_match 'prog1-source1.$(OBJEXT)'
+
+cat >> Makefile.am <<'END'
+bin_PROGRAMS += prog2
+prog2_SOURCES = source2.c
+prog2_CPPFLAGS = $(AM_CPPFLAGS)
+END
+
+add_match 'prog2-source2.$(OBJEXT)'
+
+cat >> Makefile.am <<'END'
+bin_PROGRAMS += prog3
+prog3_SOURCES = source3.cxx
+prog3_CXXFLAGS = $(AM_CXXFLAGS)
+END
+
+add_match 'prog3-source3.$(OBJEXT)'
+
+cat >> Makefile.am <<'END'
+bin_PROGRAMS += prog4
+prog4_SOURCES = source4.c++
+prog4_CPPFLAGS = $(AM_CPPFLAGS)
+END
+
+add_match 'prog4-source4.$(OBJEXT)'
+
+cat >> Makefile.am <<'END'
+bin_PROGRAMS += prog5
+prog5_SOURCES = source5.f
+prog5_FFLAGS = $(AM_FFLAGS)
+END
+
+add_match 'prog5-source5.$(OBJEXT)'
+
+cat >> Makefile.am <<'END'
+bin_PROGRAMS += prog6
+prog6_SOURCES = source6.f90
+prog6_FCFLAGS = $(AM_FCFLAGS)
+END
+
+add_match 'prog6-source6.$(OBJEXT)'
+
+cat >> Makefile.am <<'END'
+bin_PROGRAMS += prog7
+prog7_SOURCES = source7.r
+prog7_RFLAGS = $(AM_RFLAGS)
+END
+
+add_match 'prog7-source7.$(OBJEXT)'
+
+cat >> Makefile.am <<'END'
+bin_PROGRAMS += prog8
+prog8_SOURCES = source8.java
+prog8_GCJFLAGS = $(AM_GCJFLAGS)
+END
+
+add_match 'prog8-source8.$(OBJEXT)'
+
+cat >> Makefile.am <<'END'
+bin_PROGRAMS += prog9
+prog9_SOURCES = source9.upc
+prog9_UPCFLAGS = $(AM_UPCFLAGS)
+END
+
+add_match 'prog9-source9.$(OBJEXT)'
+
+cat >> Makefile.am <<'END'
+bin_PROGRAMS += prog10
+prog10_SOURCES = source10.m
+prog10_OBJCFLAGS = $(AM_OBJCFLAGS)
+END
+
+add_match 'prog10-source10.$(OBJEXT)'
+
+cat >> Makefile.am <<'END'
+bin_PROGRAMS += linkprog
+linkprog_SOURCES = linkprog.c
+linkprog_LDFLAGS = $(AM_LDFLAGS)
+END
+
+add_match 'linkprog_LINK ='
+
+cat >> Makefile.am <<'END'
+lib_LIBRARIES += libstatic.a
+libstatic_a_SOURCES = static123.c
+libstatic_a_CFLAGS = $(AM_CFLAGS)
+END
+
+add_match 'libstatic_a-static123.$(OBJEXT)'
+
+cat >> Makefile.am <<'END'
+lib_LTLIBRARIES += libshared1.la
+libshared1_la_SOURCES = shared1.c
+libshared1_la_LIBTOOLFLAGS = $(AM_LIBTOOLFLAGS)
+END
+
+add_match 'libshared1_la-shared1.lo'
+
+cat >> Makefile.am <<'END'
+lib_LTLIBRARIES += libshared2.la
+libshared2_la_SOURCES = shared2.cc
+libshared2_la_CXXFLAGS = $(AM_CXXFLAGS)
+END
+
+add_match 'libshared2_la-shared2.lo'
+
+cat >> Makefile.am <<'END'
+bin_PROGRAMS += parse1
+parse1_SOURCES = parse.y
+parse1_YFLAGS = $(AM_YFLAGS)
+END
+
+add_match 'parse1-parse.c'
+
+cat >> Makefile.am <<'END'
+bin_PROGRAMS += parse2
+parse2_SOURCES = parse.ypp
+parse2_YFLAGS = $(AM_YFLAGS)
+END
+
+add_match 'parse2-parse.cpp'
+
+cat >> Makefile.am <<'END'
+bin_PROGRAMS += lexer1
+lexer1_SOURCES = lex.l
+lexer1_LFLAGS = $(AM_YFLAGS)
+END
+
+add_match 'lexer1-lex.c'
+
+cat >> Makefile.am <<'END'
+bin_PROGRAMS += lexer2
+lexer2_SOURCES = lexer.ll
+lexer2_LFLAGS = $(AM_YFLAGS)
+END
+
+add_match 'lexer2-lexer.cc'
+
+# For debugging.
+cat Makefile.am
+
+$AUTOMAKE -a
+do_check
+
+sed '
+  s|^\(.*\)_SOURCES *= *|sub_\1_SOURCES = srcsub/|
+  s|^\(.*\)PROGRAMS *+= *|\1PROGRAMS += sub/|
+  s|^\(.*\)LIBRARIES *+= *|\1LIBRARIES += sub/|
+  s|^\(.*\)FLAGS *=|sub_\1FLAGS =|
+' Makefile.am > t
+
+cat - t > Makefile.am <<'END'
+AUTOMAKE_OPTIONS = subdir-objects
+END
+
+rm -f t
+
+# For debugging.
+cat Makefile.am
+
+$AUTOMAKE
+do_check
+
+:
diff --git a/tests/spy.test b/tests/spy.test
index c4993c6..5f1a87b 100755
--- a/tests/spy.test
+++ b/tests/spy.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -16,8 +16,8 @@
 
 # Check whether double colon rules work.  The Unix V7 make manual
 # mentions double-colon rules, but POSIX does not.  They seem to be
-# supported by all Make implementation as we can tell. This test case
-# is a spy: we want to detect if there exist implementations where
+# supported by all Make implementation as far as we can tell. This test
+# case is a spy: we want to detect if there exist implementations where
 # these do not work.  We might use these rules to simplify the rebuild
 # rules (instead of the $? hack).
 
@@ -87,8 +87,22 @@ $sleep
 touch b
 $MAKE
 test "`cat a`" = rule1
+# Ensure a is strictly newer than b, so HP-UX make does not execute rule2.
+$sleep
 : > a
 $sleep
 touch c
 $MAKE
 test "`cat a`" = rule2
+
+# Unfortunately, the following is not portable to FreeBSD/NetBSD/OpenBSD
+# make, see explanation above.
+
+#: > a
+#$sleep
+#touch b c
+#$MAKE
+#grep rule1 a
+#grep rule2 a
+
+:
diff --git a/tests/subdir5.test b/tests/subdir5.test
index 5633ac6..3f4dfa3 100755
--- a/tests/subdir5.test
+++ b/tests/subdir5.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2003, 2004, 2009, 2010 Free Software
+# Copyright (C) 2001, 2002, 2003, 2004, 2009, 2010, 2011 Free Software
 # Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -55,18 +55,14 @@ $AUTOMAKE --include-deps --copy --add-missing
 $MAKE
 
 # Now add new directories.
-#
-# We shouldn't need to $sleep here: configure ensures that files
-# generated by it are newer than configure.  Thus, even if
-# Makefile.in is newer than configure but the updated Makefile.am
-# below has the same timestamp as Makefile.in, the latter should
-# be rebuilt due to its dependency on configure.in.
 
 # First we add a new directory by modifying configure.in directly.
 # We update configure.in *before* updating sub/Makefile.am; subdir8.test
 # does it in the other way: it updates confiles.m4 (which is m4_included
 # by configure.in there) after Makefile.am.
 
+# Modified configure dependencies must be newer than config.status.
+$sleep
 sed <configure.in >configure.tmp -e '/^AC_OUTPUT$/i\
 AC_CONFIG_FILES([maude/Makefile])\
 m4_include([confile.m4])\
@@ -89,11 +85,15 @@ echo 'SUBDIRS = maude' >> Makefile.am
 
 # We want a simple rebuild to create maude/Makefile automatically.
 $MAKE
+grep '^SUBDIRS = *maude *$' Makefile.in
+grep '^SUBDIRS = *maude *$' Makefile
 test -f maude/Makefile
 
 # Then we add a new directory by modifying a file included (through
 # `m4_include') by configure.in.
 mkdir maude2
+# Modified configure dependencies must be newer than config.status.
+$sleep
 cat >> confile.m4 << 'END'
 AC_CONFIG_FILES([maude2/Makefile])
 AC_SUBST([GREPME])
@@ -104,8 +104,13 @@ echo 'SUBDIRS += maude2' >> Makefile.am
 # We want a simple rebuild to create maude2/Makefile and update
 # all other Makefiles automatically.
 $MAKE
-grep '^GREPME =' Makefile
-grep '^GREPME =' maude/Makefile
-grep '^GREPME =' maude2/Makefile
+grep '^SUBDIRS =.* maude2' Makefile.in
+grep '^SUBDIRS =.* maude2' Makefile
+
+for ext in '.in' ''; do
+  for d in . maude maude2; do
+    grep '^GREPME =' $d/Makefile$ext
+  done
+done
 
 :
diff --git a/tests/subdir8.test b/tests/subdir8.test
index 093fac8..b39dfe4 100755
--- a/tests/subdir8.test
+++ b/tests/subdir8.test
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 2003, 2004, 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004, 2009, 2010, 2011 Free Software Foundation,
+# Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -68,12 +69,6 @@ $AUTOMAKE --copy --add-missing
 $MAKE
 
 # Now add new directories.
-#
-# We shouldn't need to $sleep here: configure ensures that files
-# generated by it are newer than configure.  Thus, even if
-# Makefile.in is newer than configure but the updated Makefile.am
-# below has the same timestamp as Makefile.in, the latter should
-# be rebuilt due to its dependency on configure.in.
 
 # The first step users typically do when adding a new subdir is
 # editing configure.in.  That is already tested by subdir5.test,
@@ -94,6 +89,9 @@ mkdir maude
 
 # Update confiles.m4 *after* updating sub/Makefile.am; subdir5.test do
 # it in the other way: it updates configure.in before Makefile.am.
+# We sleep here because modified configure dependencies must be newer
+# than config.status.
+$sleep
 echo 'AC_CONFIG_FILES([maude/Makefile sub/maude/Makefile])' >> confiles.m4
 
 # We want a simple rebuild from sub/ to create sub/maude/Makefile
@@ -101,6 +99,8 @@ echo 'AC_CONFIG_FILES([maude/Makefile sub/maude/Makefile])' 
>> confiles.m4
 cd sub
 $MAKE
 cd ..
+grep '^SUBDIRS = *maude *$' sub/Makefile.in
+grep '^SUBDIRS = *maude *$' sub/Makefile
 test -f maude/Makefile
 test -f sub/maude/Makefile
 
@@ -109,9 +109,10 @@ test -f sub/maude/Makefile
 echo 'AC_DEFUN([MORE_DEFS], [AC_SUBST([GREPME])])' > m4/moredefs.m4
 $MAKE
 
-grep '^GREPME =' Makefile
-grep '^GREPME =' maude/Makefile
-grep '^GREPME =' sub/Makefile
-grep '^GREPME =' sub/maude/Makefile
+for ext in '.in' ''; do
+  for d in . maude sub sub/maude; do
+    grep '^GREPME =' $d/Makefile$ext
+  done
+done
 
 :
diff --git a/tests/substref.test b/tests/substref.test
index 3d4da05..23dc168 100755
--- a/tests/substref.test
+++ b/tests/substref.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2010, 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -63,7 +63,7 @@ diff exp got
 
 # This is unrelated to the rest of this test.  But while we are
 # at it, make sure we don't use am__helldl_SOURCES_DIST here, since
-# it's not needed.  DIST_SOURCES should contains $(helldl_SOURCES).
+# it's not needed.  DIST_SOURCES should contain $(helldl_SOURCES).
 grep am__helldl_SOURCES_DIST Makefile && Exit 1
 grep 'DIST_SOURCES.*\$(helldl_SOURCES)' Makefile
 
diff --git a/tests/suffix13.test b/tests/suffix13.test
index aa5a3ed..8120024 100755
--- a/tests/suffix13.test
+++ b/tests/suffix13.test
@@ -1,6 +1,6 @@
 #! /bin/sh
-# Copyright (C) 2002, 2003, 2006, 2009, 2010 Free Software Foundation,
-# Inc.
+# Copyright (C) 2002, 2003, 2006, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -39,7 +39,7 @@ SUFFIXES = .baz .c
 .baz.c:
        case $@ in sub/*) $(MKDIR_P) sub;; *) :;; esac
 ## Account for VPATH issues on weaker make implementations (e.g. IRIX 6.5)
-       cp `test -f $< || echo $(srcdir)/`$< $@
+       cp `test -f '$<' || echo $(srcdir)/`$< $@
 
 DISTCLEANFILES = sub/bar.c
 
diff --git a/tests/suffix7.test b/tests/suffix7.test
index 60058b8..eb67195 100755
--- a/tests/suffix7.test
+++ b/tests/suffix7.test
@@ -15,7 +15,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Test to make sure Automake supports implicit rules "confusing"
-# extensions.  Inspired by a mail from Alex Hornby. 
+# extensions.  Inspired by a mail from Alex Hornby.
 
 . ./defs || Exit 1
 
diff --git a/tests/txinfo.test b/tests/txinfo.test
index 3f1c533..b764e53 100755
--- a/tests/txinfo.test
+++ b/tests/txinfo.test
@@ -1,6 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003
-# Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2011 Free
+# Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -15,22 +15,36 @@
 # 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 ensure texinfo.tex included in distribution.  Bug report by
+# Test to ensure texinfo.tex is included in distribution.  Bug report by
 # Jim Meyering.
 
+required=makeinfo
 . ./defs || Exit 1
 
+set -e
+
+cat >> configure.in <<'END'
+AC_OUTPUT
+END
+
 cat > Makefile.am << 'END'
 info_TEXINFOS = textutils.texi
-magic:
-       @echo $(DISTFILES)
+.PHONY: test1 test2
+test1:
+       @echo DISTFILES = $(DISTFILES)
+       echo ' ' $(DISTFILES) ' ' | grep '[ /]texinfo\.tex '
+test2: distdir
+       ls -l $(distdir)
+       test -f $(distdir)/texinfo.tex
 END
 
 echo '@setfilename textutils.info' > textutils.texi
 : > texinfo.tex
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+$MAKE test1 test2
 
-$FGREP -v @SET_MAKE@ Makefile.in > Makefile.sed
-$MAKE -s -f Makefile.sed SHELL=$SHELL magic | grep 'texinfo\.tex'
+:
diff --git a/tests/txinfo16.test b/tests/txinfo16.test
index 66ed686..4c14aba 100755
--- a/tests/txinfo16.test
+++ b/tests/txinfo16.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2002, 2003, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2008, 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -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/>.
 
-# Check that info files are not built in $(srcdir).
+# Check that info files are normally built in $(srcdir),
+# not in $(builddir).
 
 required='makeinfo tex texi2dvi'
 . ./defs || Exit 1
 
 set -e
 
-echo AC_OUTPUT >> configure.in
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
 
 cat > Makefile.am << 'END'
 info_TEXINFOS = main.texi
@@ -86,3 +89,5 @@ $MAKE dvi
 test -f main.dvi
 
 $MAKE distcheck
+
+:
diff --git a/tests/txinfo18.test b/tests/txinfo18.test
index 4df5257..8dc8961 100755
--- a/tests/txinfo18.test
+++ b/tests/txinfo18.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2002, 2008, 2009  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2008, 2009, 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -23,7 +23,9 @@ required='makeinfo tex texi2dvi'
 
 set -e
 
-echo AC_OUTPUT >> configure.in
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
 
 cat > Makefile.am << 'END'
 info_TEXINFOS = main.texi
@@ -62,4 +64,14 @@ $AUTOMAKE --add-missing
 $AUTOCONF
 
 ./configure
+
+$MAKE dvi
+ls -l           # for debugging
+test -f main.sa # sanity check
+$MAKE clean
+ls -l           # for debugging
+test x"`echo main.*`" = x"main.texi"
+
 TAR_OPTIONS= $MAKE distcheck
+
+:
diff --git a/tests/txinfo2.test b/tests/txinfo2.test
index 2324f57..f51d0b6 100755
--- a/tests/txinfo2.test
+++ b/tests/txinfo2.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, 2011 Free Software
+# Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -21,24 +22,27 @@
 
 set -e
 
-echo AC_OUTPUT >> configure.in
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
 
 cat > Makefile.am << 'END'
 info_TEXINFOS = textutils.texi
-magic:
-       @echo $(DISTFILES)
+.PHONY: test
+test:
+       @echo DISTFILES = $(DISTFILES)
+       case '$(DISTFILES)' in *'~'*) exit 1;; *) exit 0;; esac
 END
 
 : > texinfo.tex
 echo '@setfilename textutils.info' > textutils.texi
 : > textutils.info~
 
-
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
+
 ./configure
-$MAKE magic >stdout
-cat stdout
-grep '~' stdout && Exit 1
-Exit 0
+$MAKE test
+
+:
diff --git a/tests/txinfo22.test b/tests/txinfo22.test
index 3c2265d..c2f23e1 100755
--- a/tests/txinfo22.test
+++ b/tests/txinfo22.test
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 2003, 2004, 2007, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004, 2007, 2008, 2011 Free Software Foundation,
+# Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -15,32 +16,27 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Make sure the user can override TEXINFO_TEX.
-# Report from Tom Tromey.
-# Also make sure Automake ignores in-line comments when using variables,
-# but preserve them in the output.
 # Also make sure TEXINFO_TEX is not distributed.
+# Report from Tom Tromey.
 
 required='makeinfo tex texi2dvi'
 . ./defs || Exit 1
 
 set -e
 
-cat > configure.in << 'END'
-AC_INIT([txinfo22], [1.0])
+cat > configure.in << END
+AC_INIT([$me], [1.0])
 AC_CONFIG_AUX_DIR([aux1])
 AM_INIT_AUTOMAKE
 AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
 END
 
-# Use a slash in the comment, because automake takes the dirname
-# of TEXINFO_TEX to compute $(am__TEXINFO_TEX_DIR)...
 cat > Makefile.am << 'END'
-TEXINFO_TEX = $(srcdir)/tex/texinfo.tex    # some comment w/ a slash
+TEXINFO_TEX = $(srcdir)/tex/texinfo.tex
 info_TEXINFOS = main.texi
 sure_it_exists:
        test -f $(TEXINFO_TEX)
-       test -d "$(am__TEXINFO_TEX_DIR)"
 sure_it_is_not_distributed: distdir
        test ! -f $(distdir)/tex/texinfo.tex
 END
@@ -67,7 +63,9 @@ test ! -f aux1/texinfo.tex
 test -f tex/texinfo.tex
 
 ./configure
+
 $MAKE sure_it_exists
 $MAKE distcheck
-grep 'TEXINFO_TEX = .* # some comment w/ a slash' Makefile
 $MAKE sure_it_is_not_distributed
+
+:
diff --git a/tests/txinfo23.test b/tests/txinfo23.test
index 903e681..660487d 100755
--- a/tests/txinfo23.test
+++ b/tests/txinfo23.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2002, 2003, 2007  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2007, 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -14,15 +14,19 @@
 # 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 subdir Texinfo in $(srcdir).
+# Check that info files are built in builddir when needed.
+# Test with subdir Texinfo.
 # (Similar to txinfo13.test, plus DISTCLEANFILES.)
+# (See also txinfo24.test and txinfo25.test)
 
 required='makeinfo tex texi2dvi-o'
 . ./defs || Exit 1
 
 set -e
 
-echo AC_OUTPUT >> configure.in
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
 
 cat > Makefile.am << 'END'
 DISTCLEANFILES = subdir/*.info*
@@ -50,7 +54,6 @@ cat > subdir/inc.texi << 'END'
 I'm included.
 END
 
-
 $ACLOCAL
 $AUTOMAKE --add-missing
 $AUTOCONF
@@ -60,3 +63,6 @@ cd build
 ../configure
 $MAKE distcheck
 test -f subdir/main.info
+test ! -f ../subdir/main.info
+
+:
diff --git a/tests/txinfo24.test b/tests/txinfo24.test
index 4c0bc82..fc9f9d1 100755
--- a/tests/txinfo24.test
+++ b/tests/txinfo24.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -16,13 +16,16 @@
 
 # Check that info files are built in builddir when needed.
 # (Similar to txinfo16.test, plus CLEANFILES.)
+# (See also txinfo23.test and txinfo25.test)
 
 required='makeinfo tex texi2dvi-o'
 . ./defs || Exit 1
 
 set -e
 
-echo AC_OUTPUT >> configure.in
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
 
 cat > Makefile.am << 'END'
 CLEANFILES = main.info
@@ -47,6 +50,7 @@ mkdir build
 cd build
 ../configure
 $MAKE
+test ! -f ../main.info
 test -f main.info
 
 cd ..
@@ -77,3 +81,5 @@ $MAKE dvi
 test -f main.dvi
 
 $MAKE distcheck
+
+:
diff --git a/tests/txinfo25.test b/tests/txinfo25.test
index 85007f9..f80b035 100755
--- a/tests/txinfo25.test
+++ b/tests/txinfo25.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -14,15 +14,20 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Similar to texinfo24.test, but with two info files, only one of
-# which being cleaned.
+# Check that info files are built in builddir and in srcdir can safely
+# co-exist.  This setup is obtained by having two info files, only one
+# of which being cleaned.
+# (Similar to txinfo16.test, plus CLEANFILES.)
+# (See also txinfo23.test and txinfo24.test)
 
 required='makeinfo tex texi2dvi-o'
 . ./defs || Exit 1
 
 set -e
 
-echo AC_OUTPUT >> configure.in
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
 
 cat > Makefile.am << 'END'
 CLEANFILES = [a-m]*.info
@@ -104,3 +109,5 @@ test -f main.dvi
 test -f other.dvi
 
 $MAKE distcheck
+
+:
diff --git a/tests/txinfo29.test b/tests/txinfo29.test
index 1d4aeff..42dd3ab 100755
--- a/tests/txinfo29.test
+++ b/tests/txinfo29.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2004  Free Software Foundation, Inc.
+# Copyright (C) 2004, 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -30,7 +30,7 @@ echo '@setfilename baz.info' > bar.texi
 
 $ACLOCAL
 AUTOMAKE_fails --add-missing
-grep '^Makefile.am:1:.*user variable.*INFO_DEPS' stderr
+grep '^Makefile\.am:1:.*user variable.*INFO_DEPS' stderr
 grep 'overrides Automake variable.*INFO_DEPS' stderr
 
 $AUTOMAKE -Wno-override
@@ -38,19 +38,20 @@ $AUTOMAKE -Wno-override
 # There is only one definition of INFO_DEPS
 test 1 = `grep '^INFO_DEPS.*=' Makefile.in | wc -l`
 # and it is the right one.
-grep '^INFO_DEPS = foo.info$' Makefile.in
-
+grep '^INFO_DEPS *= *foo.info *$' Makefile.in
 
 # Likewise with AC_SUBST.
 
 cat > Makefile.am << 'END'
 info_TEXINFOS = bar.texi
 END
-echo 'AC_SUBST([INFO_DEPS])' >>configure.in
+cat >> configure.in << 'END'
+AC_SUBST([INFO_DEPS])
+END
 rm -rf autom4te.cache # Make sure autoconf sees the configure.in update.
 AUTOMAKE_fails
 
-grep '^configure.in:4:.*user variable.*INFO_DEPS' stderr
+grep '^configure\.in:4:.*user variable.*INFO_DEPS' stderr
 grep 'overrides Automake variable.*INFO_DEPS' stderr
 
 $AUTOMAKE -Wno-override
@@ -58,4 +59,6 @@ $AUTOMAKE -Wno-override
 # There is only one definition of INFO_DEPS
 test 1 = `grep '^INFO_DEPS.*=' Makefile.in | wc -l`
 # and it is the right one.
-grep '^INFO_DEPS = @address@hidden' Makefile.in
+grep '^INFO_DEPS *= address@hidden@ *$' Makefile.in
+
+:
diff --git a/tests/txinfo3.test b/tests/txinfo3.test
index dcdfcfa..6af712f 100755
--- a/tests/txinfo3.test
+++ b/tests/txinfo3.test
@@ -1,6 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1997, 2001, 2002, 2003, 2008  Free Software Foundation,
-# Inc.
+# Copyright (C) 1997, 2001, 2002, 2003, 2008, 2011 Free Software
+# Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -22,7 +22,9 @@ required='makeinfo tex texi2dvi'
 
 set -e
 
-echo AC_OUTPUT >> configure.in
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
 
 cat > Makefile.am << 'END'
 info_TEXINFOS = textutils.texi
@@ -45,8 +47,10 @@ grep '^INFO_DEPS.*textutils$' Makefile.in
 
 # We should not use single suffix inference rules (with separate
 # dependencies), this confuses Solaris make.
-grep '^.texi:$' Makefile.in && Exit 1
-grep 'textutils: textutils.texi' Makefile.in
+grep '^\.texi:$' Makefile.in && Exit 1
+grep 'textutils: *textutils\.texi' Makefile.in
 
 ./configure
 $MAKE distcheck
+
+:
diff --git a/tests/txinfo4.test b/tests/txinfo4.test
index 1c6a92f..0c55a1c 100755
--- a/tests/txinfo4.test
+++ b/tests/txinfo4.test
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1997, 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 1997, 2001, 2002, 2003, 2011 Free Software Foundation,
+# Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -29,4 +30,6 @@ echo '@setfilename textutils.frob' > textutils.texi
 
 $ACLOCAL
 AUTOMAKE_fails
-grep 'textutils.texi:1:.*textutils.frob.*extension' stderr
+grep 'textutils\.texi:1:.*textutils\.frob.*extension' stderr
+
+:
diff --git a/tests/txinfo5.test b/tests/txinfo5.test
index 0bbc7d9..0b3ea68 100755
--- a/tests/txinfo5.test
+++ b/tests/txinfo5.test
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1998, 2001, 2002, 2008  Free Software Foundation, Inc.
+# Copyright (C) 1998, 2001, 2002, 2008, 2011 Free Software Foundation,
+# Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -15,9 +16,15 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Test to make sure that texinfo.tex is not required by --cygnus.
+# Also check that TEXINFOS + cygnus work without requiring the
+# `-Wno-override' option.
+# See also sister test txinfo5b.test.
 # Report from Ian Taylor.
+
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
 AM_MAINTAINER_MODE
 END
@@ -28,5 +35,7 @@ END
 
 echo '@setfilename ian.info' > ian.texi
 
-$ACLOCAL || Exit 1
+$ACLOCAL
 $AUTOMAKE --cygnus
+
+:
diff --git a/tests/txinfo5.test b/tests/txinfo5b.test
similarity index 75%
copy from tests/txinfo5.test
copy to tests/txinfo5b.test
index 0bbc7d9..f14eadb 100755
--- a/tests/txinfo5.test
+++ b/tests/txinfo5b.test
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1998, 2001, 2002, 2008  Free Software Foundation, Inc.
+# Copyright (C) 1998, 2001, 2002, 2008, 2011 Free Software Foundation,
+# Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -15,18 +16,29 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Test to make sure that texinfo.tex is not required by --cygnus.
+# See also sister test txinfo5.test.
 # Report from Ian Taylor.
+
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
 AM_MAINTAINER_MODE
 END
 
 cat > Makefile.am << 'END'
+# Disable `override' warning to work around an unrelated
+# texi+cygnus bug.
+AUTOMAKE_OPTIONS = -Wno-override
 info_TEXINFOS = ian.texi
 END
 
 echo '@setfilename ian.info' > ian.texi
 
-$ACLOCAL || Exit 1
+$ACLOCAL
 $AUTOMAKE --cygnus
+$AUTOMAKE -a --cygnus
+test ! -f texinfo.tex
+
+:
diff --git a/tests/txinfo6.test b/tests/txinfo6.test
index ad3704e..f5b8c0b 100755
--- a/tests/txinfo6.test
+++ b/tests/txinfo6.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1998, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1998, 2001, 2002, 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -15,8 +15,11 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Test to make sure `.txi' extension works.
+
 . ./defs || Exit 1
 
+set -e
+
 cat > Makefile.am << 'END'
 info_TEXINFOS = foo.txi
 END
@@ -24,7 +27,9 @@ END
 echo '@setfilename foo.info' > foo.txi
 : > texinfo.tex
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
+
+grep '^\.txi\.info: *$' Makefile.in
 
-$FGREP '.txi.info' Makefile.in
+:
diff --git a/tests/txinfo7.test b/tests/txinfo7.test
index 466a216..9a1dd5c 100755
--- a/tests/txinfo7.test
+++ b/tests/txinfo7.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1998, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1998, 2001, 2002, 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -19,15 +19,17 @@
 
 . ./defs || Exit 1
 
+set -e
+
 cat > Makefile.am << 'END'
 info_TEXINFOS = textutils.texi
-magic:
-       @echo $(DISTFILES)
 END
 
 echo '@setfilename textutils.info' > textutils.texi
 
-$ACLOCAL || Exit 1
-$AUTOMAKE -a || Exit 1
+$ACLOCAL
+$AUTOMAKE -a
 
 test -f texinfo.tex
+
+:
diff --git a/tests/txinfo8.test b/tests/txinfo8.test
index 7975b28..13c8e31 100755
--- a/tests/txinfo8.test
+++ b/tests/txinfo8.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004  Free Software
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2011 Free Software
 # Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -21,32 +21,45 @@
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AC_CONFIG_AUX_DIR(sub)
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-AC_OUTPUT(Makefile sub/Makefile)
+set -e
+
+cat > configure.in << END
+AC_INIT([$me], [1.0])
+AC_CONFIG_AUX_DIR([auxdir])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
 info_TEXINFOS = textutils.texi
+.PHONY: test1 test2
+test1:
+       @echo DISTFILES = $(DISTFILES)
+       echo ' ' $(DISTFILES) ' ' | grep '[ /]auxdir/texinfo\.tex '
+test2: distdir
+       ls -l $(distdir)/*
+       test -f $(distdir)/auxdir/texinfo.tex
 END
 
 echo '@setfilename textutils.info' > textutils.texi
 
-test -d sub || mkdir sub
+mkdir auxdir
 
-cat > sub/Makefile.am << 'END'
-magic:
-       @echo $(DISTFILES)
-END
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+test -f auxdir/texinfo.tex
+
+./configure
 
-$ACLOCAL || Exit 1
-$AUTOMAKE -a || Exit 1
+# Create textutils.info by hand, so that we don't have to require
+# makeinfo.  Also ensure it's really newer than textutils.texi, so
+# that make won't try to re-create it.
+$sleep
+: > textutils.info
 
-$FGREP -v @SET_MAKE@ sub/Makefile.in > sub/Makefile.sed
-test -f sub/texinfo.tex &&
-$MAKE -s -f sub/Makefile.sed SHELL=$SHELL magic | grep 'texinfo\.tex'
-stat=$?
+$MAKE test1 test2
 
-Exit $stat
+:
diff --git a/tests/txinfo9.test b/tests/txinfo9.test
index b9eb7b5..71b5efb 100755
--- a/tests/txinfo9.test
+++ b/tests/txinfo9.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -14,12 +14,12 @@
 # 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 only create dist-info target once.
-# This is just an example -- basically for many targets in texinfos.am
-# we only want them to appear once.
+# Make sure we only create texinfo-related targets once.
 
 . ./defs || Exit 1
 
+set -e
+
 cat > Makefile.am << 'END'
 info_TEXINFOS = maude.texi liver.txi heart.texinfo
 END
@@ -29,7 +29,15 @@ echo '@setfilename liver.info' > liver.txi
 echo '@setfilename heart.info' > heart.texinfo
 : > texinfo.tex
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
+
+# These are just examples -- basically for many targets in texinfos.am
+# we only want them to appear once.  But grepping them all would be
+# overkill.
+for t in info dist-info dvi-am install-html uninstall-pdf-am; do
+  $EGREP "(^| )$t*.:" Makefile.in # help in debugging
+  test `$EGREP -c "(^| )$t(:| *.:)" Makefile.in` -eq 1
+done
 
-test `grep '^dist-info:' Makefile.in | wc -l` -eq 1
+:
diff --git a/tests/vtexi.test b/tests/vtexi.test
index c28a356..e9a4511 100755
--- a/tests/vtexi.test
+++ b/tests/vtexi.test
@@ -1,6 +1,6 @@
 #!/bin/sh
-# Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003
-#   Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2011 Free Software
+# Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -15,8 +15,13 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+# Basic checks and some regressions testing on `version.texi'
+# support for texinfo files.
+
 . ./defs || Exit 1
 
+set -e
+
 cat > Makefile.am << 'END'
 info_TEXINFOS = textutils.texi
 END
@@ -30,9 +35,7 @@ END
 : > mdate-sh
 : > texinfo.tex
 
-set -e
-
-$ACLOCAL || Exit 1
+$ACLOCAL
 $AUTOMAKE
 
 # Test for bug reported by Jim Meyering:
@@ -41,25 +44,22 @@ $AUTOMAKE
 #   textutils.info: textutils.texi
 # instead of
 #   textutils.info: textutils.texi version.texi
-# (Today this should be `textutils.info: version.texi')
-
-grep 'textutils\.info:.*version\.texi$' Makefile.in
-
+# Today this should be:
+#   $(srcdir)/textutils.info: $(srcdir)/version.texi
+# or:
+#   $(srcdir)/textutils.info: version.texi
+grep '^\$(srcdir)/textutils\.info:.*[ /]version\.texi *$' Makefile.in
 
 # Test for bug reported by Lars Hecking:
 # When running the first version of configure.ac aware automake,
 # @CONFIGURE_AC@ was not properly substituted.
-
 $EGREP 'stamp-vti:.*textutils\.texi( .*)?$' Makefile.in
 $EGREP 'stamp-vti:.*\$\(top_srcdir\)/configure( .*)?$' Makefile.in
 
-
 # Check that the path to mdate-sh is correct.  Over escaping of `$'
 # etc. once led to `\$\(srcdir\)/mdate-sh'.
+# Filter out '$(srcdir)/mdate-sh'; there should be no occurrences
+# of `.../mdate-sh' left then.
+sed 's,\$(srcdir)/mdate-sh,,g' Makefile.in | grep '/mdate-sh' && Exit 1
 
-# Filter out '$(srcdir)/mdate-sh'; output occurrences of `SOMETHING/mdate-sh'
-sed -n 's,\$(srcdir)/mdate-sh,,g;s,.* \([^ ]*/mdate-sh\) .*,\1,gp' Makefile.in|
-# There must remain nothing.
- grep . && Exit 1
-
-Exit 0
+:
diff --git a/tests/vtexi2.test b/tests/vtexi2.test
index e1a1b93..00e4c1e 100755
--- a/tests/vtexi2.test
+++ b/tests/vtexi2.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1996, 1997, 2001, 2002, 2010 Free Software Foundation,
+# Copyright (C) 1996, 1997, 2001, 2002, 2011 Free Software Foundation,
 # Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -29,7 +29,7 @@ info_TEXINFOS = zardoz.texi
 END
 
 cat > zardoz.texi << 'END'
address@hidden  zardoz  
address@hidden zardoz
 @include version.texi
 END
 
@@ -40,4 +40,6 @@ END
 $ACLOCAL
 $AUTOMAKE
 
-grep '^zardoz\.dvi:' Makefile.in
+grep '^zardoz\.dvi:.*[ /]version.texi' Makefile.in
+
+:
diff --git a/tests/vtexi3.test b/tests/vtexi3.test
new file mode 100755
index 0000000..34f46c5
--- /dev/null
+++ b/tests/vtexi3.test
@@ -0,0 +1,124 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check that vers*.texi files are automatically created and distributed
+# if @included into a texi source.  Also check that they correctly contain
+# the @values definitions they are advertised to.
+# See also the related test `vtexi4.test', which does similar checks, but
+# for version.texi only, and requires makeinfo, tex and texi2dvi.
+
+. ./defs || Exit 1
+
+set -e
+
+distdir=$me-7.45.3a
+
+# This should work without tex, texinfo or makeinfo
+TEX=false TEXI2DVI=false MAKEINFO=false
+export TEX TEXI2DVI MAKEINFO
+
+cat > configure.in << END
+AC_INIT([$me], [7.45.3a])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+info_TEXINFOS = foobar.texi quux.texi zardoz.texi
+.PHONY: echo-distfiles
+echo-distfiles:
+       @echo ' ' $(DISTFILES) ' '
+END
+
+cat > foobar.texi << 'END'
address@hidden foobar.info
+random text
address@hidden version.texi
+END
+
+cat > quux.texi << 'END'
address@hidden quux.info
address@hidden version-quux.texi
+random text
+END
+
+cat > zardoz.texi << 'END'
address@hidden zardoz.info
+some randome text
address@hidden vers1a_2b.texi
+more random text
+END
+
+# Required when using Texinfo.
+: > texinfo.tex
+cp "$testsrcdir/../lib/mdate-sh" .
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+day='([1-9]|1[0-9]|2[0-9]|3[01])'
+month='(January|February|March|April|May|June|July|August|September|October|November|December)'
+year='20[0-9][0-9]' # Hopefully automake will be obsolete in 80 years ;-)
+date="$day $month $year"
+
+do_check ()
+{
+  # Basename of the vers*.texi file.
+  vfile=$1
+  # The $(srcdir) of the current build.
+  srcdir=$2
+  # The vers*.texi file must be created in $(srcdir).
+  $MAKE $srcdir/$vfile.texi
+  cat $srcdir/$vfile.texi
+  # EDITION and VERSION are synonyms, as per documentation.
+  grep "address@hidden EDITION 7\\.45\\.3a$" $srcdir/$vfile.texi
+  grep "address@hidden VERSION 7\\.45\\.3a$" $srcdir/$vfile.texi
+  # Check that UPDATED seems right, and that UPDATED and UPDATED-MONTH
+  # are consistent.
+  $EGREP "address@hidden UPDATED $date$" $srcdir/$vfile.texi
+  vmonth=`grep 'address@hidden UPDATED ' $srcdir/$vfile.texi | awk '{print $4, 
$5}'`
+  grep "address@hidden UPDATED-MONTH $vmonth$" $srcdir/$vfile.texi
+  # Check that the vers*.texi file is distributed according
+  # to $(DISTFILES).
+  $MAKE echo-distfiles # For debugging.
+  $MAKE -s echo-distfiles | grep "[ /]$vfile\\.texi"
+}
+
+mkdir build
+cd build
+../configure
+
+do_check version ..
+do_check version-quux ..
+do_check vers1a_2b ..
+
+# The various $(srcdir)/*.info are required for the distribution
+# and they must be newer than version.texi, so that make won't try
+# to rebuild them.
+$sleep
+touch ../foobar.info
+touch ../quux.info
+touch ../zardoz.info
+# Check that the vers*.texi files are really distributed.
+$MAKE distdir
+ls -l $distdir
+diff ../version.texi $distdir/version.texi
+diff ../version-quux.texi $distdir/version-quux.texi
+diff ../version.texi $distdir/vers1a_2b.texi
+
+:
diff --git a/tests/vtexi4.test b/tests/vtexi4.test
new file mode 100755
index 0000000..3c8ab41
--- /dev/null
+++ b/tests/vtexi4.test
@@ -0,0 +1,118 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check that the version.texi file is automatically created and distributed
+# if @included into a texi source.  Also check that is correctly defined
+# @values definitions it is advertised to.
+# See also the related test `vtexi3.test', which does similar checks, but
+# for more vers*.texi files, and does not require makeinfo, tex and
+# texi2dvi.
+
+required='makeinfo tex texi2dvi-o'
+. ./defs || Exit 1
+
+set -e
+
+case `LC_ALL=C date '+%u'` in
+  [1-7]) date_is_posix=:;;
+      *) date_is_posx=false;;
+esac
+$date_is_posix \
+  && day=`LC_ALL=C date '+%d'` && test -n "$day" \
+  && month=`LC_ALL=C date '+%B'` && test -n "$month" \
+  && year=`LC_ALL=C date '+%Y'`&& test -n "$year" \
+  || { echo "$me: 'date' is not POSIX-compliant enough"; Exit 77; }
+day=`echo "$day" | sed 's/^0//'`
+
+# This test requires a grep program that can work on non-text input.
+(echo 'x' | grep x) || {
+  echo "$me: grep doesn't work on input that is not pure text" >&2
+  Exit 77
+}
+
+cat > configure.in << END
+AC_INIT([$me], [123.456])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+cat > defs.am <<END
+my_date_rx = $day $month $year
+my_month_rx = $month $year
+my_version_rx = 123\.456
+END
+
+cat > Makefile.am << 'END'
+include defs.am
+info_TEXINFOS = foo.texi
+test-grepinfo:
+## Not useless uses of cat: we only tested that grep worked on
+## non-text input when that's given from a pipe.
+       cat $(srcdir)/foo.info | grep 'GREPVERSION=$(my_version_rx)='
+       cat $(srcdir)/foo.info | grep 'GREPEDITION=$(my_version_rx)='
+       cat $(srcdir)/foo.info | grep 'GREPDATE=$(my_date_rx)='
+       cat $(srcdir)/foo.info | grep 'GREPMONTH=$(my_month_rx)='
+test-distfiles:
+       @echo DISTFILES = $(DISTFILES)
+       echo ' ' $(DISTFILES) ' ' | grep '[ /]version.texi '
+test-distdir: distdir
+       ls -l $(distdir)
+       diff $(srcdir)/version.texi $(distdir)/version.texi
+.PHONY: test-grepinfo test-distfiles test-distdir
+check-local: test-grepinfo test-distfiles test-distdir
+END
+
+cat > foo.texi << 'END'
+\input texinfo
address@hidden %**start of header
address@hidden foo.info
address@hidden Zardoz
address@hidden %**end of header
+
address@hidden Top
address@hidden version.texi
+
address@hidden
+
address@hidden
+
address@hidden
+
address@hidden
+
address@hidden
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+$MAKE all dvi
+
+# debugging & sanity checks
+ls -l
+cat version.texi
+cat foo.info
+test -f foo.dvi
+
+$MAKE test-grepinfo
+$MAKE test-distfiles
+$MAKE test-distdir
+$MAKE distcheck
+
+:
diff --git a/tests/yacc5.test b/tests/yacc5.test
index 77de2e9..43ead6b 100755
--- a/tests/yacc5.test
+++ b/tests/yacc5.test
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2003, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2010, 2011 Free Software Foundation,
+# Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -39,7 +40,7 @@ mkdir sub
 $ACLOCAL
 $AUTOMAKE -a
 
-grep '^maude\.c:' Makefile.in
+grep '^maude\.c:.*maude\.y' Makefile.in
 
 
 ## Try again with subdir-objects.
@@ -53,8 +54,9 @@ END
 $ACLOCAL
 $AUTOMAKE -a
 
-# No rule needed, the default .y.c: inference rule is enough.
-grep '^sub/maude\.c:' Makefile.in && Exit 1
+# No rule needed, the default .y.c: inference rule is enough
+# (but there may be an additional dependency on a dirstamp file).
+grep '^sub/maude\.c:.*maude\.y' Makefile.in && Exit 1
 
 
 ## Try again with per-exe flags.


hooks/post-receive
-- 
GNU Automake



reply via email to

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