2 # Copyright (C) 2003-2013 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 libtool convenience libraries.
18 # This example is taken from the manual.
20 required='cc native libtoolize'
23 cat >>configure.ac <<'END'
27 AC_CONFIG_FILES([sub1/Makefile
40 cat >Makefile.am <<'END'
42 lib_LTLIBRARIES = libtop.la
48 bin_PROGRAMS = ltconvtest
49 ltconvtest_SOURCES = test.c
50 ltconvtest_LDADD = libtop.la
56 $(bindir)/ltconvtest$(EXEEXT)
60 cat >sub1/Makefile.am <<'END'
61 noinst_LTLIBRARIES = libsub1.la
62 libsub1_la_SOURCES = sub1.c
65 echo 'int sub1 () { return 1; }' > sub1/sub1.c
67 cat >sub2/Makefile.am <<'END'
69 noinst_LTLIBRARIES = libsub2.la
70 libsub2_la_SOURCES = sub2.c
76 echo 'int sub2 () { return 2; }' > sub2/sub2.c
78 cat >sub2/sub21/Makefile.am <<'END'
79 noinst_LTLIBRARIES = libsub21.la
80 libsub21_la_SOURCES = sub21.c
83 echo 'int sub21 () { return 21; }' > sub2/sub21/sub21.c
85 cat >sub2/sub22/Makefile.am <<'END'
86 noinst_LTLIBRARIES = libsub22.la
87 libsub22_la_SOURCES = sub22.c
90 echo 'int sub22 () { return 22; }' > sub2/sub22/sub22.c
111 $AUTOMAKE --add-missing
113 cwd=$(pwd) || fatal_ "getting current working directory"
115 # Install libraries in lib/, programs in bin/, and the rest in empty/.
116 # (in fact there is no "rest", so as the name imply empty/ is
117 # expected to remain empty).
118 ./configure --prefix="$cwd/empty" --libdir="$cwd/lib" --bindir="$cwd/bin"
122 test -f sub1/libsub1.la
123 test -f sub2/libsub2.la
124 test -f sub2/sub21/libsub21.la
125 test -f sub2/sub22/libsub22.la
131 test -f lib/libtop.la
133 test -f installcheck-ok
134 rm -f installcheck-ok
136 find empty -type f -print > empty.lst
137 test -s empty.lst && { cat empty.lst; exit 1; }
141 test ! -e sub1/libsub1.la
142 test ! -e sub2/libsub2.la
143 test ! -e sub2/sub21/libsub21.la
144 test ! -e sub2/sub22/libsub22.la
148 test -f installcheck-ok
149 rm -f installcheck-ok
153 find $d -type f -print > $d.lst
154 test -s $d.lst && { cat $d.lst; exit 1; }
155 : For shells with busted 'set -e'.