Fix silent-rules output for disabled dependency tracking.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 24 Jan 2010 11:36:47 +0000 (12:36 +0100)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 24 Jan 2010 11:36:47 +0000 (12:36 +0100)
* lib/am/depend2.am [!%FASTDEP%]: Rework silent-rules variable
expansion code to also work in the case where %AMDEP% expands
to FALSE at config.status time, using new substitution string
%VERBOSE-NODEP%.
* automake.in (verbose_nodep_flag): New function, appending
`@am__nodep@' to the verbose-variable name.
(handle_languages): If dependencies are not disabled, use it to
set %VERBOSE-NODEP%.
* m4/depend.m4: Substitute am__nodep as '_no', so the second
verbose-variable will always expand to an empty string, if
dependencies are enabled.
* tests/silent5.test: Also test --disable-dependency-tracking;
also test per-target flags for non-C language files.
* tests/silent9.test: New test, like silent4.test but disable
dependency tracking.
* tests/Makefile.am: Adjust.
* NEWS, THANKS: Update.
Report by Dmitry V. Levin <ldv@altlinux.org>.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
NEWS
THANKS
automake.in
lib/am/depend2.am
m4/depend.m4
tests/Makefile.am
tests/Makefile.in
tests/silent4.test
tests/silent5.test
tests/silent9.test [new file with mode: 0755]

index c0270c3..da01f8f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2010-01-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Fix silent-rules output for disabled dependency tracking.
+       * lib/am/depend2.am [!%FASTDEP%]: Rework silent-rules variable
+       expansion code to also work in the case where %AMDEP% expands
+       to FALSE at config.status time, using new substitution string
+       %VERBOSE-NODEP%.
+       * automake.in (verbose_nodep_flag): New function, appending
+       `@am__nodep@' to the verbose-variable name.
+       (handle_languages): If dependencies are not disabled, use it to
+       set %VERBOSE-NODEP%.
+       * m4/depend.m4: Substitute am__nodep as '_no', so the second
+       verbose-variable will always expand to an empty string, if
+       dependencies are enabled.
+       * tests/silent5.test: Also test --disable-dependency-tracking;
+       also test per-target flags for non-C language files.
+       * tests/silent9.test: New test, like silent4.test but disable
+       dependency tracking.
+       * tests/Makefile.am: Adjust.
+       * NEWS, THANKS: Update.
+       Report by Dmitry V. Levin <ldv@altlinux.org>.
+
 2010-01-17  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        Slighty improve tests acoutbs.test and acoutbs2.test.
diff --git a/NEWS b/NEWS
index cd427fb..bf80253 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,11 @@ Bugs fixed in 1.11.0a:
   - The `parallel-tests' test driver works around a GNU make 3.80 bug with
     trailing white space in the test list (`TESTS = foo $(EMPTY)').
 
+  - The `silent-rules' option now also silences all compile rules if dependency
+    tracking is disabled.  Also, when `silent-rules' is not used, the output from
+    `make' does not contain spurious extra lines with only a backslash in them
+    any more; it now again matches that from pre-1.11 Automake.
+
 * Long standing bugs:
 
   - On Darwin 9, `pythondir' and `pyexecdir' pointed below `/Library/Python'
diff --git a/THANKS b/THANKS
index d606ce2..57bb501 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -82,6 +82,7 @@ Dieter Baron          dillo@stieltjes.smc.univie.ac.at
 Dieter Jurzitza                DJurzitza@harmanbecker.com
 Dilyan Palauzov                Dilyan.Palauzov@aegee.org
 Dmitry Mikhin          dmitrym@acres.com.au
+Dmitry V. Levin                ldv@altlinux.org
 Doug Evans             devans@cygnus.com
 Duncan Gibson          duncan@thermal.esa.int
 Ed Hartnett            ed@unidata.ucar.edu
index 8692d61..116fc7d 100755 (executable)
@@ -1183,6 +1183,14 @@ sub verbose_flag ($)
     return '';
 }
 
+sub verbose_nodep_flag ($)
+{
+    my ($name) = @_;
+    return '$(' . verbose_var ($name) . subst ('am__nodep') . ')'
+      if (option 'silent-rules');
+    return '';
+}
+
 # silent_flag
 # -----------
 # Contents of %SILENT%: variable to expand to `@' when silent.
