From 3965294b8f3c42ce0f1fc1c4a5148bcfc2077a0a Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Sat, 30 Nov 2002 15:34:49 +0000 Subject: [PATCH] For PR automake/357: * automake.in (require_file_internal): Don't complain a file is "not found" when it is a target. Make sure "not found" files are otherwise reported as error (they were reported as 'note'). * tests/distcommon3.test: Augment to test the above. * tests/libobj12b.test: Touch ltmain.sh. * tests/required2.test: Make sure Automake fails because ltmain.sh has been removed. Reported by Ronald Landheer. --- ChangeLog | 10 ++++++++++ THANKS | 1 + automake.in | 10 ++++++++-- tests/distcommon3.test | 24 +++++++++++++++++++++--- tests/libobj12b.test | 1 + tests/required2.test | 3 ++- 6 files changed, 43 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index f4d03c57..7e724eff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2002-11-30 Alexandre Duret-Lutz + For PR automake/357: + * automake.in (require_file_internal): Don't complain a file is "not + found" when it is a target. Make sure "not found" files are otherwise + reported as error (they were reported as 'note'). + * tests/distcommon3.test: Augment to test the above. + * tests/libobj12b.test: Touch ltmain.sh. + * tests/required2.test: Make sure Automake fails because ltmain.sh + has been removed. + Reported by Ronald Landheer. + * tests/texinfo3.test: Make sure we don't output single suffix inference rules when building `.info'-less Info files (this confuses Solaris make). Run distcheck to make sure the rules diff --git a/THANKS b/THANKS index 84c8016b..83edfd91 100644 --- a/THANKS +++ b/THANKS @@ -174,6 +174,7 @@ Rob Savoye rob@cygnus.com Robert Bihlmeyer robbe@orcus.priv.at Robert Boehne rboehne@ricardo-us.com Robert Collins robert.collins@itdomain.com.au +Ronald Landheer ronald@landheer.com Rusty Ballinger rusty@rlyeh.engr.sgi.com Ryan T. Sammartino ryants@shaw.ca Sam Hocevar sam@zoy.org diff --git a/automake.in b/automake.in index 04232147..6bc5038d 100755 --- a/automake.in +++ b/automake.in @@ -8786,10 +8786,10 @@ sub require_file_internal ($$@) my $message = "required file `$errfile' not found"; if ($add_missing) { - $suppress = 1; - if (-f ("$libdir/$file")) { + $suppress = 1; + # Install the missing file. Symlink if we # can, copy if we must. Note: delete the file # first, in case it is a dangling symlink. @@ -8840,6 +8840,12 @@ sub require_file_internal ($$@) next if $found_it && $force_missing; + # If we couldn' install the file, but it is a target in + # the Makefile, don't print anything. This allows files + # like README, AUTHORS, or THANKS to be generated. + next + if !$suppress && target_defined ($file); + msg ($suppress ? 'note' : 'error', $where, "$message$trailer"); } } diff --git a/tests/distcommon3.test b/tests/distcommon3.test index 2c656252..e92ccfa3 100755 --- a/tests/distcommon3.test +++ b/tests/distcommon3.test @@ -23,13 +23,24 @@ . ./defs || exit 1 +set -e + cat > Makefile.am << 'END' README: echo 'I bet you are reading me.' > README END -$ACLOCAL || exit 1 -$AUTOMAKE || exit 1 +# Files required by --gnu +: > NEWS +: > AUTHORS +: > ChangeLog + +$ACLOCAL + +# Should not warn about missing README, since it is a target. +$AUTOMAKE --add-missing --gnu >stdout 2>&1 +cat stdout +grep README stdour && exit 1 sed -n -e '/^DIST_COMMON =.*\\$/ { :loop @@ -38,4 +49,11 @@ sed -n -e '/^DIST_COMMON =.*\\$/ { /\\$/ b loop p n - }' -e '/^DIST_COMMON =/ p' Makefile.in | grep README || exit 1 + }' -e '/^DIST_COMMON =/ p' Makefile.in | grep README + + +# Should warn about missing README. +: > Makefile.am +$AUTOMAKE --add-missing --gnu 2>stderr && exit 1 +cat stderr +grep README stderr diff --git a/tests/libobj12b.test b/tests/libobj12b.test index ecfb0822..528fec9f 100755 --- a/tests/libobj12b.test +++ b/tests/libobj12b.test @@ -45,6 +45,7 @@ END : > foo.c $ACLOCAL +: > ltmain.sh $AUTOMAKE --add-missing # This however should be diagnosed, since foo.c is in @LIBOBJS@. diff --git a/tests/required2.test b/tests/required2.test index b6e1286a..ab17a168 100755 --- a/tests/required2.test +++ b/tests/required2.test @@ -52,8 +52,9 @@ $AUTOCONF test -f autoconf/ltmain.sh # Sanity check. rm -f autoconf/ltmain.sh -$AUTOMAKE --add-missing --copy 2>stderr +$AUTOMAKE --add-missing --copy 2>stderr && exit 1 cat stderr +grep 'autoconf/ltmain.sh' stderr grep 'running more than two' stderr && exit 1 # Since we are ensuring that 'running more than two' is not printed, -- 2.43.5