* INSTALL, lib/INSTALL, lib/config-ml.in, lib/config.guess,
[automake/plouj.git] / tests / location.test
blobf7042e356933c81b3e7bd795e8cabaeef2e750ad
1 #! /bin/sh
2 # Copyright (C) 2002, 2003 Free Software Foundation, Inc.
4 # This file is part of GNU Automake.
6 # GNU Automake is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3, or (at your option)
9 # any later version.
11 # GNU Automake is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with Automake; see the file COPYING. If not, write to
18 # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 # Boston, MA 02110-1301, USA.
21 # Test for locations in error messages.
23 . ./defs || exit 1
25 set -e
27 cat >> configure.in << 'END'
28 AM_CONDITIONAL([COND1], [true])
29 AM_CONDITIONAL([COND2], [true])
30 AC_PROG_CC
31 AC_PROG_RANLIB
32 END
34 cat > Makefile.am << 'END'
35 bin_PROGRAMS = libfoo.a
36 if COND2
37 lib_LIBRARIES = libfoo.a
38 endif
39 if COND1
40 bin_PROGRAMS += ctags
41 endif
42 VAR = 1 \
43 2 \
46 VAR = 1 \
47 2 \
49 END
51 $ACLOCAL
52 AUTOMAKE_fails
54 # Smash the useless difference of lib file locations.
55 sed 's,^.*lib/am/\([a-z]*\.am\),\1,' stderr >observed
56 cat >expected <<\EOF
57 Makefile.am:12: VAR multiply defined in condition TRUE ...
58 Makefile.am:8: ... `VAR' previously defined here
59 automake: libfoo_a_OBJECTS should not be defined
60 Makefile.am:3: while processing library `libfoo.a'
61 automake: use `libfoo_a_LDADD', not `libfoo_a_LIBADD'
62 Makefile.am:3: while processing library `libfoo.a'
63 library.am: deprecated feature: target `libfoo.a' overrides `libfoo.a$(EXEEXT)'
64 library.am: change your target to read `libfoo.a$(EXEEXT)'
65 Makefile.am:3: while processing library `libfoo.a'
66 program.am: target `libfoo.a$(EXEEXT)' was defined here
67 Makefile.am:1: while processing program `libfoo.a'
68 program.am: redefinition of `libfoo.a$(EXEEXT)'...
69 Makefile.am:1: while processing program `libfoo.a'
70 library.am: ... `libfoo.a' previously defined here
71 Makefile.am:3: while processing library `libfoo.a'
72 tags.am: redefinition of `ctags'...
73 program.am: ... `ctags$(EXEEXT)' previously defined here
74 Makefile.am:6: while processing program `ctags'
75 EOF
77 diff expected observed || exit 1