+2001-10-30 Akim Demaille <akim@epita.fr>
+
+ * automake.in ($verbose): Remove, inherited from
+ Automake::General.
+ (&variable_delete): Rename as...
+ (¯o_delete): this, for consistency.
+ (&variable_assert): New.
+ (&variable_value_as_list, &variable_value_as_list_recursive_worker):
+ Use it.
+
2001-10-29 Akim Demaille <akim@epita.fr>
* m4/lispdir.m4 (AM_PATH_LISPDIR): Use AC_RUN_LOG to avoid
cluttering configure's stdout.
-
2001-10-28 Akim Demaille <akim@epita.fr>
* automake.in: Various formatting changes.
(&initialize_per_input): Don't initialize several times the same
vars.
-
+
2001-10-28 Akim Demaille <akim@epita.fr>
* automake.in (scan_one_autoconf_file): When using %generalize, be
# included in generated Makefile.in.
my $cmdline_use_dependencies = 1;
-# TRUE if in verbose mode.
-my $verbose = 0;
-
# This holds our (eventual) exit status. We don't actually exit until
# we have processed all input files.
my $exit_status = 0;
foreach my $xt (@suffixes)
{
macro_error ("$name$xt",
- "invalid variable `$name$xt'; "
- . "should be `$xname$xt'")
+ "invalid variable `$name$xt'; should be `$xname$xt'")
if variable_defined ("$name$xt");
}
}
}
-# &variable_delete ($VAR, [@CONDS])
-# ---------------------------------
+# ¯o_delete ($VAR, [@CONDS])
+# ------------------------------
# Forget about $VAR under the conditions @CONDS, or completely if
# @CONDS is empty.
-sub variable_delete ($@)
+sub macro_delete ($@)
{
my ($var, @conds) = @_;
}
+# $BOOLEAN
+# variable_assert ($VAR, $WHERE)
+# ------------------------------
+# Make sure a variable exists. $VAR is the variable name, and $WHERE
+# is the name of a macro which refers to $VAR.
+sub variable_assert ($$)
+{
+ my ($var, $where) = @_;
+
+ return 1
+ if variable_defined $var;
+
+ macro_error ($where, "variable `$var' not defined");
+
+ return 0;
+}
+
+
# Mark a variable as examined.
sub examine_variable
{
# be returned; otherwise, warn if VAR is conditionally defined.
# SCANNED is a global hash listing whose keys are all the variables
# already scanned; it is an error to rescan a variable.
-sub value_to_list
+sub value_to_list ($$$)
{
my ($var, $val, $cond) = @_;
my @result;
return @result;
}
+
# @VALUES
# variable_value_as_list ($VAR, $COND, $PARENT)
# ---------------------------------------------
my @result;
# Check defined
- if (! defined $var_value{$var})
- {
- if (defined $targets{$var})
- {
- macro_error ($var, "`$var' is a target; expected a variable");
- }
- else
- {
- macro_error ($parent, "variable `$var' not defined");
- }
- }
+ return
+ unless variable_assert $var, $parent;
# Get value for given condition
$cond ||= 'TRUE';
return @result;
}
+
+# @VALUE
+# &variable_value_as_list_recursive_worker ($VAR, $COND, $PARENT)
+# ---------------------------------------------------------------
# Return contents of variable as list, split as whitespace. This will
# recursively follow $(...) and ${...} inclusions. It preserves @...@
# substitutions. If COND is 'all', then all values under all
# that condition should be returned; otherwise, warn if VAR is
# conditionally defined. If PARENT is specified, it is the name of
# the including variable; this is only used for error reports.
-sub variable_value_as_list_recursive_worker
+sub variable_value_as_list_recursive_worker ($$$)
{
my ($var, $cond, $parent) = @_;
my @result = ();
- if (! defined $var_value{$var})
- {
- if (defined $targets{$var})
- {
- macro_error ($var, "`$var' is a target; expected a variable");
- }
- else
- {
- macro_error ($parent, "variable `$var' not defined");
- }
- }
- elsif (defined $vars_scanned{$var})
+ return
+ unless variable_assert $var, $parent;
+
+ if (defined $vars_scanned{$var})
{
# `vars_scanned' is a global we use to keep track of which
# variables we've already examined.