]> sourceware.org Git - automake.git/commitdiff
* automake.in (require_file_internal): Check for already-required
authorTom Tromey <tromey@redhat.com>
Mon, 18 Jun 2001 01:08:34 +0000 (01:08 +0000)
committerTom Tromey <tromey@redhat.com>
Mon, 18 Jun 2001 01:08:34 +0000 (01:08 +0000)
file after searching for it, and only if it is not found.  Don't
use `readlink' when checking for dangling symlink.  Work if
--force-missing specified.
* tests/acoutput2.test: Also test --force-missing.

ChangeLog
automake.in
tests/acoutput2.test

index ca600e833a4830ab91a435f086654fa867371b98..261bba82d664699223aba0b381c1c73a7925b1c2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2001-06-17  Tom Tromey  <tromey@redhat.com>
 
+       * automake.in (require_file_internal): Check for already-required
+       file after searching for it, and only if it is not found.  Don't
+       use `readlink' when checking for dangling symlink.  Work if
+       --force-missing specified.
+       * tests/acoutput2.test: Also test --force-missing.
+
        Fix for libtool.test:
        * automake.in (generate_makefile): Call handle_libtool.
        (handle_libtool): New sub.
index 4fe79c9dd09cdc93370029a9b1dc5de96fb8d509..db182a8bd55a1ce9ed6d4e52a2aa34c11948b93c 100755 (executable)
@@ -7354,10 +7354,6 @@ sub require_file_internal
        my $errfile;
        my $save_dir;
 
-       # If we've already looked for it, we're done.
-       next if defined $require_file_found{$file};
-       $require_file_found{$file} = 1;
-
        my $found_it = 0;
        my $dangling_sym = 0;
        foreach my $dir (@require_file_paths)
@@ -7371,7 +7367,7 @@ sub require_file_internal
            # config_aux_path.
            $errfile = $errdir . '/' . $file;
 
-           if (-l $fullfile && ! -f readlink ($fullfile))
+           if (-l $fullfile && ! -f $fullfile)
            {
                $dangling_sym = 1;
                last;
@@ -7385,13 +7381,26 @@ sub require_file_internal
            }
        }
 
-       if ($found_it && ! $force_missing)
+       # `--force-missing' only has an effect if `--add-missing' is
+       # specified.
+       if ($found_it && (! $add_missing || ! $force_missing))
        {
            # Prune the path list.
            @require_file_paths = $save_dir;
        }
        else
        {
+           # If we've already looked for it, we're done.  You might
+           # wonder why we don't do this before searching for the
+           # file.  If we do that, then something like
+           # AC_OUTPUT(subdir/foo foo) will fail to put foo.in into
+           # DIST_COMMON.
+           if (! $found_it)
+           {
+               next if defined $require_file_found{$file};
+               $require_file_found{$file} = 1;
+           }
+
            if ($strictness >= $mystrict)
            {
                if ($dangling_sym && $add_missing)
@@ -7452,6 +7461,11 @@ sub require_file_internal
                    @require_file_paths = &dirname ($errfile);
                }
 
+               # If --force-missing was specified, and we have
+               # actually found the file, then do nothing.
+               next
+                   if $found_it && $force_missing;
+
                if ($suppress)
                {
                    if ($is_configure)
index fdefa027fdd083b4c3e1d1d841f767048bc083f8..28d542b7021e1bacc20dfbcf4621d40fd06b6c4c 100755 (executable)
@@ -18,4 +18,8 @@ mkdir subdir
 
 $AUTOMAKE || exit 1
 
-grep '^DIST_COMMON =.*foo\.in' Makefile.in
+count=`fgrep foo.in Makefile.in | wc -l`
+test $count -eq 2 || exit 1
+
+# This ought to work as well.
+$AUTOMAKE --add-missing --force-missing
This page took 0.043665 seconds and 5 git commands to generate.