automake-commit
[Top][All Lists]
Advanced

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

[Automake-commit] [SCM] GNU Automake branch, branch-1.11, updated. v1.11


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, branch-1.11, updated. v1.11.1-535-ge8af45d
Date: Thu, 06 Oct 2011 11:47:17 +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=e8af45d7cbcdb524fcce8c40b90a6d331e6ac57c

The branch, branch-1.11 has been updated
       via  e8af45d7cbcdb524fcce8c40b90a6d331e6ac57c (commit)
       via  59919b1abf748166c0329fa1bfe5f3c3302670c2 (commit)
       via  e8082fb643b8ecd5997b9d8ca52204a81d60ea10 (commit)
       via  bbfca16e5b63386abb44f0872555198e86bd8738 (commit)
       via  90bea64bc5023be075b63bf7c651d0242f35a83c (commit)
       via  c5d19098a3deb8fc7f6ca89398edb22854737950 (commit)
       via  e834f22817217fa113e6c900d08a553051384227 (commit)
       via  6816b316a8424f868342218eab4d61497988bea6 (commit)
       via  8dc8556c9a4d1680aae579698ac3f39d39f235e5 (commit)
       via  2126b691505027fb1041a0fbd82281dd042a5bfe (commit)
       via  b10236760bd33b263be14cbd51aacaf78235e601 (commit)
       via  a2803e6a0d65e5124dd12d89acab61ac8fc11a53 (commit)
       via  b100d18da312f4b22be283b9a877b221667b2245 (commit)
       via  a2498fe8d148c507e5e09b7de8a5aee9f2418e5c (commit)
       via  c4f363ff3d699eaa6b1e1cc079d33749957934c9 (commit)
       via  eae5cfa9b373ee19b2768957b53dbe53a586b69e (commit)
       via  b9fa1fc1eb50d7907764ec0972a674548a7bd8b3 (commit)
       via  33805241126d1b087eb8af401a5f84cb33e88a3d (commit)
       via  15721c4885b8f24ca9ce2c5f2c42899277a11261 (commit)
       via  122cb639106d5b3a8dad966e43af03426670642a (commit)
       via  2c57ac68468784a67c7ed8dced20cd5ac2b63e61 (commit)
       via  73497948db0d2c6c7418f7df5c129eeee16ddf51 (commit)
       via  9393a25995d4bbedc5103cce3e7dd9a7dd39e8d6 (commit)
       via  d5ebf21cccd0597f53e7b3c4063dff4704e454a6 (commit)
       via  0209b6ddef31d414e59c6f34ae7642e9785b5770 (commit)
       via  7aea1edaab587725f4a9becd30c00b5917cfe3f0 (commit)
       via  fb7141a5a2f1da7ec13f3cb14043a0591e8ff3ea (commit)
       via  c9dfc368a623178f32b67b164f051e9ab65edd99 (commit)
      from  acb2af6bf0f745af619f164f59f7f3d37bfc6d99 (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 e8af45d7cbcdb524fcce8c40b90a6d331e6ac57c
Merge: acb2af6 59919b1
Author: Stefano Lattarini <address@hidden>
Date:   Thu Oct 6 13:45:48 2011 +0200

    Merge branch 'maint' into branch-1.11
    
    * maint:
      fix: make a test script executable
      coverage: expose automake bug#9651
      parallel-tests: automake error our on invalid TEST_EXTENSIONS
      fix: regenerate Makefile
      fix: regenerate Makefile.in files
      maintcheck: fix usage of `cd' instead of `$(am__cd)'
      docs: don't suggest installing `.m4' files in hard-coded location
      distuninstallcheck: fail also when only one file is left installed
      uninstall: "make uninstall" before "make install" works
      tests: fix tests on aclocal search path precedences
      fix: typo in NEWS
      docs: document planned precedence changes in aclocal search path
      aclocal: handle ACLOCAL_PATH environment variable
      tests: fix spurious failure in 'primary-prefix-valid-couples.test'
      docs: deprecate JAVA primary
      docs: clearer distinction between `.java' with javac and with gcj
      java: complain if java_JAVA is used but $(javadir) is undefined

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

Summary of changes:
 ChangeLog                                          |  165 ++++++++++++++++++++
 Makefile.in                                        |   24 +++-
 NEWS                                               |   28 ++++-
 THANKS                                             |    2 +
 aclocal.in                                         |   21 +++-
 automake.in                                        |   16 ++-
 doc/Makefile.in                                    |   14 +-
 doc/automake.texi                                  |  101 ++++++++++---
 lib/Automake/Makefile.in                           |   14 +-
 lib/Automake/tests/Makefile.in                     |    6 +
 lib/Makefile.in                                    |   14 +-
 lib/am/Makefile.in                                 |   10 +-
 lib/am/data.am                                     |    4 +-
 lib/am/distdir.am                                  |   22 ++-
 lib/am/inst-vars.am                                |   18 ++
 lib/am/libs.am                                     |    4 +-
 lib/am/lisp.am                                     |    8 +-
 lib/am/mans.am                                     |    8 +-
 lib/am/python.am                                   |   15 +-
 lib/am/scripts.am                                  |    4 +-
 m4/Makefile.in                                     |   14 +-
 tests/Makefile.am                                  |   15 ++
 tests/Makefile.in                                  |   21 +++
 tests/aclocal-path-install-serial.test             |   86 ++++++++++
 tests/aclocal-path-install.test                    |   55 +++++++
 ...p-python.test => aclocal-path-nonexistent.test} |   21 ++--
 tests/aclocal-path-precedence.test                 |   93 +++++++++++
 tests/aclocal-path.test                            |   58 +++++++
 ...utodist-aclocal-m4.test => dist-auxfile-2.test} |   47 ++++---
 tests/dist-auxfile.test                            |   96 ++++++++++++
 tests/distcheck-missing-m4.test                    |   27 +++-
 tests/distcheck-outdated-m4.test                   |   51 ++++++-
 ...info18.test => distcheck-override-infodir.test} |   50 ++----
 tests/distcheck-pr9579.test                        |   98 ++++++++++++
 tests/instdir-java.test                            |    1 +
 ...todist-acconfig.test => javadir-undefined.test} |   31 ++---
 tests/primary-prefix-valid-couples.test            |    2 -
 tests/test-extensions.test                         |   73 +++++++++
 tests/{java-check.test => uninstall-fail.test}     |   54 +++----
 tests/{java-sources.test => uninstall-pr9578.test} |   64 ++++----
 40 files changed, 1207 insertions(+), 248 deletions(-)
 create mode 100755 tests/aclocal-path-install-serial.test
 create mode 100755 tests/aclocal-path-install.test
 copy tests/{help-python.test => aclocal-path-nonexistent.test} (72%)
 create mode 100755 tests/aclocal-path-precedence.test
 create mode 100755 tests/aclocal-path.test
 copy tests/{autodist-aclocal-m4.test => dist-auxfile-2.test} (58%)
 create mode 100755 tests/dist-auxfile.test
 copy tests/{txinfo18.test => distcheck-override-infodir.test} (59%)
 create mode 100755 tests/distcheck-pr9579.test
 copy tests/{autodist-acconfig.test => javadir-undefined.test} (61%)
 mode change 100644 => 100755 tests/nobase-nodist.test
 create mode 100755 tests/test-extensions.test
 copy tests/{java-check.test => uninstall-fail.test} (52%)
 copy tests/{java-sources.test => uninstall-pr9578.test} (51%)

diff --git a/ChangeLog b/ChangeLog
index e1f4ce3..83cf9c2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,168 @@
+2011-10-06  Stefano Lattarini  <address@hidden>
+
+       fix: make a test script executable
+       * tests/nobase-nodist.test: Make executable.
+
+2011-10-06  Stefano Lattarini  <address@hidden>
+
+       coverage: expose automake bug#9651
+       * tests/dist-auxfile.test: New test, xfailing.
+       * tests/dist-auxfile-2.test: Likewise.
+       * tests/Makefile.am (TESTS, XFAIL_TESTS): Add them.
+
+2011-10-01  Stefano Lattarini  <address@hidden>
+
+       parallel-tests: automake error our on invalid TEST_EXTENSIONS
+       This change fixes automake bug#9400.
+       * automake.in (handle_tests): Bail out if a suffix specified in
+       TEST_EXTENSIONS would produce an invalid `xxx_LOG_COMPILER'
+       variable or an invalid suffix rule.  Before this change, automake
+       would have issued a confusing error messages (about invalid or
+       non-POSIX variables being defined), and in some situations would
+       have even produced a broken `Makefile.in' file.
+       ($TEST_EXTENSION_PATTERN): New helper variable.
+       * doc/automake.texi (Simple Tests using parallel-tests): Document
+       the limitations on TEST_EXTENSIONS explicitly.
+       * NEWS: Update.
+       * tests/test-extensions.test: New test.
+       * tests/Makefile.am (TESTS): Update.
+
+2011-09-28  Stefano Lattarini  <address@hidden>
+
+       docs: don't suggest installing `.m4' files in hard-coded location
+       This change fixes automake bug#7988.
+       * doc/automake.texi (aclocal Options): State that the use of
+       the `--print-ac-dir' option to determine the directory where
+       third-party packages can install their `.m4' files is discouraged
+       now.
+       (Extending aclocal): Suggest telling the user about ACLOCAL_PATH.
+       * THANKS: Update.
+       Report by Peter Johansson.
+
+2011-09-26  Stefano Lattarini  <address@hidden>
+
+       distuninstallcheck: fail also when only one file is left installed
+       This change fixes automake bug#9579.
+       * lib/am/distdir.am (distuninstallcheck): Be stricter in ignoring
+       a potential `dir' file created by install-info and left installed.
+       Also, be more careful about "this can't happen" kind of errors.
+       (am__distuninstallcheck_listfiles): New internal helper macro.
+       * tests/distcheck-pr9579.test: New test.
+       * tests/distcheck-override-infodir.test: Likewise.
+       * tests/Makefile.am (TESTS): Add them.
+       * NEWS, THANKS: Update.
+       Report by Nick Bowler.
+
+2011-09-28  Stefano Lattarini  <address@hidden>
+
+       maintcheck: fix usage of `cd' instead of `$(am__cd)'
+       * lib/am/inst-vars.am (am__uninstall_files_from_dir): Use
+       `$(am__cd)', not plain `cd'.
+
+2011-09-24  Stefano Lattarini  <address@hidden>
+
+       uninstall: "make uninstall" before "make install" works
+       This change fixes automake bug#9578.
+       * lib/am/inst-vars.am (am__uninstall_files_from_dir): New internal
+       macro, that defines a shell code fragment to uninstall files from
+       a given directory.
+       * lib/am/data.am (uninstall-%DIR%%PRIMARY%): Use it, to reduce code
+       duplication and improve consistency and correctness.
+       * lib/am/libs.am (uninstall-%DIR%LIBRARIES): Likewise.
+       * lib/am/lisp.am (uninstall-%DIR%LISP): Likewise.
+       * lib/am/mans.am (uninstall-man%SECTION%): Likewise.
+       * lib/am/python.am (uninstall-%DIR%LIBRARIES): Likewise.
+       * lib/am/scripts.am (uninstall-%DIR%SCRIPTS): Likewise.
+       * tests/uninstall-pr9578.test: New test.
+       * tests/uninstall-fail.test: New test.
+       * tests/Makefile.am (TESTS): Add them.
+       * NEWS, THANKS: Update.
+       Report by Nick Bowler.
+
+2011-09-22  Stefano Lattarini  <address@hidden>
+
+       tests: fix tests on aclocal search path precedences
+       * tests/aclocal-path-precedence.test: Call `$ACLOCAL' with the
+       proper overridden system acdir.
+
+2011-09-20  Stefano Lattarini  <address@hidden>
+
+       * NEWS: Fix typo.
+
+2011-09-20  Stefano Lattarini  <address@hidden>
+
+       docs: document planned precedence changes in aclocal search path
+       * doc/automake.texi (Macro Search Path): Explicitly state that the
+       lookup order for extra directories of `.m4' files will be changed
+       in the next major release.
+       * NEWS: Likewise.
+
+2011-09-19  Paolo Bonzini  <address@hidden>
+           Stefano Lattarini  <address@hidden>
+
+       aclocal: handle ACLOCAL_PATH environment variable
+       * aclocal.in (parse_ACLOCAL_PATH): New function, parse ACLOCAL_PATH
+       as a colon-separated list of directories to be included in the
+       search path.
+       * doc/automake.texi (Macro Search Path): Document new behavior and
+       the precedence rules for various elements of the search path.
+       * tests/aclocal-path.test: New test.
+       * tests/aclocal-path-install.test: Likewise.
+       * tests/aclocal-path-install-serial.test: Likewise.
+       * tests/aclocal-path-precedence.test: Likewise.
+       * tests/aclocal-path-nonexistent.test: Likewise.
+       * tests/Makefile.am (TESTS): Add them.
+       * NEWS: Update.
+       * tests/distcheck-missing-m4.test: Extend by also checking
+       interactions with ACLOCAL_PATH.
+       * tests/distcheck-outdated-m4.test: Likewise, and fix a couple
+       of botched comments since we are at it.
+
+2011-09-19  Stefano Lattarini  <address@hidden>
+
+       tests: fix spurious failure in 'primary-prefix-valid-couples.test'
+       * tests/primary-prefix-valid-couples.test: After commit
+       v1.11-464-gc9dfc36, `java_JAVA' is not a valid prefix/primary
+       combination by default anymore: one has to explicitly define
+       $(javadir) to make it so.  So just drop `java_JAVA' from our
+       Makefile.am  Also, since we are at it, ...
+       (configure.in): ... remove AM_PROG_GCJ from here, as it's not
+       really required.
+
+2011-09-19  Stefano Lattarini  <address@hidden>
+
+       docs: deprecate JAVA primary
+       * doc/automake.texi (Java): Deprecate the JAVA primary, stating
+       that it will become obsolete in automake 1.12 and probably removed
+       altogether in automake 1.13.  Reflect this in the section title,
+       by appending the string "(deprecated feature)".
+       (@menu, @detailmenu): Update.
+       (Java Support with gcj): The cross-referenced support for bytecode
+       compilation with the JAVA primary is rudimentary and deprecated.
+       State that explicitly.
+
+2011-09-19  Stefano Lattarini  <address@hidden>
+
+       docs: clearer distinction between `.java' with javac and with gcj
+       * doc/automake.texi (Java support): Rename this node ...
+       (Java support with gcj): ... to this, and change its title from
+       "Compiling Java sources" to "Compiling Java sources using gcj".
+       (@detailmenu, @menu, @cindex): Update and make more precise.
+       (Java): Change the title of this node from simply "Java" to
+       "Java bytecode compilation".
+       (@detailmenu, @menu, @cindex): Update and make more precise.
+
+2011-09-18  Stefano Lattarini  <address@hidden>
+
+       java: complain if java_JAVA is used but $(javadir) is undefined
+       Fixes automake bug#8461.
+       * automake.in (handle_java): Remove inappropriate "java" argument
+       from the calls to `&am_install_var' and `&am_primary_prefixes'.
+       * tests/instdir-java.test (Makefile.am): Define `$(javadir)'.
+       * tests/javadir-undefined.test: New test.
+       * tests/Makefile.am (TESTS): Add it.
+       * NEWS: Update.
+
 2011-09-12  Stefano Lattarini  <address@hidden>
 
        cosmetics: fix various typos and grammaros
diff --git a/Makefile.in b/Makefile.in
index 6f1e0e7..46fc1fe 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -91,6 +91,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(bindir)"
 SCRIPTS = $(bin_SCRIPTS)
 SOURCES =
@@ -145,6 +151,8 @@ am__relativize = \
 DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
 GZIP_ENV = --best
 distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+  | sed 's|^\./|${prefix}/|' | grep -v '${infodir}/dir$$'
 distcleancheck_listfiles = find . -type f -print
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -447,9 +455,7 @@ uninstall-binSCRIPTS:
        @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
        files=`for p in $$list; do echo "$$p"; done | \
               sed -e 's,.*/,,;$(transform)'`; \
-       test -n "$$list" || exit 0; \
-       echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
-       cd "$(DESTDIR)$(bindir)" && rm -f $$files
+       dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir)
 
 # This directory's subdirectories are mostly independent; you can cd
 # into them and run `make' without going through this Makefile.
@@ -753,8 +759,16 @@ distcheck: dist
          list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
          sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
 distuninstallcheck:
-       @$(am__cd) '$(distuninstallcheck_dir)' \
-       && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+       @test -n '$(distuninstallcheck_dir)' || { \
+         echo 'ERROR: trying to run $@ with an empty' \
+              '$$(distuninstallcheck_dir)' >&2; \
+         exit 1; \
+       }; \
+       $(am__cd) '$(distuninstallcheck_dir)' || { \
+         echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+         exit 1; \
+       }; \
+       test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
           || { echo "ERROR: files left after uninstall:" ; \
                if test -n "$(DESTDIR)"; then \
                  echo "  (check DESTDIR support)"; \
diff --git a/NEWS b/NEWS
index 0ec8fab..cb8aac3 100644
--- a/NEWS
+++ b/NEWS
@@ -8,11 +8,20 @@ New in 1.11.1a:
   - The `--acdir' option of aclocal is deprecated, and will probably be
     removed in the next major Automake release (1.12).
 
+  - The exact order in which the directories in the aclocal macro
+    search path are looked up is probably going to be changed in the
+    next Automake release (1.12).
+
 * Changes to aclocal:
 
-  - The `--acdir' option is deprecated.  Now you should use th new options
+  - The `--acdir' option is deprecated.  Now you should use the new options
     `--automake-acdir' and `--system-acdir' instead.
 
+  - The `ACLOCAL_PATH' environment variable is now interpreted as a
+    colon-separated list of additional directories to search after the
+    automake internal acdir (by default ${prefix}/share/aclocal-APIVERSION)
+    and before the system acdir (by default ${prefix}/share/aclocal).
+
 * Miscellaneous changes:
 
   - The `lzma' compression scheme and associated automake option `dist-lzma'
@@ -42,6 +51,12 @@ Bugs fixed in 1.11.1a:
     does not report spurious successes when used with concurrent FreeBSD
     make (e.g., "make check -j3").
 
+  - Automake now explicitly rejects invalid entries in TEST_EXTENSIONS when
+    the parallel-tests diver is in use, instead of issuing confusing and
+    apparently unrelated error messages (about "non-POSIX variable name"
+    or "bad characters in variable name"), or even, in some situations,
+    producing broken `Makefile.in' files.
+
   - The `silent-rules' option now also silences all compile rules if dependency
     tracking is disabled.  Also, when `silent-rules' is not used, the output 
from
     `make' does not contain spurious extra lines with only a backslash in them
@@ -59,6 +74,13 @@ Bugs fixed in 1.11.1a:
     languages: $(AM_YFLAGS) comes before $(YFLAGS), and $(AM_LFLAGS) before
     $(LFLAGS), so that the user variables override the developer variables.
 
+  - "make distcheck" now correctly complains also when "make uninstall"
+    leaves one and only one file installed in $(prefix).
+
+  - A "make uninstall" issued before a "make install", or after a mere
+    "make install-data" or a mere "make install-exec" does not spuriously
+    fail anymore.
+
   - Automake now warns about more primary/directory invalid combinations,
     such as "doc_LIBRARIES" or "pkglib_PROGRAMS".
 
@@ -101,6 +123,10 @@ Bugs fixed in 1.11.1a:
   - Java sources specified with check_JAVA are not compiled anymore upon
     "make all", but only upon "make check".
 
+  - An usage like "java_JAVA = foo.java" will now cause Automake to warn
+    and error out if `javadir' is undefined, instead of silently producing
+    a broken Makefile.in.
+
   - Now aclocal and automake, when they've to spawn autoconf or autom4te
     processes, honour the configure-time definitions of AUTOCONF and
     AUTOM4TE.
diff --git a/THANKS b/THANKS
index f83e1fc..81c97fb 100644
--- a/THANKS
+++ b/THANKS
@@ -244,6 +244,7 @@ Motoyuki Kasahara   address@hidden
 Nathanael Nerode       address@hidden
 Nelson H. F. Beebe     address@hidden
 Nicholas Wourms                address@hidden
+Nick Bowler            address@hidden
 Nicolas Joly           address@hidden
 Nicolas Thiery         address@hidden
 NightStrike            address@hidden
@@ -275,6 +276,7 @@ Per Oyvind Hvidsten address@hidden
 Peter Breitenlohner    address@hidden
 Peter Eisentraut       address@hidden
 Peter Gavin            address@hidden
+Peter Johansson                address@hidden
 Peter Mattis           address@hidden
 Peter Muir             address@hidden
 Peter O'Gorman         address@hidden
diff --git a/aclocal.in b/aclocal.in
index ce77e1d..2ae9a89 100644
--- a/aclocal.in
+++ b/aclocal.in
@@ -57,8 +57,9 @@ $perl_threads = 0;
 # third-party macros.
 # @user_includes can be augmented with -I.
 # @automake_includes can be reset with the `--automake-acdir' option.
-# @system_includes can be augmented with the `dirlist' file, and reset
-# with the `--system-acdir' option.
+# @system_includes can be augmented with the `dirlist' file or the
+# ACLOCAL_PATH environment variable, and reset with the `--system-acdir'
+# option.
 my @user_includes = ();
 my @automake_includes = ("@datadir@/aclocal-$APIVERSION");
 my @system_includes = ('@datadir@/aclocal');
@@ -1046,10 +1047,26 @@ sub parse_arguments ()
     }
 }
 
