* 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>
+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>
## 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
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; \
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; \
- 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.
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
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
@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}
distdir.test \
distname.test \
dollar.test \
+dollarvar.test \
double.test \
dup2.test \
else.test \
sanity.test \
scripts.test \
seenc.test \
+silent.test \
+silent2.test \
+silent3.test \
+silent4.test \
+silent5.test \
sinclude.test \
srcsub.test \
srcsub2.test \
distdir.test \
distname.test \
dollar.test \
+dollarvar.test \
double.test \
dup2.test \
else.test \
sanity.test \
scripts.test \
seenc.test \
+silent.test \
+silent2.test \
+silent3.test \
+silent4.test \
+silent5.test \
sinclude.test \
srcsub.test \
srcsub2.test \
--- /dev/null
+#!/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
+
+
+:
--- /dev/null
+#!/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
+
+:
--- /dev/null
+#!/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
+
+:
--- /dev/null
+#!/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
+
+:
--- /dev/null
+#!/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
+
+:
--- /dev/null
+#!/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
+
+: