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.
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)
# config_aux_path.
$errfile = $errdir . '/' . $file;
- if (-l $fullfile && ! -f readlink ($fullfile))
+ if (-l $fullfile && ! -f $fullfile)
{
$dangling_sym = 1;
last;
}
}
- 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)
@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)
$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