+# Add any directory listed in the `ACLOCAL_PATH' environment variable
+# to the list of system include directories.
+sub parse_ACLOCAL_PATH ()
+{
+  return if not defined $ENV{"ACLOCAL_PATH"};
+  # Directories in ACLOCAL_PATH should take precedence over system
+  # directories, so we use unshift.  However, directories that
+  # come first in ACLOCAL_PATH take precedence over directories
+  # coming later, which is why the result of split is reversed.
+  foreach my $dir (reverse split /:/, $ENV{"ACLOCAL_PATH"})
+    {
+      unshift (@system_includes, $dir) if $dir ne '' && -d $dir;
+    }
+}
+
 ################################################################
 
 parse_WARNINGS;                    # Parse the WARNINGS environment variable.
 parse_arguments;
+parse_ACLOCAL_PATH;
 $configure_ac = require_configure_ac;
 
 # We may have to rerun aclocal if some file have been installed, but
diff --git a/automake.in b/automake.in
index 208a66b..a60bc9f 100755
--- a/automake.in
+++ b/automake.in
@@ -213,6 +213,8 @@ my $DASH_D_PATTERN = "(^|\\s)-d(\\s|\$)";
 # Directories installed during 'install-exec' phase.
 my $EXEC_DIR_PATTERN =
   '^(?:bin|sbin|libexec|sysconf|localstate|lib|pkglib|.*exec.*)' . "\$";
