automake-commit
[Top][All Lists]
Advanced

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

[Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11-378-


From: Ralf Wildenhues
Subject: [Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11-378-gf19b076
Date: Sat, 02 Oct 2010 18:38:59 +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=f19b07647af068030866b7bc94710e930a6fccb9

The branch, master has been updated
       via  f19b07647af068030866b7bc94710e930a6fccb9 (commit)
       via  6edafbb503ed5d81f963fb8eeec7595c8158d828 (commit)
      from  f133e575101d91b1160a40c1846ef7bd6d1a6bf2 (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 f19b07647af068030866b7bc94710e930a6fccb9
Author: Ralf Wildenhues <address@hidden>
Date:   Sat Oct 2 20:26:47 2010 +0200

    Coverage and minor fixes for variable typo detection.
    
    * automake.in (check_typos): Remove `EXTRA_' prefix when
    computing canonical name.
    * tests/vartypo2.test, tests/vartypos.test: New tests.
    * tests/Makefile.am (TESTS): Update.
    
    Signed-off-by: Ralf Wildenhues <address@hidden>

commit 6edafbb503ed5d81f963fb8eeec7595c8158d828
Author: Ralf Wildenhues <address@hidden>
Date:   Sat Oct 2 20:25:53 2010 +0200

    Implement EXTRA_maude_DEPENDENCIES for programs and libraries.
    
    * automake.in (handle_programs, handle_libraries)
    (handle_ltlibraries): Mark EXTRA_*_DEPENDENCIES as recognized.
    * doc/automake.texi (Linking, Program and Library Variables)
    (LIBOBJS): Document EXTRA_*_DEPENDENCIES.
    * lib/am/library.am (%LIBRARY%): Also depend on
    $(EXTRA_%XLIBRARY%_DEPENDENCIES).
    * lib/am/ltlibrary.am (%LTLIBRARY%): Also depend on
    (%XLTLIBRARY%_DEPENDENCIES).
    * lib/am/program.am (%PROGRAM%%EXEEXT%): Also depend on
    $(EXTRA_%XPROGRAM%_DEPENDENCIES).
    * tests/extradep.test, tests/extradep2.test: New tests.
    * tests/Makefile.am (TESTS): Update.
    * NEWS: Update.
    Suggested by Eric Blake.
    
    Signed-off-by: Ralf Wildenhues <address@hidden>

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

Summary of changes:
 ChangeLog            |   22 ++++++++++
 NEWS                 |    4 ++
 automake.in          |    5 ++-
 doc/automake.texi    |   23 ++++++++---
 lib/am/library.am    |    4 +-
 lib/am/ltlibrary.am  |    4 +-
 lib/am/program.am    |    4 +-
 tests/Makefile.am    |    4 ++
 tests/Makefile.in    |    4 ++
 tests/extradep.test  |  104 ++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/extradep2.test |   86 +++++++++++++++++++++++++++++++++++++++++
 tests/vartypo2.test  |   71 ++++++++++++++++++++++++++++++++++
 tests/vartypos.test  |   90 +++++++++++++++++++++++++++++++++++++++++++
 13 files changed, 412 insertions(+), 13 deletions(-)
 create mode 100755 tests/extradep.test
 create mode 100755 tests/extradep2.test
 create mode 100755 tests/vartypo2.test
 create mode 100755 tests/vartypos.test

diff --git a/ChangeLog b/ChangeLog
index 90286ac..79b7d39 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,27 @@
 2010-10-02  Ralf Wildenhues  <address@hidden>
 
+       Coverage and minor fixes for variable typo detection.
+       * automake.in (check_typos): Remove `EXTRA_' prefix when
+       computing canonical name.
+       * tests/vartypo2.test, tests/vartypos.test: New tests.
+       * tests/Makefile.am (TESTS): Update.
+
+       Implement EXTRA_maude_DEPENDENCIES for programs and libraries.
+       * automake.in (handle_programs, handle_libraries)
+       (handle_ltlibraries): Mark EXTRA_*_DEPENDENCIES as recognized.
+       * doc/automake.texi (Linking, Program and Library Variables)
+       (LIBOBJS): Document EXTRA_*_DEPENDENCIES.
+       * lib/am/library.am (%LIBRARY%): Also depend on
+       $(EXTRA_%XLIBRARY%_DEPENDENCIES).
+       * lib/am/ltlibrary.am (%LTLIBRARY%): Also depend on
+       (%XLTLIBRARY%_DEPENDENCIES).
+       * lib/am/program.am (%PROGRAM%%EXEEXT%): Also depend on
+       $(EXTRA_%XPROGRAM%_DEPENDENCIES).
+       * tests/extradep.test, tests/extradep2.test: New tests.
+       * tests/Makefile.am (TESTS): Update.
+       * NEWS: Update.
+       Suggested by Eric Blake.
+
        tests: avoid running into timing issues due to sanity change.
        * tests/acloca10.test, tests/acloca18.test, tests/aclocal9.test:
        Insert strategic sleep before aclocal reruns, to ensure files
diff --git a/NEWS b/NEWS
index 9314bdd..121989f 100644
--- a/NEWS
+++ b/NEWS
@@ -29,6 +29,10 @@ New in 1.11a:
     at least one second has passed, to avoid time stamp issues with makefile
     rules rerunning autotools programs.
 
+  - For programs and libraries, automake now detects EXTRA_foo_DEPENDENCIES and
+    adds them to the normal list of dependencies, but without overwriting the
+    foo_DEPENDENCIES variable, which is normally computed by automake.
+
 Bugs fixed in 1.11a:
 
   - Lots of minor bugfixes.
diff --git a/automake.in b/automake.in
index 9cbe6c1..ef9b511 100644
--- a/automake.in
+++ b/automake.in
@@ -2678,6 +2678,7 @@ sub handle_programs
                  "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.
@@ -2789,6 +2790,7 @@ sub handle_libraries
 
       # 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);
@@ -2968,6 +2970,7 @@ sub handle_ltlibraries
       # Make sure we look at these.
       set_seen ($xlib . '_LDFLAGS');
       set_seen ($xlib . '_DEPENDENCIES');
+      set_seen ('EXTRA_' . $xlib . '_DEPENDENCIES');
 
       # Generate support for conditional object inclusion in
       # libraries.
@@ -3070,7 +3073,7 @@ sub check_typos ()
 
          for my $cond ($var->conditions->conds)
            {
-             $varname =~ /^(?:nobase_)?(?:dist_|nodist_)?(.*)_[[:alnum:]]+$/;
+             $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)")
diff --git a/doc/automake.texi b/doc/automake.texi
index 1bd327d..487f230 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -4698,11 +4698,12 @@ this purpose.
 
 @cindex @code{_DEPENDENCIES}, defined
 @vindex maude_DEPENDENCIES
address@hidden EXTRA_maude_DEPENDENCIES
 It is also occasionally useful to have a program depend on some other
 target that is not actually part of that program.  This can be done
-using the @address@hidden variable.  Each program
-depends on the contents of such a variable, but no further
-interpretation is done.
+using either the @address@hidden or the
address@hidden@var{prog}_DEPENDENCIES} variable.  Each program depends on
+the contents both variables, but no further interpretation is done.
 
 Since these dependencies are associated to the link rule used to
 create the programs they should normally list files used by the link
@@ -4725,6 +4726,10 @@ generated.
 @ref{Conditional Sources} shows a situation where @code{_DEPENDENCIES}
 may be used.
 
+The @address@hidden may be useful for cases where
+you merely want to augment the @command{automake}-generated
address@hidden@var{prog}_DEPENDENCIES} rather than replacing it.
+
 @cindex @code{LDADD} and @option{-l}
 @cindex @option{-l} and @code{LDADD}
 We recommend that you avoid using @option{-l} options in @code{LDADD}
@@ -5592,6 +5597,7 @@ option, so they should not be mode-specific options 
(those belong to
 the compiler or linker flags).  @xref{Libtool Flags}.
 
 @item maude_DEPENDENCIES
address@hidden EXTRA_maude_DEPENDENCIES
 It is also occasionally useful to have a target (program or library)
 depend on some other file that is not actually part of that target.
 This can be done using the @code{_DEPENDENCIES} variable.  Each
@@ -5622,6 +5628,10 @@ compilation using an @code{AC_SUBST} variable that 
contains a list of
 objects.  @xref{Conditional Sources}, and @ref{Conditional Libtool
 Sources}.
 
+The @code{EXTRA_*_DEPENDENCIES} variable may be useful for cases where
+you merely want to augment the @command{automake}-generated
address@hidden variable rather than replacing it.
+
 @item maude_LINK
 You can override the linker on a per-program basis.  By default the
 linker is chosen according to the languages used by the program.  For
@@ -5832,9 +5842,10 @@ However there is no need to list the corresponding 
sources in
 automatically adds @samp{$(LIBOBJS)} and @samp{$(ALLOCA)} to the
 dependencies, and it will discover the list of corresponding source
 files automatically (by tracing the invocations of the
address@hidden Autoconf macros).  However, if you have already
-defined @samp{*_DEPENDENCIES} explicitly for an unrelated reason, then
-you have to add these variables manually.
address@hidden Autoconf macros).  If you have already defined
address@hidden explicitly for an unrelated reason, then you
+either need to add these variables manually, or use
address@hidden instead of @samp{*_DEPENDENCIES}.
 
 These variables are usually used to build a portability library that
 is linked with all the programs of the project.  We now review a
