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