2 # Copyright (C) 2010-2012 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # Make sure we warn about possible variable typos when we should,
23 cat >>configure.ac <<'END'
29 cat >Makefile.am <<'END'
30 libfoo_la_SOURCES = unused
31 nodist_libfoo_la_SOURCES = unused
32 EXTRA_libfoo_la_SOURCES = unused
33 libfoo_la_LIBADD = unused
34 libfoo_la_DEPENDENCIES = unused
35 EXTRA_libfoo_la_DEPENDENCIES = unused
40 AUTOMAKE_fails --add-missing
41 # The expected diagnostic is:
42 # automake: warnings are treated as errors
43 # Makefile.am:3: warning: variable 'EXTRA_libfoo_la_SOURCES' is defined but no program or
44 # Makefile.am:3: library has 'libfoo_la' as canonical name (possible typo)
45 # Makefile.am:1: warning: variable 'libfoo_la_SOURCES' is defined but no program or
46 # Makefile.am:1: library has 'libfoo_la' as canonical name (possible typo)
47 # Makefile.am:2: warning: variable 'nodist_libfoo_la_SOURCES' is defined but no program or
48 # Makefile.am:2: library has 'libfoo_la' as canonical name (possible typo)
49 # Makefile.am:4: warning: variable 'libfoo_la_LIBADD' is defined but no program or
50 # Makefile.am:4: library has 'libfoo_la' as canonical name (possible typo)
51 # Makefile.am:6: warning: variable 'EXTRA_libfoo_la_DEPENDENCIES' is defined but no program or
52 # Makefile.am:6: library has 'libfoo_la' as canonical name (possible typo)
53 # Makefile.am:5: warning: variable 'libfoo_la_DEPENDENCIES' is defined but no program or
54 # Makefile.am:5: library has 'libfoo_la' as canonical name (possible typo)
56 grep 'as canonical' stderr | grep -v ' .libfoo_la. ' && exit 1
57 test $(grep -c 'variable.*is defined but' stderr) -eq 6
59 # If we add a global -Wnone, all warnings should disappear.
62 # Likewise, if matching programs or libraries are defined.
63 cat >>Makefile.am <<'END'
64 lib_LTLIBRARIES = libfoo.la