diff --git a/lib/am/library.am b/lib/am/library.am
index ce94e5e..db096c7 100644
--- a/lib/am/library.am
+++ b/lib/am/library.am
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994, 1995, 1996, 1999, 2003, 2009 Free Software
+## Copyright (C) 1994, 1995, 1996, 1999, 2003, 2009, 2010 Free Software
 ## Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
@@ -14,7 +14,7 @@
 
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
-%LIBRARY%: $(%XLIBRARY%_OBJECTS) $(%XLIBRARY%_DEPENDENCIES) %DIRSTAMP%
+%LIBRARY%: $(%XLIBRARY%_OBJECTS) $(%XLIBRARY%_DEPENDENCIES) 
$(EXTRA_%XLIBRARY%_DEPENDENCIES) %DIRSTAMP%
        %SILENT%-rm -f %LIBRARY%
        %VERBOSE%$(%XLIBRARY%_AR) %LIBRARY% $(%XLIBRARY%_OBJECTS) 
$(%XLIBRARY%_LIBADD)
        %SILENT%$(RANLIB) %LIBRARY%
diff --git a/lib/am/ltlibrary.am b/lib/am/ltlibrary.am
index 9455234..3cd2941 100644
--- a/lib/am/ltlibrary.am
+++ b/lib/am/ltlibrary.am
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994, 1995, 1996, 2003, 2005, 2008, 2009 Free Software
+## Copyright (C) 1994, 1995, 1996, 2003, 2005, 2008, 2009, 2010 Free Software
 ## Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
