source: trunk/essentials/sys-devel/automake-1.10/tests/depcomp7.test

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

automake 1.10

File size: 2.1 KB
Line 
1#! /bin/sh
2# Copyright (C) 2006 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# Check dependency generation (libtool case).
22
23required='libtoolize'
24. ./defs || exit 1
25
26set -e
27
28cat >> configure.in << 'END'
29AC_PROG_CC
30AM_PROG_CC_C_O
31AM_PROG_LIBTOOL
32AC_CONFIG_FILES(sub2/Makefile)
33AC_OUTPUT
34END
35
36mkdir sub sub2 sub2/sub3
37
38cat >Makefile.am <<'END'
39SUBDIRS = sub2
40bin_PROGRAMS = foo
41foo_SOURCES = foo.c sub/bar.c foo.h sub/bar.h
42foo_LDADD = sub2/libbaz.la
43END
44
45cat >sub2/Makefile.am <<'END'
46AUTOMAKE_OPTIONS = subdir-objects
47noinst_LTLIBRARIES = libbaz.la
48libbaz_la_SOURCES = baz.c sub3/ba3.c baz.h sub3/ba3.h
49END
50
51cat >foo.c <<'END'
52#include "foo.h"
53#include "sub2/baz.h"
54#include <stdlib.h>
55int main() { printf("foo"); return bar() + baz(); }
56END
57
58cat >foo.h <<'END'
59#include <stdio.h>
60#include "sub/bar.h"
61END
62
63cat >sub/bar.c <<'END'
64#include "sub/bar.h"
65int bar() { return 0; }
66END
67
68touch sub2/sub3/ba3.h
69
70cat >sub/bar.h <<'END'
71#include <stdio.h>
72extern int bar();
73END
74
75cat >sub2/baz.c <<'END'
76#include "baz.h"
77int baz() { return 0; }
78END
79
80cat >sub2/baz.h <<'END'
81extern int baz();
82END
83
84cat >sub2/sub3/ba3.c <<'END'
85#include "ba3.h"
86int ba3() { return 0; }
87END
88
89libtoolize
90$ACLOCAL
91$AUTOCONF
92$AUTOMAKE -a
93
94./configure --enable-dependency-tracking
95$MAKE
96
97# check that dependency tracking works
98if grep 'depmode=none' Makefile; then :
99else
100 cd sub2
101 $sleep
102 echo 'choke me' > sub3/ba3.h
103 if $MAKE; then exit 1; fi
104fi
105:
Note: See TracBrowser for help on using the repository browser.