2008-03-14 Stepan Kasal * lib/Automake/ChannelDefs.pm: Import changes from Autoconf. --- lib/Automake/ChannelDefs.pm 2008-02-05 15:10:22.000000000 +0100 +++ lib/Automake/ChannelDefs.pm 2008-03-14 15:03:05.904510600 +0100 @@ -25,7 +25,7 @@ use Automake::ChannelDefs; - Automake::ChannelDefs::usage (); + print Automake::ChannelDefs::usage (), "\n"; prog_error ($MESSAGE, [%OPTIONS]); error ($WHERE, $MESSAGE, [%OPTIONS]); error ($MESSAGE); @@ -34,12 +34,12 @@ verb ($MESSAGE, [%OPTIONS]); switch_warning ($CATEGORY); parse_WARNINGS (); - parse_warning ($OPTION, $ARGUMENT); + parse_warnings ($OPTION, $ARGUMENT); Automake::ChannelDefs::set_strictness ($STRICTNESS_NAME); =head1 DESCRIPTION -This packages defines channels that can be used in Automake to +This package defines channels that can be used in Automake to output diagnostics and other messages (via C). It also defines some helper function to enable or disable these channels, and some shorthand function to output on specific channels. @@ -78,7 +78,7 @@ =item C -Errors related to GNU Standards that should be warnings in `foreign' mode. +Errors related to GNU Standards that should be warnings in "foreign" mode. =item C @@ -88,6 +88,10 @@ Internal errors. Use C<&prog_error> to send messages over this channel. +=item C + +Constructs compromising the cross-compilation of the package. + =item C Warnings related to GNU Coding Standards. @@ -140,6 +144,7 @@ "####################\n"), footer => "\nPlease contact ."; +register_channel 'cross', type => 'warning', silent => 1; register_channel 'gnu', type => 'warning'; register_channel 'obsolete', type => 'warning', silent => 1; register_channel 'override', type => 'warning', silent => 1; @@ -156,13 +161,14 @@ =item C -Display warning categories. +Return the warning category descriptions. =cut sub usage () { - print "Warning categories include: + return "Warning categories include: + `cross' cross compilation issues `gnu' GNU coding standards (default in gnu and gnits modes) `obsolete' obsolete features or constructions `override' user redefinitions of Automake rules or variables @@ -172,8 +178,7 @@ `all' all the warnings `no-CATEGORY' turn off warnings in CATEGORY `none' turn off all the warnings - `error' treat warnings as errors -"; + `error' treat warnings as errors"; } =item C @@ -232,7 +237,7 @@ =item C If C<$CATEGORY> is C, turn on channel C. -If it's C, turn C off. +If it is C, turn C off. Else handle C and C for completeness. =cut @@ -291,21 +296,22 @@ } } -=item C +=item C Parse the argument of C<--warning=CATEGORY> or C<-WCATEGORY>. -C<$OPTIONS> is C<"--warning"> or C<"-W">, C<$ARGUMENT> is C. +C<$OPTIONS> is C<"--warning"> or C<"-W">, C<@ARGUMENT> is a list of +C. -This is meant to be used as a argument to C. +This can be used as an argument to C. =cut -sub parse_warnings ($$) +sub parse_warnings ($@) { - my ($opt, $categories) = @_; + my ($opt, @categories) = @_; - foreach my $cat (split (',', $categories)) + foreach my $cat (map { split ',' } @categories) { msg 'unsupported', "unknown warning category `$cat'" if switch_warning $cat;