]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
automake: silent make output for custom link commands.
authorNick Gasson <nick@nickg.me.uk>
Fri, 16 Jul 2021 01:37:09 +0000 (18:37 -0700)
committerKarl Berry <karl@freefriends.org>
Fri, 16 Jul 2021 01:37:09 +0000 (18:37 -0700)
Patch posted:
https://lists.gnu.org/archive/html/automake-patches/2021-07/msg00010.html

* bin/automake.in (define_per_target_linker_variable): Use
AM_V_${target}_LINK if defined as the verbose variable name for
custom link commands.
* doc/automake.texi (Program and Library Variables): Document the new
variable.
* t/link_override.sh: Add extra checks for silent make rules.
* NEWS: Mention this.
* THANKS: new contributor.

NEWS
THANKS
bin/automake.in
doc/automake.texi
t/link_override.sh

diff --git a/NEWS b/NEWS
index 09ade1c58024a048ae8d5ac7b115d19c3b193eb6..d67cbe9163ec288d0aca167e3a2821f2eef9641f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -18,7 +18,9 @@ New in ?.?.?:
 
   - CTAGS, ETAGS, SCOPE variables can be set via configure.
 
-  - new option "no-dist-built-sources" skips generating $(BUILT_SOURCES)
+  - Silent make output for custom link commands.
+
+  - New option "no-dist-built-sources" skips generating $(BUILT_SOURCES)
   before building the tarball as part of "make dist", that is,
   omits the dependency of $(distdir): $(BUILT_SOURCES).
 
diff --git a/THANKS b/THANKS
index 25222f61651a4cb9c51772833f8b157f44e334a6..3aa99021bf74c12a3df4f19f10b1e4f14d705688 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -300,6 +300,7 @@ Nelson H. F. Beebe              beebe@math.utah.edu
 Nicholas Wourms                 nwourms@netscape.net
 Nick Bowler                     nbowler@elliptictech.com
 Nick Brown                      brownn@brocade.com
+Nick Gasson                     nick@nickg.me.uk
 Nicola Fontana                  ntd@entidi.it
 Nicolas Joly                    njoly@pasteur.fr
 Nicolas Thiery                  nthiery@Icare.mines.edu
index f6ebe30ea8b4539b70a401bbd61c034b8577aec4..f04f5d5f55543dd02560ee9564c20e3cb6b940bf 100644 (file)
@@ -6360,8 +6360,12 @@ sub define_per_target_linker_variable
   my ($linker, $target) = @_;
 
   # If the user wrote a custom link command, we don't define ours.
-  return "${target}_LINK"
-    if set_seen "${target}_LINK";
+  my $custom_link = "${target}_LINK";
+  if (set_seen ($custom_link))
+    {
+      my $verbose = $custom_link if var (verbose_var ($custom_link));
+      return ($custom_link, $verbose);
+    }
 
   my $xlink = $linker ? $linker : 'LINK';
 
index dd932ddd796a8024903fe26a381b5f6471c19eab..0a0da6168c6a66e95d43ffc23bac8a7c72216520 100644 (file)
@@ -5903,6 +5903,9 @@ and used by Automake due to the use of per-target link flags such as
 @code{_CFLAGS}, @code{_LDFLAGS} or @code{_LIBTOOLFLAGS}, in cases where
 they apply.
 
+If the variable @code{AM_V_*_LINK} exists, it is used to output a
+status line in silent mode; otherwise, @code{AM_V_GEN} is used.
+
 @item maude_CCASFLAGS
 @itemx maude_CFLAGS
 @itemx maude_CPPFLAGS
index 1ac45fc5d24078d6101374a8aba80be6643e0220..81787af914ecd73d94e239b7bfba1b69e3e4f714 100644 (file)
@@ -27,6 +27,8 @@ bin_PROGRAMS = foo bar baz boo
 foo_LINK = $(LINK)
 bar_LINK = $(LINK)
 bar_LDFLAGS = $(AM_LDFLAGS)
+baz_LINK = $(LINK)
+AM_V_baz_LINK = xyz
 END
 
 $ACLOCAL
@@ -41,4 +43,9 @@ grep '.\$(LINK).*foo' Makefile.in && exit 1
 grep '^ *bar_LINK *=.*bar_LDFLAGS' Makefile.in && exit 1
 grep '.\$(bar_LINK).*bar' Makefile.in
 
+# Silent make rules should use AM_V_GEN unless overriden.
+grep '.\$(AM_V_GEN)\$(foo_LINK)' Makefile.in
+grep '.\$(AM_V_baz_LINK)\$(baz_LINK)' Makefile.in
+grep '.\$(AM_V_GEN)\$(baz_LINK)' Makefile.in && exit 1
+
 exit 0