2 # Copyright (C) 2002, 2004, 2009 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 # 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='libtoolize gcc'
25 cat >> configure.in << 'END'
32 cat > Makefile.am << 'END'
33 lib_LTLIBRARIES = lib0.la liba/liba.la
35 liba_liba_la_SOURCES = liba/a.c
39 1_LDADD = lib0.la liba/liba.la
52 cat > sub/1.c << 'END'
62 cat > liba/a.c << 'END'
70 # Use --copy to workaround a bug in Cygwin's `cp -p' during distcheck.
71 # (This bug is already exhibited by subobj9.test.) In brief: Cygwin's
72 # `cp -p' tries to preserve group and owner of the source and fails
73 # to do so under normal accounts. With --copy we ensure we own all files.
75 libtoolize --force --copy
78 $AUTOMAKE --add-missing --copy
80 # We need explicit rules to build 1.o and a.lo. Make sure
81 # Automake did not output additional rules for 1.lo and and a.lo.
82 $FGREP '1.o:' Makefile.in
83 $FGREP '1.lo:' Makefile.in && Exit 1
84 $FGREP 'a.o:' Makefile.in && Exit 1
85 $FGREP 'a.lo:' Makefile.in