automake-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-commit] [SCM] GNU Automake branch, ng/master, updated. v1.12.1


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, ng/master, updated. v1.12.1-311-g49e41f4
Date: Wed, 06 Jun 2012 14:52:17 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=49e41f451425a238200321f9bfbe147c7f4ad98a

The branch, ng/master has been updated
       via  49e41f451425a238200321f9bfbe147c7f4ad98a (commit)
       via  01a013f10b42fe54b432c0204234221ad55b5782 (commit)
       via  9845336c76b380814aca7971498716ed6be91eef (commit)
       via  e5c5f7c8c4993e4c08c62e6eee5d9aedcbdb7cc6 (commit)
       via  e71916a9c86731dda4ca7dd3478616a4c5823e4b (commit)
       via  434681eba2d8f0ac726d93cc7b99193d355acf0a (commit)
       via  ddc05a1f8013cecc1276414c50a7142272240ba4 (commit)
       via  739820b18ce319efd6ba393291b3041743a4cc18 (commit)
       via  d7206037c1d573c29a1c2a3e909c531b7d90cabc (commit)
       via  67d61020ff23f630bfa47bf6eec5036ecad5de74 (commit)
       via  181bc4246fcada82bc1221406428169bf8df6a2e (commit)
       via  e811379855364efe258b70088ff90101d13fad51 (commit)
       via  c7de107aaf55b1c30438d5a17fefd296fabc57ef (commit)
      from  87fd28feafa58a98fa2fdc139de803aa191abb30 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 49e41f451425a238200321f9bfbe147c7f4ad98a
Merge: 87fd28f ddc05a1 01a013f
Author: Stefano Lattarini <address@hidden>
Date:   Wed Jun 6 15:50:11 2012 +0200

    Merge branches 'ng/check-typos-at-make-runtime' and 'ng/yacc-lex-fixlets' 
into ng/master
    
    * ng/check-typos-at-make-runtime:
      [ng] cleanup: unused variable in the automake script removed
      [ng] warns: also report typos for 'LOG_DEPENDENCIES' variables
      [ng] warns: typos in '_DEPENDENCIES' variables are now reported
      [ng] warns: typos in _SOURCES etc. reported at make runtime
      [ng] refactor: new make variables am__all_libs and am__all_ltlibs
      [ng] automake: new global variable '%known_ltlibraries'
      [ng] coverage: conditional defn of lib_LIBRARIES and lib_LTLIBRARIES
    
    * ng/yacc-lex-fixlets:
      [ng] yacc: prefer use of automatic variables over automake-time transforms
      [ng] yacc/c++: prefer make-time processing over recipe-time one
      [ng] lex: fix a (mostly harmless) typo in code
      [ng] refactor: merge lang_{yacc,lex}_finish functions
      [ng] cleanup: don't error on 'YACCFLAGS' usage

commit 01a013f10b42fe54b432c0204234221ad55b5782
Author: Stefano Lattarini <address@hidden>
Date:   Wed May 30 00:34:34 2012 +0200

    [ng] yacc: prefer use of automatic variables over automake-time transforms
    
    * lib/am/yacc.am: Prefer use of GNU make builtin '$(basename)' over
    automake-time transform %BASE%.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 9845336c76b380814aca7971498716ed6be91eef
Author: Stefano Lattarini <address@hidden>
Date:   Wed May 30 00:30:07 2012 +0200

    [ng] yacc/c++: prefer make-time processing over recipe-time one
    
    * lib/am/yacc.am (am__yacc_c2h): Transform from a sed command to a
    make function.
    (Rules for Yacc -> C transform): Adjust.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit e5c5f7c8c4993e4c08c62e6eee5d9aedcbdb7cc6
Author: Stefano Lattarini <address@hidden>
Date:   Wed May 30 00:04:20 2012 +0200

    [ng] lex: fix a (mostly harmless) typo in code
    
    * lib/am/lex.am [?GENERIC?]: s/$(am__skipyacc)/$(am__skiplex)/.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit e71916a9c86731dda4ca7dd3478616a4c5823e4b
Author: Stefano Lattarini <address@hidden>
Date:   Tue May 29 23:02:42 2012 +0200

    [ng] refactor: merge lang_{yacc,lex}_finish functions
    
    They are identical after the last commit, so no need to keep them
    separated anymore
    
    * automake.in (yacc_lex_finish_helper, lang_yacc_finish,
    lang_lex_finish): Merge into ..
    (lang_yacc_lex_finish): ... this.
    Adjust calls to 'register_language' for Yacc and Lex accordingly.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 434681eba2d8f0ac726d93cc7b99193d355acf0a
Author: Stefano Lattarini <address@hidden>
Date:   Tue May 29 22:57:48 2012 +0200

    [ng] cleanup: don't error on 'YACCFLAGS' usage
    
    * automake.in (lang_yacc_finish): Stop calling 'reject_var' on
    'YACCFLAGS'; that has been obsolete for such a long time (since
    1998 at least!) that is not worth worrying about anymore in
    Automake-NG.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit ddc05a1f8013cecc1276414c50a7142272240ba4
Author: Stefano Lattarini <address@hidden>
Date:   Wed Jun 6 00:04:23 2012 +0200

    [ng] cleanup: unused variable in the automake script removed
    
    * automake.in ($output_header): Remove.
    (initialize_per_input): Don't reset it.
    (generate_makefile): Don't use its content when creating the output
    Makefile: it was always empty anyway.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 739820b18ce319efd6ba393291b3041743a4cc18
Author: Stefano Lattarini <address@hidden>
Date:   Tue Jun 5 17:08:59 2012 +0200

    [ng] warns: also report typos for 'LOG_DEPENDENCIES' variables
    
    * lib/am/parallel-tests.am (am__using_parallel_tests): New, set to
    "yes" to inform the rest of the makefile that the parallel testsuite
    harness is in use.
    * lib/am/check-typos.am (.am/vartypos/whitelisted-vars): Whitelist
    only 'LOG_DEPENDENCIES' variables that actually correspond to a
    declared test extension.
    * t/vartypos-deps.sh: New test.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit d7206037c1d573c29a1c2a3e909c531b7d90cabc
