Merge branch 'micro' into maint
[platform/upstream/automake.git] / t / ltinstloc.sh
1 #!/bin/sh
2 # Copyright (C) 2008-2013 Free Software Foundation, Inc.
3 #
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)
7 # any later version.
8 #
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.
13 #
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/>.
16
17 # Test for libtool errors for multiple install locations, esp. with nobase.
18
19
20 required='libtoolize'
21 . test-init.sh
22
23 cat >>configure.ac <<'END'
24 AC_PROG_CC
25 AM_PROG_AR
26 AC_PROG_LIBTOOL
27 AM_CONDITIONAL([COND], [:])
28 AC_OUTPUT
29 END
30
31 cat >Makefile.am <<'END'
32 if COND
33 lib_LTLIBRARIES = liba1.la sub/liba2.la
34 #else
35 pkglib_LTLIBRARIES = liba1.la
36 nobase_lib_LTLIBRARIES = sub/liba2.la
37 endif
38 AUTOMAKE_OPTIONS = subdir-objects
39 END
40
41 libtoolize
42 $ACLOCAL
43 $AUTOCONF
44 AUTOMAKE_fails --add-missing
45
46 # libtoolize might have installed config.guess and config.sub already,
47 # and autom4te might warn about bugs in Libtool macro files, so filter
48 # out warnings about Makefile.am only.  We don't care in this test
49 # whether automake installs config.guess, config.sub and ar-lib.
50
51 cat >expected <<'END'
52 Makefile.am:5: error: sub/liba2.la multiply defined in condition COND
53 Makefile.am:5: 'sub/liba2.la' should be installed below 'lib' in condition COND ...
54 Makefile.am:2: ... and should also be installed in 'lib' in condition COND.
55 Makefile.am:4: error: liba1.la multiply defined in condition COND
56 Makefile.am:4: 'liba1.la' should be installed in 'pkglib' in condition COND ...
57 Makefile.am:2: ... and should also be installed in 'lib' in condition COND.
58 Makefile.am:2: Libtool libraries can be built for only one destination
59 END
60
61 grep '^Makefile.am' stderr | diff - expected
62
63 sed 's/#//' < Makefile.am > t
64 mv -f t Makefile.am
65
66 $AUTOMAKE
67 grep ' -rpath \$(libdir)/sub' Makefile.in
68
69 :