+2001-02-03 Tom Tromey <tromey@redhat.com>
+
+ * 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 <gbsadler1@lcisp.com>
* automake.texi (Java Support): Added index, @section.
# 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
{
next if /^\@.*\@$/;
next unless s,/+[^/]+$,,;
- push (@dist_dirs, $_)
+ $dist_dirs{$_} = 1
unless $_ eq '.';
}
}
{
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
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;
else
{
# Normal usage.
+ $file = $lfile;
$local = &basename ($file);
@inputs = ($local . '.in');
@rewritten_inputs =
$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;
: '')
. ' CONFIG_HEADERS= $(SHELL) ./config.status'
. "\n");
- &push_dist_common (@inputs);
push (@actual_other_files, $local);
# Require all input files.
# 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 = ();