From 6d23af9306af875d25963d35e7b0e2556e6bcb60 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 18 Jun 2001 01:08:34 +0000 Subject: [PATCH] * 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. --- ChangeLog | 6 ++++++ automake.in | 26 ++++++++++++++++++++------ tests/acoutput2.test | 6 +++++- 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index ca600e83..261bba82 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2001-06-17 Tom Tromey + * 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. diff --git a/automake.in b/automake.in index 4fe79c9d..db182a8b 100755 --- a/automake.in +++ b/automake.in @@ -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) diff --git a/tests/acoutput2.test b/tests/acoutput2.test index fdefa027..28d542b7 100755 --- a/tests/acoutput2.test +++ b/tests/acoutput2.test @@ -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 -- 2.43.5