+# Suffixes that can appear in TEST_EXTENSIONS (parallel-tests support).
+my $TEST_EXTENSION_PATTERN = '^(\.[a-zA-Z_][a-zA-Z0-9_]*|@[a-zA-Z0-9_]+@)$';
 
 # Values for AC_CANONICAL_*
 use constant AC_CANONICAL_BUILD  => 1;
@@ -4971,7 +4973,15 @@ sub handle_tests
            }
          define_variable ('TEST_EXTENSIONS', $suff, INTERNAL);
          # FIXME: this mishandles conditions.
-         my @test_suffixes = (var 'TEST_EXTENSIONS')->value_as_list_recursive;
+         my $var = rvar 'TEST_EXTENSIONS';
+         my @test_suffixes = $var->value_as_list_recursive;
+          if ((my @invalid_test_suffixes =
+                  grep { !/$TEST_EXTENSION_PATTERN/o } @test_suffixes) > 0)
+            {
+              error $var->rdef (TRUE)->location,
+                    "invalid test extensions: @invalid_test_suffixes";
+            }
+          @test_suffixes = grep { /$TEST_EXTENSION_PATTERN/o } @test_suffixes;
          if ($handle_exeext)
            {
              unshift (@test_suffixes, $at_exeext)
@@ -5104,11 +5114,11 @@ sub handle_java
 {
     my @sourcelist = &am_install_var ('-candist',
                                      'java', 'JAVA',
-                                     'java', 'noinst', 'check');
+                                     'noinst', 'check');
     return if ! @sourcelist;
 
     my @prefixes = am_primary_prefixes ('JAVA', 1,
-                                     'java', 'noinst', 'check');
+                                       'noinst', 'check');
 
     my $dir;
     my @java_sources = ();
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 60b8ece..b1d02f3 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -105,6 +105,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 man1dir = $(mandir)/man1
 NROFF = nroff
 MANS = $(dist_man1_MANS)
@@ -478,9 +484,7 @@ uninstall-man1:
        files=`{ for i in $$list; do echo "$$i"; done; \
        } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
              -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
-       test -z "$$files" || { \
-         echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
-         cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
+       dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
 install-dist_docDATA: $(dist_doc_DATA)
        @$(NORMAL_INSTALL)
        test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)"
@@ -498,9 +502,7 @@ uninstall-dist_docDATA:
        @$(NORMAL_UNINSTALL)
        @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-       test -n "$$files" || exit 0; \
-       echo " ( cd '$(DESTDIR)$(docdir)' && rm -f" $$files ")"; \
-       cd "$(DESTDIR)$(docdir)" && rm -f $$files
+       dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir)
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
        list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
diff --git a/doc/automake.texi b/doc/automake.texi
index 37ec011..df50a00 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -230,7 +230,7 @@ Building Programs and Libraries
 * Assembly Support::            Compiling assembly sources
 * Fortran 77 Support::          Compiling Fortran 77 sources
 * Fortran 9x Support::          Compiling Fortran 9x sources
-* Java Support::                Compiling Java sources
+* Java Support with gcj::       Compiling Java sources using gcj
 * Vala Support::                Compiling Vala sources
 * Support for Other Languages::  Compiling other languages
 * ANSI::                        Automatic de-ANSI-fication (deprecated, soon 
to be removed)
@@ -291,7 +291,7 @@ Other GNU Tools
 * Emacs Lisp::                  Emacs Lisp
 * gettext::                     Gettext
 * Libtool::                     Libtool
-* Java::                        Java
+* Java::                        Java bytecode compilation (deprecated)
 * Python::                      Python
 
 Building documentation
@@ -3254,8 +3254,12 @@ Cause the output to be put into @var{file} instead of 
@file{aclocal.m4}.
 @opindex --print-ac-dir
 Prints the name of the directory that @command{aclocal} will search to
 find third-party @file{.m4} files.  When this option is given, normal
-processing is suppressed.  This option can be used by a package to
-determine where to install a macro file.
+processing is suppressed.  This option was used @emph{in the past} by
+third-party packages to determine where to install @file{.m4} macro
+files, but @emph{this usage is today discouraged}, since it causes
address@hidden(prefix)} not to be thoroughly honoured (which violates the
+GNU Coding Standards), and a similar semantics can be better obtained
+with the @env{ACLOCAL_PATH} environment variable; @pxref{Extending aclocal}.
 
 @item --verbose
 @opindex --verbose
@@ -3430,6 +3434,41 @@ Similarly, @file{dirlist} can be handy if you have 
installed a local
 copy of Automake in your account and want @command{aclocal} to look for
 macros installed at other places on the system.
 
address@hidden
address@hidden Modifying the Macro Search Path: @file{ACLOCAL_PATH}
address@hidden @env{ACLOCAL_PATH}
+
+The fourth and last mechanism to customize the macro search path is
+also the simplest.  Any directory included in the colon-separated
+environment variable @env{ACLOCAL_PATH} is added to the search path
address@hidden Keep in sync with aclocal-path-precedence.test.
+and takes precedence over system directories (including those found via
address@hidden), with the exception of the versioned directory
address@hidden (@pxref{Macro Search Path}).  However, directories
+passed via @option{-I} will take precedence over directories in
address@hidden
+
address@hidden Keep in sync with aclocal-path-installed.test.
+Also note that, if the @option{--install} option is used, any @file{.m4}
+file containing a required macro that is found in a directory listed in
address@hidden will be installed locally.
address@hidden Keep in sync with aclocal-path-installed-serial.test.
+In this case, serial numbers in @file{.m4} are honoured too,
address@hidden
+
+Conversely to @file{dirlist}, @env{ACLOCAL_PATH} is useful if you are
+using a global copy of Automake and want @command{aclocal} to look for
+macros somewhere under your home directory.
+
address@hidden Planned future incompatibilities
+
+The order in which the directories in the macro search path are currently
+looked up is confusing and/or suboptimal in various aspects, and is
+probably going to be changed in the future Automake release.  In
+particular, directories in @env{ACLOCAL_PATH} and @address@hidden
+might end up taking precedence over @address@hidden, and
+directories in @address@hidden/dirlist} might end up taking precedence
+over @address@hidden  @emph{This is a possible future incompatibility!}
 
 @node Extending aclocal
 @subsection Writing your own aclocal macros
@@ -3457,8 +3496,12 @@ aclocal_DATA = mymacro.m4 myothermacro.m4
 
 @noindent
 Please do use @file{$(datadir)/aclocal}, and not something based on
-the result of @samp{aclocal --print-ac-dir}.  @xref{Hard-Coded Install
-Paths}, for arguments.
+the result of @samp{aclocal --print-ac-dir} (@pxref{Hard-Coded Install
+Paths}, for arguments).  It might also be helpful to suggest to
+the user to add the @file{$(datadir)/aclocal} directory to his
address@hidden variable (@pxref{ACLOCAL_PATH}) so that
address@hidden will find the @file{.m4} files installed by your
+package automatically.
 
 A file of macros should be a series of properly quoted
 @code{AC_DEFUN}'s (@pxref{Macro Definitions, , , autoconf, The
@@ -4627,7 +4670,7 @@ to build programs and libraries.
 * Assembly Support::            Compiling assembly sources
 * Fortran 77 Support::          Compiling Fortran 77 sources
 * Fortran 9x Support::          Compiling Fortran 9x sources
-* Java Support::                Compiling Java sources
+* Java Support with gcj::       Compiling Java sources using gcj
 * Vala Support::                Compiling Vala sources
 * Support for Other Languages::  Compiling other languages
 * ANSI::                        Automatic de-ANSI-fication (deprecated, soon 
to be removed)
@@ -6688,17 +6731,19 @@ is as follows:
 
 @end table
 
address@hidden Java Support
address@hidden Java Support with gcj
 @comment  node-name,  next,  previous,  up
address@hidden Java Support
address@hidden Compiling Java sources using gcj
 
address@hidden Java support
address@hidden Support for Java
address@hidden Java support with gcj
address@hidden Support for Java with gcj
address@hidden Java to native code, compilation
address@hidden Compilation of Java to native code
 
 Automake includes support for natively compiled Java, using @command{gcj},
-the Java front end to the GNU Compiler Collection (preliminary support
+the Java front end to the GNU Compiler Collection (rudimentary support
 for compiling Java to bytecode using the @command{javac} compiler is
-also present; @pxref{Java}).
+also present, @emph{albeit deprecated}; @pxref{Java}).
 
 Any package including Java code to be compiled must define the output
 variable @code{GCJ} in @file{configure.ac}; the variable @code{GCJFLAGS}
@@ -6792,8 +6837,9 @@ source file.
 Automake currently only includes full support for C, C++ (@pxref{C++
 Support}), Objective C (@pxref{Objective C Support}), Fortran 77
 (@pxref{Fortran 77 Support}), Fortran 9x (@pxref{Fortran 9x Support}),
-and Java (@pxref{Java Support}).  There is only rudimentary support for other
-languages, support for which will be improved based on user demand.
+and Java (@pxref{Java Support with gcj}).  There is only rudimentary
+support for other languages, support for which will be improved based
+on user demand.
 
 Some limited support for adding your own languages is available via the
 suffix rule handling (@pxref{Suffixes}).
@@ -7467,7 +7513,7 @@ use in GNU programs, it tries hard to interoperate with 
other GNU tools.
 * Emacs Lisp::                  Emacs Lisp
 * gettext::                     Gettext
 * Libtool::                     Libtool
-* Java::                        Java
+* Java::                        Java bytecode compilation (deprecated)
 * Python::                      Python
 @end menu
 
@@ -7560,15 +7606,22 @@ libtool, The Libtool Manual}) with the 
@code{LTLIBRARIES} primary.
 
 
 @node Java
address@hidden Java
address@hidden Java bytecode compilation (deprecated)
 
 @cindex @code{_JAVA} primary, defined
 @cindex @code{JAVA} primary, defined
 @cindex Primary variable, @code{JAVA}
address@hidden Java to bytecode, compilation
address@hidden Compilation of Java to bytecode
 
 Automake provides some minimal support for Java bytecode compilation with
 the @code{JAVA} primary (in addition to the support for compiling Java to
-native machine code; @pxref{Java Support}).
+native machine code; @pxref{Java Support with gcj}).  Note however that
address@hidden interface and most features described here are deprecated}; the
+next automake release will strive to provide a better and cleaner
+interface, which however @emph{won't be backward-compatible}; the present
+interface will probably be removed altogether in future automake releases
+(1.13 or later), so don't use it in new code.
 
 Any @file{.java} files listed in a @code{_JAVA} variable will be
 compiled with @code{JAVAC} at build time.  By default, @file{.java}
@@ -8764,9 +8817,15 @@ Each log file is created when the corresponding test has 
completed.
 The set of log files is listed in the read-only variable
 @code{TEST_LOGS}, and defaults to @code{TESTS}, with the executable
 extension if any (@pxref{EXEEXT}), as well as any suffix listed in
address@hidden removed, and @file{.log} appended.
address@hidden defaults to @file{.test}.  Results are undefined
-if a test file name ends in several concatenated suffixes.
address@hidden removed, and @file{.log} appended.  Results
+are undefined if a test file name ends in several concatenated suffixes.
address@hidden defaults to @file{.test}; it can be overridden by
+the user, in which case any extension listed in it must be constituted
+by a dot, followed by a non-digit alphabetic character, followed by any
+number of alphabetic characters.
address@hidden Keep in sync with test-extensions.test.
+For example, @samp{.sh}, @samp{.T} and @samp{.t1} are valid extensions,
+while @samp{.x-y}, @samp{.6c} and @samp{.t.1} are not.
 
 @vindex _LOG_COMPILE
 @vindex _LOG_COMPILER
diff --git a/lib/Automake/Makefile.in b/lib/Automake/Makefile.in
index 1602023..83ed03f 100644
--- a/lib/Automake/Makefile.in
+++ b/lib/Automake/Makefile.in
@@ -96,6 +96,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(perllibdir)" "$(DESTDIR)$(perllibdir)"
 DATA = $(dist_perllib_DATA) $(nodist_perllib_DATA)
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
@@ -316,9 +322,7 @@ uninstall-dist_perllibDATA:
        @$(NORMAL_UNINSTALL)
        @list='$(dist_perllib_DATA)'; test -n "$(perllibdir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-       test -n "$$files" || exit 0; \
-       echo " ( cd '$(DESTDIR)$(perllibdir)' && rm -f" $$files ")"; \
-       cd "$(DESTDIR)$(perllibdir)" && rm -f $$files
+       dir='$(DESTDIR)$(perllibdir)'; $(am__uninstall_files_from_dir)
 install-nodist_perllibDATA: $(nodist_perllib_DATA)
        @$(NORMAL_INSTALL)
        test -z "$(perllibdir)" || $(MKDIR_P) "$(DESTDIR)$(perllibdir)"
@@ -336,9 +340,7 @@ uninstall-nodist_perllibDATA:
        @$(NORMAL_UNINSTALL)
        @list='$(nodist_perllib_DATA)'; test -n "$(perllibdir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-       test -n "$$files" || exit 0; \
-       echo " ( cd '$(DESTDIR)$(perllibdir)' && rm -f" $$files ")"; \
-       cd "$(DESTDIR)$(perllibdir)" && rm -f $$files
+       dir='$(DESTDIR)$(perllibdir)'; $(am__uninstall_files_from_dir)
 
 # This directory's subdirectories are mostly independent; you can cd
 # into them and run `make' without going through this Makefile.
