From 9805344a6fc642e819ba5cc8e811acb80e1e2547 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Wed, 27 Jul 2005 11:09:44 +0000 Subject: [PATCH] * lib/Automake/Variable.pm (require_variables): Mention aclocal's search path when suggesting to add a macro in configure.ac. People are confused when Automake suggests adding a macro (such as AC_PROG_LIBTOOL) that is already in configure.ac. * automake.in (require_file_internal): Suggest `automake --add-missing' for missing files that can be installed. * tests/library3.test: Adjust. --- ChangeLog | 10 ++++++++++ automake.in | 7 ++++++- lib/Automake/Variable.pm | 19 +++++++++++++------ tests/library3.test | 4 ++-- 4 files changed, 31 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 431b0a12..735b471f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2005-07-27 Alexandre Duret-Lutz + + * lib/Automake/Variable.pm (require_variables): Mention aclocal's + search path when suggesting to add a macro in configure.ac. + People are confused when Automake suggests adding a macro (such as + AC_PROG_LIBTOOL) that is already in configure.ac. + * automake.in (require_file_internal): Suggest `automake --add-missing' + for missing files that can be installed. + * tests/library3.test: Adjust. + 2005-07-27 Stepan Kasal * tests/defs.in: When required matches both `*libtool*' and diff --git a/automake.in b/automake.in index 700e7e8b..d07abcc3 100755 --- a/automake.in +++ b/automake.in @@ -7140,7 +7140,7 @@ sub require_file_internal ($$$@) my $message = "required file `$fullfile' not found"; if ($add_missing) { - if (-f ("$libdir/$file")) + if (-f "$libdir/$file") { $suppress = 1; @@ -7183,6 +7183,11 @@ sub require_file_internal ($$$@) } } } + else + { + $trailer = "\n `automake --add-missing' can install `$file'" + if -f "$libdir/$file"; + } # If --force-missing was specified, and we have # actually found the file, then do nothing. diff --git a/lib/Automake/Variable.pm b/lib/Automake/Variable.pm index 54963092..e6c98c03 100644 --- a/lib/Automake/Variable.pm +++ b/lib/Automake/Variable.pm @@ -1125,21 +1125,28 @@ sub require_variables ($$$@) next VARIABLE if $undef_cond->false; $text .= ("in the following conditions:\n " - . join ("\n ", map { $_->human } $undef_cond->conds)); + . join ("\n ", map { $_->human } $undef_cond->conds) + . "\n"); } ++$res; if (exists $_am_macro_for_var{$var}) { - $text .= "\nThe usual way to define `$var' is to add " - . "`$_am_macro_for_var{$var}'\nto `$configure_ac' and " - . "run `aclocal' and `autoconf' again."; + my $mac = $_am_macro_for_var{$var}; + $text .= " The usual way to define `$var' is to add " + . "`$mac'\n to `$configure_ac' and run `aclocal' and " + . "`autoconf' again."; + # aclocal will not warn about undefined macros unless it + # starts with AM_. + $text .= "\n If `$mac' is in `$configure_ac', make sure\n" + . " its definition is in aclocal's search path." + unless $mac =~ /^AM_/; } elsif (exists $_ac_macro_for_var{$var}) { - $text .= "\nThe usual way to define `$var' is to add " - . "`$_ac_macro_for_var{$var}'\nto `$configure_ac' and " + $text .= " The usual way to define `$var' is to add " + . "`$_ac_macro_for_var{$var}'\n to `$configure_ac' and " . "run `autoconf' again."; } diff --git a/tests/library3.test b/tests/library3.test index 8806e6f5..dd069a8d 100755 --- a/tests/library3.test +++ b/tests/library3.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2002, 2003 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is part of GNU Automake. # @@ -55,4 +55,4 @@ $ACLOCAL AUTOMAKE_fails grep '^Makefile.am:.*: !A and !C and !D$' stderr # Is there only one missing condition? -test `grep ': ' stderr | wc -l` = 1 || exit 1 +test `grep ': !' stderr | wc -l` = 1 || exit 1 -- 2.43.5