2 # Copyright (C) 2003, 2004 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 2, or (at your option)
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 conditional libtool libraries.
22 # This combines two examples from the manual.
24 required
='libtoolize gcc'
29 cat >>configure.
in <<'END'
30 AM_CONDITIONAL([WANT_LIBFOO], [true])
31 AM_CONDITIONAL([WANT_LIBBAR], [false])
32 AC_SUBST([WANTEDLIBS], ['lib1foo.la lib1bar.la'])
38 cat >Makefile.am
<<'END'
39 EXTRA_LTLIBRARIES = lib1foo.la lib1bar.la lib3bar.la
40 lib_LTLIBRARIES = $(WANTEDLIBS)
41 lib1foo_la_SOURCES = foo.c
42 lib1foo_la_LDFLAGS = -rpath '$(libdir)'
43 lib1bar_la_SOURCES = bar.c
44 lib1bar_la_LDFLAGS = -rpath '$(libdir)'
45 lib3bar_la_SOURCES = bar.c
48 lib_LTLIBRARIES += lib2foo.la
49 check_LTLIBRARIES = lib3foo.la
52 lib_LTLIBRARIES += lib2bar.la
54 lib2foo_la_SOURCES = foo.c
55 lib2bar_la_SOURCES = bar.c
56 lib3foo_la_SOURCES = foo.c
59 echo 'int one () { return 1; }' >foo.c
60 echo 'int two () { return 2; }' >bar.c
67 $AUTOMAKE --add-missing
69 # Install libraries in lib/, and the rest in empty/.
70 # (in fact there is no "rest", so as the name imply empty/ is
71 # expected to remain empty).
72 .
/configure
--prefix=`pwd`/empty
--libdir=`pwd`/lib
88 test -f lib
/lib1foo.la
89 test -f lib
/lib1bar.la
90 test -f lib
/lib2foo.la
91 test ! -f lib
/lib3foo.la
92 find empty
-type f
-print > empty.lst
94 test 0 = `wc -l < empty.lst`
97 find lib
-type f
-print > lib.lst
98 test 0 = `wc -l < lib.lst`