@@ -14,5 +14,5 @@
 
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
-%LTLIBRARY%: $(%XLTLIBRARY%_OBJECTS) $(%XLTLIBRARY%_DEPENDENCIES) %DIRSTAMP%
+%LTLIBRARY%: $(%XLTLIBRARY%_OBJECTS) $(%XLTLIBRARY%_DEPENDENCIES) 
$(EXTRA_%XLTLIBRARY%_DEPENDENCIES) %DIRSTAMP%
        %VERBOSE%$(%XLINK%) %RPATH% $(%XLTLIBRARY%_OBJECTS) 
$(%XLTLIBRARY%_LIBADD) $(LIBS)
diff --git a/lib/am/program.am b/lib/am/program.am
index 7e568e7..c0e188f 100644
--- a/lib/am/program.am
+++ b/lib/am/program.am
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994, 1995, 1996, 1997, 2001, 2003, 2005, 2009
+## Copyright (C) 1994, 1995, 1996, 1997, 2001, 2003, 2005, 2009, 2010
 ## Free Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
@@ -14,7 +14,7 @@
 
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
-%PROGRAM%%EXEEXT%: $(%XPROGRAM%_OBJECTS) $(%XPROGRAM%_DEPENDENCIES) %DIRSTAMP%
+%PROGRAM%%EXEEXT%: $(%XPROGRAM%_OBJECTS) $(%XPROGRAM%_DEPENDENCIES) 
$(EXTRA_%XPROGRAM%_DEPENDENCIES) %DIRSTAMP%
 ## Remove program before linking.  Otherwise the link will fail if the
 ## program is running somewhere.  FIXME: this could be a loss if
 ## you're using an incremental linker.  Maybe we should think twice?
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 6352a11..aff077e 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -345,6 +345,8 @@ extra9.test \
 extra10.test \
 extra11.test \
 extra12.test \
