GNU Make always prints them, except when using --silent. Adopt this behavior.
* lib/Autom4te/ChannelDefs.pm (note): New. (@EXPORT): Add note. * bin/autoreconf.in (autoreconf): Use new note sub for enter/leave directory messages. Do not print them when no directry was given or empty. (parse_args): Use '' in ARGV when no directory was given, so that no enter/leave messages are printed. Signed-off-by: Bert Wesarg <[email protected]> --- bin/autoreconf.in | 21 ++++++++++++++------- lib/Autom4te/ChannelDefs.pm | 14 +++++++++++++- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/bin/autoreconf.in b/bin/autoreconf.in index 006b1b9..c9ef36b 100644 --- a/bin/autoreconf.in +++ b/bin/autoreconf.in @@ -172,7 +172,8 @@ sub parse_args () # is simpler, and (ii) we are still able to diagnose simultaneous # presence of configure.ac and configure.in. @ARGV = map { /configure\.(ac|in)$/ ? dirname ($_) : $_ } @ARGV; - push @ARGV, '.' unless @ARGV; + # do not use '.', so that we don't print the enter/leave messages + push @ARGV, '' unless @ARGV; if ($verbose && $debug) { @@ -667,17 +668,23 @@ sub autoreconf ($) # The format for this message is not free: taken from Emacs, itself # using GNU Make's format. - verb "Entering directory `$directory'"; - chdir $directory - or error "cannot chdir to $directory: $!"; + if ($directory) + { + note "Entering directory `$directory'"; + chdir $directory + or error "cannot chdir to $directory: $!"; + } autoreconf_current_directory; # The format is not free: taken from Emacs, itself using GNU Make's # format. - verb "Leaving directory `$directory'"; - chdir $cwd - or error "cannot chdir to $cwd: $!"; + if ($directory) + { + note "Leaving directory `$directory'"; + chdir $cwd + or error "cannot chdir to $cwd: $!"; + } } diff --git a/lib/Autom4te/ChannelDefs.pm b/lib/Autom4te/ChannelDefs.pm index c66d322..fea6419 100644 --- a/lib/Autom4te/ChannelDefs.pm +++ b/lib/Autom4te/ChannelDefs.pm @@ -54,7 +54,7 @@ use Exporter; use vars qw (@ISA @EXPORT); @ISA = qw (Exporter); -@EXPORT = qw (&prog_error &error &fatal &verb +@EXPORT = qw (&prog_error &error &fatal &verb ¬e &switch_warning &parse_WARNINGS &parse_warnings); =head2 CHANNELS @@ -236,6 +236,18 @@ sub verb ($;%) msg 'verb', '', $msg, %opts; } +=item C<note ($MESSAGE, [%OPTIONS])> + +Messages which can be silence with C<--silent>. + +=cut + +sub note ($;%) +{ + my ($msg, %opts) = @_; + msg 'note', '', $msg, %opts; +} + =item C<switch_warning ($CATEGORY)> If C<$CATEGORY> is C<mumble>, turn on channel C<mumble>. -- 1.7.7.931.gdbe98
