automake-ng
[Top][All Lists]
Advanced

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

[Automake-NG] [PATCH 12/17] [ng] warns: don't report possible issues wit


From: Stefano Lattarini
Subject: [Automake-NG] [PATCH 12/17] [ng] warns: don't report possible issues with '_DEPENDENCIES' variables
Date: Tue, 22 May 2012 22:50:53 +0200

This will allow us to move (in future changes) some more processing at
make runtime, without having automake complain spuriously (which couldn't
be avoided, as to avoid such complaints automake should have access to
context and information only available at make runtime -- which is clearly
impossible).

* NG-NEWS: Document that Automake-NG can be weaker than mainline Automake
in diagnostic and early error detection; and also explain why it is so.
* automake.in (check_typos): Don't check for possible typos in the
'_DEPENDENCIES'.
Consequently, don't bother calling 'set_seen' ...
(handle_per_suffix_test): ... on the 'LOG_DEPENDENCIES' variables ...
(scan_aclocal_m4): ... nor on the 'CONFIG_STATUS_DEPENDENCIES' and
'CONFIGURE_DEPENDENCIES' variables ...
(handle_tags): ... nor on the 'TAGS_DEPENDENCIES' variable ...
(handle_ltlibraries): ... nor on the 'libfoo_la_DEPENDENCIES' nor
the 'EXTRA_libfoo_la_DEPENDENCIES' variables ...
(handle_libraries): ... nor on the 'libfoo_a_DEPENDENCIES' nor the
'EXTRA_libfoo_a_DEPENDENCIES' variables ...
(handle_programs): ... nor on the 'program_DEPENDENCIES' nor the
'EXTRA_program_DEPENDENCIES' variables.
* t/vartypos.sh, t/vartypo2.sh: Relax accordingly.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 NG-NEWS       |    6 ++++++
 automake.in   |   21 ++-------------------
 t/vartypo2.sh |    9 +--------
 t/vartypos.sh |   14 +-------------
 4 files changed, 10 insertions(+), 40 deletions(-)

diff --git a/NG-NEWS b/NG-NEWS
index 74b0721..c67a580 100644
--- a/NG-NEWS
+++ b/NG-NEWS
@@ -59,6 +59,12 @@ Warnings and diagnostic
 * The 'portability-recursive' warning category is obsolete, and has been
   removed.
 
+* Automake-NG is less smart than mainline Automake in detecting some kind
+  of possible typos or suspicious usages at automake runtime.  This is due
+  to the fact that more processing and logic takes place in the generated
+  Makefiles rather than in the automake script, so that the latter has
+  access to less context and information.
+
 Serial testsuite harness (obsolescent)
 ======================================
 
diff --git a/automake.in b/automake.in
index 08815de..ec57787 100644
--- a/automake.in
+++ b/automake.in
@@ -2429,8 +2429,6 @@ sub handle_programs
       reject_var ($xname . '_LIBADD',
                  "use '${xname}_LDADD', not '${xname}_LIBADD'");
 
-      set_seen ($xname . '_DEPENDENCIES');
-      set_seen ('EXTRA_' . $xname . '_DEPENDENCIES');
       set_seen ($xname . '_LDFLAGS');
 
       # Determine program to use for link.
@@ -2541,10 +2539,6 @@ sub handle_libraries
       reject_var ($xlib . '_LDADD',
                  "use '${xlib}_LIBADD', not '${xlib}_LDADD'");
 
-      # Make sure we at look at this.
-      set_seen ($xlib . '_DEPENDENCIES');
-      set_seen ('EXTRA_' . $xlib . '_DEPENDENCIES');
-
       &handle_source_transform ($xlib, $onelib, $obj, $where,
                                NONLIBTOOL => 1, LIBTOOL => 0);
 
@@ -2728,10 +2722,8 @@ sub handle_ltlibraries
       $where->push_context ("while processing Libtool library '$onelib'");
       $where->set (INTERNAL->get);
 
-      # Make sure we look at these.
+      # Make sure we look at this.
       set_seen ($xlib . '_LDFLAGS');
-      set_seen ($xlib . '_DEPENDENCIES');
-      set_seen ('EXTRA_' . $xlib . '_DEPENDENCIES');
 
       # Generate support for conditional object inclusion in
       # libraries.
@@ -2831,7 +2823,7 @@ sub check_typos ()
   # It is ok if the user sets this particular variable.
   set_seen 'AM_LDFLAGS';
 