+extradep.test \
+extradep2.test \
 f90only.test \
 flavor.test \
 flibs.test \
@@ -798,6 +800,8 @@ vala5.test \
 vars.test \
 vars3.test \
 vartar.test \
+vartypos.test \
+vartypo2.test \
 version.test \
 version2.test \
 version3.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 8d5622c..e1d72ac 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -556,6 +556,8 @@ extra9.test \
 extra10.test \
 extra11.test \
 extra12.test \
+extradep.test \
+extradep2.test \
 f90only.test \
 flavor.test \
 flibs.test \
@@ -1009,6 +1011,8 @@ vala5.test \
 vars.test \
 vars3.test \
 vartar.test \
+vartypos.test \
+vartypo2.test \
 version.test \
 version2.test \
 version3.test \
diff --git a/tests/extradep.test b/tests/extradep.test
new file mode 100755
index 0000000..d84182d
--- /dev/null
+++ b/tests/extradep.test
@@ -0,0 +1,104 @@
+#! /bin/sh
+# Copyright (C) 2010 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 EXTRA_*_DEPENDENCIES.  See extradep2 for libtool variant.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_SUBST([deps], [bardep])
+AM_CONDITIONAL([COND], [test -n "$cond"])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+noinst_LIBRARIES = libfoo.a
+EXTRA_libfoo_a_DEPENDENCIES = libfoodep
+libfoodep:
+       @echo making $@
+       @: > $@
+CLEANFILES = libfoodep
+
+bin_PROGRAMS = foo bar
+EXTRA_foo_DEPENDENCIES = foodep
+if COND
+EXTRA_foo_DEPENDENCIES += foodep2
+endif
+bar_LDADD = libfoo.a
+EXTRA_bar_DEPENDENCIES = $(deps)
+
+EXTRA_DIST = foodep bardep
+
+bar-is-newer-than-libfoo.a:
+       test `ls -1t bar$(EXEEXT) libfoo.a | sed q` = bar$(EXEEXT)
+END
+
+cat >libfoo.c <<'END'
+int libfoo () { return 0; }
+END
+
+cat >foo.c <<'END'
+int main () { return 0; }
+END
+
+cat >bar.c <<'END'
+extern int libfoo ();
+int main () { return libfoo (); }
+END
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+./configure cond=yes
+
+# hypotheses:
+# EXTRA_*_DEPENDENCIES are honored.
+# conditionals and substitutions are honored.
+# *_DEPENDENCIES are not overwritten by their EXTRA_* counterparts.
+
+: >foodep
+: >foodep2
+: >bardep
+$MAKE >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep 'making libfoodep' stdout
+
+rm -f foodep
+$MAKE && Exit 1
+: >foodep
+
+rm -f foodep2
+$MAKE && Exit 1
+: >foodep2
+
+rm -f bardep
+$MAKE && Exit 1
+: >bardep
+
+$MAKE
+$sleep
+touch libfoo.a
+$MAKE
+$MAKE bar-is-newer-than-libfoo.a
+
+$MAKE distcheck
+
+:
diff --git a/tests/extradep2.test b/tests/extradep2.test
new file mode 100755
index 0000000..7d72e82
--- /dev/null
+++ b/tests/extradep2.test
@@ -0,0 +1,86 @@
+#! /bin/sh
+# Copyright (C) 2010 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 EXTRA_*_DEPENDENCIES, libtool version; see extradep.test.
+
+required=libtoolize
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_LIBTOOL
+AC_SUBST([deps], [bardep])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+noinst_LTLIBRARIES = libfoo.la
+EXTRA_libfoo_la_DEPENDENCIES = libfoodep
+libfoodep:
+       @echo making $@
+       @: > $@
+CLEANFILES = libfoodep
+
+bin_PROGRAMS = bar
+bar_LDADD = libfoo.la
+EXTRA_bar_DEPENDENCIES = $(deps)
+
+EXTRA_DIST = bardep
+
+bar-is-newer-than-libfoo.la:
+       test `ls -1t bar$(EXEEXT) libfoo.la | sed q` = bar$(EXEEXT)
+END
+
+cat >libfoo.c <<'END'
+int libfoo () { return 0; }
+END
+
+cat >bar.c <<'END'
+extern int libfoo ();
+int main () { return libfoo (); }
+END
+
+libtoolize
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+./configure
+
+# hypothesis: EXTRA_*_DEPENDENCIES are honored.
+
+: >foodep
+: >foodep2
+: >bardep
+$MAKE >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep 'making libfoodep' stdout
+
+rm -f bardep
+$MAKE && Exit 1
+: >bardep
+
+$MAKE
+$sleep
+touch libfoo.la
+$MAKE
+$MAKE bar-is-newer-than-libfoo.la
+
+$MAKE distcheck
+
+:
diff --git a/tests/vartypo2.test b/tests/vartypo2.test
new file mode 100755
index 0000000..5b87404
--- /dev/null
+++ b/tests/vartypo2.test
@@ -0,0 +1,71 @@
+#! /bin/sh
+# Copyright (C) 2010 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
+
+set -e
+
+cat >>configure.in <<'END'
+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
+libfoo_la_DEPENDENCIES = unused
+EXTRA_libfoo_la_DEPENDENCIES = 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)
+# 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)
+
+
+test -z "`grep 'as canonical' stderr | grep -v ' .libfoo_la. '`"
+test `grep 'variable.*is defined but' stderr | wc -l` = 6
+
+# 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/tests/vartypos.test b/tests/vartypos.test
new file mode 100755
index 0000000..73e7c55
--- /dev/null
+++ b/tests/vartypos.test
@@ -0,0 +1,90 @@
+#! /bin/sh
+# Copyright (C) 2010 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.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >>configure.in <<'END'
+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
+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
+AUTOMAKE_fails
+# 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)
+# 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)
+
+test -z "`grep 'as canonical' stderr | grep -v ' .foo. ' | grep -v ' 
.libfoo_a. '`"
+test `grep 'variable.*is defined but' stderr | wc -l` = 13
+
+# If we add a global -Wnone, all warnings should disappear.
+$AUTOMAKE -Wnone
+
+# Likewise, if matching programs or libraries are defined.
+cat >>Makefile.am <<'END'
+bin_PROGRAMS = foo
+lib_LIBRARIES = libfoo.a
+END
+
+$AUTOMAKE
+
+:


hooks/post-receive
-- 
GNU Automake



reply via email to

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