diff --git a/lib/Automake/tests/Makefile.in b/lib/Automake/tests/Makefile.in
index 7d39ed3..6072c33 100644
--- a/lib/Automake/tests/Makefile.in
+++ b/lib/Automake/tests/Makefile.in
@@ -101,6 +101,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 # Restructured Text title and section.
 am__rst_title = sed 's/.*/   &   /;h;s/./=/g;p;x;p;g;p;s/.*//'
 am__rst_section = sed 'p;s/./=/g;p;g'
diff --git a/lib/Makefile.in b/lib/Makefile.in
index a689f03..c5b7f8d 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -98,6 +98,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(pkgvdatadir)" "$(DESTDIR)$(scriptdir)"
 DATA = $(dist_pkgvdata_DATA) $(dist_script_DATA)
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
@@ -287,9 +293,7 @@ uninstall-dist_pkgvdataDATA:
        @$(NORMAL_UNINSTALL)
        @list='$(dist_pkgvdata_DATA)'; test -n "$(pkgvdatadir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-       test -n "$$files" || exit 0; \
-       echo " ( cd '$(DESTDIR)$(pkgvdatadir)' && rm -f" $$files ")"; \
-       cd "$(DESTDIR)$(pkgvdatadir)" && rm -f $$files
+       dir='$(DESTDIR)$(pkgvdatadir)'; $(am__uninstall_files_from_dir)
 install-dist_scriptDATA: $(dist_script_DATA)
        @$(NORMAL_INSTALL)
        test -z "$(scriptdir)" || $(MKDIR_P) "$(DESTDIR)$(scriptdir)"
@@ -307,9 +311,7 @@ uninstall-dist_scriptDATA:
        @$(NORMAL_UNINSTALL)
        @list='$(dist_script_DATA)'; test -n "$(scriptdir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-       test -n "$$files" || exit 0; \
-       echo " ( cd '$(DESTDIR)$(scriptdir)' && rm -f" $$files ")"; \
-       cd "$(DESTDIR)$(scriptdir)" && rm -f $$files
+       dir='$(DESTDIR)$(scriptdir)'; $(am__uninstall_files_from_dir)
 
 # This directory's subdirectories are mostly independent; you can cd
 # into them and run `make' without going through this Makefile.
diff --git a/lib/am/Makefile.in b/lib/am/Makefile.in
index df9e3ba..c5b9ae4 100644
--- a/lib/am/Makefile.in
+++ b/lib/am/Makefile.in
@@ -89,6 +89,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(amdir)"
 DATA = $(dist_am_DATA)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -279,9 +285,7 @@ uninstall-dist_amDATA:
        @$(NORMAL_UNINSTALL)
        @list='$(dist_am_DATA)'; test -n "$(amdir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-       test -n "$$files" || exit 0; \
-       echo " ( cd '$(DESTDIR)$(amdir)' && rm -f" $$files ")"; \
-       cd "$(DESTDIR)$(amdir)" && rm -f $$files
+       dir='$(DESTDIR)$(amdir)'; $(am__uninstall_files_from_dir)
 tags: TAGS
 TAGS:
 
diff --git a/lib/am/data.am b/lib/am/data.am
index 36af717..1817447 100644
--- a/lib/am/data.am
+++ b/lib/am/data.am
@@ -73,9 +73,7 @@ uninstall-%DIR%%PRIMARY%:
        @list='$(%DIR%_%PRIMARY%)'; test -n "$(%NDIR%dir)" || list=; \
 ?BASE? files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
 ?!BASE?        $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \
-       test -n "$$files" || exit 0; \
-       echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$files ")"; \
-       cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$files
+       dir='$(DESTDIR)$(%NDIR%dir)'; $(am__uninstall_files_from_dir)
 endif %?INSTALL%
 
 
diff --git a/lib/am/distdir.am b/lib/am/distdir.am
index c2dd7c5..ceb7e41 100644
--- a/lib/am/distdir.am
+++ b/lib/am/distdir.am
@@ -1,6 +1,6 @@
 ## automake - create Makefile.in from Makefile.am
 ## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
-## 2010 Free Software Foundation, Inc.
+## 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
@@ -516,11 +516,23 @@ distcheck: dist
 ## from distcheck, so that they can be overridden by the user.
 .PHONY: distuninstallcheck
 distuninstallcheck_listfiles = find . -type f -print
+## The `dir' file (created by install-info) might still exist after
+## uninstall, so we must be prepared to account for it.  The following
+## check is not 100% strict, but is definitely good enough, and even
+## accounts for overridden ${infodir}.
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+  | sed 's|^\./|${prefix}/|' | grep -v '${infodir}/dir$$'
 distuninstallcheck:
