From cf4be7d67fc084d88038815339bcd450efcb8083 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 4 Feb 2001 03:27:52 +0000 Subject: [PATCH] * automake.in (handle_configure): Don't modify variable which aliases list element. Don't push @inputs onto the dist list. Fixes colon7.test. (initialize_per_input) [dist_dirs]: New variable. (handle_dist_worker): Use global dist_dirs. (handle_configure): Set dist_dirs entries at toplevel. --- ChangeLog | 9 +++++++++ automake.in | 38 +++++++++++++++++++++++++++----------- stamp-vti | 4 ++-- version.texi | 4 ++-- 4 files changed, 40 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4f44a4d5..aef51eb7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2001-02-03 Tom Tromey + + * automake.in (handle_configure): Don't modify variable which + aliases list element. Don't push @inputs onto the dist list. + Fixes colon7.test. + (initialize_per_input) [dist_dirs]: New variable. + (handle_dist_worker): Use global dist_dirs. + (handle_configure): Set dist_dirs entries at toplevel. + 2001-02-02 Gordon Sadler * automake.texi (Java Support): Added index, @section. diff --git a/automake.in b/automake.in index fba82c8e..b422e422 100755 --- a/automake.in +++ b/automake.in @@ -2651,7 +2651,6 @@ sub handle_dist_worker # subdir. If so, add it to the list. I didn't want to do this # originally, but there were so many requests that I finally # relented. - local (@dist_dirs); if (&variable_defined ('EXTRA_DIST')) { # FIXME: This should be fixed to work with conditionals. That @@ -2663,7 +2662,7 @@ sub handle_dist_worker { next if /^\@.*\@$/; next unless s,/+[^/]+$,,; - push (@dist_dirs, $_) + $dist_dirs{$_} = 1 unless $_ eq '.'; } } @@ -2674,18 +2673,17 @@ sub handle_dist_worker { next if /^\@.*\@$/; next unless s,/+[^/]+$,,; - push (@dist_dirs, $_) + $dist_dirs{$_} = 1 unless $_ eq '.'; } - if (@dist_dirs) + if (scalar keys %dist_dirs) { # Prepend $(distdir) to each directory given. Doing it via a # hash lets us ensure that each directory is used only once. - local (%dhash); - grep ($dhash{'$(distdir)/' . $_} = 1, @dist_dirs); + grep ($dist_dirs{'$(distdir)/' . $_} = 1, keys %dist_dirs); $output_rules .= "\t"; - &pretty_print_rule ('$(mkinstalldirs)', "\t ", sort keys %dhash); + &pretty_print_rule ('$(mkinstalldirs)', "\t ", sort keys %dist_dirs); } # In loop, test for file existence because sometimes a file gets @@ -3518,10 +3516,10 @@ sub handle_configure local (@actual_other_files) = (); local ($file, $local); local (@inputs, @rewritten_inputs, $single); - local ($need_rewritten); - foreach $file (@other_input_files) + local ($need_rewritten, $lfile); + foreach $lfile (@other_input_files) { - if ($file =~ /^([^:]*):(.*)$/) + if ($lfile =~ /^([^:]*):(.*)$/) { # This is the ":" syntax of AC_OUTPUT. $file = $1; @@ -3533,6 +3531,7 @@ sub handle_configure else { # Normal usage. + $file = $lfile; $local = &basename ($file); @inputs = ($local . '.in'); @rewritten_inputs = @@ -3540,6 +3539,19 @@ sub handle_configure $need_rewritten = 0; } + # Make sure the dist directory for each input file is created. + # We only have to do this at the topmost level though. This + # is a bit ugly but it easier than spreading out the logic, + # especially in cases like AC_OUTPUT(foo/out:bar/in), where + # there is no Makefile in bar/. + if ($relative_dir eq '.') + { + foreach (@inputs) + { + $dist_dirs{&dirname ($_)} = 1; + } + } + # Skip files not in this directory. next unless &dirname ($file) eq $relative_dir; @@ -3568,7 +3580,6 @@ sub handle_configure : '') . ' CONFIG_HEADERS= $(SHELL) ./config.status' . "\n"); - &push_dist_common (@inputs); push (@actual_other_files, $local); # Require all input files. @@ -6877,6 +6888,11 @@ sub initialize_per_input # distribution. %dist_common = (); + # This holds a list of directories which we must create at `dist' + # time. This is used in some strange scenarios involving weird + # AC_OUTPUT commands. + %dist_dirs = (); + # List of dependencies for the obvious targets. @install_data = (); @install_exec = (); diff --git a/stamp-vti b/stamp-vti index b3d4c979..f803e45c 100644 --- a/stamp-vti +++ b/stamp-vti @@ -1,4 +1,4 @@ -@set UPDATED 22 January 2001 -@set UPDATED-MONTH January 2001 +@set UPDATED 2 February 2001 +@set UPDATED-MONTH February 2001 @set EDITION 1.4c @set VERSION 1.4c diff --git a/version.texi b/version.texi index b3d4c979..f803e45c 100644 --- a/version.texi +++ b/version.texi @@ -1,4 +1,4 @@ -@set UPDATED 22 January 2001 -@set UPDATED-MONTH January 2001 +@set UPDATED 2 February 2001 +@set UPDATED-MONTH February 2001 @set EDITION 1.4c @set VERSION 1.4c -- 2.43.5