* automake.in (@substfroms, @substtos): Move near
traverse_variable_recursively.
(traverse_variable_recursively, traverse_variable_recursively_worker):
New functions, extracted from define_objects_from_sources.
(define_objects_from_sources): Rewrite using
traverse_variable_recursively.
(handle_source_transform): Use variables_conditionally_defined
instead of calling variable_conditions_recursive directly.
Adjust the call to define_objects_from_sources; there is no need
to reset @substtos, @substfroms, and %vars_scanned now.
(variable_conditions_recursive): Rewrite using
traverse_variable_recursively.
(variable_conditions_recursive_sub): Remove.
(variable_conditionally_defined): Fix condition comparison (the
consequence was that DIST_SUBDIRS was always output).
* lib/Automake/Condition.pm (merge): Allow merging several
conditions at once.