* lib/Automake/Variable.pm (require_variables): Mention aclocal's
authorAlexandre Duret-Lutz <adl@gnu.org>
Wed, 27 Jul 2005 11:09:45 +0000 (11:09 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Wed, 27 Jul 2005 11:09:45 +0000 (11:09 +0000)
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
automake.in
lib/Automake/Variable.pm
tests/library3.test

index 431b0a1..735b471 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2005-07-27  Alexandre Duret-Lutz  <adl@gnu.org>
+
+       * 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  <kasal@ucw.cz>
 
        * tests/defs.in: When required matches both `*libtool*' and
index 700e7e8..d07abcc 100755 (executable)
@@ -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.
index 5496309..e6c98c0 100644 (file)
@@ -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.";
        }
 
index 8806e6f..dd069a8 100755 (executable)
@@ -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