tests: give few aclocal tests more significant names
[automake.git] / t / libtool3.sh
blobb86c84fdd613bc701c12d7889153265f22a3bbbb
1 #! /bin/sh
2 # Copyright (C) 2002-2012 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)
7 # any later version.
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 # Try to build and package a program linked to a Libtool library.
18 # Also make sure we do not bloat the Makefile with unneeded rules.
20 required='cc libtoolize'
21 . test-init.sh
23 cat >> configure.ac << 'END'
24 AC_PROG_CC
25 AM_PROG_AR
26 AM_PROG_LIBTOOL
27 AC_OUTPUT
28 END
30 cat > Makefile.am << 'END'
31 lib_LTLIBRARIES = lib0.la liba/liba.la
32 lib0_la_SOURCES = 0.c
33 liba_liba_la_SOURCES = liba/a.c
35 bin_PROGRAMS = 1
36 1_SOURCES = sub/1.c
37 1_LDADD = lib0.la liba/liba.la
38 END
40 mkdir liba sub
42 cat > 0.c << 'END'
43 int
44 zero (void)
46 return 0;
48 END
50 cat > sub/1.c << 'END'
51 int zero ();
53 int
54 main (void)
56 return zero ();
58 END
60 cat > liba/a.c << 'END'
61 int
62 a (void)
64 return 'a';
66 END
68 # Use --copy to workaround a bug in Cygwin's 'cp -p' during distcheck.
69 # (This bug is already exhibited by subobj9.sh.) In brief: Cygwin's
70 # 'cp -p' tries to preserve group and owner of the source and fails
71 # to do so under normal accounts. With --copy we ensure we own all files.
73 libtoolize --force --copy
74 $ACLOCAL
75 $AUTOCONF
76 $AUTOMAKE --add-missing --copy
78 # We need explicit rules to build 1.o and a.lo. Make sure
79 # Automake did not output additional rules for 1.lo and and a.lo.
80 $FGREP '1.o:' Makefile.in
81 $FGREP '1.lo:' Makefile.in && exit 1
82 $FGREP 'a.o:' Makefile.in && exit 1
83 $FGREP 'a.lo:' Makefile.in
85 ./configure
87 $MAKE
88 $MAKE distcheck