Documentation and tests for the `silent' option.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 7 Mar 2009 14:59:24 +0000 (15:59 +0100)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 7 Mar 2009 15:03:02 +0000 (16:03 +0100)
* NEWS: Update.
* doc/automake.texi (Invoking Automake): `silent' turns off some
portability warnings.
(Libtool Flags): `silent' silences libtool.
(Options): Document the `silent' flag.
* tests/dollarvar.test, tests/silent.test, tests/silent2.test,
tests/silent3.test, tests/silent4.test, tests/silent5.test: New
tests.
* tests/Makefile.am: Update.
* Makefile.am (maintainer-check): Ignore `DESTDIR' and `V' when
checking for make variables that should not be overridden from
the command line.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13 files changed:
ChangeLog
Makefile.am
Makefile.in
NEWS
doc/automake.texi
tests/Makefile.am
tests/Makefile.in
tests/dollarvar.test [new file with mode: 0755]
tests/silent.test [new file with mode: 0755]
tests/silent2.test [new file with mode: 0755]
tests/silent3.test [new file with mode: 0755]
tests/silent4.test [new file with mode: 0755]
tests/silent5.test [new file with mode: 0755]

index dd000d4..cd4c9fd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2009-03-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Documentation and tests for the `silent' option.
+       * NEWS: Update.
+       * doc/automake.texi (Invoking Automake): `silent' turns off some
+       portability warnings.
+       (Libtool Flags): `silent' silences libtool.
+       (Options): Document the `silent' flag.
+       * tests/dollarvar.test, tests/silent.test, tests/silent2.test,
+       tests/silent3.test, tests/silent4.test, tests/silent5.test: New
+       tests.
+       * tests/Makefile.am: Update.
+       * Makefile.am (maintainer-check): Ignore `DESTDIR' and `V' when
+       checking for make variables that should not be overridden from
+       the command line.
+
 2009-03-07  Jan Engelhardt  <jengelh@medozas.de>
            Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
index d637e10..8b87a8c 100644 (file)
@@ -3,7 +3,7 @@
 ## Makefile for Automake.
 
 ## Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004,
-## 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+## 2005, 2006, 2007, 2008, 2009  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
@@ -273,13 +273,15 @@ maintainer-check: automake aclocal
        done
 ## Overriding a Makefile macro on the command line is not portable when
 ## recursive targets are used.  Better use an envvar.  SHELL is an exception,
-## POSIX says it can't come from the environment.
+## POSIX says it can't come from the environment.  V and DESTDIRS are exceptions,
+## too, as package authors are urged not to intitialize this anywhere.
        @if grep -E '\$$MAKE .*(SHELL=.*=|=.*SHELL=)' $(srcdir)/tests/*.test; then \
          echo 'Rewrite "$$MAKE foo=bar SHELL=$$SHELL" as "foo=bar $$MAKE -e SHELL=$$SHELL"' 1>&2; \
          echo ' in the above lines, it is more portable.' 1>&2; \
          exit 1; \
        fi
-       @if grep -v SHELL $(srcdir)/tests/*.test | grep '\$$MAKE .*=' ; then \
+       @if sed 's/DESTDIR=[^ ]*//; s/SHELL=[^ ]*//; s/V=[^ ]*//' $(srcdir)/tests/*.test | \
+           grep '\$$MAKE .*=' ; then \
          echo 'Rewrite "$$MAKE foo=bar" as "foo=bar $$MAKE -e" in the above lines,' 1>&2; \
          echo 'it is more portable.' 1>&2; \
          exit 1; \
index 49f70c2..0958059 100644 (file)
@@ -933,7 +933,8 @@ maintainer-check: automake aclocal
          echo ' in the above lines, it is more portable.' 1>&2; \
          exit 1; \
        fi
-       @if grep -v SHELL $(srcdir)/tests/*.test | grep '\$$MAKE .*=' ; then \
+       @if sed 's/DESTDIR=[^ ]*//; s/SHELL=[^ ]*//; s/V=[^ ]*//' $(srcdir)/tests/*.test | \
+           grep '\$$MAKE .*=' ; then \
          echo 'Rewrite "$$MAKE foo=bar" as "foo=bar $$MAKE -e" in the above lines,' 1>&2; \
          echo 'it is more portable.' 1>&2; \
          exit 1; \
