automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 1.6.2: patch-multi-inputs


From: Alexandre Duret-Lutz
Subject: Re: 1.6.2: patch-multi-inputs
Date: Wed, 31 Jul 2002 11:07:40 +0200
User-agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.2 (i386-debian-linux-gnu)

This patch also lacks a ChangeLog entry and a test case.
You'll have to sign up an FSF assignment before we can
install a patch of this size.  I'll send you the form.

[...]

| +       ### Original
| +       # Note that we only examine the first ":" file to see if it is
| +       # automake input; the rest are just taken verbatim.  We still keep
| +       # all the files around for dependency checking, however.
| +       #$input =~ s/\.in$//
| +       #  or die "$me: invalid input file name `$arg'\n.";
| +       ### New
| +       # Look for *.in for which *.am exists.

Frankly, describing the new behavior is the only thing that
matters here.  Keeping track of the old code is the job of CVS.

| +       my @done = ();
| +     InAm1:
| +       {
| +         do
| +           {
| +             if (($input =~ /^(.*)\.in$/) && -f $1.".am")
| +               {
| +                 $input = $1;
| +                 unshift @rest, @done;
| +                 last InAm1;
| +               }
| +             else
| +               {
| +                 push @done, $input;
| +                 $input = shift @rest;
| +               }
| +           }
| +             while $input;
| +       }

The purpose of this loop seems the remove the right "input" from
@rest, so that it doesn't appears as dependency in
$output_files.  How important is this?

I'd say it seems cleaner to preserve all dependencies in
$output_files and teach handle_configure to not add `$input' to
those already listed.  If we do this, the current code can be
simplified to something around the lines of (completly untested,
but you get the idea):

  my $input;
  my ($local, @rest) = split (/:/, $arg);
  @rest = ($local,) unless  @rest;
  # The input file is the first dependency we found for which
  # the `.am' file exists.
  foreach my $file (@rest)
    {
       if (($file =~ /^(.*)\.in$/) && -f $1.".am")
         {
            $file = $input;
            last;
         }
    }
  err "no input file found in `$arg'\n" unless ($input);
  push (@input_files, $input);
  $output_files{$input} = $arg;

| +       die "$me: no input file found in `$arg'\n" unless ($input);

We don't use `die' in the development version of Automake.
Today this should be

          err "no input file found in `$arg'\n" unless ($input);

| +       ###
|       }
|        push (@input_files, $input);
|        $output_files{$input} = join (':', ($local, @rest));
| @@ -4611,8 +4635,32 @@
|          }
|          else
|          {
| -            # FIXME: should be error if .in is missing.
| -            $input =~ s/\.in$//;

See the comment on `die' below.

[...]

| +       die "$me: no input file found in `$config_files'\n" unless ($input);

I'm surprized the test suite succeeds with this.  AC_CONFIG_FILES
is not used only for Makefile.ams, so Automake should not die
when it doesn't file the `.am' file.

-- 
Alexandre Duret-Lutz




reply via email to

[Prev in Thread] Current Thread [Next in Thread]