Merge branch 'msvc' into maint
[platform/upstream/automake.git] / tests / libtoo10.test
1 #! /bin/sh
2 # Copyright (C) 2007, 2009  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 # Make sure .libs directories are removed for _PROGRAMS.
18 # Report from Guillermo Ontañón.
19
20 required=libtoolize
21 . ./defs || Exit 1
22 set -e
23
24 cat >> configure.in << 'END'
25 AM_PROG_AR
26 AC_PROG_LIBTOOL
27 AC_OUTPUT
28 END
29
30 cat > Makefile.am << 'END'
31 lib_LTLIBRARIES = lib/libfoo.la
32 lib_libfoo_la_SOURCES = foo.c
33 bin_PROGRAMS = src/main
34 check_PROGRAMS = check/test
35 src_main_SOURCES = main.c
36 check_test_SOURCES = main.c
37 LDADD = lib/libfoo.la
38 END
39
40 mkdir lib src check
41 cat > foo.c << 'END'
42 int foo () { return 0; }
43 END
44
45 cat > main.c << 'END'
46 extern int foo ();
47 int main () { return foo (); }
48 END
49
50 libtoolize
51 $ACLOCAL
52 $AUTOMAKE --add-missing
53 $AUTOCONF
54 ./configure
55 $MAKE all check
56 $MAKE clean
57 test ! -d src/.libs
58 test ! -d src/_libs
59 test ! -d check/.libs
60 test ! -d check/_libs
61 $MAKE distcheck