From 3c85b9c95b745b08aea12afe1f0839d30228cbaa Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Mon, 30 Jul 2012 20:34:12 +0200 Subject: [PATCH] cleanup: remove almost-unused global var 'topsrcdir' Cherry picked from commit v1.12.2-740-ga7f24eb in Automake-NG. * automake.in ($topsrcdir): Delete, it was only used once ... (handle_LIBOBJS_or_ALLOCA): ... in here, so it's simpler to inline its expansion. Improve formatting of immediately surrounding code a little while we are at it. (initialize_per_input): Don't reset the deleted variable. Signed-off-by: Stefano Lattarini --- automake.in | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/automake.in b/automake.in index 1a94c04..d85d361 100644 --- a/automake.in +++ b/automake.in @@ -484,9 +484,6 @@ my $am_relative_dir; my $in_file_name; my $relative_dir; -# Relative path to the top directory. -my $topsrcdir; - # Greatest timestamp of the output's dependencies (excluding # configure's dependencies). my $output_deps_greatest_timestamp; @@ -640,7 +637,6 @@ sub initialize_per_input () $in_file_name = undef; $relative_dir = undef; - $topsrcdir = undef; $output_deps_greatest_timestamp = 0; @@ -2309,8 +2305,10 @@ sub handle_LIBOBJS_or_ALLOCA ($) # we are already there, and since the targets are built without # a $(top_builddir), it helps BSD Make to match them with # dependencies. - $dir = "$config_libobj_dir/" if $config_libobj_dir ne '.'; - $dir = "$topsrcdir/$dir" if $relative_dir ne '.'; + $dir = "$config_libobj_dir/" + if $config_libobj_dir ne '.'; + $dir = backname ($relative_dir) . "/$dir" + if $relative_dir ne '.'; define_variable ('LIBOBJDIR', "$dir", INTERNAL); $clean_files{"\$($var)"} = MOSTLY_CLEAN; # If LTLIBOBJS is used, we must also clear LIBOBJS (which might @@ -8111,7 +8109,6 @@ sub generate_makefile ($$) $relative_dir = dirname ($makefile); $am_relative_dir = dirname ($makefile_am); - $topsrcdir = backname ($relative_dir); read_main_am_file ($makefile_am); if (handle_options) -- 2.7.4