2 # Copyright (C) 2002-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 # Test for locations in error messages.
21 cat >> configure.ac
<< 'END'
22 AM_CONDITIONAL
([COND1
], [true
])
23 AM_CONDITIONAL
([COND2
], [true
])
29 cat > Makefile.am
<< 'END'
30 bin_PROGRAMS
= libfoo.a
32 lib_LIBRARIES
= libfoo.a
48 # Smash the useless difference of lib file locations.
49 smash_useless_diffs
()
51 # FIXME: we could get rid of the second 's,,,' once we improve our
53 sed -e "s,^$am_amdir/\\([a-z]*\.am\\),\\1," \
54 -e "s,^automake-$APIVERSION:,automake:," ${1+"$@"};
58 AUTOMAKE_fails
-Wno-error
60 smash_useless_diffs stderr
>observed
62 # Apparently useless use of sed here required to avoid spuriously
63 # triggering some maintainer-checks failures.
64 sed 's/^> //' > expected
<< 'END'
65 > Makefile.am
:12: warning
: VAR multiply defined
in condition TRUE ...
66 > Makefile.am
:8: ...
'VAR' previously defined here
67 > automake
: error
: libfoo_a_OBJECTS should not be defined
68 > Makefile.am
:3: while processing library
'libfoo.a'
69 > automake
: error
: use
'libfoo_a_LDADD', not
'libfoo_a_LIBADD'
70 > Makefile.am
:3: while processing library
'libfoo.a'
71 > library.am
: warning
: deprecated feature
: target
'libfoo.a' overrides
'libfoo.a$(EXEEXT)'
72 > library.am
: change your target to
read 'libfoo.a$(EXEEXT)'
73 > Makefile.am
:3: while processing library
'libfoo.a'
74 > program.am
: target
'libfoo.a$(EXEEXT)' was defined here
75 > Makefile.am
:1: while processing program
'libfoo.a'
76 > program.am
: warning
: redefinition of
'libfoo.a$(EXEEXT)' ...
77 > Makefile.am
:1: while processing program
'libfoo.a'
78 > library.am
: ...
'libfoo.a' previously defined here
79 > Makefile.am
:3: while processing library
'libfoo.a'
80 > tags.am
: warning
: redefinition of
'ctags' ...
81 > program.am
: ...
'ctags$(EXEEXT)' previously defined here
82 > Makefile.am
:6: while processing program
'ctags'
87 diff expected observed ||
exit 1
89 AUTOMAKE_fails
-Werror
90 smash_useless_diffs stderr
>observed
91 (echo 'automake: warnings are treated as errors' && cat expected
) > t
97 diff expected observed ||
exit 1