2 # Copyright (C) 2009-2012 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # Check user extensibility of silent-rules mode.
21 cat >>configure.ac <<'EOF'
22 AC_CONFIG_FILES([sub/Makefile])
26 # We delegate all the work to the subdir makefile. This is done
27 # to ensure any command-line setting of $(V) gets correctly passed
28 # down to recursive make invocations.
29 echo SUBDIRS = sub > Makefile.am
32 cat > sub/Makefile.am <<'EOF'
33 AUTOMAKE_OPTIONS = -Wno-portability-recursive
34 my_verbose = $(my_verbose_$(V))
35 my_verbose_ = $(my_verbose_$(AM_DEFAULT_VERBOSITY))
36 my_verbose_0 = @echo " XGEN $@";
38 all-local: foo gen-headers
43 @headers=`for i in $(list); do echo sub/$$i.h; done`; \
44 if $(AM_V_P); then set -x; else \
45 echo " GEN [headers]"; \
47 rm -f $$headers || exit 1; \
48 ## Only fake header generation.
49 : generate-header --flags $$headers
52 $(my_verbose)cp $(srcdir)/foo.in $@
60 $AUTOMAKE --add-missing
67 --verbose) silent=false;;
68 *) fatal_ "do_check(): incorrect usage";;
72 $MAKE ${1+"$@"} >output 2>&1 || { cat output; Exit 1; }
75 $FGREP 'cp ' output && Exit 1
76 $FGREP 'generate-header' output && Exit 1
77 $FGREP 'rm -f' output && Exit 1
78 grep '[012]\.h' output && Exit 1
79 grep '^ XGEN foo$' output
80 grep '^ GEN \[headers\]$' output
82 $FGREP 'GEN ' output && Exit 1
83 $FGREP 'cp ./foo.in foo' output
84 $FGREP "rm -f sub/0.h sub/1.h sub/2.h" output
85 $FGREP "generate-header --flags sub/0.h sub/1.h sub/2.h" output
89 ./configure --enable-silent-rules
91 do_check --verbose V=1
95 ./configure --disable-silent-rules