2 # Copyright (C) 2002-2017 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 <https://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 sed -e "s,^$am_amdir/\\([a-z]*\.am\\),\\1," \
52 -e "s,^automake-$APIVERSION:,automake:," ${1+"$@"};
56 AUTOMAKE_fails
-Wno-error
58 smash_useless_diffs stderr
>observed
60 # Apparently useless use of sed here required to avoid spuriously
61 # triggering some maintainer-checks failures.
62 sed 's/^> //' > expected
<< 'END'
63 > Makefile.am
:12: warning
: VAR multiply defined
in condition TRUE ...
64 > Makefile.am
:8: ...
'VAR' previously defined here
65 > automake
: error
: libfoo_a_OBJECTS should not be defined
66 > Makefile.am
:3: while processing library
'libfoo.a'
67 > automake
: error
: use
'libfoo_a_LDADD', not
'libfoo_a_LIBADD'
68 > Makefile.am
:3: while processing library
'libfoo.a'
69 > library.am
: warning
: deprecated feature
: target
'libfoo.a' overrides
'libfoo.a$(EXEEXT)'
70 > library.am
: change your target to
read 'libfoo.a$(EXEEXT)'
71 > Makefile.am
:3: while processing library
'libfoo.a'
72 > program.am
: target
'libfoo.a$(EXEEXT)' was defined here
73 > Makefile.am
:1: while processing program
'libfoo.a'
74 > program.am
: warning
: redefinition of
'libfoo.a$(EXEEXT)' ...
75 > Makefile.am
:1: while processing program
'libfoo.a'
76 > library.am
: ...
'libfoo.a' previously defined here
77 > Makefile.am
:3: while processing library
'libfoo.a'
78 > tags.am
: warning
: redefinition of
'ctags' ...
79 > program.am
: ...
'ctags$(EXEEXT)' previously defined here
80 > Makefile.am
:6: while processing program
'ctags'
85 diff expected observed ||
exit 1
87 AUTOMAKE_fails
-Werror
88 smash_useless_diffs stderr
>observed
89 (echo 'automake: warnings are treated as errors' && cat expected
) > t
95 diff expected observed ||
exit 1