27 |
|
|
28 |
use Autom4te::ChannelDefs; |
use Autom4te::ChannelDefs; |
29 |
|
|
30 |
Autom4te::ChannelDefs::usage (); |
print Autom4te::ChannelDefs::usage (), "\n"; |
31 |
prog_error ($MESSAGE, [%OPTIONS]); |
prog_error ($MESSAGE, [%OPTIONS]); |
32 |
error ($WHERE, $MESSAGE, [%OPTIONS]); |
error ($WHERE, $MESSAGE, [%OPTIONS]); |
33 |
error ($MESSAGE); |
error ($MESSAGE); |
36 |
verb ($MESSAGE, [%OPTIONS]); |
verb ($MESSAGE, [%OPTIONS]); |
37 |
switch_warning ($CATEGORY); |
switch_warning ($CATEGORY); |
38 |
parse_WARNINGS (); |
parse_WARNINGS (); |
39 |
parse_warning ($OPTION, $ARGUMENT); |
parse_warnings ($OPTION, $ARGUMENT); |
40 |
Autom4te::ChannelDefs::set_strictness ($STRICTNESS_NAME); |
Autom4te::ChannelDefs::set_strictness ($STRICTNESS_NAME); |
41 |
|
|
42 |
=head1 DESCRIPTION |
=head1 DESCRIPTION |
80 |
|
|
81 |
=item C<error-gnu/warn> |
=item C<error-gnu/warn> |
82 |
|
|
83 |
Errors related to GNU Standards that should be warnings in `foreign' mode. |
Errors related to GNU Standards that should be warnings in "foreign" mode. |
84 |
|
|
85 |
=item C<error-gnits> |
=item C<error-gnits> |
86 |
|
|
90 |
|
|
91 |
Internal errors. Use C<&prog_error> to send messages over this channel. |
Internal errors. Use C<&prog_error> to send messages over this channel. |
92 |
|
|
93 |
|
=item C<cross> |
94 |
|
|
95 |
|
Constructs compromising the cross-compilation of the package. |
96 |
|
|
97 |
=item C<gnu> |
=item C<gnu> |
98 |
|
|
99 |
Warnings related to GNU Coding Standards. |
Warnings related to GNU Coding Standards. |
146 |
"####################\n"), |
"####################\n"), |
147 |
footer => "\nPlease contact <bug-automake\@gnu.org>."; |
footer => "\nPlease contact <bug-automake\@gnu.org>."; |
148 |
|
|
149 |
|
register_channel 'cross', type => 'warning', silent => 1; |
150 |
register_channel 'gnu', type => 'warning'; |
register_channel 'gnu', type => 'warning'; |
151 |
register_channel 'obsolete', type => 'warning', silent => 1; |
register_channel 'obsolete', type => 'warning', silent => 1; |
152 |
register_channel 'override', type => 'warning', silent => 1; |
register_channel 'override', type => 'warning', silent => 1; |
163 |
|
|
164 |
=item C<usage ()> |
=item C<usage ()> |
165 |
|
|
166 |
Display warning categories. |
Return the warning category descriptions. |
167 |
|
|
168 |
=cut |
=cut |
169 |
|
|
170 |
sub usage () |
sub usage () |
171 |
{ |
{ |
172 |
print "Warning categories include: |
return "Warning categories include: |
173 |
|
`cross' cross compilation issues |
174 |
`gnu' GNU coding standards (default in gnu and gnits modes) |
`gnu' GNU coding standards (default in gnu and gnits modes) |
175 |
`obsolete' obsolete features or constructions |
`obsolete' obsolete features or constructions |
176 |
`override' user redefinitions of Automake rules or variables |
`override' user redefinitions of Automake rules or variables |
180 |
`all' all the warnings |
`all' all the warnings |
181 |
`no-CATEGORY' turn off warnings in CATEGORY |
`no-CATEGORY' turn off warnings in CATEGORY |
182 |
`none' turn off all the warnings |
`none' turn off all the warnings |
183 |
`error' treat warnings as errors |
`error' treat warnings as errors"; |
|
"; |
|
184 |
} |
} |
185 |
|
|
186 |
=item C<prog_error ($MESSAGE, [%OPTIONS])> |
=item C<prog_error ($MESSAGE, [%OPTIONS])> |
239 |
=item C<switch_warning ($CATEGORY)> |
=item C<switch_warning ($CATEGORY)> |
240 |
|
|
241 |
If C<$CATEGORY> is C<mumble>, turn on channel C<mumble>. |
If C<$CATEGORY> is C<mumble>, turn on channel C<mumble>. |
242 |
If it's C<no-mumble>, turn C<mumble> off. |
If it is C<no-mumble>, turn C<mumble> off. |
243 |
Else handle C<all> and C<none> for completeness. |
Else handle C<all> and C<none> for completeness. |
244 |
|
|
245 |
=cut |
=cut |
298 |
} |
} |
299 |
} |
} |
300 |
|
|
301 |
=item C<parse_warning ($OPTION, $ARGUMENT)> |
=item C<parse_warnings ($OPTION, @ARGUMENT)> |
302 |
|
|
303 |
Parse the argument of C<--warning=CATEGORY> or C<-WCATEGORY>. |
Parse the argument of C<--warning=CATEGORY> or C<-WCATEGORY>. |
304 |
|
|
305 |
C<$OPTIONS> is C<"--warning"> or C<"-W">, C<$ARGUMENT> is C<CATEGORY>. |
C<$OPTIONS> is C<"--warning"> or C<"-W">, C<@ARGUMENT> is a list of |
306 |
|
C<CATEGORY>. |
307 |
|
|
308 |
This is meant to be used as a argument to C<Getopt>. |
This can be used as a argument to C<Getopt>. |
309 |
|
|
310 |
=cut |
=cut |
311 |
|
|
312 |
sub parse_warnings ($$) |
sub parse_warnings ($@) |
313 |
{ |
{ |
314 |
my ($opt, $categories) = @_; |
my ($opt, @categories) = @_; |
315 |
|
|
316 |
foreach my $cat (split (',', $categories)) |
foreach my $cat (map { split ',' } @categories) |
317 |
{ |
{ |
318 |
msg 'unsupported', "unknown warning category `$cat'" |
msg 'unsupported', "unknown warning category `$cat'" |
319 |
if switch_warning $cat; |
if switch_warning $cat; |