Author: Stefano Lattarini <address@hidden>
Date:   Tue Jun 5 16:16:21 2012 +0200

    [ng] warns: typos in '_DEPENDENCIES' variables are now reported
    
    Detection of those typos had been disabled in commit in commit
    'v1.12-295-g9a5f837' of 2012-05-22, "[ng] warns: don't report possible
    issues with '_DEPENDENCIES' variables", to avoid spurious errors.
    
    * lib/am/check-typos.am (.am/vartypos/suffixes): Add '_DEPENDENCIES'.
    (.am/vartypos/whitelisted-vars): Extend accordingly to avoid spurious
    errors.
    * t/vartypos.sh: Extend to also test bad usages of '_DEPENDENCIES'
    variables.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 67d61020ff23f630bfa47bf6eec5036ecad5de74
Author: Stefano Lattarini <address@hidden>
Date:   Tue Jun 5 13:49:04 2012 +0200

    [ng] warns: typos in _SOURCES etc. reported at make runtime
    
    For example, on an input:
    
        bin_PROGRAMS = frob
        forb_SOURCES = main.c
    
    a proper warning should be given, since either 'forb' or 'frob' is likely a
    typo.  Mainline Automake gives the warning at automake runtime, while with
    this change, the warnings will be moved at make runtime.  This will allow
    us to warn about variables like '_DEPENDENCIES', whose definitions can
    be unavailable (or unanalyzable) at automake runtime (check about those
    variables had to be disabled in commit 'v1.12-295-g9a5f837' of 2012-05-22,
    "[ng] warns: don't report possible issues with '_DEPENDENCIES' variables",
    to avoid spurious errors).
    
    * automake.in (generate_makefile): Emit code to perform make runtime
    checks, in particular those moved out from ...
    (check_typos): ... this now-deleted function ...
    * lib/am/check-typos.am: ... into this new Makefile fragment.
    * Makefile.am (dist_am_DATA): Add the new file.
    * lib/am/header-vars.am (am__error): New internal function, declares an
    error without immediately terminating the make process.  Allows us to
    diagnose more issues at once, rather than stopping at the first one.
    * t/spell.sh: Adjust and extend.
    * t/spell2.sh: Likewise.
    * t/warnopts.sh: Adjust.
    * t/vartypo2.sh: Remove, its content adjusted and merged ...
    * t/vartypos.sh: ... into this test, adjusted and extended as well.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 181bc4246fcada82bc1221406428169bf8df6a2e
Author: Stefano Lattarini <address@hidden>
Date:   Tue Jun 5 18:31:58 2012 +0200

    [ng] refactor: new make variables am__all_libs and am__all_ltlibs
    
    This change is only a preparatory refactoring in view of future changes.
    
    * t/all-progs.sh: Renamed ...
    * t/all-prog-libs.sh: ... like this, and extended.
    * automake.in (generate_makefile): Define the make vars 'am__all_libs'
    and 'am__all_ltlibs' respectively from the sorted keys of the hashes
    '%known_libraries' and '%known_ltlibraries'.  For consistency, and for
    offering a better stability of the output Makefiles, sort the keys of
    the '%known_programs' hash before using them to define the make variable
    'am__all_progs'.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit e811379855364efe258b70088ff90101d13fad51
Author: Stefano Lattarini <address@hidden>
Date:   Tue Jun 5 18:28:01 2012 +0200

    [ng] automake: new global variable '%known_ltlibraries'
    
    This is just a preparatory refactoring in view of future changes.
    
    * automake.in (%known_ltlibraries): New global variable.
    (initialize_per_input): Reset it.
    (handle_ltlibraries): Register processed libtool libraries in
    '%known_ltlibraries' rather than in '%known_libraries'.
    (lang_vala_finish): Also take into account the contents of
    '%known_ltlibraries'; since we are at it, refactor a little
    to remove some inconsistency and code duplication.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit c7de107aaf55b1c30438d5a17fefd296fabc57ef
Author: Stefano Lattarini <address@hidden>
Date:   Tue Jun 5 18:22:33 2012 +0200

    [ng] coverage: conditional defn of lib_LIBRARIES and lib_LTLIBRARIES
    
    This improved coverage will come handy to check the correctness of
    future changes.
    
    * t/cond30.sh: Enhance.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 Makefile.am              |    1 +
 automake.in              |   98 ++++++++++++-------------------------
 lib/am/check-typos.am    |   84 ++++++++++++++++++++++++++++++++
 lib/am/header-vars.am    |    8 +++
 lib/am/lex.am            |    2 +-
 lib/am/parallel-tests.am |    3 +
 lib/am/yacc.am           |    8 +--
 t/all-prog-libs.sh       |   85 ++++++++++++++++++++++++++++++++
 t/all-progs.sh           |   62 ------------------------
 t/cond30.sh              |   35 +++++++++++--
 t/spell.sh               |   29 ++++++++++-
 t/spell2.sh              |   33 +++++++++++--
 t/vartypo2.sh            |   63 ------------------------
 t/vartypos-deps.sh       |  103 +++++++++++++++++++++++++++++++++++++++
 t/vartypos.sh            |  120 +++++++++++++++++++++++++++++-----------------
 t/warnopts.sh            |   27 ++++++-----
 16 files changed, 495 insertions(+), 266 deletions(-)
 create mode 100644 lib/am/check-typos.am
 create mode 100755 t/all-prog-libs.sh
 delete mode 100755 t/all-progs.sh
 delete mode 100755 t/vartypo2.sh
 create mode 100755 t/vartypos-deps.sh

diff --git a/Makefile.am b/Makefile.am
index 4f95e11..a08a3e5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -187,6 +187,7 @@ EXTRA_DIST += lib/Automake/Config.in
 dist_am_DATA = \
   lib/am/serial-tests.am \
   lib/am/parallel-tests.am \
+  lib/am/check-typos.am \
   lib/am/color-tests.am \
   lib/am/clean-hdr.am \
   lib/am/clean.am \
diff --git a/automake.in b/automake.in
index 0428cf9..176e882 100644
--- a/automake.in
+++ b/automake.in
@@ -517,7 +517,6 @@ my $output_deps_greatest_timestamp;
 # These variables are used when generating each Makefile.in.
 # They hold the Makefile.in until it is ready to be printed.
 my $output_vars;
-my $output_header;
 my $output_verbatim;
 my $output_rules;
 my $output_trailer;
@@ -570,10 +569,11 @@ my %dep_files;
 # This is a list of all targets to run during "make dist".
 my @dist_targets;
 
