source: vendor/automake/1.9.6/tests/libobj12.test

Last change on this file was 3086, checked in by bird, 18 years ago

automake 1.9.6

File size: 1.8 KB
Line 
1#! /bin/sh
2# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
3#
4# This file is part of GNU Automake.
5#
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)
9# any later version.
10#
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.
15#
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.
20
21
22# Test if a file can be mentioned in LIBOBJS and explicitly.
23# (See libobj13.test for the LTLIBRARIES check.)
24
25. ./defs || exit 1
26set -e
27
28cat >> configure.in << 'END'
29AC_PROG_CC
30AC_PROG_RANLIB
31AC_LIBOBJ([foo])
32AC_LIBOBJ([bar])
33AC_OUTPUT
34END
35
36cat > Makefile.am << 'END'
37noinst_LIBRARIES = libfoo.a libbar.a
38noinst_PROGRAMS = p1 p2
39
40libfoo_a_SOURCES =
41libfoo_a_LIBADD = @LIBOBJS@
42
43libbar_a_SOURCES = foo.c
44
45p1_SOURCES =
46p1_LDADD = @LIBOBJS@
47
48p2_SOURCES = bar.c
49END
50
51: > foo.c
52: > bar.c
53
54$ACLOCAL
55$AUTOMAKE
56
57# This however should be diagnosed, since foo.c and bar.c are in @LIBOBJS@.
58echo 'libfoo_a_SOURCES += foo.c' >> Makefile.am
59echo 'p1_SOURCES += bar.c' >> Makefile.am
60AUTOMAKE_fails
61$FGREP foo.c stderr
62$FGREP bar.c stderr
63
64# Global `LDADD' can also come into play.
65cat > Makefile.am << 'END'
66noinst_PROGRAMS = a b
67LDADD = @LIBOBJS@
68END
69$AUTOMAKE
70grep 'a_DEPENDENCIES.*LIBOBJS' Makefile.in
71echo 'a_SOURCES = foo.c' >> Makefile.am
72AUTOMAKE_fails
73$FGREP foo.c stderr
Note: See TracBrowser for help on using the repository browser.