-  foreach my $primary ('SOURCES', 'LIBADD', 'LDADD', 'LDFLAGS', 'DEPENDENCIES')
+  foreach my $primary ('SOURCES', 'LIBADD', 'LDADD', 'LDFLAGS')
     {
       foreach my $var (variables $primary)
        {
@@ -3581,8 +3573,6 @@ sub handle_tags
                                         TAGSDIRS  => "@tag_deps",
                                         CTAGSDIRS => "@ctag_deps",
                                         CSCOPEDIRS => "@cscope_deps");
-
-       set_seen 'TAGS_DEPENDENCIES';
     }
     elsif (reject_var ('TAGS_DEPENDENCIES',
                       "it doesn't make sense to define 'TAGS_DEPENDENCIES'"
@@ -3831,9 +3821,6 @@ sub scan_aclocal_m4 ()
 {
   my $regen_aclocal = 0;
 
-  set_seen 'CONFIG_STATUS_DEPENDENCIES';
-  set_seen 'CONFIGURE_DEPENDENCIES';
-
   if (-f 'aclocal.m4')
     {
       &define_variable ("ACLOCAL_M4", '$(top_srcdir)/aclocal.m4', INTERNAL);
@@ -4588,10 +4575,6 @@ sub handle_per_suffix_test($)
                        '$(SHELL) $(am__config_aux_dir)/test-driver',
                        INTERNAL);
     }
-  # Required to avoid spurious errors like:
-  # ``variable 'LOG_DEPENDENCIES' is defined but no program or
-  #   library has 'LOG' as canonical name (possible typo)''
-  set_seen ("${pfx}LOG_DEPENDENCIES");
 }
 
 # is_valid_test_extension ($EXT)
diff --git a/t/vartypo2.sh b/t/vartypo2.sh
index 9b52df6..9c1b6d7 100755
--- a/t/vartypo2.sh
+++ b/t/vartypo2.sh
@@ -31,8 +31,6 @@ libfoo_la_SOURCES = unused
 nodist_libfoo_la_SOURCES = unused
 EXTRA_libfoo_la_SOURCES = unused
 libfoo_la_LIBADD = unused
-libfoo_la_DEPENDENCIES = unused
-EXTRA_libfoo_la_DEPENDENCIES = unused
 END
 
 libtoolize
@@ -48,14 +46,9 @@ AUTOMAKE_fails --add-missing
 # 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)
-# Makefile.am:6: warning: variable `EXTRA_libfoo_la_DEPENDENCIES' is defined 
but no program or
-# Makefile.am:6: library has `libfoo_la' as canonical name (possible typo)
-# Makefile.am:5: warning: variable `libfoo_la_DEPENDENCIES' is defined but no 
program or
-# Makefile.am:5: 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` = 6
+test `grep 'variable.*is defined but' stderr | wc -l` = 4
 
 # If we add a global -Wnone, all warnings should disappear.
 $AUTOMAKE -Wnone
diff --git a/t/vartypos.sh b/t/vartypos.sh
index eb924cc..d176d04 100755
--- a/t/vartypos.sh
+++ b/t/vartypos.sh
@@ -29,15 +29,11 @@ nodist_foo_SOURCES = unused
 EXTRA_foo_SOURCES = unused
 foo_LDADD = unused
 foo_LDFLAGS = unused
-foo_DEPENDENCIES = unused
-EXTRA_foo_DEPENDENCIES = unused
 
 libfoo_a_SOURCES = unused
 nodist_libfoo_a_SOURCES = unused
 EXTRA_libfoo_a_SOURCES = unused
 libfoo_a_LIBADD = unused
-libfoo_a_DEPENDENCIES = unused
-EXTRA_libfoo_a_DEPENDENCIES = unused
 END
 
 $ACLOCAL
@@ -62,18 +58,10 @@ AUTOMAKE_fails -Wno-extra-portability
 # 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)
-# Makefile.am:14: warning: variable 'EXTRA_libfoo_a_DEPENDENCIES' is defined 
but no program or
-# Makefile.am:14: library has 'libfoo_a' as canonical name (possible typo)
-# Makefile.am:7: warning: variable 'EXTRA_foo_DEPENDENCIES' is defined but no 
program or
-# Makefile.am:7: library has 'foo' as canonical name (possible typo)
-# Makefile.am:6: warning: variable 'foo_DEPENDENCIES' is defined but no 
program or
-# Makefile.am:6: library has 'foo' as canonical name (possible typo)
-# Makefile.am:13: warning: variable 'libfoo_a_DEPENDENCIES' is defined but no 
program or
-# Makefile.am:13: library has 'libfoo_a' 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` = 13
+test `grep 'variable.*is defined but' stderr | wc -l` = 9
 
 # If we add a global -Wnone, all warnings should disappear.
 $AUTOMAKE -Wnone
-- 
1.7.9.5




reply via email to

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