summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2012-01-01 11:14:27 +0100
committerStefano Lattarini <stefano.lattarini@gmail.com>2012-01-01 11:14:27 +0100
commitc1b14e966c2aa929e80bdfb259d0a81813859509 (patch)
treecfc181ea85ba2075a50b30c9b83d518bd027837f
parent5dee15f4684717914cbfbbc2db5fe22e8f5e25e2 (diff)
parent280407599a72f8229c7b89d64b703e2dbc94cc87 (diff)
downloadautomake-c1b14e966c2aa929e80bdfb259d0a81813859509.tar.gz
Merge branch 'maint'
* maint: tests: make 'lzip.test' executable dist: obsolete support for lzma (superseded by xz and lzip) test defs: more granular overriding of the make program docs: fix a couple broken anchors dist: add support for lzip compression docs: fix paragraph names for automake and aclocal invocations tests: fix spurious failure due to autom4te caching fix: last entry in ChangeLog tests: tweak tests on silent-rules for makes without nested vars silent-rules: fallback for makes without nested vars
-rw-r--r--ChangeLog.11174
-rw-r--r--NEWS13
-rw-r--r--automake.in9
-rw-r--r--doc/automake.texi74
-rw-r--r--lib/Automake/Options.pm10
-rw-r--r--lib/am/distdir.am4
-rw-r--r--m4/silent.m432
-rwxr-xr-xtests/lzma.test20
-rwxr-xr-xtests/python11.test2
-rwxr-xr-xtests/silent-nested-vars.test149
-rwxr-xr-xtests/silent6.test12
11 files changed, 399 insertions, 100 deletions
diff --git a/ChangeLog.11 b/ChangeLog.11
index 252dd18db..cd60419a0 100644
--- a/ChangeLog.11
+++ b/ChangeLog.11
@@ -19,61 +19,6 @@
2011-12-27 Stefano Lattarini <stefano.lattarini@gmail.com>
- docs: "aclocal --install -I /abs/dir" actually copies files
-
- This change is for automake bug#8407.
-
- In the past, there had been some debate and confusion about
- whether "aclocal --install" should copy third-party .m4 files
- in the first directory passed to the `-I' option even when
- such directory was given as an absolute path, or whether it
- was better to do so only for directories specified with a
- relative path.
-
- The rationale for this latter behaviour was that, before the
- existence of the `ACLOCAL_PATH' variable, the only way (a poor
- way, I might add) for a common user to extend the search path
- of a system-wide installation of aclocal was to export something
- like ACLOCAL="aclocal -I /my/extra/macros" in the environment.
- Today, the correct way to proceed is undoubtedly through the
- use of ACLOCAL_PATH, so we can settle the question once and for
- all, and start verifying the correct behaviour of `-I' with a
- new test.
-
- * tests/aclocal-install-absdir.test: New test.
- * tests/Makefile.am (TESTS): Add it.
- * doc/automake.texi (aclocal Options): Be more explicit about
- this part of `--install' semantics.
-
-2011-12-26 Stefano Lattarini <stefano.lattarini@gmail.com>
-
- docs: fix node names for automake and aclocal invocations
-
- With the older node names, an "info automake" command issued
- from the command line would have opened the node about the
- invocation of the automake program, rather than the Top node
- of the automake documentation. To invoke the Top node, one
- had to issue the command "info Automake" instead (note the
- different capitalization). This was suboptimal, and certainly
- confusing.
-
- With this change, "info automake" will open the Top node of the
- automake documentation; to access the nodes about the invocation
- of the automake and aclocal program, one has now to issue "info
- automake-invocation" and "info aclocal-invocation" respectively.
-
- This change fixes automake bug#8071.
-
- See also commits `v2.61a-22-ge9215d1' and `v2.61a-72-g8c07b48' in
- the autoconf git repository, which tackled a similar issue.
-
- * doc/automake.texi (@direntry): Rename nodes `aclocal' and
- `automake' to `aclocal-invocation' and `automake-invocation'
- respectively.
- * NEWS: Update.
-
-2011-12-27 Stefano Lattarini <stefano.lattarini@gmail.com>
-
regex: remove obsolete macro AM_WITH_REGEX
Today, practically nobody uses the GNU rx library, which, according
to its own website <http://www.gnu.org/software/rx/rx.html>, has
@@ -156,6 +101,125 @@
<http://ftp.gnu.org/gnu/automake/automake-1.7.9.tar.gz>
Reported by Jim Meyering in automake bug#10374.
+2011-12-27 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ docs: "aclocal --install -I /abs/dir" actually copies files
+
+ This change is for automake bug#8407.
+
+ In the past, there had been some debate and confusion about
+ whether "aclocal --install" should copy third-party .m4 files
+ in the first directory passed to the `-I' option even when
+ such directory was given as an absolute path, or whether it
+ was better to do so only for directories specified with a
+ relative path.
+
+ The rationale for this latter behaviour was that, before the
+ existence of the `ACLOCAL_PATH' variable, the only way (a poor
+ way, I might add) for a common user to extend the search path
+ of a system-wide installation of aclocal was to export something
+ like ACLOCAL="aclocal -I /my/extra/macros" in the environment.
+ Today, the correct way to proceed is undoubtedly through the
+ use of ACLOCAL_PATH, so we can settle the question once and for
+ all, and start verifying the correct behaviour of `-I' with a
+ new test.
+
+ * tests/aclocal-install-absdir.test: New test.
+ * tests/Makefile.am (TESTS): Add it.
+ * doc/automake.texi (aclocal Options): Be more explicit about
+ this part of `--install' semantics.
+
+2011-12-26 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ docs: fix node names for automake and aclocal invocations
+
+ With the older node names, an "info automake" command issued
+ from the command line would have opened the node about the
+ invocation of the automake program, rather than the Top node
+ of the automake documentation. To invoke the Top node, one
+ had to issue the command "info Automake" instead (note the
+ different capitalization). This was suboptimal, and certainly
+ confusing.
+
+ With this change, "info automake" will open the Top node of the
+ automake documentation; to access the nodes about the invocation
+ of the automake and aclocal program, one has now to issue "info
+ automake-invocation" and "info aclocal-invocation" respectively.
+
+ This change fixes automake bug#8071.
+
+ See also commits `v2.61a-22-ge9215d1' and `v2.61a-72-g8c07b48' in
+ the autoconf git repository, which tackled a similar issue.
+
+ * doc/automake.texi (@direntry): Rename nodes `aclocal' and
+ `automake' to `aclocal-invocation' and `automake-invocation'
+ respectively.
+ * NEWS: Update.
+
+2011-12-26 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests: tweak tests on silent-rules for makes without nested vars
+ * tests/silent-nested-vars.test: Define $MAKE to `./mymake' in
+ the environment, so that it will be automatically picked up by
+ configure. Related tweaks and simplifications.
+ Remove the checks verifying that silent rules are respected also
+ when the 'subdir-objects' option is set, the checks testing the
+ old syntax for user-defined silent rules, and the tests using
+ the default $MAKE programs: they are redundant w.r.t. other test
+ cases. Related simplifications.
+ Remove the temporary files used in a sanity check as soon as they
+ are not needed anymore.
+ Do not capture also the standard error of configure: we only want
+ to grep its standard output.
+ Consistently use `stdout' for the name of files where to save the
+ standard output captured from make and configure, for consistency
+ with other tests.
+ Make grepping of configure output and of the generated Makefile
+ stricter.
+ Improve and tweak the `mymake' script a little.
+ * tests/silent6.test: Make grepping of make stdout slightly
+ stricter. After having configured with silent rules disabled,
+ try to force the use silent rules with `make V=1'.
+
+2011-12-25 Paul Eggert <eggert@cs.ucla.edu>
+
+ silent-rules: fallback for makes without nested vars
+
+ This fixes two problems reported for Automake (Bug#9928, Bug#10237)
+ and is in response to a bug report for building coreutils on HP
+ NonStop OS (Bug#10234). The problem is that HP NonStop 'make'
+ treats a line like "AM_V_CC = $(am__v_CC_$(V))" as one that
+ expands a macro with the funny name am__v_CC_$(V instead of the
+ desired name am__v_CC_1 or am__v_CC_0, and since the funny macro
+ is not defined the line is equivalent to "AM_V_CC = )"; this
+ inserts a stray ")" when $(AM_V_CC) is used, which eventually
+ causes 'make' to fail.
+
+ The basic idea is that instead of generating Makefile.in lines like
+ "AM_V_CC = $(am__v_CC_$(V))", we generate
+ "AM_V_CC = $(am__v_CC_@AM_V@)". We then AC_SUBST $(V) for @AM_V@
+ in the usual case where `make' supports nested variables,
+ and substitute 1 (or 0) otherwise. Similarly for usages like
+ $(am__v_CC_$(AM_DEFAULT_VERBOSITY)).
+
+ With this change, make implementations that doesn't grasp nested
+ variable expansions will still be able to run Makefiles generated
+ using the silent-rules option. They won't allow the user to
+ override the make verbosity at runtime through redefinition of
+ $(V) (as in "make V=0"); but this is still an improvement over not
+ being able to work at all.
+
+ * NEWS: Document this.
+ * automake.in (define_verbose_var): When defining the variables,
+ use @AM_V@ rather than $(V), and use @AM_DEFAULT_V@ rather than
+ $(AM_DEFAULT_VERBOSITY).
+ * doc/automake.texi (Automake silent-rules Option): Explain new system.
+ * m4/silent.m4 (AM_SILENT_RULES): Check whether `make' supports
+ nested variables, and substitute AM_V and AM_DEFAULT_V accordingly.
+ * tests/silent-nested-vars.test: New test.
+ * tests/Makefile.am (TESTS): Add it.
+>>>>>>> maint
+
2011-12-24 Stefano Lattarini <stefano.lattarini@gmail.com>
gitignore: use only one .gitignore file, in the top-level directory
diff --git a/NEWS b/NEWS
index 839a34eb8..a64847df9 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,10 @@ New in 1.11a:
- automake now generates silenced rules for texinfo outputs.
+ - The `lzma' compression format for distribution archives has been
+ deprecated in favor of `xz' and `lzip', and will be removed in the
+ next major Automake release (1.12).
+
- The deprecated options `--output-dir', `--Werror' and `--Wno-error'
have been removed.
@@ -103,6 +107,8 @@ New in 1.11a:
- The `dist' and `dist-all' targets now can run compressors in parallel.
+ - "make dist" can now create lzip-compressed tarballs.
+
- In the Automake info documentation, the Top node and the nodes about
the invocation of the automake and aclocal programs have been renamed;
now, calling "info automake" will open the Top node, while calling
@@ -205,6 +211,13 @@ Bugs fixed in 1.11a:
not used, `make' output no longer contains spurious backslash-only
lines, thus once again matching what Automake did before 1.11.
+ - The `silent-rules' option now generates working makefiles even for
+ the uncommon `make' implementations that do not support the
+ nested-variables extension to POSIX 2008. For such `make'
+ implementations, whether a build is silent is determined at
+ configure time, and cannot be overridden at make time with
+ `make V=0' or `make V=1'.
+
- The AM_COND_IF macro also works if the shell expression for the conditional
is no longer valid for the condition.
diff --git a/automake.in b/automake.in
index de3a7a21f..c08ed8271 100644
--- a/automake.in
+++ b/automake.in
@@ -1140,9 +1140,12 @@ sub define_verbose_var ($$)
my $silent_var = $pvar . '_0';
if (option 'silent-rules')
{
- # Using `$V' instead of `$(V)' breaks IRIX make.
- define_variable ($var, '$(' . $pvar . '_$(V))', INTERNAL);
- define_variable ($pvar . '_', '$(' . $pvar . '_$(AM_DEFAULT_VERBOSITY))', INTERNAL);
+ # For typical `make's, `configure' replaces AM_V (inside @@) with $(V)
+ # and AM_DEFAULT_V (inside @@) with $(AM_DEFAULT_VERBOSITY).
+ # For strict POSIX 2008 `make's, it replaces them with 0 or 1 instead.
+ # See AM_SILENT_RULES in m4/silent.m4.
+ define_variable ($var, '$(' . $pvar . '_@'.'AM_V'.'@)', INTERNAL);
+ define_variable ($pvar . '_', '$(' . $pvar . '_@'.'AM_DEFAULT_V'.'@)', INTERNAL);
Automake::Variable::define ($silent_var, VAR_AUTOMAKE, '', TRUE, $val,
'', INTERNAL, VAR_ASIS)
if (! vardef ($silent_var, TRUE));
diff --git a/doc/automake.texi b/doc/automake.texi
index 4afada93f..d8f98c98e 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -45,8 +45,8 @@ section entitled ``GNU Free Documentation License.''
@dircategory Individual utilities
@direntry
-* aclocal-invocation: (automake)Invoking aclocal. Generating aclocal.m4.
-* automake-invocation: (automake)Invoking Automake. Generating Makefile.in.
+* aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+* automake-invocation: (automake)automake Invocation. Generating Makefile.in.
@end direntry
@titlepage
@@ -99,7 +99,7 @@ section entitled ``GNU Free Documentation License.''
* Autotools Introduction:: An Introduction to the Autotools
* Generalities:: General ideas
* Examples:: Some example packages
-* Invoking Automake:: Creating a Makefile.in
+* automake Invocation:: Creating a Makefile.in
* configure:: Scanning configure.ac, using aclocal
* Directories:: Declaring subdirectories
* Programs:: Building programs and libraries
@@ -178,7 +178,7 @@ Scanning @file{configure.ac}, using @command{aclocal}
* Requirements:: Configuration requirements
* Optional:: Other things Automake recognizes
-* Invoking aclocal:: Auto-generating aclocal.m4
+* aclocal Invocation:: Auto-generating aclocal.m4
* Macros:: Autoconf macros supplied with Automake
Auto-generating aclocal.m4
@@ -2532,13 +2532,17 @@ with different flags. In this instance, the names of the object files
would be chosen by automake; they would be @file{false-true.o} and
@file{true-true.o}. (The name of the object files rarely matters.)
-
-@node Invoking Automake
+@node automake Invocation
@chapter Creating a @file{Makefile.in}
+@c This node used to be named "Invoking automake". This @anchor
+@c allows old links to still work.
+@anchor{Invoking automake}
@cindex Multiple @file{configure.ac} files
@cindex Invoking @command{automake}
@cindex @command{automake}, invoking
+@cindex Invocation of @command{automake}
+@cindex @command{automake}, invocation
To create all the @file{Makefile.in}s for a package, run the
@command{automake} program in the top level directory, with no
@@ -2778,7 +2782,7 @@ easier. These macros can automatically be put into your
@menu
* Requirements:: Configuration requirements
* Optional:: Other things Automake recognizes
-* Invoking aclocal:: Auto-generating aclocal.m4
+* aclocal Invocation:: Auto-generating aclocal.m4
* Macros:: Autoconf macros supplied with Automake
@end menu
@@ -3155,16 +3159,19 @@ appear as dependencies in @file{Makefile} rules.
@code{m4_include} is seldom used by @file{configure.ac} authors, but
can appear in @file{aclocal.m4} when @command{aclocal} detects that
-some required macros come from files local to your package (as opposed
-to macros installed in a system-wide directory, @pxref{Invoking
-aclocal}).
+some required macros come from files local to your package (as opposed to
+macros installed in a system-wide directory, @pxref{aclocal Invocation}).
@end ftable
-
-@node Invoking aclocal
+@node aclocal Invocation
@section Auto-generating aclocal.m4
+@c This node used to be named "Invoking automake". This @anchor
+@c allows old links to still work.
+@anchor{Invoking aclocal}
+@cindex Invocation of @command{aclocal}
+@cindex @command{aclocal}, Invocation
@cindex Invoking @command{aclocal}
@cindex @command{aclocal}, Invoking
@@ -3342,7 +3349,7 @@ All warnings are output by default.
@vindex WARNINGS
The environment variable @env{WARNINGS} is honored in the same
-way as it is for @command{automake} (@pxref{Invoking Automake}).
+way as it is for @command{automake} (@pxref{automake Invocation}).
@end table
@@ -8633,10 +8640,10 @@ archives are frequently smaller than @command{bzip2}-compressed archives.
@trindex dist-lzip
@item @code{dist-lzma}
-Generate an @samp{lzma} tar archive of the distribution. @command{lzma}
-archives are frequently smaller than @command{bzip2}-compressed archives.
+Generate an @samp{lzma} tar archive of the distribution.
The @samp{lzma} format is obsolete, you should use the @samp{xz} format
-instead.
+instead. @emph{Support for @samp{lzma}-compressed archives will be
+removed in the next major Automake release.}
@trindex dist-lzma
@item @code{dist-shar}
@@ -10275,8 +10282,8 @@ In order to use this option with C sources, you should add
These three mutually exclusive options select the tar format to use
when generating tarballs with @samp{make dist}. (The tar file created
is then compressed according to the set of @option{no-dist-gzip},
-@option{dist-bzip2}, @option{dist-lzip}, @option{dist-tarZ} and
-@option{dist-xz} options in use.)
+@option{dist-bzip2}, @option{dist-lzip}, @option{dist-xz} and
+@option{dist-tarZ} options in use.)
These options must be passed as arguments to @code{AM_INIT_AUTOMAKE}
(@pxref{Macros}) because they can require additional configure checks.
@@ -10328,7 +10335,7 @@ will be suppressed.
@cindex Option, @option{-W@var{category}}
@cindex Option, @option{--warnings=@var{category}}
These options behave exactly like their command-line counterpart
-(@pxref{Invoking Automake}). This allows you to enable or disable some
+(@pxref{automake Invocation}). This allows you to enable or disable some
warning categories on a per-file basis. You can also setup some warnings
for your entire project; for instance, try @samp{AM_INIT_AUTOMAKE([-Wall])}
in your @file{configure.ac}.
@@ -10944,18 +10951,23 @@ For portability to different @command{make} implementations, package authors
are advised to not set the variable @code{V} inside the @file{Makefile.am}
file, to allow the user to override the value for subdirectories as well.
-The current implementation of this feature relies on a non-POSIX, but in
-practice rather widely supported @file{Makefile} construct of nested
-variable expansion @samp{$(@var{var1}$(V))}. Do not use the
-@option{silent-rules} option if your package needs to build with
-@command{make} implementations that do not support it. The
-@option{silent-rules} option turns off warnings about recursive variable
-expansion, which are in turn enabled by @option{-Wportability}
-(@pxref{Invoking Automake}).
+The current implementation of this feature normally uses nested
+variable expansion @samp{$(@var{var1}$(V))}, a @file{Makefile} feature
+that is not required by POSIX 2008 but is widely supported in
+practice. The @option{silent-rules} option thus turns off warnings
+about recursive variable expansion, which are in turn enabled by
+@option{-Wportability} (@pxref{automake Invocation}). On the rare
+@command{make} implementations that do not support nested variable
+expansion, whether rules are silent is always determined at configure
+time, and cannot be overridden at make time. Future versions of POSIX
+are likely to require nested variable expansion, so this minor
+limitation should go away with time.
@vindex @code{AM_V_GEN}
@vindex @code{AM_V_at}
@vindex @code{AM_DEFAULT_VERBOSITY}
+@vindex @code{AM_V}
+@vindex @code{AM_DEFAULT_V}
To extend the silent mode to your own rules, you have two choices:
@itemize @bullet
@@ -10971,8 +10983,8 @@ The following snippet shows how you would define your own equivalent of
@code{AM_V_GEN}:
@example
-pkg_verbose = $(pkg_verbose_$(V))
-pkg_verbose_ = $(pkg_verbose_$(AM_DEFAULT_VERBOSITY))
+pkg_verbose = $(pkg_verbose_@@AM_V@@)
+pkg_verbose_ = $(pkg_verbose_@@AM_DEFAULT_V@@)
pkg_verbose_0 = @@echo PKG-GEN $@@;
foo: foo.in
@@ -11171,7 +11183,7 @@ These overriding semantics make it possible to fine tune some default
settings of Automake, or replace some of its rules. Overriding
Automake rules is often inadvisable, particularly in the topmost
directory of a package with subdirectories. The @option{-Woverride}
-option (@pxref{Invoking Automake}) comes in handy to catch overridden
+option (@pxref{automake Invocation}) comes in handy to catch overridden
definitions.
Note that Automake does not make any distinction between rules with
@@ -11619,7 +11631,7 @@ autoreconf -vfi
@end example
The use of @option{--force-missing} ensures that auxiliary tools will be
-overridden by new versions (@pxref{Invoking Automake}).
+overridden by new versions (@pxref{automake Invocation}).
It is important to regenerate all these files each time Automake is
upgraded, even between bug fixes releases. For instance, it is not
diff --git a/lib/Automake/Options.pm b/lib/Automake/Options.pm
index 6836157a3..34c026c28 100644
--- a/lib/Automake/Options.pm
+++ b/lib/Automake/Options.pm
@@ -272,10 +272,18 @@ sub _process_option_list (\%@)
error ($where,
"automatic de-ANSI-fication support has been removed");
}
+ elsif ($_ eq 'dist-lzma')
+ {
+ # Creation of distribution tarball compressed with lzma is
+ # deprecated, will be removed in the next major release.
+ msg 'obsolete', $where,
+ "lzma compression is deprecated; use `dist-xz' " .
+ "or `dist-lzip' instead\n";
+ }
elsif ($_ eq 'no-installman' || $_ eq 'no-installinfo'
|| $_ eq 'dist-shar' || $_ eq 'dist-zip'
|| $_ eq 'dist-tarZ' || $_ eq 'dist-bzip2'
- || $_ eq 'dist-lzip' || $_ eq 'dist-lzma' || $_ eq 'dist-xz'
+ || $_ eq 'dist-lzip' || $_ eq 'dist-xz'
|| $_ eq 'no-dist-gzip' || $_ eq 'no-dist'
|| $_ eq 'dejagnu' || $_ eq 'no-texinfo.tex'
|| $_ eq 'readme-alpha' || $_ eq 'check-news'
diff --git a/lib/am/distdir.am b/lib/am/distdir.am
index 690695d18..2697efc3f 100644
--- a/lib/am/distdir.am
+++ b/lib/am/distdir.am
@@ -352,8 +352,8 @@ dist-bzip2: distdir
?LZIP?DIST_ARCHIVES += $(distdir).tar.lz
.PHONY: dist-lzip
dist-lzip: distdir
- tardir=$(distdir) && $(am__tar) | lzip -9 -c >$(distdir).tar.lz
- $(am__post_remove_distdir)
+ tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
+ $(am__remove_distdir)
?LZMA?DIST_ARCHIVES += $(distdir).tar.lzma
.PHONY: dist-lzma
diff --git a/m4/silent.m4 b/m4/silent.m4
index 432dd4577..c94fff958 100644
--- a/m4/silent.m4
+++ b/m4/silent.m4
@@ -1,5 +1,5 @@
## -*- Autoconf -*-
-# Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -25,6 +25,36 @@ case $enable_silent_rules in @%:@ (((
no) AM_DEFAULT_VERBOSITY=1;;
*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
esac
+dnl
+dnl A few `make' implementations (e.g., NonStop OS and NextStep)
+dnl do not support nested variable expansions.
+dnl See automake bug#9928 and bug#10237.
+am_make=${MAKE-make}
+AC_CACHE_CHECK([whether $am_make supports nested variables],
+ [am_cv_make_support_nested_variables],
+ [if AS_ECHO([['TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi])
+if test $am_cv_make_support_nested_variables = yes; then
+ dnl Using `$V' instead of `$(V)' breaks IRIX make.
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AC_SUBST([AM_V])dnl
+AM_SUBST_NOTMAKE([AM_V])dnl
+AC_SUBST([AM_DEFAULT_V])dnl
+AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
AM_BACKSLASH='\'
AC_SUBST([AM_BACKSLASH])dnl
diff --git a/tests/lzma.test b/tests/lzma.test
index 4262ceb45..6c42ae9c9 100755
--- a/tests/lzma.test
+++ b/tests/lzma.test
@@ -16,9 +16,15 @@
# Check support for no-dist-gzip with lzma.
-required=lzma
. ./defs || Exit 1
+errmsg='lzma.*deprecated.*dist-xz.*dist-lzip.*instead'
+
+echo AUTOMAKE_OPTIONS = dist-lzma > Makefile.am
+$ACLOCAL --force
+AUTOMAKE_fails -Wnone -Wobsolete
+grep "^Makefile\\.am:1:.*$errmsg" stderr
+
cat > configure.in << 'END'
AC_INIT([lzma], [1.0])
AM_INIT_AUTOMAKE([no-dist-gzip dist-lzma])
@@ -32,8 +38,16 @@ test: distcheck
test -f $(DIST_ARCHIVES)
END
-$ACLOCAL
+$ACLOCAL --force
+AUTOMAKE_fails
+grep "^configure\\.in:2:.*$errmsg" stderr
+
+$AUTOMAKE -Wno-obsolete
+
+lzma --version || skip_ "lzma compressor required for the rest of the test"
+
$AUTOCONF
-$AUTOMAKE
./configure
$MAKE test
+
+:
diff --git a/tests/python11.test b/tests/python11.test
index 604f3eb68..969a461b6 100755
--- a/tests/python11.test
+++ b/tests/python11.test
@@ -45,7 +45,7 @@ sed 's/AM_PATH_PYTHON/AM_PATH_PYTHON(,,:)/' configure.in >configure.int
mv -f configure.int configure.in
$ACLOCAL --force
$AUTOCONF --force
-# This one should define PYTHON as `:' and exit successfully.
+# This one should define PYTHON as ":" and exit successfully.
./configure
# Any user setting should be used.
diff --git a/tests/silent-nested-vars.test b/tests/silent-nested-vars.test
new file mode 100755
index 000000000..0024b5d38
--- /dev/null
+++ b/tests/silent-nested-vars.test
@@ -0,0 +1,149 @@
+#!/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 silent-rules mode, on 'make' implementations that do not
+# support nested variables (Bug#9928, Bug#10237).
+
+. ./defs || Exit 1
+
+set -e
+
+cat >>configure.in <<'EOF'
+AM_SILENT_RULES
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_OUTPUT
+EOF
+
+cat > Makefile.am <<'EOF'
+# Need generic and non-generic rules.
+bin_PROGRAMS = foo bar
+bar_CFLAGS = $(AM_CFLAGS)
+
+# Check that AM_V and AM_DEFAULT_V work as advertised.
+pkg_verbose = $(pkg_verbose_@AM_V@)
+pkg_verbose_ = $(pkg_verbose_@AM_DEFAULT_V@)
+pkg_verbose_0 = @echo PKG-GEN $@;
+
+bin_SCRIPTS = oop
+oop:
+ $(pkg_verbose)echo $@ >$@
+
+mostlyclean-local:
+ rm -f oop
+EOF
+
+cat > foo.c <<'EOF'
+int main ()
+{
+ return 0;
+}
+EOF
+cp foo.c bar.c
+
+cat >mymake <<'EOF'
+#! /bin/sh
+makerules=
+
+case $1 in
+ -f)
+ makefile=$2
+ case $2 in
+ -) makerules=`cat` || exit ;;
+ esac ;;
+ *)
+ for makefile in makefile Makefile; do
+ test -f $makefile && break
+ done ;;
+esac
+
+nested_var_pat='^[^#].*\$([^)]*\$'
+if
+ case $makefile in
+ -) printf '%s\n' "$makerules" | grep "$nested_var_pat";;
+ *) grep "$nested_var_pat" $makefile;;
+ esac
+then
+ echo >&2 "mymake: $makefile contains nested variables"
+ exit 1
+fi
+
+case $makefile in
+ -) printf '%s\n' "$makerules" | $mymake_MAKE "$@";;
+ *) exec $mymake_MAKE "$@";;
+esac
+EOF
+chmod a+x mymake
+mymake_MAKE=${MAKE-make}
+MAKE=./mymake
+export MAKE mymake_MAKE
+
+# As a sanity check, verify that `mymake' rejects Makefiles that
+# use nested variables.
+cat > Makefile <<'END'
+a = $(b$(c))
+all:
+ touch bar
+END
+$MAKE && Exit 99
+mv -f Makefile foo.mk
+$MAKE -f foo.mk && Exit 99
+cat foo.mk | $MAKE -f - && Exit 99
+test -f bar && Exit 99
+sed '/a =/d' foo.mk > Makefile
+$MAKE && test -f bar || Exit 99
+rm -f bar Makefile foo.mk
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+./configure --enable-silent-rules >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep '^checking whether \./mymake supports nested variables\.\.\. no *$' \
+ stdout
+$EGREP 'CC|AM_V|GEN' Makefile # For debugging.
+grep '^AM_V_CC = *\$(am__v_CC_0) *$' Makefile
+grep '^AM_V_GEN = *\$(am__v_GEN_0) *$' Makefile
+$MAKE >stdout || { cat stdout; Exit 1; }
+cat stdout
+$EGREP ' (-c|-o)' stdout && Exit 1
+grep 'mv ' stdout && Exit 1
+grep 'echo .*oop' stdout && Exit 1
+grep 'CC .*foo\.' stdout
+grep 'CC .*bar\.' stdout
+grep 'CCLD .*foo' stdout
+grep 'CCLD .*bar' stdout
+grep 'PKG-GEN .*oop' stdout
+$MAKE distclean
+
+./configure --disable-silent-rules > stdout || { cat stdout; Exit 1; }
+cat stdout
+grep '^checking whether \./mymake supports nested variables\.\.\. no *$' \
+ stdout
+$EGREP 'CC|AM_V|GEN' Makefile # For debugging.
+grep '^AM_V_CC = *\$(am__v_CC_1) *$' Makefile
+grep '^AM_V_GEN = *\$(am__v_GEN_1) *$' Makefile
+
+$MAKE >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep ' -c' stdout
+grep ' -o foo' stdout
+grep ' -o bar' stdout
+grep 'echo .*>oop' stdout
+$EGREP '(CC|LD) ' stdout && Exit 1
+
+:
diff --git a/tests/silent6.test b/tests/silent6.test
index 28b7a2ded..b4759cb6b 100755
--- a/tests/silent6.test
+++ b/tests/silent6.test
@@ -45,14 +45,14 @@ $AUTOCONF
./configure --enable-silent-rules
$MAKE >stdout || { cat stdout; Exit 1; }
cat stdout
-grep 'GEN foo' stdout
+grep '^ *GEN foo *$' stdout
grep 'cp ' stdout && Exit 1
$MAKE clean
$MAKE V=1 >stdout || { cat stdout; Exit 1; }
cat stdout
grep 'GEN ' stdout && Exit 1
-grep 'cp ' stdout
+grep 'cp \.*/foo\.in foo' stdout
$MAKE distclean
@@ -60,7 +60,13 @@ $MAKE distclean
$MAKE >stdout || { cat stdout; Exit 1; }
cat stdout
grep 'GEN ' stdout && Exit 1
-grep 'cp ' stdout
+grep 'cp \.*/foo\.in foo' stdout
+
+$MAKE clean
+$MAKE V=0 >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep '^ *GEN foo *$' stdout
+grep 'cp ' stdout && Exit 1
$MAKE distclean