silent: new $(AM_V_P) variable, tell if we're running in silent mode
[platform/upstream/automake.git] / t / silent-obsolescent-warns.sh
1 #!/bin/sh
2 # Copyright (C) 2009-2012 Free Software Foundation, Inc.
3 #
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)
7 # any later version.
8 #
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.
13 #
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/>.
16
17 # Some checks about silent-rules mode and warnings.
18
19 . ./defs || Exit 1
20
21 cat >>configure.ac <<'EOF'
22 AM_SILENT_RULES
23 AC_OUTPUT
24 EOF
25
26 cat > Makefile.am <<'EOF'
27 my_verbose = $(my_verbose_$(V))
28 my_verbose_ = $(my_verbose_$(AM_DEFAULT_VERBOSITY))
29 my_verbose_0 = @echo " PKG-GEN    $@";
30 foo: foo.in
31         $(my_verbose)cp $(srcdir)/foo.in $@
32 EOF
33
34 $ACLOCAL
35 $AUTOMAKE --add-missing
36
37 cat > configure.ac <<'END'
38 AC_INIT([silent6], [1.0])
39 AM_INIT_AUTOMAKE([-Wall])
40 AC_CONFIG_FILES([Makefile])
41 END
42
43 rm -rf autom4te*.cache
44 $ACLOCAL
45 AUTOMAKE_fails
46 grep 'my_verbose_\$(V.*non-POSIX ' stderr
47 $AUTOMAKE -Wno-error
48
49 # AM_SILENT_RULES should turn off the warning.
50 echo 'AM_SILENT_RULES' >> configure.ac
51 rm -rf autom4te*.cache
52 $ACLOCAL
53 $AUTOMAKE
54 grep 'AM_V_GEN' Makefile.in
55 $AUTOMAKE --force -Wno-all -Wportability
56 grep 'AM_V_GEN' Makefile.in
57
58 # The 'silent-rules' option to AM_INIT_AUTOMAKE should work likewise.
59 cat > configure.ac <<'END'
60 AC_INIT([silent6], [1.0])
61 AM_INIT_AUTOMAKE([silent-rules])
62 AC_CONFIG_FILES([Makefile])
63 END
64 rm -rf autom4te*.cache
65 $ACLOCAL
66 $AUTOMAKE
67 grep 'AM_V_GEN' Makefile.in
68 $AUTOMAKE --force -Wno-all -Wportability
69 grep 'AM_V_GEN' Makefile.in
70
71 :