Merge branch 'msvc' into maint
[platform/upstream/automake.git] / tests / silent-configsite.test
1 #!/bin/sh
2 # Copyright (C) 2010 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 # Check that the user can control default mode of silent-rules
18 # from config.site, and that this default can be overridden from
19 # either the ./configure or make command line.
20
21 . ./defs || Exit 1
22
23 set -e
24
25 cat >> configure.in <<'EOF'
26 AM_SILENT_RULES
27 AC_OUTPUT
28 EOF
29
30 cat > Makefile.am <<'EOF'
31 .PHONY: test-silent test-nosilent
32 test-silent:
33         test x'$(AM_DEFAULT_VERBOSITY)' = x'0'
34 test-nosilent:
35         test x'$(AM_DEFAULT_VERBOSITY)' = x'1'
36 EOF
37
38 unset enable_silent_rules || :
39
40 : 'No explicit default in configure.in, enable by default in config.site'
41
42 $ACLOCAL
43 $AUTOCONF
44 $AUTOMAKE --add-missing
45 echo "enable_silent_rules=\${enable_silent_rules-yes}" > config.site
46 CONFIG_SITE=./config.site ./configure
47 $MAKE test-silent
48 $MAKE distclean
49 # Command line should win over default values in config.site.
50 CONFIG_SITE=./config.site ./configure --disable-silent-rules
51 $MAKE test-nosilent
52 $MAKE distclean
53
54 : 'Disable by default in configure.in, enable by default in config.site'
55
56 sed 's/^AM_SILENT_RULES/&([no])/' configure.in > configure.tmp
57 mv -f configure.tmp configure.in
58 $ACLOCAL
59 $AUTOCONF
60 $AUTOMAKE --add-missing
61 echo "enable_silent_rules=\${enable_silent_rules-yes}" > config.site
62 CONFIG_SITE=./config.site ./configure
63 $MAKE test-silent
64 # Command line should win over default values in config.site.
65 $MAKE distclean
66 CONFIG_SITE=./config.site ./configure --disable-silent-rules
67 $MAKE test-nosilent
68 $MAKE distclean
69
70 : 'Enable by default in configure.in, disable by default in config.site'
71
72 sed 's/^AM_SILENT_RULES/&([yes])/' configure.in > configure.tmp
73 mv -f configure.tmp configure.in
74 $ACLOCAL
75 $AUTOCONF
76 $AUTOMAKE --add-missing
77 echo "enable_silent_rules=\${enable_silent_rules-no}" > config.site
78 CONFIG_SITE=./config.site ./configure
79 $MAKE test-nosilent
80 $MAKE distclean
81 # Command line should win over default values in config.site.
82 CONFIG_SITE=./config.site ./configure --enable-silent-rules
83 $MAKE test-silent
84 $MAKE distclean
85
86 :