-# Keep track of all programs declared in this Makefile, without
-# $(EXEEXT).  @substitutions@ are not listed.
+# Keep track of all programs and libraries declared in this Makefile,
+# without $(EXEEXT).  @substitutions@ are not listed.
 my %known_programs;
 my %known_libraries;
+my %known_ltlibraries;
 
 # This keeps track of which extensions we've seen (that we care
 # about).
@@ -644,7 +644,6 @@ sub initialize_per_input ()
     $output_deps_greatest_timestamp = 0;
 
     $output_vars = '';
-    $output_header = '';
     $output_verbatim = '';
     $output_rules = '';
     $output_trailer = '';
@@ -681,6 +680,7 @@ sub initialize_per_input ()
 
     %known_programs = ();
     %known_libraries= ();
+    %known_ltlibraries= ();
 
     %extension_seen = ();
 
@@ -830,7 +830,7 @@ register_language ('name' => 'yacc',
                   'output_extensions' => sub { (my $ext = $_[0]) =~ tr/y/c/;
                                                return ($ext,) },
                   'rule_file' => 'yacc',
-                  '_finish' => \&lang_yacc_finish,
+                  '_finish' => \&lang_yacc_lex_finish,
                   '_target_hook' => \&lang_yacc_target_hook,
                   'nodist_specific' => 1);
 register_language ('name' => 'yaccxx',
@@ -844,7 +844,7 @@ register_language ('name' => 'yaccxx',
                   'extensions' => ['.y++', '.yy', '.yxx', '.ypp'],
                   'output_extensions' => sub { (my $ext = $_[0]) =~ tr/y/c/;
                                                return ($ext,) },
-                  '_finish' => \&lang_yacc_finish,
+                  '_finish' => \&lang_yacc_lex_finish,
                   '_target_hook' => \&lang_yacc_target_hook,
                   'nodist_specific' => 1);
 
@@ -860,7 +860,7 @@ register_language ('name' => 'lex',
                   'extensions' => ['.l'],
                   'output_extensions' => sub { (my $ext = $_[0]) =~ tr/l/c/;
                                                return ($ext,) },
-                  '_finish' => \&lang_lex_finish,
+                  '_finish' => \&lang_yacc_lex_finish,
                   '_target_hook' => \&lang_lex_target_hook,
                   'nodist_specific' => 1);
 register_language ('name' => 'lexxx',
@@ -874,7 +874,7 @@ register_language ('name' => 'lexxx',
                   'extensions' => ['.l++', '.ll', '.lxx', '.lpp'],
                   'output_extensions' => sub { (my $ext = $_[0]) =~ tr/l/c/;
                                                return ($ext,) },
-                  '_finish' => \&lang_lex_finish,
+                  '_finish' => \&lang_yacc_lex_finish,
                   '_target_hook' => \&lang_lex_target_hook,
                   'nodist_specific' => 1);
 
@@ -2651,7 +2651,7 @@ sub handle_ltlibraries
               . "did you mean '$suggestion'?")
        }
 
-      ($known_libraries{$onelib} = $bn) =~ s/\.la$//;
+      ($known_ltlibraries{$onelib} = $bn) =~ s/\.la$//;
 
       $where->push_context ("while processing Libtool library '$onelib'");
       $where->set (INTERNAL->get);
@@ -2746,32 +2746,6 @@ sub handle_ltlibraries
     }
 }
 
-# See if any _SOURCES variable were misspelled.
-sub check_typos ()
-{
-  # It is ok if the user sets this particular variable.
-  set_seen 'AM_LDFLAGS';
-
-  foreach my $primary ('SOURCES', 'LIBADD', 'LDADD', 'LDFLAGS')
-    {
-      foreach my $var (variables $primary)
-       {
-         my $varname = $var->name;
-         # A configure variable is always legitimate.
-         next if exists $configure_vars{$varname};
-
-         for my $cond ($var->conditions->conds)
-           {
-             $varname =~ 
/^(?:EXTRA_)?(?:nobase_)?(?:dist_|nodist_)?(.*)_[[:alnum:]]+$/;
-             msg_var ('syntax', $var, "variable '$varname' is defined but no"
-                      . " program or\nlibrary has '$1' as canonical name"
-                      . " (possible typo)")
-               unless $var->rdef ($cond)->seen;
-           }
-       }
-    }
-}
-
 
 # Handle scripts.
 sub handle_scripts
@@ -5401,13 +5375,14 @@ sub lang_vala_finish_target ($$)
 sub lang_vala_finish
 {
   my ($self) = @_;
+  my @names =
+    (
+      keys %known_programs,
+      keys %known_libraries,
+      keys %known_ltlibraries,
+    );
 
-  foreach my $prog (keys %known_programs)
-    {
-      lang_vala_finish_target ($self, $prog);
-    }
-
-  while (my ($name) = each %known_libraries)
+  foreach my $name (@names)
     {
       lang_vala_finish_target ($self, $name);
     }
@@ -5511,8 +5486,7 @@ sub lang_lex_target_hook
     $clean_files{$output} = $transform{'DIST_SOURCE'} ? MAINTAINER_CLEAN : 
CLEAN;
 }
 
-# This is a helper for both lex and yacc.
-sub yacc_lex_finish_helper
+sub lang_yacc_lex_finish
 {
   return if defined $language_scratch{'lex-yacc-done'};
   $language_scratch{'lex-yacc-done'} = 1;
@@ -5522,26 +5496,6 @@ sub yacc_lex_finish_helper
   define_variable ('YLWRAP', INTERNAL, '$(am__config_aux_dir)/ylwrap');
 }
 
-sub lang_yacc_finish
-{
-  return if defined $language_scratch{'yacc-done'};
-  $language_scratch{'yacc-done'} = 1;
-
-  reject_var 'YACCFLAGS', "'YACCFLAGS' obsolete; use 'YFLAGS' instead";
-
-  yacc_lex_finish_helper;
-}
-
-
-sub lang_lex_finish
-{
-  return if defined $language_scratch{'lex-done'};
-  $language_scratch{'lex-done'} = 1;
-
-  yacc_lex_finish_helper;
-}
-
-
 # Given a hash table of linker names, pick the name that has the most
 # precedence.  This is lame, but something has to have global
 # knowledge in order to eliminate the conflict.  Add more linkers as
@@ -7488,8 +7442,12 @@ sub generate_makefile ($$)
   handle_tags;
   handle_minor_options;
 
