From 3497cbc55268e2daf66bf179978883fc92183cc2 Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Wed, 22 Oct 2008 21:31:46 +0200 Subject: [PATCH] Cleanup of per-input global variables in automake.in. * automake.in ($output_vars, $output_all, $output_header) ($output_rules, $output_trailer): Fix comment, and sort declarations in the order they will appear in the output. ($all_target): Unused variable, remove. (Variables not reset by &initialize_per_input.): New section, clarify that %am_file_cache is not reset. (initialize_per_input): Reset $am_file_name, $am_relative_dir, $in_file_name, $relative_dir, and $topsrcdir to `undef' rather than the empty string; $topsrcdir was not reset at all. Sort remaining variables in the same order as in the section `Variables reset by &initialize_per_input'. Signed-off-by: Ralf Wildenhues --- ChangeLog | 13 +++++++++++++ automake.in | 40 +++++++++++++++++++++------------------- 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3a7967dcc..44390c1bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,18 @@ 2008-10-22 Ralf Wildenhues + Cleanup of per-input global variables in automake.in. + * automake.in ($output_vars, $output_all, $output_header) + ($output_rules, $output_trailer): Fix comment, and sort + declarations in the order they will appear in the output. + ($all_target): Unused variable, remove. + (Variables not reset by &initialize_per_input.): New section, + clarify that %am_file_cache is not reset. + (initialize_per_input): Reset $am_file_name, $am_relative_dir, + $in_file_name, $relative_dir, and $topsrcdir to `undef' rather + than the empty string; $topsrcdir was not reset at all. Sort + remaining variables in the same order as in the section + `Variables reset by &initialize_per_input'. + Let stderr output end up on fd 2 in testsuite. * tests/defs.in (AUTOMAKE_run): Output recorded stderr on file descriptor 2. diff --git a/automake.in b/automake.in index 591b451df..fea09067a 100755 --- a/automake.in +++ b/automake.in @@ -479,13 +479,13 @@ my $topsrcdir; # configure's dependencies). my $output_deps_greatest_timestamp; -# These two variables are used when generating each Makefile.in. +# These variables are used when generating each Makefile.in. # They hold the Makefile.in until it is ready to be printed. -my $output_rules; my $output_vars; -my $output_trailer; my $output_all; my $output_header; +my $output_rules; +my $output_trailer; # This is the conditional stack, updated on if/else/endif, and # used to build Condition objects. @@ -552,9 +552,6 @@ my %known_programs; # trailing `/'. my %de_ansi_files; -# This is the name of the redirect `all' target to use. -my $all_target; - # This keeps track of which extensions we've seen (that we care # about). my %extension_seen; @@ -584,6 +581,13 @@ my $get_object_extension_was_run; # Record each file processed by make_paragraphs. my %transformed_files; + + +################################################################ + +## ---------------------------------------------- ## +## Variables not reset by &initialize_per_input. ## +## ---------------------------------------------- ## # Cache each file processed by make_paragraphs. # (This is different from %transformed_files because @@ -625,19 +629,20 @@ sub initialize_per_input () { reset_local_duplicates (); - $am_file_name = ''; - $am_relative_dir = ''; + $am_file_name = undef; + $am_relative_dir = undef; - $in_file_name = ''; - $relative_dir = ''; + $in_file_name = undef; + $relative_dir = undef; + $topsrcdir = undef; $output_deps_greatest_timestamp = 0; - $output_rules = ''; $output_vars = ''; - $output_trailer = ''; $output_all = ''; $output_header = ''; + $output_rules = ''; + $output_trailer = ''; Automake::Options::reset; Automake::Variable::reset; @@ -652,6 +657,10 @@ sub initialize_per_input () @check_tests = (); %clean_files = (); + %compile_clean_files = (); + + # We always include `.'. This isn't strictly correct. + %libtool_clean_directories = ('.' => 1); @sources = (); @dist_sources = (); @@ -669,8 +678,6 @@ sub initialize_per_input () %de_ansi_files = (); - $all_target = ''; - %extension_seen = (); %language_scratch = (); @@ -683,11 +690,6 @@ sub initialize_per_input () $get_object_extension_was_run = 0; - %compile_clean_files = (); - - # We always include `.'. This isn't strictly correct. - %libtool_clean_directories = ('.' => 1); - %transformed_files = (); } -- 2.47.2