automake-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-commit] [SCM] GNU Automake branch, je-silent, updated. Release


From: Ralf Wildenhues
Subject: [Automake-commit] [SCM] GNU Automake branch, je-silent, updated. Release-1-10-280-gbee1af3
Date: Mon, 09 Mar 2009 21:04:00 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=bee1af31a3e62086b4476ad491aacfecb4e149d8

The branch, je-silent has been updated
       via  bee1af31a3e62086b4476ad491aacfecb4e149d8 (commit)
       via  b09961790e7e4f5f4f58e5b48464cbc5ad9e624f (commit)
      from  19e0c0ae4b457c0c32f43ac4cbc26dc9965b02a5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit bee1af31a3e62086b4476ad491aacfecb4e149d8
Author: Ralf Wildenhues <address@hidden>
Date:   Mon Mar 9 21:57:49 2009 +0100

    Provide variables for silencing of user rules.
    
    * automake.in (handle_languages): Always define `AM_V_GEN' and
    `AM_V_at'.
    * doc/automake.texi (Options): Document these flags.
    * tests/silent7.test: New test.
    * tests/Makefile.am: Update.
    
    Signed-off-by: Ralf Wildenhues <address@hidden>

commit b09961790e7e4f5f4f58e5b48464cbc5ad9e624f
Author: Ralf Wildenhues <address@hidden>
Date:   Mon Mar 9 21:45:57 2009 +0100

    Redo variable naming for `silent' machinery.
    
    The public variables are named `AM_V_' plus the compiler
    short-hand now, e.g.: AM_V_CC, AM_V_CXXLD, AM_V_GEN.  The
    dispatch variables are internal details and begin with
    `am__v_'.
    
    * automake.in (verbose_var): Update comment.
    (verbose_private_var): New function.  Order functions so that
    ones not needed outside this section are listed first.
    (verbose_dispatch): Remove, no need to factor this.
    (define_verbose_var, define_verbose_libtool): Use
    verbose_private_var.
    (define_verbose_tagvar): Likewise; and simplify.
    Report by Jan Engelhardt.
    
    Signed-off-by: Ralf Wildenhues <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                            |   21 +++++++++
 automake.in                          |   79 ++++++++++++++++------------------
 doc/automake.texi                    |    8 +++
 tests/Makefile.am                    |    1 +
 tests/Makefile.in                    |    1 +
 tests/{silent6.test => silent7.test} |   44 +++++++++----------
 6 files changed, 89 insertions(+), 65 deletions(-)
 copy tests/{silent6.test => silent7.test} (66%)

diff --git a/ChangeLog b/ChangeLog
index 183890a..fdb3648 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,26 @@
 2009-03-09  Ralf Wildenhues  <address@hidden>
 
+       Provide variables for silencing of user rules.
+       * automake.in (handle_languages): Always define `AM_V_GEN' and
+       `AM_V_at'.
+       * doc/automake.texi (Options): Document these flags.
+       * tests/silent7.test: New test.
+       * tests/Makefile.am: Update.
+
+       Redo variable naming for `silent' machinery.
+       The public variables are named `AM_V_' plus the compiler
+       short-hand now, e.g.: AM_V_CC, AM_V_CXXLD, AM_V_GEN.  The
+       dispatch variables are internal details and begin with
+       `am__v_'.
+       * automake.in (verbose_var): Update comment.
+       (verbose_private_var): New function.  Order functions so that
+       ones not needed outside this section are listed first.
+       (verbose_dispatch): Remove, no need to factor this.
+       (define_verbose_var, define_verbose_libtool): Use
+       verbose_private_var.
+       (define_verbose_tagvar): Likewise; and simplify.
+       Report by Jan Engelhardt.
+
        Let -Wportability turn on/off the portability-recursive channel.
        * lib/Automake/ChannelDefs.pm (switch_warning): switch
        `portability-recursive' channel as well if changing the
diff --git a/automake.in b/automake.in
index 675a1fe..7286a44 100755
--- a/automake.in
+++ b/automake.in
@@ -1115,13 +1115,41 @@ sub backname ($)
 
 # verbose_var (NAME)
 # ------------------
-# The naming policy for the variables used to implement `silent'.
+# The public variable stem used to implement `silent'.
 sub verbose_var ($)
 {
     my ($name) = @_;
+    return 'AM_V_' . $name;
+}
+
+# verbose_private_var (NAME)
+# --------------------------
+# The naming policy for the private variables used to implement `silent'.
+sub verbose_private_var ($)
+{
+    my ($name) = @_;
     return 'am__v_' . $name;
 }
 