-  # Must come after handle_programs so that %known_programs is up-to-date.
-  define_variable ('am__all_progs', INTERNAL, keys %known_programs);
+  # Must come after invocation of handle_programs, handle_libraries and
+  # handle_ltlibraries, so that %known_programs and %known_libraries are
+  # up-to-date.
+  define_variable 'am__all_progs',  INTERNAL, sort keys %known_programs;
+  define_variable 'am__all_libs',   INTERNAL, sort keys %known_libraries;
+  define_variable 'am__all_ltlibs', INTERNAL, sort keys %known_ltlibraries;
   handle_tests;
 
   # This must come after most other rules.
@@ -7517,7 +7475,13 @@ sub generate_makefile ($$)
   # defined or overridden variables.
   $output_vars .= output_variables;
 
-  check_typos;
+  my $output_checks = '';
+  # See if any _SOURCES (or _LIBADD, or ...) variable were misspelled.
+  $output_checks .= preprocess_file ("$libdir/am/check-typos.am");
+  # Report errors (if any) seen at make runtime.
+  $output_checks .= '$(if $(am__seen_error),' . 
+                    '$(error Some Automake-NG error occurred))' .
+                    "\n";
 
   if ($exit_code != 0)
     {
@@ -7529,8 +7493,8 @@ sub generate_makefile ($$)
 
   # We make sure that 'all:' is the first target.
   my $output = $output_vars .
-               $output_header .
                $output_verbatim .
+               $output_checks .
                $output_rules .
                $output_trailer;
 
diff --git a/lib/am/check-typos.am b/lib/am/check-typos.am
new file mode 100644
index 0000000..82e19c9
--- /dev/null
+++ b/lib/am/check-typos.am
@@ -0,0 +1,84 @@
+## automake - create Makefile.in from Makefile.am
+## Copyright (C) 2012 Free Software Foundation, Inc.
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2, or (at your option)
+## any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program.  If not, see <http://www.gnu.org/licenses/>.
+##
+## See if any _SOURCES or similar variable were misspelled, as in:
+##    bin_PROGRAMS = bar
+##    baz_SOURCES = main.c  # Should be bar_SOURCES.
+
+## FIXME: With this, we impose runtime penalty to all make runs.  Maybe we
+## FIXME: should make all these checks conditional to whether the user sets
+## FIXME: a AM_SANITY_CHECKS variable or something?
+
+## FIXME: We should document the '.am/' namespace as reserved for automake
+## FIXME: internals somewhere.
+
+# Variables with these suffixes are candidates for typo checking.
+.am/vartypos/suffixes := _SOURCES _LIBADD _LDADD _LDFLAGS _DEPENDENCIES
+
+# But these variables are not, even if they match the patterns above.
+.am/vartypos/whitelisted-vars := \
+  AM_LDFLAGS \
+  BUILT_SOURCES \
+  TAGS_DEPENDENCIES \
+  CONFIG_STATUS_DEPENDENCIES \
+  CONFIGURE_DEPENDENCIES
+
+# The '*LOG_DEPENDENCIES' variables are used to declare extra dependencies
+# for test cases, but only when the parallel testsuite harness is in use.
+ifeq "$(am__using_parallel_tests)" "yes"
+# Extension-less tests are always accepted.
+.am/vartypos/whitelisted-vars += LOG_DEPENDENCIES
+# We expect '.ext' to be a valid tests extension iff 'EXT_LOG_DRIVER' is
+# defined.  Hence the following logic.
+.am/vartypos/whitelisted-vars += \
+  $(patsubst %_LOG_DRIVER,%_LOG_DEPENDENCIES, \
+             $(filter %_LOG_DRIVER,$(.VARIABLES)))
+endif
+
+# Canonicalized names of programs and libraries (vanilla or libtool) that
+# have been declared.
+.am/vartypos/known-canon-proglibs := \
+  $(sort $(call am__canon, $(am__all_progs) \
+                           $(am__all_libs) \
+                          $(am__all_ltlibs)))
+
+# Extract 'foo' from something like "EXTRA_nodist_foo_SOURCES".
+define .am/vartypos/canon-name-from-var
+$(call am__strip_suffixes, $(.am/vartypos/suffixes), \
+  $(patsubst dist_%,%, \
+  $(patsubst nodist_%,%, \
+  $(patsubst nobase_%,%, \
+  $(patsubst EXTRA_%,%, \
+  $1)))))
+endef
+
+define .am/vartypos/check
+$(eval $0/canon := $(call .am/vartypos/canon-name-from-var,$1))
+$(if $(filter $($0/canon),$(.am/vartypos/known-canon-proglibs)),, \
+     $(call am__error,variable '$1' is defined but no program) \
+     $(call am__error,  or library has '$($0/canon)' as canonical name))
+endef
+
+# The variables candidate for checking of typos.
+.am/vartypos/candidate-vars := \
+  $(filter-out $(.am/vartypos/whitelisted-vars), \
+               $(filter $(addprefix %,$(.am/vartypos/suffixes)), \
+                        $(.VARIABLES)))
+
+# Apparently useless use of eval required to avoid a spurious "missing
+# separator" error from GNU make.
+$(eval $(foreach v,$(.am/vartypos/candidate-vars), \
+                   $(call .am/vartypos/check,$v)))
diff --git a/lib/am/header-vars.am b/lib/am/header-vars.am
index 9903af9..74870c6 100644
--- a/lib/am/header-vars.am
+++ b/lib/am/header-vars.am
@@ -16,6 +16,14 @@
 
 VPATH = @srcdir@
 
+## Declare an error, without immediately terminating the execution (proper
+## code will take care later of that).  This will allow us to diagnose more
+## issues at once, rather than stopping at the first one.
+am__seen_error :=
+define am__error
+$(warning $1)$(eval am__seen_error := yes)
+endef
+
 # Some problematic characters (especially when used in arguments
 # to make functions, or for syntax highlighting).
 am__bslash := \\
diff --git a/lib/am/lex.am b/lib/am/lex.am
index bc553f4..b5e2bb2 100644
--- a/lib/am/lex.am
+++ b/lib/am/lex.am
@@ -24,6 +24,6 @@ endif %?MAINTAINER-MODE%
 ?GENERIC?%%DERIVED-EXT%: %%EXT%
 ?!GENERIC?%OBJ%: %SOURCE%
 ?SUBDIROBJ?    %SILENT%test -d $(dir $@) || $(MKDIR_P) $(dir $@)
-?GENERIC?      %VERBOSE%$(am__skipyacc) \
+?GENERIC?      %VERBOSE%$(am__skiplex) \
 ?!GENERIC??DIST_SOURCE?        %VERBOSE%$(am__skiplex) \
        $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c %OBJ% -- %COMPILE%
diff --git a/lib/am/parallel-tests.am b/lib/am/parallel-tests.am
index 819b4e2..b628853 100644
--- a/lib/am/parallel-tests.am
+++ b/lib/am/parallel-tests.am
@@ -25,6 +25,9 @@ include color-tests.am
 ## of more test metadata, and the use of custom test derivers and protocols
 ## (among them, TAP).
 
+## Used by (at least) 'check-typos.am'.
+am__using_parallel_tests := yes
+
 am__maybe_invalid_test_extensions = \
   $(if \
     $(strip $1), \
diff --git a/lib/am/yacc.am b/lib/am/yacc.am
index 4815087..4393ce9 100644
--- a/lib/am/yacc.am
+++ b/lib/am/yacc.am
@@ -36,9 +36,7 @@ if %?FIRST%
 if %?MAINTAINER-MODE%
 @address@hidden = test -f $@ ||
 endif %?MAINTAINER-MODE%
-## The 's/c$/h/' substitution *must* be the last one.
-am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \
-                  -e s/c++$$/h++/ -e s/c$$/h/
+am__yacc_c2h = $(basename $1)$(subst c,h,$(suffix $1))
 endif %?FIRST%
 
 ?GENERIC?%%DERIVED-EXT%: %%EXT%
@@ -49,6 +47,6 @@ endif %?FIRST%
 ?!GENERIC??DIST_SOURCE?        $(am__skipyacc) \
        $(SHELL) $(YLWRAP) $< \
          y.tab.c $@ \
-         y.tab.h `echo %OBJ% | $(am__yacc_c2h)` \
-         y.output %BASE%.output \
+         y.tab.h $(call am__yacc_c2h,$@) \
+         y.output $(basename $@).output \
          -- %COMPILE%
diff --git a/t/all-prog-libs.sh b/t/all-prog-libs.sh
new file mode 100755
index 0000000..1857a45
--- /dev/null
+++ b/t/all-prog-libs.sh
@@ -0,0 +1,85 @@
+#! /bin/sh
+# Copyright (C) 2007-2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Test internal automake variables:
+#  - $(am__all_progs).
+#  - $(am__all_libs).
+#  - $(am__all_ltlibs).
+
+. ./defs || Exit 1
+
+cat >> configure.ac << 'END'
+AC_SUBST([CC], [who-cares])
+m4_define([AM_PROG_AR], [AC_SUBST([AR], [who-cares])])
+AM_PROG_AR
+AC_SUBST([RANLIB], [who-cares])
+AC_SUBST([LIBTOOL], [who-cares])
+AC_SUBST([EXEEXT], [''])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = no-dependencies
+
+check_PROGRAMS = p1
+check_LIBRARIES = lib01.a
+check_LTLIBRARIES = lib1.la
+check_SCRIPTS = x1
+
+EXTRA_PROGRAMS = p2
+EXTRA_LIBRARIES = lib02.a
+EXTRA_LTLIBRARIES = lib2.la
+EXTRA_SCRIPTS = x2
+
+bin_PROGRAMS = p3
+lib_LIBRARIES = lib03.a
+lib_LTLIBRARIES = lib3.la
+bin_SCRIPTS = x3
+
+noinst_PROGRAMS = p4
+noinst_LIBRARIES = lib04.a
+noinst_LTLIBRARIES = lib4.la
+noinst_SCRIPTS = x4
+
+mydir = $(prefix)
+my_PROGRAMS = p5
+my_LIBRARIES = lib05.a
+my_LTLIBRARIES = lib5.la
+my_SCRIPTS = x5
+
+.PHONY: debug test
+debug:
+       @echo  PROGS-BEG:  $(am__all_progs)   :PROGS-END
+       @echo   LIBS-BEG:  $(am__all_libs)    :LIBS-END
+       @echo LTLIBS-BEG:  $(am__all_ltlibs)  :LTLIBS-END
+test: debug
+       test '$(am__all_progs)'  = 'p1 p2 p3 p4 p5'
+       test '$(am__all_libs)'   = 'lib01.a lib02.a lib03.a lib04.a lib05.a'
+       test '$(am__all_ltlibs)' = 'lib1.la lib2.la lib3.la lib4.la lib5.la'
+END
+
+: > ltmain.sh
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+./configure
+$MAKE test
+$MAKE test EXEEXT=.exe
+$MAKE test EXEEXT=.bin
+
+:
diff --git a/t/all-progs.sh b/t/all-progs.sh
deleted file mode 100755
index 3b8050a..0000000
--- a/t/all-progs.sh
+++ /dev/null
@@ -1,62 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2007-2012 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Test internal automake variable $(am__all_progs).
-
-. ./defs || Exit 1
-
-cat >> configure.ac << 'END'
-AC_SUBST([CC], ['whocares'])
-AC_SUBST([EXEEXT], [''])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-AUTOMAKE_OPTIONS = no-dependencies
-
-check_PROGRAMS = p1
-check_SCRIPTS = x1
-
-EXTRA_PROGRAMS = p2
-EXTRA_SCRIPTS = x2
-
-bin_PROGRAMS = p3
-bin_SCRIPTS = x3
-
-noinst_PROGRAMS = p4
-noinst_SCRIPTS = x4
-
-mydir = $(prefix)
-my_PROGRAMS = p5
-my_SCRIPTS = x5
-
-.PHONY: debug test
-debug:
-       @echo BEG: $(am__all_progs) :END
-test: debug
-       test '$(sort $(am__all_progs))' = 'p1 p2 p3 p4 p5'
-END
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-$MAKE test
-$MAKE test EXEEXT=.exe
-$MAKE test EXEEXT=.bin
-
-:
diff --git a/t/cond30.sh b/t/cond30.sh
index 6c2b396..495842c 100755
--- a/t/cond30.sh
+++ b/t/cond30.sh
@@ -14,43 +14,68 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# For PR/352: make sure we support bin_PROGRAMS being defined conditionally.
+# For PR/352: make sure we support bin_PROGRAMS, lib_LIBRARIES and
+#             lib_LTLIBRARIES being defined conditionally.
 
 . ./defs || Exit 1
 
 cat >>configure.ac <<'EOF'
-AM_CONDITIONAL([C1], [test -z "$two"])
-AM_CONDITIONAL([C2], [test -n "$two"])
+m4_define([AM_PROG_AR], [:])
+AM_PROG_AR
+AM_CONDITIONAL([C1], [test x"$two" != x"yes"])
+AM_CONDITIONAL([C2], [test x"$two"  = x"yes"])
 AC_OUTPUT
 EOF
 
+# Avoid spurious interferences from the environment.
+unset undefined two || :
+
 cat > Makefile.am <<'EOF'
 AUTOMAKE_OPTIONS = no-dependencies
 CC = false
+AR = false
+RANLIB = false
+LIBTOOL = false
 EXEEXT = .foo
 
 if C1
 bin_PROGRAMS = a
+lib_LIBRARIES = liba.a
+lib_LTLIBRARIES = libxa.la
 endif
 if C2
 bin_PROGRAMS = b $(undefined)
+lib_LIBRARIES = libb.a $(undefined)
+lib_LTLIBRARIES = libxb.la $(undefined)
 endif
 
 .PHONY: test-a test-b
 test-a:
        test a.foo = $(bin_PROGRAMS)
+       test liba.a = $(lib_LIBRARIES)
+       test libxa.la = $(lib_LTLIBRARIES)
 test-b:
        test b.foo = $(bin_PROGRAMS)
+       test libb.a = $(lib_LIBRARIES)
+       test libxb.la = $(lib_LTLIBRARIES)
 EOF
 
+: > ltmain.sh
+
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -a
+
+$FGREP SOURCES Makefile.in # For debugging.
 
 $FGREP 'a_SOURCES = a.c' Makefile.in
 $FGREP 'b_SOURCES = b.c' Makefile.in
+$FGREP 'liba_a_SOURCES = liba.c' Makefile.in
+$FGREP 'libb_a_SOURCES = libb.c' Makefile.in
+$FGREP 'libxa_la_SOURCES = libxa.c' Makefile.in
+$FGREP 'libxb_la_SOURCES = libxb.c' Makefile.in
 
-./configure
+./configure two=no
 $MAKE test-a
 
 ./configure two=yes
diff --git a/t/spell.sh b/t/spell.sh
index a2b4752..790739d 100755
--- a/t/spell.sh
+++ b/t/spell.sh
@@ -16,14 +16,39 @@
 
 # Test to make sure misspellings in _SOURCES variables cause failure.
 
+required=cc
 . ./defs || Exit 1
 
+cat >> configure.ac << 'END'
+AC_PROG_CC
+AC_OUTPUT
+END
+
 cat > Makefile.am << 'END'
 bin_PROGRAMS = zardoz foo
 zardoz_SOURCES = x.c
 boo_SOURCES = y.c
 END
 
+echo 'int main (void) { return 0; }' > x.c
+echo 'int main (void) { return 0; }' > y.c
+
 $ACLOCAL
-AUTOMAKE_fails
-grep 'Makefile.am:3:.*boo' stderr
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+$MAKE 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+
+LC_ALL=C sed 's/^Makefile:[0-9][0-9]*: //' stderr > got
+
+cat > exp << 'END'
+variable 'boo_SOURCES' is defined but no program
+  or library has 'boo' as canonical name
+*** Some Automake-NG error occurred.  Stop.
+END
+
+diff exp got
+
+:
diff --git a/t/spell2.sh b/t/spell2.sh
index a4b0a46..dead9c1 100755
--- a/t/spell2.sh
+++ b/t/spell2.sh
@@ -14,18 +14,41 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Test to make sure misspellings in _SOURCES variables cause failure.
+# Test to make sure misspellings in _LDADD variable cause failure.
 
+required=cc
 . ./defs || Exit 1
 
-echo AC_PROG_CC >> configure.ac
+cat >> configure.ac << 'END'
+AC_PROG_CC
+AC_OUTPUT
+END
 
 cat > Makefile.am << 'END'
 bin_PROGRAMS = zardoz
 zardoz_SOURCES = x.c
-qardoz_LDADD = -ljoe
+qardoz_LDADD = -lm
 END
 
+echo 'int main (void) { return 0; }' > x.c
+
 $ACLOCAL
-AUTOMAKE_fails
-grep 'Makefile.am:3:.*qardoz' stderr
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+
+$MAKE 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+
+LC_ALL=C sed 's/^Makefile:[0-9][0-9]*: //' stderr > got
+
+cat > exp << 'END'
+variable 'qardoz_LDADD' is defined but no program
+  or library has 'qardoz' as canonical name
+*** Some Automake-NG error occurred.  Stop.
+END
+
+diff exp got
+
+:
diff --git a/t/vartypo2.sh b/t/vartypo2.sh
deleted file mode 100755
index 9c1b6d7..0000000
--- a/t/vartypo2.sh
+++ /dev/null
@@ -1,63 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2010-2012 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Make sure we warn about possible variable typos when we should,
-# Libtool variant.
-
-required=libtoolize
-. ./defs || Exit 1
-
-cat >>configure.ac <<'END'
-AM_PROG_AR
-AC_PROG_LIBTOOL
-AC_OUTPUT
-END
-
-cat >Makefile.am <<'END'
-libfoo_la_SOURCES = unused
-nodist_libfoo_la_SOURCES = unused
-EXTRA_libfoo_la_SOURCES = unused
-libfoo_la_LIBADD = unused
-END
-
-libtoolize
-$ACLOCAL
-AUTOMAKE_fails --add-missing
-# The expected diagnostic is:
-# automake: warnings are treated as errors
-# Makefile.am:3: warning: variable `EXTRA_libfoo_la_SOURCES' is defined but no 
program or
-# Makefile.am:3: library has `libfoo_la' as canonical name (possible typo)
-# Makefile.am:1: warning: variable `libfoo_la_SOURCES' is defined but no 
program or
-# Makefile.am:1: library has `libfoo_la' as canonical name (possible typo)
-# Makefile.am:2: warning: variable `nodist_libfoo_la_SOURCES' is defined but 
no program or
-# Makefile.am:2: library has `libfoo_la' as canonical name (possible typo)
-# Makefile.am:4: warning: variable `libfoo_la_LIBADD' is defined but no 
program or
-# Makefile.am:4: library has `libfoo_la' as canonical name (possible typo)
-
-grep 'as canonical' stderr | grep -v ' .libfoo_la. ' && Exit 1
-test `grep 'variable.*is defined but' stderr | wc -l` = 4
-
-# If we add a global -Wnone, all warnings should disappear.
-$AUTOMAKE -Wnone
-
-# Likewise, if matching programs or libraries are defined.
-cat >>Makefile.am <<'END'
-lib_LTLIBRARIES = libfoo.la
-END
-
-$AUTOMAKE
-
-:
diff --git a/t/vartypos-deps.sh b/t/vartypos-deps.sh
new file mode 100755
index 0000000..212b29a
--- /dev/null
+++ b/t/vartypos-deps.sh
@@ -0,0 +1,103 @@
+#! /bin/sh
+# Copyright (C) 2010-2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Make sure we warn about possible variable typos for the
+# *_DEPENDENCIES when we should, and do not warn about them
+# when we should not.
+
+. ./defs || Exit 1
+
+subdirs='ok1 ok2 ko1 ko2'
+mkdir $subdirs
+
+errgrep ()
+{
+  grep "variable '${1}_DEPENDENCIES' is defined" stderr
+  grep "'$1' as canonical name" stderr
+}
+
+cat >> configure.ac <<END
+AC_CONFIG_FILES([$(for d in $subdirs; do echo $d/Makefile; done)])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+AM_LDFLAGS = unused
+ETAGS_ARGS = --unused
+TAGS_DEPENDENCIES = foo.c
+CONFIG_STATUS_DEPENDENCIES = cvs-version.sh
+CONFIGURE_DEPENDENCIES = cvs-version.sh
+foo.c:
+       echo 'int main (void) { return 0; }' > $@
+END
+
+: > cvs-version.sh
+
+cat > ok1/Makefile.am <<'END'
+TESTS = unused ignored.test
+LOG_DEPENDENCIES = unused
+TEST_LOG_DEPENDENCIES = unused
+END
+
+cat > ok2/Makefile.am <<'END'
+TESTS = ignored.sh notseen.tap
+TEST_EXTENSIONS = .sh .tap
+LOG_DEPENDENCIES = unused
+SH_LOG_DEPENDENCIES = unused
+TAP_LOG_DEPENDENCIES = unused
+END
+
+cat > ko1/Makefile.am <<'END'
+LOG_DEPENDENCIES =
+TEST_LOG_DEPENDENCIES =
+END
+
+cat > ko2/Makefile.am <<'END'
+TESTS = unused ignored.test
+TEST_LOG_DEPENDENCIES =
+LOG_DEPENDENCIES =
+SH_LOG_DEPENDENCIES =
+CONFIGSTATUS_DEPENDENCIES =
+CONFIG_DEPENDENCIES =
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+
+$MAKE
+(cd ok1 && $MAKE)
+(cd ok2 && $MAKE)
+
+cd ko1
+$MAKE 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+errgrep LOG
+errgrep TEST_LOG
+cd ..
+
+cd ko2
+$MAKE 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+errgrep SH_LOG
+errgrep CONFIG
+errgrep CONFIGSTATUS
+$EGREP "'(TEST_)?LOG" stderr && Exit 1
+cd ..
+
+:
diff --git a/t/vartypos.sh b/t/vartypos.sh
index d176d04..cf9b31e 100755
--- a/t/vartypos.sh
+++ b/t/vartypos.sh
@@ -18,60 +18,92 @@
 
 . ./defs || Exit 1
 
-cat >>configure.ac <<'END'
+: > ltmain.sh
+
+cat >> configure.ac <<'END'
+m4_define([AC_PROG_RANLIB], [AC_SUBST([RANLIB],  [who-cares])])
+m4_define([AM_PROG_AR],     [AC_SUBST([AR],      [who-cares])])
+m4_define([LT_INIT],        [AC_SUBST([LIBTOOL], [who-cares])])
+LT_INIT
+AM_PROG_AR
 AC_PROG_RANLIB
 AC_OUTPUT
 END
 
-cat >Makefile.am <<'END'
-foo_SOURCES = unused
-nodist_foo_SOURCES = unused
-EXTRA_foo_SOURCES = unused
-foo_LDADD = unused
-foo_LDFLAGS = unused
-
-libfoo_a_SOURCES = unused
-nodist_libfoo_a_SOURCES = unused
-EXTRA_libfoo_a_SOURCES = unused
-libfoo_a_LIBADD = unused
+cat > Makefile.am <<'END'
+foo_SOURCES =
+dist_foo_SOURCES =
+nodist_foo_SOURCES =
+EXTRA_foo_SOURCES =
+EXTRA_dist_foo_SOURCES =
+EXTRA_nodist_foo_SOURCES =
+
+foo_DEPENDENCIES =
+EXTRA_foo_DEPENDENCIES =
+
+foo_LDADD =
+foo_LDFLAGS =
+EXTRA_foo_LDADD =
+EXTRA_foo_LDFLAGS =
+
+libfoo_a_SOURCES =
+dist_libfoo_a_SOURCES =
+nodist_libfoo_a_SOURCES =
+EXTRA_libfoo_a_SOURCES =
+EXTRA_dist_libfoo_a_SOURCES =
+EXTRA_nodist_libfoo_a_SOURCES =
+
+libfoo_a_DEPENDENCIES =
+EXTRA_libfoo_a_DEPENDENCIES =
+
+libfoo_a_LIBADD =
+EXTRA_libfoo_a_LIBADD =
+libfoo_a_LDFLAGS =
+EXTRA_libfoo_a_LDFLAGS =
+
+libbar_la_SOURCES =
+dist_libbar_la_SOURCES =
+nodist_libbar_la_SOURCES =
+EXTRA_libbar_la_SOURCES =
+EXTRA_dist_libbar_la_SOURCES =
+EXTRA_nodist_libbar_la_SOURCES =
+
+libbar_la_DEPENDENCIES =
+EXTRA_libbar_la_DEPENDENCIES =
+
+libbar_la_LIBADD =
+EXTRA_libbar_la_LIBADD =
+libbar_la_LDFLAGS =
+EXTRA_libbar_la_LDFLAGS =
+
+.PHONY: nihil
+nihil:
+       @:
 END
 
 $ACLOCAL
-AUTOMAKE_fails -Wno-extra-portability
-# The expected diagnostic is:
-# automake: warnings are treated as errors
-# Makefile.am:2: warning: variable 'nodist_foo_SOURCES' is defined but no 
program or
-# Makefile.am:2: library has 'foo' as canonical name (possible typo)
-# Makefile.am:1: warning: variable 'foo_SOURCES' is defined but no program or
-# Makefile.am:1: library has 'foo' as canonical name (possible typo)
-# Makefile.am:9: warning: variable 'libfoo_a_SOURCES' is defined but no 
program or
-# Makefile.am:9: library has 'libfoo_a' as canonical name (possible typo)
-# Makefile.am:10: warning: variable 'nodist_libfoo_a_SOURCES' is defined but 
no program or
-# Makefile.am:10: library has 'libfoo_a' as canonical name (possible typo)
-# Makefile.am:11: warning: variable 'EXTRA_libfoo_a_SOURCES' is defined but no 
program or
-# Makefile.am:11: library has 'libfoo_a' as canonical name (possible typo)
-# Makefile.am:3: warning: variable 'EXTRA_foo_SOURCES' is defined but no 
program or
-# Makefile.am:3: library has 'foo' as canonical name (possible typo)
-# Makefile.am:12: warning: variable 'libfoo_a_LIBADD' is defined but no 
program or
-# Makefile.am:12: library has 'libfoo_a' as canonical name (possible typo)
-# Makefile.am:4: warning: variable 'foo_LDADD' is defined but no program or
-# Makefile.am:4: library has 'foo' as canonical name (possible typo)
-# Makefile.am:5: warning: variable 'foo_LDFLAGS' is defined but no program or
-# Makefile.am:5: library has 'foo' as canonical name (possible typo)
-
-grep 'as canonical' stderr | grep -v ' .foo. ' | grep -v ' .libfoo_a. ' \
-  && Exit 1
-test `grep 'variable.*is defined but' stderr | wc -l` = 9
-
-# If we add a global -Wnone, all warnings should disappear.
-$AUTOMAKE -Wnone
-
-# Likewise, if matching programs or libraries are defined.
-cat >>Makefile.am <<'END'
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+$MAKE nihil 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+
+$FGREP 'as canonical' stderr \
+  | $EGREP -v " '(foo|libfoo_a|libbar_la)' " && Exit 1
+test 36 -eq $(grep -c 'variable.*is defined but' stderr)
+
+# If matching programs or libraries are defined, all errors should
+# disappear.
+cat >> Makefile.am <<'END'
 bin_PROGRAMS = foo
 lib_LIBRARIES = libfoo.a
+lib_LTLIBRARIES = libbar.la
 END
 
-$AUTOMAKE -Wno-extra-portability
+# FIXME!  We have to remake the Makefile by hand!  This is unacceptable.
+$AUTOMAKE Makefile
+./config.status Makefile
+$MAKE nihil
 
 :
diff --git a/t/warnopts.sh b/t/warnopts.sh
index 774a38a..ccf011b 100755
--- a/t/warnopts.sh
+++ b/t/warnopts.sh
@@ -18,7 +18,8 @@
 
 . ./defs || Exit 1
 
-cat >>configure.ac <<END
+cat >> configure.ac << 'END'
+AC_PROG_CC
 AC_CONFIG_FILES([sub/Makefile])
 AM_CONDITIONAL([COND_FALSE], [false])
 AC_OUTPUT
@@ -30,35 +31,36 @@ mkdir sub
 # warnings disabled.
 
 cat > Makefile.am << 'END'
-AUTOMAKE_OPTIONS = -Wno-unsupported
+AUTOMAKE_OPTIONS = subdir-objects -Wno-unsupported
 if COND_FALSE
 AUTOMAKE_OPTIONS += no-dependencies
 endif
-foo_SOURCES = unused
+bin_PROGRAMS = foo
+foo_SOURCES = sub/foo.c
 SUBDIRS = sub
 END
 
 cat > sub/Makefile.am << 'END'
-AUTOMAKE_OPTIONS = -Wno-syntax
+AUTOMAKE_OPTIONS = subdir-objects -Wno-portability
 if COND_FALSE
 AUTOMAKE_OPTIONS += no-dependencies
 endif
-foo_SOURCES = unused
+bin_PROGRAMS = foo
+foo_SOURCES = sub/foo.c
 END
 
 $ACLOCAL
 AUTOMAKE_fails
 # The expected diagnostic is
 #   automake: warnings are treated as errors
-#   Makefile.am:5: warning: variable 'foo_SOURCES' is defined but no program or
-#   Makefile.am:5: library has 'foo' as canonical name (possible typo)
+#   Makefile.am:6: warning: compiling 'sub/foo.c' in subdir requires 
'AM_PROG_CC_C_O' in 'configure.ac'
 #   sub/Makefile.am:1: warning: 'AUTOMAKE_OPTIONS' cannot have conditional 
contents
-grep '^Makefile.am:.*foo_SOURCES' stderr
+grep '^Makefile\.am:.*sub/foo\.c.*AM_PROG_CC_C_O' stderr
 grep '^sub/Makefile.am:.*AUTOMAKE_OPTIONS' stderr
-grep '^sub/Makefile.am:.*foo_SOURCES' stderr && Exit 1
-grep '^Makefile.am:.*AUTOMAKE_OPTIONS' stderr && Exit 1
-# Only three lines of warnings.
-test `grep -v 'warnings are treated as errors' stderr | wc -l` = 3
+grep '^sub/Makefile\.am:.*AM_PROG_CC_C_O' stderr && Exit 1
+grep '^Makefile\.am:.*AUTOMAKE_OPTIONS' stderr && Exit 1
+# Only two lines of warnings.
+test $(grep -v 'warnings are treated as errors' stderr | wc -l) = 2
 
 rm -rf autom4te*.cache
 
@@ -67,6 +69,7 @@ cat >configure.ac <<END
 AC_INIT([warnopts], [1.0])
 AM_INIT_AUTOMAKE([-Wnone])
 AC_CONFIG_FILES([Makefile sub/Makefile])
+AC_PROG_CC
 AC_OUTPUT
 END
 $ACLOCAL


hooks/post-receive
-- 
GNU Automake



reply via email to

[Prev in Thread] Current Thread [Next in Thread]