-## We use -le 1 because the `dir' file (created by install-info)
-## might still exist after uninstall.
-       @$(am__cd) '$(distuninstallcheck_dir)' \
-       && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+       @test -n '$(distuninstallcheck_dir)' || { \
+         echo 'ERROR: trying to run $@ with an empty' \
+              '$$(distuninstallcheck_dir)' >&2; \
+         exit 1; \
+       }; \
+       $(am__cd) '$(distuninstallcheck_dir)' || { \
+         echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+         exit 1; \
+       }; \
+       test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
           || { echo "ERROR: files left after uninstall:" ; \
                if test -n "$(DESTDIR)"; then \
                  echo "  (check DESTDIR support)"; \
diff --git a/lib/am/inst-vars.am b/lib/am/inst-vars.am
index a49cfe9..a807f79 100644
--- a/lib/am/inst-vars.am
+++ b/lib/am/inst-vars.am
@@ -15,6 +15,7 @@
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 if %?FIRST%
+
 ## These variables help stripping any $(VPATH) that some
 ## Make implementations prepend before VPATH-found files.
 ## The issue is discussed at length in distdir.am.
@@ -52,4 +53,21 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+
+## A shell code fragment to uninstall files from a given directory.
+## It expects the $dir and $files shell variables to be defined respectively
+## to the directory where the files to be removed are, and to the list of
+## such files.
+am__uninstall_files_from_dir = { \
+## Some rm implementations complain if `rm -f' is used without arguments.
+  test -z "$$files" \
+## At least Solaris /bin/sh still lacks `test -e', so we use the multiple
+## tests below instead.  We expect $dir to be either non-existent or a
+## directory, so the failure we'll experience if it is a regular file
+## is indeed desired and welcome (better to fail loudly thasn silently).
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+
 endif %?FIRST%
diff --git a/lib/am/libs.am b/lib/am/libs.am
index eec62a1..29f630b 100644
--- a/lib/am/libs.am
+++ b/lib/am/libs.am
@@ -87,9 +87,7 @@ uninstall-%DIR%LIBRARIES:
        @list='$(%DIR%_LIBRARIES)'; test -n "$(%NDIR%dir)" || list=; \
 ?BASE? files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
 ?!BASE?        $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \
-       test -n "$$files" || exit 0; \
-       echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f "$$files" )"; \
-       cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$files
+       dir='$(DESTDIR)$(%NDIR%dir)'; $(am__uninstall_files_from_dir)
 endif %?INSTALL%
 
 
diff --git a/lib/am/lisp.am b/lib/am/lisp.am
index ab45b30..6ffcdbf 100644
--- a/lib/am/lisp.am
+++ b/lib/am/lisp.am
@@ -128,12 +128,8 @@ uninstall-%DIR%LISP:
        list='$(%DIR%_LISP)'; \
 ?BASE? files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
 ?!BASE?        $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \
-       test -n "$$files" || exit 0; \
-       filesc=`echo "$$files" | sed 's|$$|c|'`; \
-       echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$files ")"; \
-       cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$files || exit $$?; \
-       echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$filesc ")"; \
-       cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$filesc
+       files="$$files "`echo "$$files" | sed 's|$$|c|'`; \
+       dir='$(DESTDIR)$(%NDIR%dir)'; $(am__uninstall_files_from_dir)
 endif %?INSTALL%
 
 
diff --git a/lib/am/mans.am b/lib/am/mans.am
index 66a6c7e..b41a94d 100644
--- a/lib/am/mans.am
+++ b/lib/am/mans.am
@@ -119,9 +119,7 @@ if %?NOTRANS_MANS%
 ?HAVE_NOTRANS?   sed -n '/\.%SECTION%[a-z]*$$/p'; \
 ## Extract basename of manpage, change the extension if needed.
        } | sed 's,.*/,,;s,\.[^%SECTION%][0-9a-z]*$$,.%SECTION%,'`; \
-       test -z "$$files" || { \
-         echo " ( cd '$(DESTDIR)$(man%SECTION%dir)' && rm -f" $$files ")"; \
-         cd "$(DESTDIR)$(man%SECTION%dir)" && rm -f $$files; }
+       dir='$(DESTDIR)$(man%SECTION%dir)'; $(am__uninstall_files_from_dir)
 endif %?NOTRANS_MANS%
 if %?TRANS_MANS%
 ## Handle MANS without notrans_ prefix
@@ -136,7 +134,5 @@ if %?TRANS_MANS%
 ## transform, and change the extension if needed.
        } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^%SECTION%][0-9a-z]*$$,%SECTION%,;x' 
\
              -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
-       test -z "$$files" || { \
-         echo " ( cd '$(DESTDIR)$(man%SECTION%dir)' && rm -f" $$files ")"; \
-         cd "$(DESTDIR)$(man%SECTION%dir)" && rm -f $$files; }
+       dir='$(DESTDIR)$(man%SECTION%dir)'; $(am__uninstall_files_from_dir)
 endif %?TRANS_MANS%
diff --git a/lib/am/python.am b/lib/am/python.am
index 40aaa62..427c95d 100644
--- a/lib/am/python.am
+++ b/lib/am/python.am
@@ -94,16 +94,15 @@ uninstall-%DIR%PYTHON:
 ?BASE? files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
 ?!BASE?        $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \
        test -n "$$files" || exit 0; \
+       dir='$(DESTDIR)$(%NDIR%dir)'; \
+## Also remove the .pyc and .pyo byte compiled versions.
        filesc=`echo "$$files" | sed 's|$$|c|'`; \
        fileso=`echo "$$files" | sed 's|$$|o|'`; \
-       echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$files ")"; \
-       cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$files || exit $$?; \
-## This is to remove the .pyc and .pyo byte compiled versions (a bit
-## of a hack).
-       echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$filesc ")"; \
-       cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$filesc || exit $$?; \
-       echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$fileso ")"; \
-       cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$fileso
+       st=0; \
+       for files in "$$files" "$$filesc" "$$fileso"; do \
+         $(am__uninstall_files_from_dir) || st=$$?; \
+       done; \
+       exit $$st
 endif %?INSTALL%
 
 
diff --git a/lib/am/scripts.am b/lib/am/scripts.am
index 790cb64..346f0d3 100644
--- a/lib/am/scripts.am
+++ b/lib/am/scripts.am
@@ -83,9 +83,7 @@ uninstall-%DIR%SCRIPTS:
 ?!BASE?        $(am__nobase_strip_setup); \
 ?!BASE?        files=`$(am__nobase_strip) \
 ?!BASE?               -e 'h;s,.*/,,;$(transform);x;s|[^/]*$$||;G;s,\n,,'`; \
-       test -n "$$list" || exit 0; \
-       echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$files ")"; \
-       cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$files
+       dir='$(DESTDIR)$(%NDIR%dir)'; $(am__uninstall_files_from_dir)
 endif %?INSTALL%
 
 
diff --git a/m4/Makefile.in b/m4/Makefile.in
index 9e096fd..2fe6235 100644
--- a/m4/Makefile.in
+++ b/m4/Makefile.in
@@ -89,6 +89,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(automake_acdir)" \
        "$(DESTDIR)$(system_acdir)"
 DATA = $(dist_automake_ac_DATA) $(dist_system_ac_DATA)
@@ -281,9 +287,7 @@ uninstall-dist_automake_acDATA:
        @$(NORMAL_UNINSTALL)
        @list='$(dist_automake_ac_DATA)'; test -n "$(automake_acdir)" || list=; 
\
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-       test -n "$$files" || exit 0; \
-       echo " ( cd '$(DESTDIR)$(automake_acdir)' && rm -f" $$files ")"; \
-       cd "$(DESTDIR)$(automake_acdir)" && rm -f $$files
+       dir='$(DESTDIR)$(automake_acdir)'; $(am__uninstall_files_from_dir)
 install-dist_system_acDATA: $(dist_system_ac_DATA)
        @$(NORMAL_INSTALL)
        test -z "$(system_acdir)" || $(MKDIR_P) "$(DESTDIR)$(system_acdir)"
@@ -301,9 +305,7 @@ uninstall-dist_system_acDATA:
        @$(NORMAL_UNINSTALL)
        @list='$(dist_system_ac_DATA)'; test -n "$(system_acdir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-       test -n "$$files" || exit 0; \
-       echo " ( cd '$(DESTDIR)$(system_acdir)' && rm -f" $$files ")"; \
-       cd "$(DESTDIR)$(system_acdir)" && rm -f $$files
+       dir='$(DESTDIR)$(system_acdir)'; $(am__uninstall_files_from_dir)
 tags: TAGS
 TAGS:
 
diff --git a/tests/Makefile.am b/tests/Makefile.am
index c2dbf23..bf17aea 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -20,6 +20,8 @@ XFAIL_TESTS = \
 all.test \
 auxdir2.test \
 cond17.test \
+dist-auxfile.test \
+dist-auxfile-2.test \
 gcj6.test \
 java-nobase.test \
 pr8365-remake-timing.test \
@@ -74,6 +76,11 @@ acloca21.test \
 acloca22.test \
 aclocal-acdir.test \
 aclocal-print-acdir.test \
+aclocal-path.test \
+aclocal-path-install.test \
+aclocal-path-install-serial.test \
+aclocal-path-nonexistent.test \
+aclocal-path-precedence.test \
 acoutnoq.test \
 acoutpt.test \
 acoutpt2.test \
@@ -311,6 +318,8 @@ destdir.test \
 dirlist.test \
 dirlist2.test \
 discover.test \
+dist-auxfile.test \
+dist-auxfile-2.test \
 dist-included-parent-dir.test \
 distcleancheck.test \
 distcom2.test \
@@ -330,6 +339,8 @@ distcheck-hook.test \
 distcheck-hook2.test \
 distcheck-missing-m4.test \
 distcheck-outdated-m4.test \
+distcheck-pr9579.test \
+distcheck-override-infodir.test \
 dmalloc.test \
 doc-parsing-buglets-colneq-subst.test \
 doc-parsing-buglets-tabs.test \
@@ -453,6 +464,7 @@ java2.test \
 java3.test \
 java-check.test \
 java-empty-classpath.test \
+javadir-undefined.test \
 javaprim.test \
 javasubst.test \
 java-clean.test \
@@ -622,6 +634,7 @@ parallel-tests-log-override-1.test \
 parallel-tests-log-override-2.test \
 parallel-tests-log-override-recheck.test \
 parallel-tests-log-compiler-example.test \
+test-extensions.test \
 parse.test \
 percent.test \
 percent2.test \
@@ -846,6 +859,8 @@ txinfo32.test \
 txinfo33.test \
 transform.test \
 transform2.test \
+uninstall-pr9578.test \
+uninstall-fail.test \
 unused.test \
 upc.test \
 upc2.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 5384f30..ea63131 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -104,6 +104,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 # Restructured Text title and section.
 am__rst_title = sed 's/.*/   &   /;h;s/./=/g;p;x;p;g;p;s/.*//'
 am__rst_section = sed 'p;s/./=/g;p;g'
@@ -285,6 +291,8 @@ XFAIL_TESTS = \
 all.test \
 auxdir2.test \
 cond17.test \
+dist-auxfile.test \
+dist-auxfile-2.test \
 gcj6.test \
 java-nobase.test \
 pr8365-remake-timing.test \
@@ -352,6 +360,11 @@ acloca21.test \
 acloca22.test \
 aclocal-acdir.test \
 aclocal-print-acdir.test \
+aclocal-path.test \
+aclocal-path-install.test \
+aclocal-path-install-serial.test \
+aclocal-path-nonexistent.test \
+aclocal-path-precedence.test \
 acoutnoq.test \
 acoutpt.test \
 acoutpt2.test \
@@ -589,6 +602,8 @@ destdir.test \
 dirlist.test \
 dirlist2.test \
 discover.test \
+dist-auxfile.test \
+dist-auxfile-2.test \
 dist-included-parent-dir.test \
 distcleancheck.test \
 distcom2.test \
@@ -608,6 +623,8 @@ distcheck-hook.test \
 distcheck-hook2.test \
 distcheck-missing-m4.test \
 distcheck-outdated-m4.test \
+distcheck-pr9579.test \
+distcheck-override-infodir.test \
 dmalloc.test \
 doc-parsing-buglets-colneq-subst.test \
 doc-parsing-buglets-tabs.test \
@@ -731,6 +748,7 @@ java2.test \
 java3.test \
 java-check.test \
 java-empty-classpath.test \
+javadir-undefined.test \
 javaprim.test \
 javasubst.test \
 java-clean.test \
@@ -900,6 +918,7 @@ parallel-tests-log-override-1.test \
 parallel-tests-log-override-2.test \
 parallel-tests-log-override-recheck.test \
 parallel-tests-log-compiler-example.test \
+test-extensions.test \
 parse.test \
 percent.test \
 percent2.test \
@@ -1124,6 +1143,8 @@ txinfo32.test \
 txinfo33.test \
 transform.test \
 transform2.test \
+uninstall-pr9578.test \
+uninstall-fail.test \
 unused.test \
 upc.test \
 upc2.test \
diff --git a/tests/aclocal-path-install-serial.test 
b/tests/aclocal-path-install-serial.test
new file mode 100755
index 0000000..15b4204
--- /dev/null
+++ b/tests/aclocal-path-install-serial.test
@@ -0,0 +1,86 @@
+#! /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/>.
+
+# ACLOCAL_PATH, acdir and `--install' interactions when serial number
+# are involved.
+
+am_create_testdir=empty
+. ./defs || Exit 1
+
+set -e
+
+cat > configure.in << 'END'
+AC_INIT
+AM_FOO
+END
+
+set_serial ()
+{
+  serial=$1 file=$2
+  sed '/^# serial/d' $file > t
+  case $serial in
+    none) mv -f t $file;;
+       *) (echo "# serial $serial" && cat t) > $file; rm -f t;;
+  esac
+  cat $file # For debugging.
+}
+
+win ()
+{
+  case $1 in
+    sdir) ok=sdir ko=pdir;;
+    pdir) ok=pdir ko=sdir;;
+       *) fatal_ "win(): invalud argument \`$1'";;
+  esac
+  rm -rf aclocal.m4 autom4te*.cache m4/*
+  $ACLOCAL -I m4 --install
+  test -f m4/foo.m4 # Sanity check.
+  $AUTOCONF
+  $FGREP "::$ok:"  m4/foo.m4
+  $FGREP "::$ok::" configure
+  $FGREP "::$ko::" m4/foo.m4 configure && Exit 1
+  :
+}
+
+mkdir sdir pdir m4
+
+ACLOCAL="$ACLOCAL --system-acdir=`pwd`/sdir"
+ACLOCAL_PATH=./pdir; export ACLOCAL_PATH
+
+cat > sdir/foo.m4 << 'END'
+AC_DEFUN([AM_FOO], [::sdir::])
+END
+cat > pdir/foo.m4 << 'END'
+AC_DEFUN([AM_FOO], [::pdir::])
+END
+
+set_serial 2 sdir/foo.m4
+set_serial 1 pdir/foo.m4
+win sdir
+
+set_serial 3.3 sdir/foo.m4
+set_serial 5.7 pdir/foo.m4
+win pdir
+
+set_serial 0    sdir/foo.m4
+set_serial none pdir/foo.m4
+win sdir
+
+set_serial none  sdir/foo.m4
+set_serial 1.2.3 pdir/foo.m4
+win pdir
+
+:
diff --git a/tests/aclocal-path-install.test b/tests/aclocal-path-install.test
new file mode 100755
index 0000000..5e46eb6
--- /dev/null
+++ b/tests/aclocal-path-install.test
@@ -0,0 +1,55 @@
+#! /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/>.
+
+# ACLOCAL_PATH and `--install' interactions.
+
+am_create_testdir=empty
+. ./defs || Exit 1
+
+set -e
+
+cat > configure.in << 'END'
+AC_INIT
+AM_FOO
+END
+
+mkdir acdir pdir ldir
+
+ACLOCAL="$ACLOCAL --system-acdir=`pwd`/acdir"
+ACLOCAL_PATH=./pdir; export ACLOCAL_PATH
+
+cat > acdir/foo.m4 << 'END'
+AC_DEFUN([AM_FOO], [:])
+END
+
+cat > pdir/bar.m4 << 'END'
+AC_DEFUN([AM_BAR], [:])
+END
+
+# The `--install' option should never cause anything to be installed
+# in a directory specified in ACLOCAL_PATH.
+$ACLOCAL --install 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+grep ' no -I was supplied' stderr
+test ! -f pdir/foo.m4
+
+# The `--install' option should cause a required macro found in a
+# directory specified in ACLOCAL_PATH to be installed locally.
+echo AM_BAR >> configure.in
+$ACLOCAL --install -I ldir
+diff pdir/bar.m4 ldir/bar.m4
+
+:
diff --git a/tests/help-python.test b/tests/aclocal-path-nonexistent.test
similarity index 72%
copy from tests/help-python.test
copy to tests/aclocal-path-nonexistent.test
index ba20013..e1157a1 100755
--- a/tests/help-python.test
+++ b/tests/aclocal-path-nonexistent.test
@@ -14,24 +14,23 @@
 # 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 macro `AM_PATH_PYTHON' adds proper text to the
-# configure help screen.
+# Non-existent directories in ACLOCAL_PATH are ok.
 
+am_create_testdir=empty
 . ./defs || Exit 1
 
 set -e
 
-cat > configure.in <<END
-AC_INIT([$me], [1.0])
-AM_PATH_PYTHON
+cat > configure.in << 'END'
+AC_INIT
+AM_FOO
 END
 
-$ACLOCAL
-$AUTOCONF
-
-./configure --help >stdout || { cat stdout; Exit 1; }
-cat stdout
+mkdir mdir
+echo 'AC_DEFUN([AM_FOO], [am--foo])' > mdir/foo.m4
 
-grep '^  *PYTHON  *the Python interpreter$' stdout
+ACLOCAL_PATH=./nonesuch:./mdir:`pwd`/nonesuch2:nonesuch3 $ACLOCAL
+$AUTOCONF
+$FGREP 'am--foo' configure
 
 :
diff --git a/tests/aclocal-path-precedence.test 
b/tests/aclocal-path-precedence.test
new file mode 100755
index 0000000..b170dd5
--- /dev/null
+++ b/tests/aclocal-path-precedence.test
@@ -0,0 +1,93 @@
+#! /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 precedence rules for ACLOCAL_PATH.
+
+am_create_testdir=empty
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_INIT
+AM_INIT_AUTOMAKE([parallel-tests])
+FOO_MACRO
+BAR_MACRO
+AC_PROG_LIBTOOL
+AM_GNU_GETTEXT
+END
+
+mkdir mdir1 mdir2 mdir3 sysdir extradir
+
+cat > mdir1/foo1.m4 << 'END'
+AC_DEFUN([FOO_MACRO], [::pass-foo::])
+END
+
+cat > mdir2/foo2.m4 << 'END'
+AC_DEFUN([FOO_MACRO], [::fail-foo::])
+END
+
+cat > mdir1/baz.m4 << 'END'
+AC_DEFUN([BAR_MACRO], [::fail-bar::])
+END
+
+cat > mdir3/bar.m4 << 'END'
+AC_DEFUN([BAR_MACRO], [::pass-bar::])
+END
+
+cat > mdir2/quux.m4 << 'END'
+AC_DEFUN([AM_INIT_AUTOMAKE], [::fail-init::])
+AC_DEFUN([AC_PROG_LIBTOOL],  [::pass-libtool::])
+AC_DEFUN([AM_GNU_GETTEXT],   [::pass-gettext::])
+END
+
+cat > sysdir/libtool.m4 << 'END'
+AC_DEFUN([AC_PROG_LIBTOOL], [::fail-libtool::])
+END
+
+cat > extradir/gettext.m4 << 'END'
+AC_DEFUN([AM_GNU_GETTEXT], [::fail-gettext::])
+END
+
+echo ./extradir > sysdir/dirlist
+
+ACLOCAL_PATH=mdir1:mdir2 $ACLOCAL -I mdir3 --system-acdir sysdir
+$AUTOCONF
+
+$FGREP '::' configure # For debugging.
+
+# Directories coming first in ACLOCAL_PATH should take precedence
+# over those coming later.
+$FGREP '::pass-foo::' configure
+
+# Directories from `-I' options should take precedence over directories
+# in ACLOCAL_PATH.
+$FGREP '::pass-bar::' configure
+
+# Directories in ACLOCAL_PATH should take precedence over system acdir
+# (typically `${prefix}/share/aclocal'), and any directory added through
+# the `dirlist' special file.
+$FGREP '::pass-gettext::' configure
+$FGREP '::pass-libtool::' configure
+
+# Directories in ACLOCAL_PATH shouldn't take precedence over the internal
+# automake acdir (typically `${prefix}/share/aclocal-${APIVERSION}').
+$FGREP 'am__api_version' configure
+
+# A final sanity check.
+$FGREP '::fail' configure && Exit 1
+
+:
diff --git a/tests/aclocal-path.test b/tests/aclocal-path.test
new file mode 100755
index 0000000..16fd3f9
--- /dev/null
+++ b/tests/aclocal-path.test
@@ -0,0 +1,58 @@
+#! /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 basic ACLOCAL_PATH support.
+
+am_create_testdir=empty
+. ./defs || Exit 1
+
+set -e
+
+cat > configure.in << 'END'
+AC_INIT
+AM_FOO_MACRO
+AM_BAR_MACRO
+AM_BAZ_MACRO
+END
+
+mkdir mdir1 mdir2 mdir3
+
+cat > mdir1/foo.m4 << 'END'
+AC_DEFUN([AM_FOO_MACRO], [am--foo])
+END
+
+cat > mdir2/bar.m4 << 'END'
+AC_DEFUN([AM_BAR_MACRO], [am--bar])
+END
+
+cat > mdir3/baz.m4 << 'END'
+AC_DEFUN([AM_BAZ_MACRO], [am--baz])
+END
+
+ACLOCAL_PATH=mdir1:./mdir2:`pwd`/mdir3 $ACLOCAL
+$AUTOCONF
+
+# there should be no m4_include in aclocal.m4, even though ACLOCAL_PATH
+# contains `mdir1' and `./mdir2' as relative directories.  Only -I
+# directories should be subject to file inclusion.
+$FGREP m4_include aclocal.m4 && Exit 1
+
+$EGREP 'AM_(FOO|BAR|BAZ)_MACRO' configure && Exit 1
+$FGREP 'am--foo' configure
+$FGREP 'am--bar' configure
+$FGREP 'am--baz' configure
+
+:
diff --git a/tests/autodist-aclocal-m4.test b/tests/dist-auxfile-2.test
similarity index 58%
copy from tests/autodist-aclocal-m4.test
copy to tests/dist-auxfile-2.test
index 3f53d59..08daa6c 100755
--- a/tests/autodist-aclocal-m4.test
+++ b/tests/dist-auxfile-2.test
@@ -14,41 +14,48 @@
 # 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 `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.
+# Files specified by AC_REQUIRE_AUX_FILE must exist, and if a Makefile
+# is present in the build-aux directory, they correctly get automatically
+# distributed.
+# Related to automake bug#9651.
 
+am_create_testdir=empty
 . ./defs || Exit 1
 
 set -e
 
-{ echo 'm4_include([defs.m4])'
-  cat configure.in
-  echo 'AC_OUTPUT'
-} > t
-mv -f t configure.in
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AC_CONFIG_AUX_DIR([sub])
+AM_INIT_AUTOMAKE
+AC_REQUIRE_AUX_FILE([zardoz])
+AC_CONFIG_FILES([Makefile sub/Makefile])
+AC_OUTPUT
+END
 
 cat > Makefile.am <<'END'
-.PHONY: test
+SUBDIRS = sub
 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; :
+       ls -l $(distdir) $(distdir)/* ;: For debugging.
+       test -f $(distdir)/sub/zardoz
+.PHONY: test
 check-local: test
 END
 
-: > defs.m4
-$ACLOCAL
-mv -f aclocal.m4 defs.m4
+mkdir sub
+: > sub/Makefile.am
 
-$AUTOMAKE
+echo dummy > sub/zardoz
+
+$ACLOCAL
 $AUTOCONF
+$AUTOMAKE -a
+test -f sub/install-sh
+# Should work also without `--add-missing'.
+$AUTOMAKE
 
 ./configure
+
 $MAKE test
 $MAKE distcheck
 
diff --git a/tests/dist-auxfile.test b/tests/dist-auxfile.test
new file mode 100755
index 0000000..2776a25
--- /dev/null
+++ b/tests/dist-auxfile.test
@@ -0,0 +1,96 @@
+#! /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/>.
+
+# Files specified by AC_REQUIRE_AUX_FILE must exist, and they get
+# automatically distributed by the top-level Makefile.am.
+# Automake bug#9651 reported that this didn't happen when the build-aux
+# directory was set to `.' by AC_CONFIG_AUX_DIR.
+
+am_create_testdir=empty
+. ./defs || Exit 1
+
+set -e
+
+i=0
+for auxdir in build-aux ''; do
+
+  echo "*** Testing with auxdir '$auxdir' ***"
+
+  i=`expr $i + 1`
+  mkdir T$i.d
+  cd T$i.d
+
+  unindent > configure.in <<END
+    AC_INIT([$me], [1.0])
+    AC_CONFIG_AUX_DIR([${auxdir:-.}])
+    AM_INIT_AUTOMAKE
+    AC_REQUIRE_AUX_FILE([foo.txt])
+    AC_REQUIRE_AUX_FILE([bar.sh])
+    AC_REQUIRE_AUX_FILE([zardoz])
+    AC_CONFIG_FILES([Makefile subdir/Makefile])
+    AC_OUTPUT
+END
+
+  echo auxdir = ${auxdir:+"$auxdir/"} > Makefile.am
+  unindent >> Makefile.am <<'END'
+    SUBDIRS = subdir
+    test: distdir
+       ls -l $(distdir) $(distdir)/*      ;: For debugging.
+       @echo DIST_COMMON = $(DIST_COMMON) ;: Likewise.
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]$(auxdir)foo.txt '
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]$(auxdir)bar.sh '
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]$(auxdir)zardoz '
+       test -f $(distdir)/$(auxdir)foo.txt
+       test -f $(distdir)/$(auxdir)bar.sh
+       test -f $(distdir)/$(auxdir)zardoz
+    .PHONY: test
+    check-local: test
+END
+
+  mkdir subdir
+  : > subdir/Makefile.am
+  
+  test -z "$auxdir" || mkdir "$auxdir" || Exit 99
+
+  if test -z "$auxdir"; then
+    auxdir=.
+    auxdir_rx='\.'
+  else
+    auxdir_rx=$auxdir
+  fi
+
+  $ACLOCAL
+  $AUTOCONF
+
+  AUTOMAKE_fails
+  grep "^configure\\.in:4:.* required file.*$auxdir_rx/foo\\.txt" stderr
+  grep "^configure\\.in:5:.* required file.*$auxdir_rx/bar\\.sh"  stderr
+  grep "^configure\\.in:6:.* required file.*$auxdir_rx/zardoz"    stderr
+
+  touch $auxdir/foo.txt $auxdir/bar.sh $auxdir/zardoz
+  cp "$testsrcdir"/../lib/missing "$testsrcdir"/../lib/install-sh $auxdir
+  $AUTOMAKE
+  ./configure
+  $MAKE test
+  $EGREP '(foo\.txt|bar\.sh|zardoz)' subdir/Makefile.in && Exit 1
+
+  $MAKE distcheck
+
+  cd ..
+
+done
+
+:
diff --git a/tests/distcheck-missing-m4.test b/tests/distcheck-missing-m4.test
index f4e0eda..1a2b62f 100755
--- a/tests/distcheck-missing-m4.test
+++ b/tests/distcheck-missing-m4.test
@@ -39,9 +39,10 @@ AC_OUTPUT
 MY_FOO
 MY_BAR
 MY_BAZ
+MY_ZAR
 END
 
-mkdir m4 acdir acdir1 acdir2
+mkdir m4 acdir acdir1 acdir2 pth
 
 cat > acdir/dirlist << END
 $cwd/acdir1
@@ -52,21 +53,25 @@ echo 'AC_DEFUN([MY_FOO], [:])' > m4/foo.m4
 echo 'AC_DEFUN([MY_BAR], [:])' > acdir1/bar.m4
 echo 'AC_DEFUN([MY_BAZ], [:])' > acdir1/baz.m4
 echo 'AC_DEFUN([MY_QUX], [:])' > acdir2/qux.m4
+echo 'AC_DEFUN([MY_ZAR], [:])' > pth/zar.m4
+echo 'AC_DEFUN([MY_BLA], [:])' > pth/bla.m4
 
 ACLOCAL="$ACLOCAL --system-acdir=$cwd/acdir"; export ACLOCAL
+ACLOCAL_PATH=$cwd/pth; export ACLOCAL_PATH
 
 # We don't use `--install' here.  Our distcheck-hook should catch this.
 $ACLOCAL -I m4
 $AUTOCONF
-$EGREP 'MY_(FOO|BAR|BAZ)' configure && Exit 1 # Sanity check.
+$EGREP 'MY_(FOO|BAR|BAZ|ZAR)' configure && Exit 1 # Sanity check.
 $AUTOMAKE
 
 ./configure
 
 $MAKE distcheck >output 2>&1 && { cat output; Exit 1; }
 cat output
-$EGREP "required m4 file.*not distributed.* bar.m4( |$)" output
-$EGREP "required m4 file.*not distributed.* baz.m4( |$)" output
+for x in bar baz zar; do
+  $EGREP "required m4 file.*not distributed.* $x.m4( |$)" output
+done
 # Check that we don't fail for spurious errors.
 $EGREP -i 'mkdir:|autom4te.*\.cache|:.*(permission|denied)' output && Exit 1
 
@@ -74,28 +79,34 @@ $EGREP -i 'mkdir:|autom4te.*\.cache|:.*(permission|denied)' 
output && Exit 1
 $ACLOCAL -I m4 --install
 test -f m4/bar.m4 # Sanity check.
 test -f m4/baz.m4 # Likewise.
+test -f m4/zar.m4 # Likewise.
 using_gmake || $MAKE Makefile
 $MAKE distcheck
 
-# We start to use a new "third-party" macro from a new .m4 file, but forget
+# We start to use new "third-party" macros from new .m4 files, but forget
 # to re-run "aclocal --install" by hand, relying on automatic remake rules.
 # Our distcheck-hook should catch this too.
-echo MY_QUX >> configure.in
+cat >> configure.in << 'END'
+MY_QUX
+MY_BLA
+END
 
 $MAKE
-$EGREP 'MY_(FOO|BAR|BAZ|QUX)' configure && Exit 1 # Sanity check.
+$EGREP 'MY_(FOO|BAR|BAZ|QUX|ZAR|BLA)' configure && Exit 1 # Sanity check.
 
 $MAKE distcheck >output 2>&1 && { cat output; Exit 1; }
 cat output
 $EGREP "required m4 file.*not distributed.* qux.m4( |$)" output
+$EGREP "required m4 file.*not distributed.* bla.m4( |$)" output
 # Check that we don't fail for spurious errors.
 $EGREP -i 'mkdir:|autom4te.*\.cache|permission|denied' output && Exit 1
 # Check that we don't complain for files that should have been found.
-grep " ba[rz].m4" output && Exit 1
+$FGREP " (bar|baz|zar).m4" output && Exit 1
 
 # Now we again use `--install', and "make distcheck" should pass.
 $ACLOCAL -I m4 --install
 test -f m4/qux.m4 # Sanity check.
+test -f m4/bla.m4 # Likewise.
 using_gmake || $MAKE Makefile
 $MAKE distcheck
 
diff --git a/tests/distcheck-outdated-m4.test b/tests/distcheck-outdated-m4.test
index 74f2922..7a3ade8 100755
--- a/tests/distcheck-outdated-m4.test
+++ b/tests/distcheck-outdated-m4.test
@@ -50,7 +50,8 @@ END
 
 ACLOCAL="$ACLOCAL --system-acdir=$cwd/acdir"; export ACLOCAL
 
-# We don't use `--install' here.  Our distcheck-hook should catch this.
+# The use of `--install' here won't help when the installed file `.m4'
+# will become out-of-date w.r.t. the one in the system acdir.
 $ACLOCAL -I m4 --install
 $AUTOCONF
 $AUTOMAKE
@@ -77,10 +78,54 @@ cat output
 $EGREP "required m4 file.* outdated.* baz.m4( |$)" output
 # Check that we don't fail for spurious errors.
 $EGREP -i 'mkdir:|autom4te.*\.cache|permission|denied' output && Exit 1
-# Check that we don't complain for files that should have been found.
+# Check that we don't complain for files that aren't outdated.
 $EGREP " (foo|bar).m4" output && Exit 1
 
-# Now we again use `--install', and "make distcheck" should pass.
+# Now we again use `--install' explicitly, and "make distcheck"
+# should pass.
+$ACLOCAL -I m4 --install
+using_gmake || $MAKE Makefile
+$MAKE distcheck
+
+# Similar to what have been done above, but this time we:
+#  - use ACLOCAL_PATH, and
+#  - do not add the use of a new macro.
+
+echo MY_FNORD >> configure.in
+
+mkdir pth
+cat > pth/fnord.m4 << 'END'
+# serial 1
+AC_DEFUN([MY_FNORD], [:])
+END
+
+ACLOCAL_PATH="$cwd/pth"; export ACLOCAL_PATH
+
+# The explicit use of `--install' here won't help when the installed file
+# `.m4' will become out-of-date w.r.t. the one in the system acdir.
+$ACLOCAL -I m4 --install
+using_gmake || $MAKE Makefile
+$MAKE distcheck
+
+# Only increase serial number, without changing the other contents; this
+# is deliberate.
+cat > pth/fnord.m4 << 'END'
+# serial 2
+AC_DEFUN([MY_FNORD], [:])
+END
+
+$MAKE # Rebuild configure and makefiles.
+$MAKE distcheck >output 2>&1 && { cat output; Exit 1; }
+cat output
+
+$EGREP "required m4 file.* outdated.* fnord.m4( |$)" output
+# Check that we don't fail for spurious errors.
+$EGREP -i 'mkdir:|autom4te.*\.cache|permission|denied' output && Exit 1
+# Check that we don't complain for files that aren't outdated.
+$EGREP " (foo|bar|baz).m4" output && Exit 1
+
+# Now we again use `--install' explicitly, and "make distcheck"
+# should pass.
 $ACLOCAL -I m4 --install
 using_gmake || $MAKE Makefile
 $MAKE distcheck
diff --git a/tests/txinfo18.test b/tests/distcheck-override-infodir.test
similarity index 59%
copy from tests/txinfo18.test
copy to tests/distcheck-override-infodir.test
index 8dc8961..8c54cfb 100755
--- a/tests/txinfo18.test
+++ b/tests/distcheck-override-infodir.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2002, 2008, 2009, 2011 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,9 +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 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.
+# Check that we can override ${infodir} while having distcheck still
+# working.  Relate to automake bug#9579.
 
 required='makeinfo tex texi2dvi'
 . ./defs || Exit 1
@@ -28,50 +27,37 @@ AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
+infodir = ${prefix}/blah/blah/foobar
 info_TEXINFOS = main.texi
-main_TEXINFOS = sub.texi
+## Sanity check.
+installcheck-local:
+       if test x$${infodir+set} != xset; then \
+         ls -l "$(DESTDIR)/$(prefix)/blah/blah/foobar/" || exit 1; \
+         test -f "$(DESTDIR)/$(prefix)/blah/blah/foobar/dir" || exit 1; \
+       else \
+         ls -l "$(DESTDIR)/$$infodir/" || exit 1; \
+         test -f "$(DESTDIR)/$$infodir/dir" || exit 1; \
+       fi
 END
 
 cat > main.texi << 'END'
 \input texinfo
 @setfilename main.info
 @settitle main
address@hidden au
address@hidden sa
address@hidden sb
address@hidden sa sb
 @node Top
 Hello walls.
address@hidden sub.texi
 @bye
 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
-
 $ACLOCAL
-$AUTOMAKE --add-missing
+$AUTOMAKE -a
 $AUTOCONF
 
 ./configure
+$MAKE
 
-$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
+$MAKE distcheck
+infodir="`pwd`"/_info $MAKE -e distcheck
+test -f _info/dir || Exit 99 # Sanity check.
 
 :
diff --git a/tests/distcheck-pr9579.test b/tests/distcheck-pr9579.test
new file mode 100755
index 0000000..667401d
--- /dev/null
+++ b/tests/distcheck-pr9579.test
@@ -0,0 +1,98 @@
+#! /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 against automake bug#9579: distcheck does not always detect
+# incomplete uninstall as advertised.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
+
+# NOTE: the use of `dir' as the name of the data file installed by hand
+# is deliberate, and enhances coverage -- see definition and comments of
+# lib/am/distdir.am:$(am__distuninstallcheck_listfiles).
+
+cat > Makefile.am << 'END'
+dist_data_DATA = foo
+EXTRA_DIST = dir
+install-data-local:
+       $(MKDIR_P) '$(DESTDIR)$(datadir)'
+       cp '$(srcdir)/dir' '$(DESTDIR)$(datadir)/dir'
+END
+
+: > foo
+: > dir
+
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
+
+./configure --prefix="`pwd`/inst"
+
+# Sanity checks.
+$MAKE install
+find inst -type f
+test -f inst/share/foo
+test -f inst/share/dir
+# We expect the uninstall target of our Makefile to be definitely broken.
+$MAKE uninstall
+test -f inst/share/dir
+rm -rf inst
+
+$MAKE distcheck >output 2>&1 && { cat output; Exit 1; }
+cat output
+
+$FGREP 'ERROR: files left after uninstall:' output
+grep '/share/dir *$' output
+
+# A few trickier corner cases.
+
+cat > Makefile.am << 'END'
+EXTRA_DIST = dir
+install-data-local:
+install-data-local:
+       $(MKDIR_P) '$(DESTDIR)$(prefix)/mu/share/info'
+       cp '$(srcdir)/dir' '$(DESTDIR)$(prefix)/mu/share/info'
+       $(MKDIR_P) '$(DESTDIR)$(infodir)/more'
+       cp '$(srcdir)/dir' '$(DESTDIR)$(infodir)/more'
+END
+
+$AUTOMAKE
+./config.status Makefile
+
+# Sanity checks, again.
+$MAKE install
+find inst -type f
+test -f inst/mu/share/info/dir
+test -f inst/share/info/more/dir
+# We expect the uninstall target of our Makefile to be definitely broken.
+$MAKE uninstall
+test -f inst/mu/share/info/dir
+test -f inst/share/info/more/dir
+rm -rf inst
+
+$MAKE distcheck >output 2>&1 && { cat output; Exit 1; }
+cat output
+
+$FGREP 'ERROR: files left after uninstall:' output
+grep '/mu/share/info/dir *$' output
+grep '/share/info/more/dir *$' output
+
+:
diff --git a/tests/instdir-java.test b/tests/instdir-java.test
index 9d9a03c..94a6a25 100755
--- a/tests/instdir-java.test
+++ b/tests/instdir-java.test
@@ -26,6 +26,7 @@ AC_OUTPUT
 END
 
 cat >Makefile.am <<'END'
+javadir = $(datarootdir)/java
 java_JAVA = foo.java
 END
 
diff --git a/tests/autodist-acconfig.test b/tests/javadir-undefined.test
similarity index 61%
copy from tests/autodist-acconfig.test
copy to tests/javadir-undefined.test
index 49ab2f0..9b6d1f3 100755
--- a/tests/autodist-acconfig.test
+++ b/tests/javadir-undefined.test
@@ -14,33 +14,24 @@
 # 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 `acconfig.h' is automatically distributed if it exists
-# (at automake runtime).
-# Related to automake bug#7819.
+# Use of JAVA primary should not allow the use of the `java_' prefix
+# when $(javadir) is undefined.  Otherwise, we could silently end up
+# with a broken Makefile.in (where "make install" doesn't install
+# the *.class files).
+# See automake bug#8461.
 
 . ./defs || Exit 1
 
 set -e
 
-cat >> configure.in <<END
-AC_OUTPUT
-END
-
-cat > Makefile.am <<'END'
-.PHONY: test
-test: distdir
-       ls -l $(distdir)
-       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]acconfig\.h '
-       test -f $(distdir)/acconfig.h
-END
+$ACLOCAL
 
-: > acconfig.h
+echo java_JAVA = a.java > Makefile.am
+AUTOMAKE_fails
+grep '^Makefile\.am:1:.*java_JAVA.*javadir.* undefined' stderr
+$EGREP '(uninitialized|line) ' stderr && Exit 1
 
-$ACLOCAL
+echo javadir = a-dummy-value >> Makefile.am
 $AUTOMAKE
-$AUTOCONF
-
-./configure
-$MAKE test
 
 :
diff --git a/tests/nobase-nodist.test b/tests/nobase-nodist.test
old mode 100644
new mode 100755
diff --git a/tests/primary-prefix-valid-couples.test 
b/tests/primary-prefix-valid-couples.test
index f326808..36ff5d8 100755
--- a/tests/primary-prefix-valid-couples.test
+++ b/tests/primary-prefix-valid-couples.test
@@ -25,7 +25,6 @@ cat >> configure.in <<'END'
 AC_PROG_CC
 AC_PROG_RANLIB
 AC_PROG_LIBTOOL
-AM_PROG_GCJ
 AM_PATH_PYTHON
 AM_PATH_LISPDIR
 END
@@ -78,7 +77,6 @@ done
 echo "info_TEXINFOS = foo.texi" >> Makefile.am
 echo "lisp_LISP = foo.el" >> Makefile.am
 echo "python_PYTHON = foo.py" >> Makefile.am
-echo "java_JAVA = foo.java" >> Makefile.am
 
 awk '{print NR ":" $0}' Makefile.am # For debugging.
 
diff --git a/tests/test-extensions.test b/tests/test-extensions.test
new file mode 100755
index 0000000..1d5872c
--- /dev/null
+++ b/tests/test-extensions.test
@@ -0,0 +1,73 @@
+#! /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/>.
+
+# Make sure that Automake diagnose invalid entries in TEST_EXTENSIONS,
+# and do not diagnose valid (albeit more unusual) ones.
+# See automake bug#9400.
+
+parallel_tests=yes
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in <<'END'
+AC_SUBST([ext], [".e"])
+AC_OUTPUT
+END
+
+$ACLOCAL
+$AUTOCONF
+
+cat > Makefile.am << 'END'
+TESTS =
+TEST_EXTENSIONS = .sh .T .t1 ._foo .BAR .x_Y_z ._ @ext@
+END
+
+$AUTOMAKE
+
+$EGREP -i 'log|ext' Makefile.in # For debugging.
+
+for lc in sh T t1 _foo BAR x_Y_z _; do
+  uc=`echo $lc | tr '[a-z]' '[A-Z]'`
+  $FGREP "\$(${uc}_LOG_COMPILER)" Makefile.in
+  grep "^${uc}_LOG_COMPILE =" Makefile.in
+  grep "^\.${lc}\.log:" Makefile.in
+done
+grep "address@hidden@\.log:" Makefile.in
+
+# The produced Makefile is not broken.
+./configure
+$MAKE all check
+
+cat > Makefile.am << 'END'
+TESTS = foo.test bar.sh
+TEST_EXTENSIONS = .test mu .x-y a-b .t.1 .sh .6c .0 .11 .@ .t33 .a=b _&_
+END
+
+AUTOMAKE_fails
+for suf in mu .x-y a-b .t.1 .6c .0 .11 '.@' '.a=b' '_&_'; do
+  suf2=`printf '%s\n' "$suf" | sed -e 's/\./\\./'`
+  $EGREP "^Makefile\.am:2:.*invalid test extension.* $suf2( |$)" stderr
+done
+
+# Verify that we accept valid suffixes, even if intermixed with
+# invalid ones.
+$EGREP '\.(sh|test|t33)' stderr && Exit 1
+
+# Verify that we don't try to handle invalid suffixes.
+$EGREP '(LOG_COMPILER|non-POSIX var|bad character)' stderr && Exit 1
+
+:
diff --git a/tests/java-check.test b/tests/uninstall-fail.test
similarity index 52%
copy from tests/java-check.test
copy to tests/uninstall-fail.test
index a67b4e8..a3e7a7a 100755
--- a/tests/java-check.test
+++ b/tests/uninstall-fail.test
@@ -14,11 +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 that check_JAVA causes *.class files to be built only with
-# "make check", and not also with "make all".
-# See automake bug#8234.
+# "make uninstall" complains and errors out on failures.
+
+# FIXME: this test only deal with DATA primary; maybe we need sister
+# tests for other primaries too?  E.g., SCRIPTS, PROGRAMS, LISP, PYTHON,
+# etc...
 
-required=javac
 . ./defs || Exit 1
 
 set -e
@@ -28,39 +29,36 @@ AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
-check_JAVA = One.java Two.java
+data_DATA = foobar.txt
 END
 
-cat > One.java <<'END'
-class One { }
-END
-
-cat > Two.java <<'END'
-class Two { // Deliberately missing closing bracket.
-END
+: > foobar.txt
 
 $ACLOCAL
-$AUTOCONF
 $AUTOMAKE
+$AUTOCONF
+
+inst=__inst-dir__
+
+./configure --prefix="`pwd`/$inst"
+
+mkdir $inst $inst/share
+: > $inst/share/foobar.txt
 
-inst=`pwd`/_inst
+chmod a-w $inst/share
+touch $inst/share/t && skip_ "cannot make directories unwritable"
+rm -f $inst/share/t
 
-./configure --prefix="$inst"
+$MAKE uninstall >output 2>&1 && { cat output; Exit 1; }
+cat output
+grep "rm: .*foobar\.txt" output
 
-$MAKE
-ls | $EGREP '\.(class|stamp)$' && Exit 1
+chmod a-rwx $inst/share
+(cd $inst/share) && skip_ "cannot make directories fully unreadable"
 
-# Make Two.java compilable.
-echo '}' >> Two.java
+$MAKE uninstall >output 2>&1 && { cat output; Exit 1; }
+cat output
+grep "cd: .*$inst/share" output
 
-# "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-sources.test b/tests/uninstall-pr9578.test
similarity index 51%
copy from tests/java-sources.test
copy to tests/uninstall-pr9578.test
index 770eb2d..9aea52d 100755
--- a/tests/java-sources.test
+++ b/tests/uninstall-pr9578.test
@@ -14,8 +14,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/>.
 
-# Test definition of automake-generated private Makefile variable
-# `$(am__java_sources)'.
+# Check against automake bug#9578: "make uninstall" issued before
+# "make install" or after a mere "make install-data" or a mere
+# "make install-exec" failed spuriously.
+#
+# FIXME: this test only deal with DATA and script primaries; maybe we
+# need sister tests for other primaries too?  E.g., PROGRAMS, LISP,
+# PYTHON, etc...
 
 . ./defs || Exit 1
 
@@ -25,43 +30,40 @@ cat >> configure.in << 'END'
 AC_OUTPUT
 END
 
-cat > Makefile.am << 'END'
-foodir = $(prefix)
-
-foo_JAVA = a.java
-dist_foo_JAVA = b.java
-nodist_foo_JAVA = c.java
-nobase_foo_JAVA = d.java
-nobase_dist_foo_JAVA = e.java
-nobase_nodist_foo_JAVA = f.java
+: > foo
+: > bar
 
-.PHONY: debug
-debug:
-       @echo 'am__java_sources: "$(am__java_sources)"'
-got:
-       @lst='$(am__java_sources)'; \
-         for f in $$lst; do echo $$f; done | sort > $@
+cat > Makefile.am << 'END'
+bin_SCRIPTS = foo
+data_DATA = bar
 END
 
 $ACLOCAL
 $AUTOMAKE
 $AUTOCONF
 
-cat > exp << 'END'
-a.java
-b.java
-c.java
-d.java
-e.java
-f.java
-END
+./configure --prefix="`pwd`/inst"
+
+$MAKE uninstall
+test ! -d inst
+
+rm -rf inst
+
+$MAKE install-exec
+test -f inst/bin/foo || Exit 99 # Sanity check.
+$MAKE uninstall
+test ! -f inst/bin/foo
+
+$MAKE install-data
+test -f inst/share/bar || Exit 99 # Sanity check.
+$MAKE uninstall
+test ! -f inst/share/bar
 
-./configure
-$MAKE debug
-$MAKE got
+rm -rf inst
 
-cat got
-cat exp
-diff exp got
+$MAKE install-exec
+test -f inst/bin/foo || Exit 99 # Sanity check.
+$MAKE uninstall
+test ! -f inst/bin/foo
 
 :


hooks/post-receive
-- 
GNU Automake



reply via email to

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