diff --git a/NEWS b/NEWS
index d4b59e9..78ce7ab 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -109,6 +109,11 @@ New in 1.10a:
 
   - The `color-tests' option causes colored test result output on terminals.
 
+  - The `silent' option enables Linux kernel-style silent build output.
+    This option requires the widely supported but non-POSIX `make' feature
+    of recursive variable expansion, so do not use it if your package needs
+    to build with `make' implementations that do not support it.
+
   - New prefix `notrans_' for manpages which should not be transformed
     by --program-transform.
 
index 0dfa9c7..0d104cc 100644 (file)
@@ -2562,6 +2562,8 @@ variables.
 The categories output by default are @samp{syntax} and
 @samp{unsupported}.  Additionally, @samp{gnu} and @samp{portability}
 are enabled in @option{--gnu} and @option{--gnits} strictness.
+On the other hand, the @option{silent} options (@pxref{Options})
+turns off portability warnings about recursive variable expansions.
 
 @vindex WARNINGS
 The environment variable @env{WARNINGS} can contain a comma separated
@@ -5261,7 +5263,9 @@ setting.
 The libtool rules also use a @code{LIBTOOLFLAGS} variable that should
 not be set in @file{Makefile.am}: this is a user variable (@pxref{Flag
 Variables Ordering}.  It allows users to run @samp{make
-LIBTOOLFLAGS=--silent}, for instance.
+LIBTOOLFLAGS=--silent}, for instance.  Note that the verbosity of
+@command{libtool} can also be influenced with the Automake @option{silent}
+option (@pxref{Options}).
 
 
 @node LTLIBOBJS, Libtool Issues, Libtool Flags, A Shared Library
@@ -8693,6 +8697,38 @@ non-alpha releases.  The second form is
 @samp{@var{MAJOR}.@var{MINOR}@var{ALPHA}}, where @var{ALPHA} is a
 letter; it should be omitted for non-alpha releases.
 
+@item @option{silent}
+@cindex Option, @option{silent}
+@opindex silent
+Enable silent build rules.  This will cause many build rules to output a
+status line of the form
+
+@example
+  GEN @var{output-file}
+@end example
+
+@noindent
+instead of printing the command that will be executed to update
+@var{output-file}.  It will also silence @command{libtool} output.
+
+@vindex @code{V}
+The verbosity can be influenced at @command{make} run time by setting the
+variable @code{V}: @samp{make V=0} is equivalent to @code{V} being unset,
+while @samp{make V=1} will produce verbose output.
+
+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} option if your package needs to build with
+@command{make} implementations that do not support it.  The
+@option{silent} option turns off warnings about recursive variable
+expansion, which are in turn enabled by @option{-Wportability}
+(@pxref{Invoking Automake}).
+
 @item @option{std-options}
 @cindex Options, @option{std-options}
 @cindex @samp{make installcheck}, testing @option{--help} and @option{--version}
index 8a65684..5ff30e4 100644 (file)
@@ -240,6 +240,7 @@ distcom7.test \
 distdir.test \
 distname.test \
 dollar.test \
+dollarvar.test \
 double.test \
 dup2.test \
 else.test \
@@ -534,6 +535,11 @@ rulepat.test \
 sanity.test \
 scripts.test \
 seenc.test \
+silent.test \
+silent2.test \
+silent3.test \
+silent4.test \
+silent5.test \
 sinclude.test \
 srcsub.test \
 srcsub2.test \
index a491055..dfc01de 100644 (file)
@@ -395,6 +395,7 @@ distcom7.test \
 distdir.test \
 distname.test \
 dollar.test \
+dollarvar.test \
 double.test \
 dup2.test \
 else.test \
@@ -689,6 +690,11 @@ rulepat.test \
 sanity.test \
 scripts.test \
 seenc.test \
+silent.test \
+silent2.test \
+silent3.test \
+silent4.test \
+silent5.test \
 sinclude.test \
 srcsub.test \
 srcsub2.test \
diff --git a/tests/dollarvar.test b/tests/dollarvar.test
new file mode 100755 (executable)
index 0000000..3c43a61
--- /dev/null
@@ -0,0 +1,63 @@
+#!/bin/sh
+# Copyright (C) 2009  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 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Test to make sure that -Wportability complains about recursive
+# variable expansions and variables containing `$', `$(...)', or
+# `${...}' in the name.  We support recursive variable expansions using
+# the latter two constructs for the `silent' option, and they are
+# rather widely supported in practice.  OTOH variable definitions
+# containing a `$' on the left hand side of an assignment are not
+# portable in practice, even though POSIX allows them.  :-/
+
+. ./defs
+
+set -e
+
+cat >Makefile.am <<'EOF'
+x = 1
+foo$x = 1
+bar$(x) = 1
+baz${x} = 1
+bla = $(foo$x)
+bli = $(foo$(x))
+blo = $(foo${x})
+EOF
+
+$ACLOCAL
+AUTOMAKE_fails -Wportability
+grep 'Makefile.am:2' stderr
+grep 'Makefile.am:3' stderr
+grep 'Makefile.am:4' stderr
+grep 'Makefile.am:5' stderr
+grep 'Makefile.am:6' stderr
+grep 'Makefile.am:7' stderr
+
+# On the other hand, if we allow `silent' mode, then we need to allow
+# recursive variable expansion, too.
+
+# This should work with AUTOMAKE_OPTIONS.
+echo 'AUTOMAKE_OPTIONS = silent' >> Makefile.am
+
+AUTOMAKE_fails -Wportability
+grep 'Makefile.am:2' stderr
+grep 'Makefile.am:3' stderr
+grep 'Makefile.am:4' stderr
+grep 'Makefile.am:5' stderr
+grep 'Makefile.am:6' stderr && Exit 1
+grep 'Makefile.am:7' stderr && Exit 1
+
+
+:
diff --git a/tests/silent.test b/tests/silent.test
new file mode 100755 (executable)
index 0000000..b3c03e4
--- /dev/null
@@ -0,0 +1,92 @@
+#!/bin/sh
+# Copyright (C) 2009  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 3, 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 mode, without libtool, standard depmode case.
+
+# Please keep this file in sync with silent2.test.
+
+. ./defs
+
+set -e
+
+mkdir sub
+
+cat >>configure.in <<'EOF'
+AC_CONFIG_FILES([sub/Makefile])
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_OUTPUT
+EOF
+
+cat > Makefile.am <<'EOF'
+AUTOMAKE_OPTIONS = silent
+# Need generic and non-generic rules.
+bin_PROGRAMS = foo bar
+bar_CFLAGS = $(AM_CFLAGS)
+SUBDIRS = sub
+EOF
+
+cat > sub/Makefile.am <<'EOF'
+AUTOMAKE_OPTIONS = silent subdir-objects
+# Need generic and non-generic rules.
+bin_PROGRAMS = baz bla
+bla_CFLAGS = $(AM_CFLAGS)
+EOF
+
+cat > foo.c <<'EOF'
+int main ()
+{
+  return 0;
+}
+EOF
+cp foo.c bar.c
+cp foo.c sub/baz.c
+cp foo.c sub/bla.c
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+./configure
+$MAKE >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep ' -c' stdout && Exit 1
+grep ' -o foo' stdout && Exit 1
+grep mv stdout && Exit 1
+grep 'CC .*foo\.' stdout
+grep 'CC .*bar\.' stdout
+grep 'CC .*baz\.' stdout
+grep 'CC .*bla\.' stdout
+grep 'CCLD .*foo' stdout
+grep 'CCLD .*bar' stdout
+grep 'CCLD .*baz' stdout
+grep 'CCLD .*bla' stdout
+
+$MAKE clean
+$MAKE V=1 >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep ' -c' stdout
+grep ' -o foo' stdout
+grep 'CC .*foo\.' stdout && Exit 1
+grep 'CC .*bar\.' stdout && Exit 1
+grep 'CC .*baz\.' stdout && Exit 1
+grep 'CC .*bla\.' stdout && Exit 1
+grep 'CCLD .*foo' stdout && Exit 1
+grep 'CCLD .*bar' stdout && Exit 1
+grep 'CCLD .*baz' stdout && Exit 1
+grep 'CCLD .*bla' stdout && Exit 1
+
+:
diff --git a/tests/silent2.test b/tests/silent2.test
new file mode 100755 (executable)
index 0000000..136952e
--- /dev/null
@@ -0,0 +1,94 @@
+#!/bin/sh
+# Copyright (C) 2009  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 3, 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 mode, without libtool, non-fastdep case
+# (so that, with GCC, we also cover the other code paths in depend2).
+
+# Please keep this file in sync with silent.test.
+
+required=gcc
+. ./defs
+
+set -e
+
+mkdir sub
+
+cat >>configure.in <<'EOF'
+AC_CONFIG_FILES([sub/Makefile])
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_OUTPUT
+EOF
+
+cat > Makefile.am <<'EOF'
+AUTOMAKE_OPTIONS = silent
+# Need generic and non-generic rules.
+bin_PROGRAMS = foo bar
+bar_CFLAGS = $(AM_CFLAGS)
+SUBDIRS = sub
+EOF
+
+cat > sub/Makefile.am <<'EOF'
+AUTOMAKE_OPTIONS = silent subdir-objects
+# Need generic and non-generic rules.
+bin_PROGRAMS = baz bla
+bla_CFLAGS = $(AM_CFLAGS)
+EOF
+
+cat > foo.c <<'EOF'
+int main ()
+{
+  return 0;
+}
+EOF
+cp foo.c bar.c
+cp foo.c sub/baz.c
+cp foo.c sub/bla.c
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+./configure am_cv_CC_dependencies_compiler_type=gcc
+$MAKE >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep ' -c' stdout && Exit 1
+grep ' -o foo' stdout && Exit 1
+grep mv stdout && Exit 1
+grep 'CC .*foo\.' stdout
+grep 'CC .*bar\.' stdout
+grep 'CC .*baz\.' stdout
+grep 'CC .*bla\.' stdout
+grep 'CCLD .*foo' stdout
+grep 'CCLD .*bar' stdout
+grep 'CCLD .*baz' stdout
+grep 'CCLD .*bla' stdout
+
+$MAKE clean
+$MAKE V=1 >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep ' -c' stdout
+grep ' -o foo' stdout
+grep 'CC .*foo\.' stdout && Exit 1
+grep 'CC .*bar\.' stdout && Exit 1
+grep 'CC .*baz\.' stdout && Exit 1
+grep 'CC .*bla\.' stdout && Exit 1
+grep 'CCLD .*foo' stdout && Exit 1
+grep 'CCLD .*bar' stdout && Exit 1
+grep 'CCLD .*baz' stdout && Exit 1
+grep 'CCLD .*bla' stdout && Exit 1
+
+:
diff --git a/tests/silent3.test b/tests/silent3.test
new file mode 100755 (executable)
index 0000000..0df2bae
--- /dev/null
@@ -0,0 +1,95 @@
+#!/bin/sh
+# Copyright (C) 2009  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 3, 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 mode, with libtool, standard depmode case.
+
+# Please keep this file in sync with silent4.test.
+
+required=libtoolize
+. ./defs
+
+set -e
+
+mkdir sub
+
+cat >>configure.in <<'EOF'
+AC_CONFIG_FILES([sub/Makefile])
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_LIBTOOL
+AC_OUTPUT
+EOF
+
+cat > Makefile.am <<'EOF'
+AUTOMAKE_OPTIONS = silent
+# Need generic and non-generic rules.
+lib_LTLIBRARIES = libfoo.la libbar.la
+libbar_la_CFLAGS = $(AM_CFLAGS)
+SUBDIRS = sub
+EOF
+
+cat > sub/Makefile.am <<'EOF'
+AUTOMAKE_OPTIONS = silent subdir-objects
+# Need generic and non-generic rules.
+lib_LTLIBRARIES = libbaz.la libbla.la
+libbla_la_CFLAGS = $(AM_CFLAGS)
+EOF
+
+cat > libfoo.c <<'EOF'
+int main ()
+{
+  return 0;
+}
+EOF
+cp libfoo.c libbar.c
+cp libfoo.c sub/libbaz.c
+cp libfoo.c sub/libbla.c
+
+libtoolize
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+./configure
+$MAKE >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep ' -c' stdout && Exit 1
+grep ' -o libfoo' stdout && Exit 1
+grep mv stdout && Exit 1
+grep ' CC .*foo\.' stdout
+grep ' CC .*bar\.' stdout
+grep ' CC .*baz\.' stdout
+grep ' CC .*bla\.' stdout
+grep ' CCLD .*foo' stdout
+grep ' CCLD .*bar' stdout
+grep ' CCLD .*baz' stdout
+grep ' CCLD .*bla' stdout
+
+$MAKE clean
+$MAKE V=1 >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep ' -c' stdout
+grep ' -o libfoo' stdout
+grep ' CC .*foo\.' stdout && Exit 1
+grep ' CC .*bar\.' stdout && Exit 1
+grep ' CC .*baz\.' stdout && Exit 1
+grep ' CC .*bla\.' stdout && Exit 1
+grep ' CCLD .*foo' stdout && Exit 1
+grep ' CCLD .*bar' stdout && Exit 1
+grep ' CCLD .*baz' stdout && Exit 1
+grep ' CCLD .*bla' stdout && Exit 1
+
+:
diff --git a/tests/silent4.test b/tests/silent4.test
new file mode 100755 (executable)
index 0000000..dc897cb
--- /dev/null
@@ -0,0 +1,98 @@
+#!/bin/sh
+# Copyright (C) 2009  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 3, 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 mode, with libtool, non-fastdep case
+# (so that, with GCC, we also cover the other code paths in depend2).
+
+# Please keep this file in sync with silent3.test.
+
+required="libtoolize gcc"
+. ./defs
+
+set -e
+
+mkdir sub
+
+cat >>configure.in <<'EOF'
+AC_CONFIG_FILES([sub/Makefile])
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_LIBTOOL
+AC_OUTPUT
+EOF
+
+cat > Makefile.am <<'EOF'
+AUTOMAKE_OPTIONS = silent
+# Need generic and non-generic rules.
+lib_LTLIBRARIES = libfoo.la libbar.la
+libbar_la_CFLAGS = $(AM_CFLAGS)
+SUBDIRS = sub
+EOF
+
+cat > sub/Makefile.am <<'EOF'
+AUTOMAKE_OPTIONS = silent subdir-objects
+# Need generic and non-generic rules.
+lib_LTLIBRARIES = libbaz.la libbla.la
+libbla_la_CFLAGS = $(AM_CFLAGS)
+EOF
+
+cat > libfoo.c <<'EOF'
+int main ()
+{
+  return 0;
+}
+EOF
+cp libfoo.c libbar.c
+cp libfoo.c sub/libbaz.c
+cp libfoo.c sub/libbla.c
+
+libtoolize
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+./configure am_cv_CC_dependencies_compiler_type=gcc
+$MAKE >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep ' -c' stdout && Exit 1
+grep ' -o libfoo' stdout && Exit 1
+grep mv stdout && Exit 1
+grep ' CC .*foo\.' stdout
+grep ' CC .*bar\.' stdout
+grep ' CC .*baz\.' stdout
+grep ' CC .*bla\.' stdout
+grep ' CCLD .*foo' stdout
+grep ' CCLD .*bar' stdout
+grep ' CCLD .*baz' stdout
+grep ' CCLD .*bla' stdout
+
+$MAKE clean
+$MAKE V=1 >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep ' -c' stdout
+grep ' -o libfoo' stdout
+grep ' CC .*foo\.' stdout && Exit 1
+grep ' CC .*bar\.' stdout && Exit 1
+grep ' CC .*baz\.' stdout && Exit 1
+grep ' CC .*bla\.' stdout && Exit 1
+grep ' CCLD .*foo' stdout && Exit 1
+grep ' CCLD .*bar' stdout && Exit 1
+grep ' CCLD .*baz' stdout && Exit 1
+grep ' CCLD .*bla' stdout && Exit 1
+
+$MAKE distclean
+
+:
diff --git a/tests/silent5.test b/tests/silent5.test
new file mode 100755 (executable)
index 0000000..4a2fd5d
--- /dev/null
@@ -0,0 +1,162 @@
+#!/bin/sh
+# Copyright (C) 2009  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 3, 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 mode, languages other than C.
+
+required='g++ gfortran flex bison'
+. ./defs
+
+set -e
+
+mkdir sub
+
+cat >>configure.in <<'EOF'
+AM_PROG_CC_C_O
+AC_PROG_CXX
+AC_PROG_F77
+AC_PROG_FC
+AC_PROG_LEX
+AC_PROG_YACC
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+EOF
+
+cat > Makefile.am <<'EOF'
+AUTOMAKE_OPTIONS = silent
+# Need generic and non-generic rules.
+bin_PROGRAMS = foo bar
+bar_CFLAGS = $(AM_CFLAGS)
+foo_SOURCES = foo1.cpp foo2.f90 foo3.f foo5.l foo6.y
+SUBDIRS = sub
+AM_YFLAGS = -d
+LDADD = $(LEXLIB)
+BUILT_SOURCES = foo6.h
+EOF
+
+cat > sub/Makefile.am <<'EOF'
+AUTOMAKE_OPTIONS = silent subdir-objects
+# Need generic and non-generic rules.
+bin_PROGRAMS = baz bla
+bla_CFLAGS = $(AM_CFLAGS)
+baz_SOURCES = baz1.cpp baz2.f90 baz3.f baz5.l baz6.y
+AM_YFLAGS = -d
+LDADD = $(LEXLIB)
+BUILT_SOURCES = baz6.h
+EOF
+
+cat > foo1.cpp <<'EOF'
+int main ()
+{
+  return 0;
+}
+EOF
+cat > foo2.f90 <<'EOF'
+      subroutine foo2
+      return
+      end
+EOF
+cat > foo3.f <<'EOF'
+      subroutine foo3
+      return
+      end
+EOF
+cat > foo5.l <<'EOF'
+%%
+"END"   return EOF;
+.
+%%
+EOF
+cat > foo6.y <<'EOF'
+%{
+void yyerror (char *s) {}
+%}
+%token EOF
+%%
+fubar : 'f' 'o' 'o' 'b' 'a' 'r' EOF {};
+EOF
+cp foo1.cpp bar.c
+cp foo1.cpp sub/baz.c
+cp foo1.cpp sub/bla.c
+cp foo1.cpp sub/baz1.cpp
+cp foo2.f90 sub/baz2.f90
+cp foo3.f sub/baz3.f
+cp foo5.l sub/baz5.l
+cp foo6.y sub/baz6.y
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+# configure once for fastdep, once for non-fastdep
+for config_args in '' am_cv_CC_dependencies_compiler_type=gcc
+do
+  ./configure $config_args
+  $MAKE >stdout || { cat stdout; Exit 1; }
+  cat stdout
+  grep ' -c' stdout && Exit 1
+  grep ' -o ' stdout && Exit 1
+  grep mv stdout && Exit 1
+
+  grep 'CXX .*foo1\.' stdout
+  grep 'CXX .*baz1\.' stdout
+  grep 'FC .*foo2\.' stdout
+  grep 'FC .*baz2\.' stdout
+  grep 'F77 .*foo3\.' stdout
+  grep 'F77 .*baz3\.' stdout
+  grep 'LEX .*foo5\.' stdout
+  grep 'LEX .*baz5\.' stdout
+  grep ' CC .*foo5\.' stdout
+  grep ' CC .*baz5\.' stdout
+  grep 'YACC .*foo6\.' stdout
+  grep 'YACC .*baz6\.' stdout
+  grep ' CC .*foo6\.' stdout
+  grep ' CC .*baz6\.' stdout
+
+  grep 'CXXLD .*foo' stdout
+  grep 'CCLD .*bar' stdout
+  grep 'CXXLD .*baz' stdout
+  grep 'CCLD .*bla' stdout
+
+  $MAKE clean
+  $MAKE V=1 >stdout || { cat stdout; Exit 1; }
+  cat stdout
+  grep ' -c' stdout
+  grep ' -o ' stdout
+
+  grep 'CXX .*foo1\.' stdout && Exit 1
+  grep 'CXX .*baz1\.' stdout && Exit 1
+  grep 'FC .*foo2\.' stdout && Exit 1
+  grep 'FC .*baz2\.' stdout && Exit 1
+  grep 'F77 .*foo3\.' stdout && Exit 1
+  grep 'F77 .*baz3\.' stdout && Exit 1
+  grep 'LEX .*foo5\.' stdout && Exit 1
+  grep 'LEX .*baz5\.' stdout && Exit 1
+  grep ' CC .*foo5\.' stdout && Exit 1
+  grep ' CC .*baz5\.' stdout && Exit 1
+  grep 'YACC .*foo6\.' stdout && Exit 1
+  grep 'YACC .*baz6\.' stdout && Exit 1
+  grep ' CC .*foo6\.' stdout && Exit 1
+  grep ' CC .*baz6\.' stdout && Exit 1
+
+  grep 'CXXLD .*foo' stdout && Exit 1
+  grep 'CCLD .*bar' stdout && Exit 1
+  grep 'CXXLD .*baz' stdout && Exit 1
+  grep 'CCLD .*bla' stdout && Exit 1
+  $MAKE clean
+  $MAKE maintainer-clean
+done
+
+: