doc: typos in test file.
[automake.git] / t / silent-configsite.sh
blob76a41f097dff877e29008239e16481529ae1ad15
1 #!/bin/sh
2 # Copyright (C) 2010-2024 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)
7 # any later version.
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 <https://www.gnu.org/licenses/>.
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.
21 . test-init.sh
23 cat >> configure.ac <<'EOF'
24 # This line will be edited later to force silent-rules default.
25 AC_OUTPUT
26 EOF
28 cat > Makefile.am <<'EOF'
29 .PHONY: test-silent test-nosilent
30 test-silent:
31 test x'$(AM_DEFAULT_VERBOSITY)' = x'0'
32 test-nosilent:
33 test x'$(AM_DEFAULT_VERBOSITY)' = x'1'
34 EOF
36 unset enable_silent_rules
38 : 'No explicit default in configure.ac, enable by default in config.site'
40 $ACLOCAL
41 $AUTOCONF
42 $AUTOMAKE --add-missing
43 echo "enable_silent_rules=\${enable_silent_rules-yes}" > config.site
44 CONFIG_SITE=./config.site ./configure
45 $MAKE test-silent
46 $MAKE distclean
47 # Command line should win over default values in config.site.
48 CONFIG_SITE=./config.site ./configure --disable-silent-rules
49 $MAKE test-nosilent
50 $MAKE distclean
52 : 'Disable by default in configure.ac, enable by default in config.site'
54 sed 's/.*silent-rules default.*/AM_SILENT_RULES([no])/' configure.ac > t
55 diff t configure.ac && fatal_ "editing configure.ac"
56 mv -f t configure.ac
57 $ACLOCAL
58 $AUTOCONF
59 $AUTOMAKE --add-missing
60 echo "enable_silent_rules=\${enable_silent_rules-yes}" > config.site
61 CONFIG_SITE=./config.site ./configure
62 $MAKE test-silent
63 # Command line should win over default values in config.site.
64 $MAKE distclean
65 CONFIG_SITE=./config.site ./configure --disable-silent-rules
66 $MAKE test-nosilent
67 $MAKE distclean
69 : 'Enable by default in configure.ac, disable by default in config.site'
71 sed 's/.*AM_SILENT_RULES.*/AM_SILENT_RULES([yes])/' configure.ac > t
72 diff t configure.ac && fatal_ "editing configure.ac"
73 mv -f t configure.ac
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