+# define_verbose_var (NAME, VAL)
+# ------------------------------
+# For `silent' mode, setup VAR and dispatcher, to expand to VAL if silent.
+sub define_verbose_var ($$)
+{
+    my ($name, $val) = @_;
+    my $var = verbose_var ($name);
+    my $pvar = verbose_private_var ($name);
+    if (option 'silent')
+      {
+       # Using `$V' instead of `$(V)' breaks IRIX make.
+       define_variable ($var, '$(' . $pvar . '_$(V))', INTERNAL);
+       define_variable ($pvar . '_', $val, INTERNAL);
+       define_variable ($pvar . '_0', $val, INTERNAL);
+      }
+}
+
+# Above should not be needed in the general automake code.
+
 # verbose_flag (NAME)
 # -------------------
 # Contents of %VERBOSE%: variable to expand before rule command.
@@ -1133,16 +1161,6 @@ sub verbose_flag ($)
     return '';
 }
 
-# verbose_dispatch (VAR)
-# ----------------------
-# Recursive variable dispatch string.
-sub verbose_dispatch ($)
-{
-    my ($var) = @_;
-    # Using `$V' instead of `$(V)' breaks IRIX make.
-    return '$(' . $var . '_$(V))';
-}
-
 # silent_flag
 # -----------
 # Contents of %SILENT%: variable to expand to `@' when silent.
@@ -1151,40 +1169,16 @@ sub silent_flag ()
     return verbose_flag ('at');
 }
 
-# define_verbose_var (VAR, VAL)
-# -----------------------------
-# For `silent' mode, setup VAR and dispatcher, to expand to VAL if silent.
-sub define_verbose_var ($$)
-{
-    my ($var, $val) = @_;
-    if (option 'silent')
-      {
-       define_variable ($var, verbose_dispatch ($var), INTERNAL);
-       define_variable ($var . '_', $val, INTERNAL);
-       define_variable ($var . '_0', $val, INTERNAL);
-      }
-}
-
 # define_verbose_tagvar (NAME)
 # ----------------------------
 # Engage the needed `silent' machinery for tag NAME.
 sub define_verbose_tagvar ($)
 {
     my ($name) = @_;
-    my $var = verbose_var ($name);
-    if (option 'silent' && !vardef ($var, TRUE))
+    if (option 'silent')
       {
-       Automake::Variable::define ($var, VAR_AUTOMAKE, '', TRUE,
-                                   verbose_dispatch ($var),
-                                   '', INTERNAL, VAR_ASIS);
-       Automake::Variable::define ($var . '_' , VAR_AUTOMAKE, '', TRUE,
-                                   '$(' . $var . '_0)',
-                                   '', INTERNAL, VAR_ASIS);
-       Automake::Variable::define ($var . '_0', VAR_AUTOMAKE, '', TRUE,
-                                   '@echo "  '. $name . ' ' x (6 - length 
($name)) . '" $@;',
-                                   '', INTERNAL, VAR_ASIS);
-       my $silent = verbose_var ('at');
-       define_verbose_var ($silent, '@');
+       define_verbose_var ($name, '@echo "  '. $name . ' ' x (6 - length 
($name)) . '" $@;');
+       define_verbose_var ('at', '@');
       }
 }
 
@@ -1193,10 +1187,8 @@ sub define_verbose_tagvar ($)
 # Engage the needed `silent' machinery for `libtool --silent'.
 sub define_verbose_libtool ()
 {
-    my $var = verbose_var ('lt');
-    my $flag = verbose_flag ('lt');
-    define_verbose_var ($var, '--silent');
-    return $flag;
+    define_verbose_var ('lt', '--silent');
+    return verbose_flag ('lt');
 }
 
 
@@ -1657,6 +1649,9 @@ sub handle_languages
          unless defined $done{$languages{'c'}};
        define_linker_variable ($languages{'c'});
       }
