2 # Copyright (C) 2002, 2003, 2010 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 # Test for locations in error messages.
23 cat >> configure.in << 'END'
24 AM_CONDITIONAL([COND1], [true])
25 AM_CONDITIONAL([COND2], [true])
30 cat > Makefile.am << 'END'
31 bin_PROGRAMS = libfoo.a
33 lib_LIBRARIES = libfoo.a
48 AUTOMAKE_fails -Wno-error
50 # Smash the useless difference of lib file locations.
51 sed 's,^.*lib/am/\([a-z]*\.am\),\1,' stderr >observed
53 Makefile.am:12: warning: VAR multiply defined in condition TRUE ...
54 Makefile.am:8: ... `VAR' previously defined here
55 automake: error: libfoo_a_OBJECTS should not be defined
56 Makefile.am:3: while processing library `libfoo.a'
57 automake: error: use `libfoo_a_LDADD', not `libfoo_a_LIBADD'
58 Makefile.am:3: while processing library `libfoo.a'
59 library.am: warning: deprecated feature: target `libfoo.a' overrides `libfoo.a$(EXEEXT)'
60 library.am: change your target to read `libfoo.a$(EXEEXT)'
61 Makefile.am:3: while processing library `libfoo.a'
62 program.am: target `libfoo.a$(EXEEXT)' was defined here
63 Makefile.am:1: while processing program `libfoo.a'
64 program.am: warning: redefinition of `libfoo.a$(EXEEXT)' ...
65 Makefile.am:1: while processing program `libfoo.a'
66 library.am: ... `libfoo.a' previously defined here
67 Makefile.am:3: while processing library `libfoo.a'
68 tags.am: warning: redefinition of `ctags' ...
69 program.am: ... `ctags$(EXEEXT)' previously defined here
70 Makefile.am:6: while processing program `ctags'
73 diff expected observed || Exit 1
75 AUTOMAKE_fails -Werror
76 sed 's,^.*lib/am/\([a-z]*\.am\),\1,' stderr >observed
77 ( echo 'automake: warnings are treated as errors'; cat expected ) \
78 | diff - observed || Exit 1