{
if (! -f ($am_file . '.am'))
{
- &err ("`$am_file.am' does not exist");
+ &error ("`$am_file.am' does not exist");
}
else
{
msg 'automake', '', $msg, %opts;
}
-# err ($WHERE, $MESSAGE, [%OPTIONS])
-# err ($MESSAGE)
-# ----------------------------------
+# error ($WHERE, $MESSAGE, [%OPTIONS])
+# error ($MESSAGE)
+# ------------------------------------
# Uncategorized errors.
-sub err ($;$%)
+sub error ($;$%)
{
my ($where, $msg, %opts) = @_;
msg ('error', $where, $msg, %opts);
# Got a version number.
if (version_check $&)
{
- err ($where, "require Automake $_, but have $VERSION",
- uniq_scope => US_GLOBAL);
+ error ($where, "require Automake $_, but have $VERSION",
+ uniq_scope => US_GLOBAL);
return 1;
}
}
}
else
{
- err ($where, "option `$_' not recognized",
- uniq_scope => US_GLOBAL);
+ error ($where, "option `$_' not recognized",
+ uniq_scope => US_GLOBAL);
return 1;
}
}
# Check that the library fits the standard naming convention.
if (basename ($onelib) !~ /^lib.*\.a/)
{
- err $where, "`$onelib' is not a standard library name";
+ error $where, "`$onelib' is not a standard library name";
}
$where->push_context ("while processing library `$onelib'");
# implied conditions, etc.)
if (defined $instdirs{$lib} && $instdirs{$lib} ne $dir)
{
- err ($where, "`$lib' is already going to be installed in "
- . "`$instdirs{$lib}'", partial => 1);
- err ($liblocations{$lib}, "`$lib' previously declared here");
+ error ($where, "`$lib' is already going to be installed in "
+ . "`$instdirs{$lib}'", partial => 1);
+ error ($liblocations{$lib}, "`$lib' previously declared here");
}
else
{
$outfile = $1;
if ($outfile =~ /\.(.+)$/ && $1 ne 'info')
{
- err "$filename:$.", "output `$outfile' has unrecognized extension";
+ error ("$filename:$.",
+ "output `$outfile' has unrecognized extension");
return;
}
}
}
elsif ($macro eq 'AM_AUTOMAKE_VERSION')
{
- err ($where,
- "version mismatch. This is Automake $VERSION,\n" .
- "but the definition used by this AM_INIT_AUTOMAKE\n" .
- "comes from Automake $args[1]. You should recreate\n" .
- "aclocal.m4 with aclocal and run automake again.\n")
- if ($VERSION ne $args[1]);
+ error ($where,
+ "version mismatch. This is Automake $VERSION,\n" .
+ "but the definition used by this AM_INIT_AUTOMAKE\n" .
+ "comes from Automake $args[1]. You should recreate\n" .
+ "aclocal.m4 with aclocal and run automake again.\n")
+ if $VERSION ne $args[1];
$seen_automake_version = 1;
}
{
if (-f 'aclocal.m4')
{
- err ($seen_init_automake || $me,
- "your implementation of AM_INIT_AUTOMAKE comes from " .
- "an\nold Automake version. You should recreate " .
- "aclocal.m4\nwith aclocal and run automake again.\n");
+ error ($seen_init_automake || $me,
+ "your implementation of AM_INIT_AUTOMAKE comes from " .
+ "an\nold Automake version. You should recreate " .
+ "aclocal.m4\nwith aclocal and run automake again.\n");
}
else
{
- err ($seen_init_automake || $me,
- "no proper implementation of AM_INIT_AUTOMAKE was " .
- "found,\nprobably because aclocal.m4 is missing...\n" .
- "You should run aclocal to create this file, then\n" .
- "run automake again.\n");
+ error ($seen_init_automake || $me,
+ "no proper implementation of AM_INIT_AUTOMAKE was " .
+ "found,\nprobably because aclocal.m4 is missing...\n" .
+ "You should run aclocal to create this file, then\n" .
+ "run automake again.\n");
}
}
{
my ($negate, $cond, $where) = @_;
- err $where, "$cond does not appear in AM_CONDITIONAL"
+ error $where, "$cond does not appear in AM_CONDITIONAL"
if ! $configure_cond{$cond} && $cond !~ /^TRUE|FALSE$/;
push (@cond_stack, make_conditional_string ($negate, $cond));
if (! @cond_stack)
{
- err $where, "else without if";
+ error $where, "else without if";
return;
}
{
$cond = make_conditional_string ($negate, $cond);
- err ($where, "else reminder ($negate$cond) incompatible with "
- . "current conditional: $cond_stack[$#cond_stack]")
+ error ($where, "else reminder ($negate$cond) incompatible with "
+ . "current conditional: $cond_stack[$#cond_stack]")
if $cond_stack[$#cond_stack] ne $cond;
}
if (! @cond_stack)
{
- err $where, "endif without if: $negate$cond";
+ error $where, "endif without if: $negate$cond";
return;
}
{
$cond = make_conditional_string ($negate, $cond);
- err ($where, "endif reminder ($negate$cond) incompatible with "
- . "current conditional: $cond_stack[$#cond_stack]")
+ error ($where, "endif reminder ($negate$cond) incompatible with "
+ . "current conditional: $cond_stack[$#cond_stack]")
if $cond_stack[$#cond_stack] ne $cond;
}
# We will adjust the owner of this variable unless told otherwise.
my $adjust_owner = 1;
- err $where, "bad characters in variable name `$var'"
+ error $where, "bad characters in variable name `$var'"
if $var !~ /$MACRO_PATTERN/o;
# NEWS-OS 4.2R complains if a Makefile variable begins with `_'.
&& exists $var_type{$var}{$cond}
&& $var_type{$var}{$cond} ne $type)
{
- err ($where, "$var was set with `$var_type{$var}=' "
- . "and is now set with `$type='");
+ error ($where, "$var was set with `$var_type{$var}=' "
+ . "and is now set with `$type='");
}
}
else
{
if (!exists $var_type{$var} && $type eq '+')
{
- err $where, "$var must be set with `=' before using `+='";
+ error $where, "$var must be set with `=' before using `+='";
}
}
$var_type{$var}{$cond} = $type;
my $undef_cond = variable_not_always_defined_in_cond $var, $cond;
if (! $undef_cond->false)
{
- err ($where,
- "Cannot apply `+=' because `$var' is not defined "
- . "in\nthe following conditions:\n "
- . join ("\n ", map { $_->human } $undef_cond->conds)
- . "\nEither define `$var' in these conditions,"
- . " or use\n`+=' in the same conditions as"
- . " the definitions.");
+ error ($where,
+ "Cannot apply `+=' because `$var' is not defined "
+ . "in\nthe following conditions:\n "
+ . join ("\n ", map { $_->human } $undef_cond->conds)
+ . "\nEither define `$var' in these conditions,"
+ . " or use\n`+=' in the same conditions as"
+ . " the definitions.");
}
else
{
}
elsif (/$WHITE_PATTERN/o)
{
- err $where, "blank line following trailing backslash"
+ error $where, "blank line following trailing backslash"
if $saw_bk;
# Stick a single white line before the incoming macro or rule.
$spacing = "\n";
{
# Stick a single white line before the incoming macro or rule.
$spacing = "\n";
- err $where, "blank line following trailing backslash"
+ error $where, "blank line following trailing backslash"
if $saw_bk;
}
elsif (/$COMMENT_PATTERN/o)
# Stick comments before the incoming macro or rule.
$comment .= $spacing . $_;
$spacing = '';
- err $where, "comment following trailing backslash"
+ error $where, "comment following trailing backslash"
if $saw_bk && $comment eq '';
$prev_state = IN_COMMENT;
}
$output_trailer .= $cond->subst_string;
$output_trailer .= $_;
$comment = $spacing = '';
- err $where, "`#' comment at start of rule is unportable"
+ error $where, "`#' comment at start of rule is unportable"
if $_ =~ /^\t\s*\#/;
}
$output_trailer .= $comment;
- err ($where, (@cond_stack ? "unterminated conditionals: @cond_stack"
- : "too many conditionals closed in include file"))
+ error ($where, (@cond_stack ? "unterminated conditionals: @cond_stack"
+ : "too many conditionals closed in include file"))
if "@saved_cond_stack" ne "@cond_stack";
}
$where->set ($file);
# Sanity checks.
- err $where, "blank line following trailing backslash:\n$_"
+ error $where, "blank line following trailing backslash:\n$_"
if /\\$/;
- err $where, "comment following trailing backslash:\n$_"
+ error $where, "comment following trailing backslash:\n$_"
if /\\#/;
if (/^$/)
elsif (/$ASSIGNMENT_PATTERN/mso)
{
my ($var, $type, $val) = ($1, $2, $3);
- err $where, "variable `$var' with trailing backslash"
+ error $where, "variable `$var' with trailing backslash"
if /\\$/;
$is_rule = 0;
}
}
- err ($where, @cond_stack ?
- "unterminated conditionals: @cond_stack" :
- "too many conditionals closed in include file")
+ error ($where, @cond_stack ?
+ "unterminated conditionals: @cond_stack" :
+ "too many conditionals closed in include file")
if "@saved_cond_stack" ne "@cond_stack";
return ($comment, $result_vars, $result_rules);
{
if ($nodir_name eq 'EXTRA')
{
- err ($where,
- "`$one_name' contains configure substitution, "
- . "but shouldn't");
+ error ($where,
+ "`$one_name' contains configure substitution, "
+ . "but shouldn't");
}
# Check here to make sure variables defined in
# configure.ac do not imply that EXTRA_PRIMARY
. "`autoconf' again.";
}
- err $where, $text, uniq_scope => US_GLOBAL;
+ error $where, $text, uniq_scope => US_GLOBAL;
}
return $res;
}