@@ -1380,6 +1388,8 @@ sub handle_languages
          ? ('FALSE', 'FALSE') : ('AMDEP', "am__fastdep$fpfx");
 
        my $verbose = verbose_flag ($lang->ccer || 'GEN');
+       my $verbose_nodep = ($AMDEP eq 'FALSE')
+         ? $verbose : verbose_nodep_flag ($lang->ccer || 'GEN');
        my $silent = silent_flag ();
 
        my %transform = ('EXT'     => $ext,
@@ -1394,6 +1404,7 @@ sub handle_languages
                         'DERIVED-EXT' => 'BUG',
                         DIST_SOURCE   => 1,
                         VERBOSE   => $verbose,
+                        'VERBOSE-NODEP' => $verbose_nodep,
                         SILENT    => $silent,
                        );
 
@@ -1616,6 +1627,7 @@ sub handle_languages
                             LTOBJ     => "$obj.lo",
 
                             VERBOSE   => $verbose,
+                            'VERBOSE-NODEP'  => $verbose_nodep,
                             SILENT    => $silent,
                             COMPILE   => $obj_compile,
                             LTCOMPILE => $obj_ltcompile,
index 3674fee..9a193a4 100644 (file)
@@ -1,6 +1,6 @@
 ## automake - create Makefile.in from Makefile.am
 ## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-## 2003, 2004, 2006, 2008, 2009  Free Software Foundation, Inc.
+## 2003, 2004, 2006, 2008, 2009, 2010  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
@@ -71,18 +71,17 @@ if %FASTDEP%
 ?GENERIC??SUBDIROBJ?   %COMPILE% -MT %OBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %OBJ% %SOURCEFLAG%%SOURCE% &&\
 ?GENERIC??SUBDIROBJ?   $(am__mv) %DEPBASE%.Tpo %DEPBASE%.Po
 else !%FASTDEP%
-?VERBOSE?      %VERBOSE% @AM_BACKSLASH@
 if %AMDEP%
