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-315-g9a1218d
Date: Thu, 07 Jun 2012 12:49:15 +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=9a1218de5ff036965a95e06c91acd03cf1b3e3bb

The branch, ng/master has been updated
       via  9a1218de5ff036965a95e06c91acd03cf1b3e3bb (commit)
       via  dd96c943d4edfecbf34ee1d30d0c288e70d10f40 (commit)
       via  b58ba55a17179a66ed277f2344448cc819116aa5 (commit)
       via  0a5dd0b2f92fcac769cfdb3bf2ffac80bcfa5a42 (commit)
      from  49e41f451425a238200321f9bfbe147c7f4ad98a (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 9a1218de5ff036965a95e06c91acd03cf1b3e3bb
Merge: dd96c94 b58ba55
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jun 7 12:17:00 2012 +0200

    Merge branch 'ng/check-typos-at-make-runtime' into ng/master
    
    * ng/check-typos-at-make-runtime:
      [ng] vartypos: update news file
      [ng] vartypos: allow user to whitelist false positives

commit b58ba55a17179a66ed277f2344448cc819116aa5
Author: Stefano Lattarini <address@hidden>
Date:   Wed Jun 6 18:12:49 2012 +0200

    [ng] vartypos: update news file
    
    * NG-NEWS (Warnings and diagnostic):  Diagnostic about typos in
    '_SOURCES' etc. variable is issued at make, not automake, runtime,
    and when undesired can be silenced (totally or partly) with the
    help of the 'AM_VARTYPOS_WHITELIST' variable.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 0a5dd0b2f92fcac769cfdb3bf2ffac80bcfa5a42
Author: Stefano Lattarini <address@hidden>
Date:   Wed Jun 6 17:37:12 2012 +0200

    [ng] vartypos: allow user to whitelist false positives
    
    It can happen that the user legitimately employs what the new Automake-NG
    make runtime warnings would take for an erroneous usage; for example, GNU
    coreutils 8.17 uses something like this is its build system (see file
    'src/Makefile.am'):
    
        # Shared files.
        copy_LDADD =
        cp_LDADD += $(copy_LDADD)
        ginstall_LDADD += $(copy_LDADD)
        mv_LDADD += $(copy_LDADD)
        ...
        copy_LDADD += $(LIB_SELINUX)       # for selinux use
        copy_LDADD += $(LIB_CLOCK_GETTIME) # for gettime, settime, ...
        copy_LDADD += $(LIB_XATTR)         # for various xattr functions
        ...
    
    Since it does so without having a program called 'copy' anywhere, the
    Makefile generated by Automake complains like this:
    
        Makefile:2544: variable 'copy_LDADD' is defined but no program
        Makefile:2544:   or library has 'copy' as canonical name
        Makefile:2546: *** Some Automake-NG error occurred.  Stop.
    
    Instead of forcing the coreutils developers to heavily edit their Makefile,
    it is better to allow them to whitelist their suspicious usages as correct.
    And such a whitelisting capability is a good idea even regardless this
    motivation, since it helps enforcing the Autotools- philosophy "the user is
    always right" (as long as he is explicit enough).
    
    * lib/am/check-typos (.am/vartypos/whitelisted-vars ): Also add the contents
    of the user-reserved variable '$(AM_VARTYPOS_WHITELIST)' (note that it is
    still undocumented).
    * t/vartypos-whitelist.sh: New test.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

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

Summary of changes:
 NG-NEWS                  |   14 ++++++
 lib/am/check-typos.am    |    4 ++
 lib/am/parallel-tests.am |   11 +----
 t/vartypos-whitelist.sh  |  109 ++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 129 insertions(+), 9 deletions(-)
 create mode 100755 t/vartypos-whitelist.sh

diff --git a/NG-NEWS b/NG-NEWS
index 1e3c464..8b2ad53 100644
--- a/NG-NEWS
+++ b/NG-NEWS
@@ -68,6 +68,20 @@ Warnings and diagnostic
   Makefiles rather than in the automake script, so that the latter has
   access to less context and information.
 
+* Diagnostic about possible typos in '_SOURCES', '_LIBADD, '_LDFLAGS',
+  '_LDADD' and '_DEPENDENCIES' variables is now done at make runtime
+  rather than at automake runtime.  In case some (or all) such diagnostic
+  is undesired, it can be silenced by adding the affected variables to
+  the 'AM_VARTYPOS_WHITELIST' variable, as in:
+
+        bin_PROGRAMS = cp mv
+        copy_LDADD = -lselinux -lrt -acl
+        cp_LDADD = $(copy_LDADD)
+        mv_LDADD = $(copy_LDADD)
+        # Without this, the generated Makefile would complain that
+        # no program or library has 'copy' as canonical name.
+        AM_VARTYPOS_WHITELIST = copy_LDADD
+
 
 Serial testsuite harness (obsolescent)
 ======================================
diff --git a/lib/am/check-typos.am b/lib/am/check-typos.am
index 82e19c9..71769c9 100644
--- a/lib/am/check-typos.am
+++ b/lib/am/check-typos.am
@@ -48,6 +48,10 @@ ifeq "$(am__using_parallel_tests)" "yes"
              $(filter %_LOG_DRIVER,$(.VARIABLES)))
 endif
 