+
+    # Always provide the user with `AM_V_GEN' for `silent' mode.
+    define_verbose_tagvar ('GEN');
 }
 
 
diff --git a/doc/automake.texi b/doc/automake.texi
index da6e779..2a22ca4 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -8733,6 +8733,14 @@ variable expansion @samp{$(@var{var1}$(V))}.  Do not use 
the
 expansion, which are in turn enabled by @option{-Wportability}
 (@pxref{Invoking Automake}).
 
address@hidden @code{AM_V_GEN}
address@hidden @code{AM_V_at}
+To extend the silent mode to your own rules, you can use the predefined
+variable @code{AM_V_GEN} as a prefix to commands that should output a
+status line in silent mode, and @code{AM_V_at} as a prefix to commands
+that should not output anything in silent mode.  With @code{V=1}, these
+variables will expand to empty strings.
+
 @item @option{std-options}
 @cindex Options, @option{std-options}
 @cindex @samp{make installcheck}, testing @option{--help} and 
@option{--version}
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a1af65d..2197a11 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -542,6 +542,7 @@ silent3.test \
 silent4.test \
 silent5.test \
 silent6.test \
+silent7.test \
 sinclude.test \
 srcsub.test \
 srcsub2.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 04b6582..ddd73bd 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -697,6 +697,7 @@ silent3.test \
 silent4.test \
 silent5.test \
 silent6.test \
+silent7.test \
 sinclude.test \
 srcsub.test \
 srcsub2.test \
diff --git a/tests/silent6.test b/tests/silent7.test
similarity index 66%
copy from tests/silent6.test
copy to tests/silent7.test
index 2bc2f8f..4fd52f3 100755
--- a/tests/silent6.test
+++ b/tests/silent7.test
@@ -21,24 +21,17 @@
 set -e
 
 cat >>configure.in <<'EOF'
-# Layering violation: this conditional should be decided
-# by the package author, not the user.  We just do it here
-# for testing convenience.
-AM_CONDITIONAL([SILENT], [test "$silent_rules" = yes])
 AC_OUTPUT
 EOF
 
 cat > Makefile.am <<'EOF'
-if SILENT
-my_verbose = $(my_verbose_$V)
-my_verbose_ = $(my_verbose_0)
-my_verbose_0 = @echo GEN $@;
-endif
-
 all-local: foo
 
+## And here's how you should do it in your own code:
 foo: foo.in
-       $(my_verbose)cp $(srcdir)/foo.in $@
+       $(AM_V_GEN)cp $(srcdir)/foo.in $@
+       $(AM_V_at)echo more >> $@
+
 EXTRA_DIST = foo.in
 CLEANFILES = foo
 EOF
@@ -46,28 +39,33 @@ EOF
 : >foo.in
 
 $ACLOCAL
-# FIXME: it should not be necessary to disable Wportability here.
-$AUTOMAKE --add-missing -Wno-portability --silent-rules
+$AUTOMAKE --add-missing
 $AUTOCONF
 
-./configure silent_rules=yes
+./configure
 $MAKE >stdout || { cat stdout; Exit 1; }
 cat stdout
-grep 'GEN foo' stdout
-grep 'cp ' stdout && Exit 1
-
-$MAKE clean
-$MAKE V=1 >stdout || { cat stdout; Exit 1; }
-cat stdout
-grep 'GEN foo' stdout && Exit 1
+grep 'GEN.*foo' stdout && Exit 1
 grep 'cp ' stdout
+grep 'echo ' stdout
 
 $MAKE distclean
 
-./configure silent_rules=no
+echo 'AUTOMAKE_OPTIONS = silent' >> Makefile.am
+$AUTOMAKE
+
+./configure
 $MAKE >stdout || { cat stdout; Exit 1; }
 cat stdout
-grep 'GEN foo' stdout && Exit 1
+grep 'GEN.*foo' stdout
+grep 'cp ' stdout && Exit 1
+grep 'echo ' stdout && Exit 1
+
+$MAKE clean
+$MAKE V=1 >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep 'GEN.*foo' stdout && Exit 1
 grep 'cp ' stdout
+grep 'echo ' stdout
 
 :


hooks/post-receive
--
GNU Automake




reply via email to

[Prev in Thread] Current Thread [Next in Thread]