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