From: Stefano Lattarini Date: Mon, 30 Jul 2012 18:30:23 +0000 (+0200) Subject: [ng] cleanup: remove two almost-unused global vars: {am,in}_file_name X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf2a8b03a21e46177b4368a52b8434c7f1944238;p=thirdparty%2Fautomake.git [ng] cleanup: remove two almost-unused global vars: {am,in}_file_name * automake.in ($am_file_name, $in_file_name): Delete these, which were used only in the 'read_main_am_file' subroutine; instead ... (read_main_am_file): ... modify it to only work from the '$makefile_am' argument (which it was already receiving), and the new '$makefile_in' argument, which is now passed to it ... (generate_makefile): ... from here. (initialize_per_input): Don't reset the two deleted variables anymore. Signed-off-by: Stefano Lattarini --- diff --git a/automake.in b/automake.in index 549953052..6e657c955 100644 --- a/automake.in +++ b/automake.in @@ -497,11 +497,8 @@ my $am_file = 'BUG'; ## ------------------------------------------ ## # Basename and relative dir of the input file. -my $am_file_name; my $am_relative_dir; - # Same but wrt Makefile.in. -my $in_file_name; my $relative_dir; # Relative path to the top directory. @@ -620,10 +617,7 @@ sub initialize_per_input () { reset_local_duplicates (); - $am_file_name = undef; $am_relative_dir = undef; - - $in_file_name = undef; $relative_dir = undef; $topsrcdir = undef; @@ -5624,9 +5618,9 @@ sub define_standard_variables } # Read main am file. -sub read_main_am_file +sub read_main_am_file ($$) { - my ($amfile) = @_; + my ($amfile, $infile) = @_; # This supports the strange variable tricks we are about to play. prog_error ("variable defined before read_main_am_file\n" . variables_dump ()) @@ -5634,8 +5628,8 @@ sub read_main_am_file # Generate copyright header for generated Makefile.in. # We do discard the output of predefined variables, handled below. - $output_vars = ("# $in_file_name generated by automake " - . $VERSION . " from $am_file_name.\n"); + $output_vars = ("# " . basename ($infile) . " generated by automake " + . $VERSION . " from " . basename ($amfile) . ".\n"); $output_vars .= '# ' . subst ('configure_input') . "\n"; $output_vars .= $gen_copyright; @@ -6812,11 +6806,6 @@ sub generate_makefile ($$) # we have processed AUTOMAKE_OPTIONS. buffer_messages ('warning'); - # Name of input file ("Makefile.am") and output file - # ("Makefile.in"). These have no directory components. - $am_file_name = basename ($makefile_am); - $in_file_name = basename ($makefile_in); - # $OUTPUT is encoded. If it contains a ":" then the first element # is the real output file, and all remaining elements are input # files. We don't scan or otherwise deal with these input files, @@ -6828,7 +6817,7 @@ sub generate_makefile ($$) $am_relative_dir = dirname ($makefile_am); $topsrcdir = backname ($relative_dir); - read_main_am_file ($makefile_am); + read_main_am_file ($makefile_am, $makefile_in); if (handle_options) { # Process buffered warnings.