+# Allow the user to add his own whitelist.
+# FIXME: this is still undocumtend!
+.am/vartypos/whitelisted-vars += $(AM_VARTYPOS_WHITELIST)
+
 # Canonicalized names of programs and libraries (vanilla or libtool) that
 # have been declared.
 .am/vartypos/known-canon-proglibs := \
diff --git a/lib/am/parallel-tests.am b/lib/am/parallel-tests.am
index b628853..8f4c0f9 100644
--- a/lib/am/parallel-tests.am
+++ b/lib/am/parallel-tests.am
@@ -28,13 +28,6 @@ include color-tests.am
 ## Used by (at least) 'check-typos.am'.
 am__using_parallel_tests := yes
 
-am__maybe_invalid_test_extensions = \
-  $(if \
-    $(strip $1), \
-    $(foreach am__e, $1,\
-      $(warning invalid test extension: '$(am__e)')) \
-    $(error invalid test extensions have been encountered))
-
 am__is_xfail_test = \
   $(if $(filter-out $(am__xfail_test_bases), \
                     $(patsubst $(srcdir)/%,%,$(1))),no,yes)
@@ -94,8 +87,8 @@ am__tpfx = \
 ## FIXME: this will pick up the default from the environment; are we sure
 ## FIXME: we want that?
 !TEST_EXTENSIONS ?= .test
-!$(call am__maybe_invalid_test_extensions,\
-!  $(filter-out .%,$(TEST_EXTENSIONS)))
+!$(foreach am__e,$(filter-out .%,$(TEST_EXTENSIONS)),\
+!     $(call am__error,invalid test extension: '$(am__e)'))
 !$(foreach am__e,$(TEST_EXTENSIONS), \
 !  $(eval $(call am__handle_per_suffix_test,$(am__e))))
 ## It is *imperative* that the "empty" suffix goes last.  Otherwise, a
diff --git a/t/vartypos-whitelist.sh b/t/vartypos-whitelist.sh
new file mode 100755
index 0000000..7c718b2
--- /dev/null
+++ b/t/vartypos-whitelist.sh
@@ -0,0 +1,109 @@
+#! /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 allow the use to whitelist false positives in our
+# detection of variable typos.  Inspired by the GNU coreutils (8.17)
+# build system.
+
+required=cc
+. ./defs || Exit 1
+
+cat >> configure.ac << 'END'
+AC_PROG_CC
+AM_PROG_AR
+AC_PROG_RANLIB
+AC_SUBST([LIBSELINUX], ["$l_selinux"])
+AC_OUTPUT
+END
+
+l_selinux=; export l_selinux=
+
+cat > Makefile.am <<'END'
+bin_PROGRAMS = cp mv rm
+noinst_LIBRARIES = libremove.a libcopy.a
+remove_LDADD = libremove.a
+copy_LDADD = libcopy.a
+copy_LDADD += @LIBSELINUX@
+cp_LDADD = $(copy_LDADD)
+rm_LDADD = $(remove_LDADD)
+mv_LDADD = $(copy_LDADD) $(remove_LDADD)
+AM_VARTYPOS_WHITELIST = copy_LDADD remove_LDADD
+EXTRA_DIST = libcopy.h libremove.h
+END
+
+echo 'extern void cu_copy (void);' > libcopy.h
+echo 'extern void cu_remove (void);' > libremove.h
+
+cat > libcopy.c << 'END'
+#include "libcopy.h"
+void cu_copy (void) { return; }
+END
+
+cat > libremove.c << 'END'
+#include "libremove.h"
+void cu_remove (void) { return; }
+END
+
+cat > cp.c <<'END'
+#include "libcopy.h"
+int main (void)
+{
+  cu_copy ();
+  return 0;
+}
+END
+
+cat > rm.c <<'END'
+#include "libremove.h"
+int main (void)
+{
+  cu_remove ();
+  return 0;
+}
+END
+
+cat > mv.c <<'END'
+#include "libremove.h"
+#include "libcopy.h"
+int main (void)
+{
+  cu_copy ();
+  cu_remove ();
+  return 0;
+}
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+$MAKE
+
+# If we remove the whitelisting, failure ensues.
+$MAKE AM_VARTYPOS_WHITELIST= 2>stderr && { cat stderr; Exit 1; }
+cat stderr >&2
+grep "'copy_LDADD' is defined but no program" stderr
+grep "'remove_LDADD' is defined but no program" stderr
+$MAKE AM_VARTYPOS_WHITELIST=remove_LDADD 2>stderr && { cat stderr; Exit 1; }
+cat stderr >&2
+grep "'copy_LDADD' is defined but no program" stderr
+grep "remove_LDADD" stderr && Exit 1
+
+# Sanity check the distribution.
+$MAKE distcheck
+
+:


hooks/post-receive
-- 
GNU Automake



reply via email to

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