-       source='%SOURCE%' object='%OBJ%' libtool=no @AMDEPBACKSLASH@
+       %VERBOSE%source='%SOURCE%' object='%OBJ%' libtool=no @AMDEPBACKSLASH@
        DEPDIR=$(DEPDIR) $(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@
 endif %AMDEP%
 if %?GENERIC%
-?-o?   %COMPILE% %-c% %-o% %OBJ% %SOURCEFLAG%%SOURCE%
-?!-o?  %COMPILE% %-c% %SOURCEFLAG%%SOURCE%
+?-o?   %VERBOSE-NODEP%%COMPILE% %-c% %-o% %OBJ% %SOURCEFLAG%%SOURCE%
+?!-o?  %VERBOSE-NODEP%%COMPILE% %-c% %SOURCEFLAG%%SOURCE%
 else !%?GENERIC%
 ## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
-?-o?   %COMPILE% %-c% %-o% %OBJ% %SOURCEFLAG%`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
-?!-o?  %COMPILE% %-c% %SOURCEFLAG%`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
+?-o?   %VERBOSE-NODEP%%COMPILE% %-c% %-o% %OBJ% %SOURCEFLAG%`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
+?!-o?  %VERBOSE-NODEP%%COMPILE% %-c% %SOURCEFLAG%`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
 endif !%?GENERIC%
 endif !%FASTDEP%
 
@@ -99,18 +98,17 @@ if %FASTDEP%
 ?GENERIC??SUBDIROBJ?   %COMPILE% -MT %OBJOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %OBJOBJ% %SOURCEFLAG%`$(CYGPATH_W) '%SOURCE%'` &&\
 ?GENERIC??SUBDIROBJ?   $(am__mv) %DEPBASE%.Tpo %DEPBASE%.Po
 else !%FASTDEP%
-?VERBOSE?      %VERBOSE% @AM_BACKSLASH@
 if %AMDEP%
-       source='%SOURCE%' object='%OBJOBJ%' libtool=no @AMDEPBACKSLASH@
+       %VERBOSE%source='%SOURCE%' object='%OBJOBJ%' libtool=no @AMDEPBACKSLASH@
        DEPDIR=$(DEPDIR) $(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@
 endif %AMDEP%
 if %?GENERIC%
-?-o?   %COMPILE% %-c% %-o% %OBJOBJ% %SOURCEFLAG%`$(CYGPATH_W) '%SOURCE%'`
-?!-o?  %COMPILE% %-c% `$(CYGPATH_W) %SOURCEFLAG%'%SOURCE%'`
+?-o?   %VERBOSE-NODEP%%COMPILE% %-c% %-o% %OBJOBJ% %SOURCEFLAG%`$(CYGPATH_W) '%SOURCE%'`
+?!-o?  %VERBOSE-NODEP%%COMPILE% %-c% `$(CYGPATH_W) %SOURCEFLAG%'%SOURCE%'`
 else !%?GENERIC%
 ## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
-?-o?   %COMPILE% %-c% %-o% %OBJOBJ% %SOURCEFLAG%`if test -f '%SOURCE%'; then $(CYGPATH_W) '%SOURCE%'; else $(CYGPATH_W) '$(srcdir)/%SOURCE%'; fi`
-?!-o?  %COMPILE% %-c% %SOURCEFLAG%`if test -f '%SOURCE%'; then $(CYGPATH_W) '%SOURCE%'; else $(CYGPATH_W) '$(srcdir)/%SOURCE%'; fi`
+?-o?   %VERBOSE-NODEP%%COMPILE% %-c% %-o% %OBJOBJ% %SOURCEFLAG%`if test -f '%SOURCE%'; then $(CYGPATH_W) '%SOURCE%'; else $(CYGPATH_W) '$(srcdir)/%SOURCE%'; fi`
+?!-o?  %VERBOSE-NODEP%%COMPILE% %-c% %SOURCEFLAG%`if test -f '%SOURCE%'; then $(CYGPATH_W) '%SOURCE%'; else $(CYGPATH_W) '$(srcdir)/%SOURCE%'; fi`
 endif !%?GENERIC%
 endif !%FASTDEP%
 endif %?NONLIBTOOL%
@@ -129,14 +127,13 @@ if %FASTDEP%
 ?GENERIC??SUBDIROBJ?   %LTCOMPILE% -MT %LTOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %LTOBJ% %SOURCEFLAG%%SOURCE% &&\
 ?GENERIC??SUBDIROBJ?   $(am__mv) %DEPBASE%.Tpo %DEPBASE%.Plo
 else !%FASTDEP%
-?VERBOSE?      %VERBOSE% @AM_BACKSLASH@
 if %AMDEP%
-       source='%SOURCE%' object='%LTOBJ%' libtool=yes @AMDEPBACKSLASH@
+       %VERBOSE%source='%SOURCE%' object='%LTOBJ%' libtool=yes @AMDEPBACKSLASH@
        DEPDIR=$(DEPDIR) $(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@
 endif %AMDEP%
 ## We can always use `-o' with Libtool.
-?GENERIC?      %LTCOMPILE% %-c% -o %LTOBJ% %SOURCEFLAG%%SOURCE%
+?GENERIC?      %VERBOSE-NODEP%%LTCOMPILE% %-c% -o %LTOBJ% %SOURCEFLAG%%SOURCE%
 ## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
-?!GENERIC?     %LTCOMPILE% %-c% -o %LTOBJ% %SOURCEFLAG%`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
+?!GENERIC?     %VERBOSE-NODEP%%LTCOMPILE% %-c% -o %LTOBJ% %SOURCEFLAG%`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
 endif !%FASTDEP%
 endif %?LIBTOOL%
index efe8643..8304180 100644 (file)
@@ -1,12 +1,12 @@
 ##                                                          -*- Autoconf -*-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
-# Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
+# 2010  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 10
+# serial 11
 
 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
 # written in clear, in which case automake, when reading aclocal.m4,
@@ -175,8 +175,11 @@ AC_DEFUN([AM_DEP_TRACK],
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
+  am__nodep='_no'
 fi
 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
 AC_SUBST([AMDEPBACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
 ])
index c160028..3b4c850 100644 (file)
@@ -605,6 +605,7 @@ silent4.test \
 silent5.test \
 silent6.test \
 silent7.test \
+silent9.test \
 sinclude.test \
 srcsub.test \
 srcsub2.test \
index 2954803..f3a3e46 100644 (file)
@@ -839,6 +839,7 @@ silent4.test \
 silent5.test \
 silent6.test \
 silent7.test \
+silent9.test \
 sinclude.test \
 srcsub.test \
 srcsub2.test \
index 37e690c..3fd9f65 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (C) 2009  Free Software Foundation, Inc.
+# Copyright (C) 2009, 2010  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
@@ -17,7 +17,7 @@
 # Check silent-rules mode, with libtool, non-fastdep case
 # (so that, with GCC, we also cover the other code paths in depend2).
 
-# Please keep this file in sync with silent3.test.
+# Please keep this file in sync with silent3.test and silent9.test.
 
 required="libtoolize gcc"
 . ./defs
index 8d517be..1f06cf0 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (C) 2009  Free Software Foundation, Inc.
+# Copyright (C) 2009, 2010  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
@@ -37,9 +37,13 @@ EOF
 
 cat > Makefile.am <<'EOF'
 # Need generic and non-generic rules.
-bin_PROGRAMS = foo bar
+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)
 SUBDIRS = sub
 AM_YFLAGS = -d
 LDADD = $(LEXLIB)
@@ -49,9 +53,13 @@ EOF
 cat > sub/Makefile.am <<'EOF'
 AUTOMAKE_OPTIONS = subdir-objects
 # Need generic and non-generic rules.
-bin_PROGRAMS = baz bla
+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)
 AM_YFLAGS = -d
 LDADD = $(LEXLIB)
 BUILT_SOURCES = baz6.h
@@ -100,8 +108,9 @@ $ACLOCAL
 $AUTOMAKE --add-missing
 $AUTOCONF
 
-# configure once for fastdep, once for non-fastdep
-for config_args in '' am_cv_CC_dependencies_compiler_type=gcc
+# configure once for fastdep, once for non-fastdep, once for nodep
+for config_args in '' am_cv_CC_dependencies_compiler_type=gcc \
+  --disable-dependency-tracking
 do
   ./configure $config_args --enable-silent-rules
   $MAKE >stdout || { cat stdout; Exit 1; }
diff --git a/tests/silent9.test b/tests/silent9.test
new file mode 100755 (executable)
index 0000000..6be0f98
--- /dev/null
@@ -0,0 +1,97 @@
+#!/bin/sh
+# Copyright (C) 2009, 2010  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 libtool, nodep case.
+
+# Please keep this file in sync with silent3.test and silent4.test.
+
+required="libtoolize"
+. ./defs
+
+set -e
+
+mkdir sub
+
+cat >>configure.in <<'EOF'
+AM_SILENT_RULES
+AC_CONFIG_FILES([sub/Makefile])
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_LIBTOOL
+AC_OUTPUT
+EOF
+
+cat > Makefile.am <<'EOF'
+# Need generic and non-generic rules.
+lib_LTLIBRARIES = libfoo.la libbar.la
+libbar_la_CFLAGS = $(AM_CFLAGS)
+SUBDIRS = sub
+EOF
+
+cat > sub/Makefile.am <<'EOF'
+AUTOMAKE_OPTIONS = subdir-objects
+# Need generic and non-generic rules.
+lib_LTLIBRARIES = libbaz.la libbla.la
+libbla_la_CFLAGS = $(AM_CFLAGS)
+EOF
+
+cat > libfoo.c <<'EOF'
+int main ()
+{
+  return 0;
+}
+EOF
+cp libfoo.c libbar.c
+cp libfoo.c sub/libbaz.c
+cp libfoo.c sub/libbla.c
+
+libtoolize
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+./configure --disable-dependency-tracking --enable-silent-rules
+$MAKE >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep ' -c' stdout && Exit 1
+grep ' -o libfoo' stdout && Exit 1
+grep mv stdout && Exit 1
+grep ' CC .*foo\.' stdout
+grep ' CC .*bar\.' stdout
+grep ' CC .*baz\.' stdout
+grep ' CC .*bla\.' stdout
+grep ' CCLD .*foo' stdout
+grep ' CCLD .*bar' stdout
+grep ' CCLD .*baz' stdout
+grep ' CCLD .*bla' stdout
+
+$MAKE clean
+$MAKE V=1 >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep ' -c' stdout
+grep ' -o libfoo' stdout
+grep ' CC .*foo\.' stdout && Exit 1
+grep ' CC .*bar\.' stdout && Exit 1
+grep ' CC .*baz\.' stdout && Exit 1
+grep ' CC .*bla\.' stdout && Exit 1
+grep ' CCLD .*foo' stdout && Exit 1
+grep ' CCLD .*bar' stdout && Exit 1
+grep ' CCLD .*baz' stdout && Exit 1
+grep ' CCLD .*bla' stdout && Exit 1
+
+$MAKE distclean
+
+: