Hash :
14141f25
Author :
Date :
2012-05-01T14:23:04
silent rules: support for them is always active now Before this change, support for silent rules was optional and activated only if the 'silent-rules' option was specified. The rationale behind that behaviour was that the silent-rules machinery originally only worked with make implementations supporting nested variables expansions, which isn't (or wasn't) a POSIX-specified features; so that packages wanting to be "extra-portable" couldn't use the silent-rules machinery at all. But after Paul Eggert's commit 'v1.11-598-g8493499' of 25-12-2011, "silent-rules: fallback for makes without nested vars" (motivated by automake bugs #9928 and #10237), Makefiles generated when the 'silent-rules' option is enabled can work also with those make implementations that don't support nested variables expansion (albeit the configure-time selected verbosity cannot be overridden at make runtime in such case). In light of that, and since silent rules are disabled by default even when the 'silent-rules' option is given (unless the developer explicitly makes them enabled by default be calling "AM_SILENT_RULES([yes])" in configure.ac), we can now have the support for silent rules always enabled. The 'silent-rules' option will thus become a no-op, but will reaming a valid option for the time being, for better backward-compatibility. A collateral effect of this change is that the use of the 'silent-rules' option will not anymore automatically disable the warnings in the 'portability-recursive' category. The present change is basically a backport of the Automake-NG commit 'v1.11d-75-g61ca923' of 19-04-2012, "[ng] silent rules: support for them is always active now". Stemmed by this thread on the Automake-NG list: <http://lists.gnu.org/archive/html/automake-ng/2012-04/msg00027.html> * automake.in: Enable silent-rules machinery unconditionally. Reword some comments. Do not switch off warnings in the category 'portability-recursive' anymore if the 'silent-rules' option is given. * m4/init.m4: Call 'AC_REQUIRE' on 'AM_SILENT_RULES' unconditionally. * lib/Automake/Options.pm: Recognize 'silent-rules' as a dummy option. Do not bother anymore checking that it is set in 'configure.ac'. * t/silent.sh: Remove now-redundant calls to AM_SILENT_RULES. * t/silent2.sh: Likewise. * t/silent3.sh: Likewise. * t/silent4.sh: Likewise. * t/silent8.sh: Likewise. * t/silent9.sh: Likewise. * t/silent-lex.sh: Likewise. * t/silent-many-gcc.sh: Likewise. * t/silent-many-generic.sh: Likewise. * t/silent-yacc-headers.sh: Likewise. * t/silent-yacc.sh: Likewise. * t/silentcxx-gcc.sh: Likewise. * t/silentcxx.sh: Likewise. * t/silentf77.sh: Likewise. * t/silentf90.sh: Likewise. * t/help-silent.sh: Likewise. * t/silent-configsite.sh: Likewise, and other minor adjustments. * t/silent7.sh: Likewise. Also, extend to check that silent rules are disabled by default, and remove obsoleted checks about the 'silent-rules' option being rejected in 'AUTOMAKE_OPTIONS'. * t/silent6.sh: Remove now-redundant calls to 'AM_SILENT_RULES'. Call automake with '-Wno-portability-recursive'. Remove other obsoleted checks. * t/dollarvar.sh: Don't expect the use of 'AM_SILENT_RULES' in 'configure.ac' to disable warning in the 'portability-recursive' category anymore. * t/compile_f_c_cxx.sh: Adjust to avoid a spurious failure. * t/silent-amopts.sh: Remove as obsolete. * t/silent-nowarn.sh: Likewise. * t/list-of-tests.mk: Adjust. * NEWS: Update. * doc/automake.texi: Update and simplify accordingly. * configure.ac (AM_INIT_AUTOMAKE): Remove 'silent-rules' option. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240
#!/bin/sh
# Copyright (C) 2009-2012 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 2, 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-rules mode, with gcc depmode and many languages at once.
# This test partly overlaps with other silent*.test, but it serves as
# a stress test by using many different languages at once -- so don't
# remove this test script.
# This test requires the GNU compilers; keep it in sync with sister test
# 'silent-many-generic.test', which should work with generic compilers.
required='gcc g++ gfortran lex yacc'
. ./defs || Exit 1
# Avoids too much code duplication.
do_and_check_silent_build ()
{
case $1 in
--rebuild) rebuild=true;;
*) rebuild=false;;
esac
$MAKE >stdout || { cat stdout; Exit 1; }
cat stdout
# Avoid spurious failures with SunStudio Fortran compilers.
sed '/^NOTICE:/d' stdout > t
mv -f t stdout
cat stdout
$EGREP ' (-c|-o)' stdout && Exit 1
$EGREP '(mv|ylwrap) ' 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 ' CC .*foo5\.' stdout
grep ' CC .*baz5\.' 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
if $rebuild; then :; else
grep 'YACC .*foo6\.' stdout
grep 'YACC .*baz6\.' stdout
grep 'LEX .*foo5\.' stdout
grep 'LEX .*baz5\.' stdout
fi
unset rebuild
}
# Avoids too much code duplication.
do_and_check_verbose_build ()
{
case $1 in
--rebuild) rebuild=true;;
*) rebuild=false;;
esac
$MAKE V=1 >stdout || { cat stdout; Exit 1; }
cat stdout
grep ' -c ' stdout
grep ' -o ' stdout
$EGREP '(CC|CXX|FC|F77|LD) ' stdout && Exit 1
if $rebuild; then :; else
grep 'ylwrap ' stdout
$EGREP '(LEX|YACC) ' stdout && Exit 1
fi
unset rebuild
}
mkdir sub
cat >>configure.ac <<'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'
# Need generic and non-generic rules.
bin_PROGRAMS = foo bar fo2
bar_CFLAGS = $(AM_CFLAGS)
foo_SOURCES = foo1.cpp foo2.f90 foo3.f foo5.l foo6.y
fo2_SOURCES = $(foo_SOURCES)
fo2_CPPFLAGS = $(AM_CPPFLAGS)
fo2_FFLAGS = $(AM_FFLAGS)
fo2_FCFLAGS = $(AM_FCFLAGS)
fo2_YFLAGS = -v
fo2_LFLAGS = -n
SUBDIRS = sub
AM_YFLAGS = -d
LDADD = $(LEXLIB)
BUILT_SOURCES = foo6.h
EOF
cat > sub/Makefile.am <<'EOF'
AUTOMAKE_OPTIONS = subdir-objects
# Need generic and non-generic rules.
bin_PROGRAMS = baz bla ba2
bla_CFLAGS = $(AM_CFLAGS)
baz_SOURCES = baz1.cpp baz2.f90 baz3.f baz5.l baz6.y
ba2_SOURCES = $(baz_SOURCES)
ba2_CPPFLAGS = $(AM_CPPFLAGS)
ba2_FFLAGS = $(AM_FFLAGS)
ba2_FCFLAGS = $(AM_FCFLAGS)
ba2_YFLAGS = -v
ba2_LFLAGS = -n
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'
%{
#define YY_NO_UNISTD_H 1
%}
%%
"END" return EOF;
.
%%
/* Avoid possible link errors. */
int yywrap (void)
{
return 1;
}
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
# Sanity check: make sure the cache variables we force are really
# used by configure.
$FGREP am_cv_CC_dependencies_compiler_type configure
$FGREP am_cv_CXX_dependencies_compiler_type configure
# Ensure per-target rules are used, to ensure their coverage below.
# (We do not do an exhaustive check, that wouldn't be practical).
$FGREP 'bar-bar.o' Makefile.in
$FGREP 'fo2-foo5.c' Makefile.in
$FGREP 'fo2-foo6.c' Makefile.in
# Force gcc ("fast") depmode.
depmodes="am_cv_CC_dependencies_compiler_type=gcc \
am_cv_CXX_dependencies_compiler_type=gcc"
# This apparently useless "for" loop is here to simplify the syncing
# with sister test 'silent-many-generic.test'.
for config_args in \
"$depmodes"
do
./configure $config_args --enable-silent-rules
do_and_check_silent_build
# Cleaning and then rebuilding with the same V flag (and without
# removing the generated sources in between) shouldn't trigger a
# different set of rules.
$MAKE clean
do_and_check_silent_build --rebuild
# Ensure a clean rebuild.
$MAKE clean
# This is required, since these files are not removed by 'make clean'
# (as dictated by the GNU Coding Standards).
rm -f *foo5.c *foo6.[ch] sub/*baz5.c sub/*baz6.[ch]
do_and_check_verbose_build
# Cleaning and then rebuilding with the same V flag (and without
# removing the generated sources in between) shouldn't trigger a
# different set of rules.
$MAKE clean
do_and_check_verbose_build --rebuild
# Ensure a clean reconfiguration/rebuild.
$MAKE clean
$MAKE maintainer-clean
done
: