source: trunk/essentials/sys-devel/automake-1.8/tests/aclocal7.test

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

automake 1.8.5

File size: 3.0 KB
Line 
1#! /bin/sh
2# Copyright (C) 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., 59 Temple Place - Suite 330,
19# Boston, MA 02111-1307, USA.
20
21# Make sure aclocal does not overwrite aclocal.m4 needlessly.
22# Also make sure automake --no-force does not overwrite Makefile.in needlessly.
23
24. ./defs || exit 1
25
26set -e
27
28cat >> configure.in << 'END'
29SOME_DEFS
30AC_CONFIG_FILES([sub/Makefile])
31END
32
33mkdir sub
34: > sub/Makefile.am
35
36cat >> Makefile.am << 'END'
37SUBDIRS = sub
38include fragment.inc
39END
40
41: > fragment.inc
42
43mkdir m4
44echo 'AC_DEFUN([SOME_DEFS], [])' > m4/somedefs.m4
45
46$sleep
47
48$ACLOCAL -I m4
49
50# Automake will take aclocal.m4 to be newer if it has the same timestamp
51# as Makefile.in. Avoid the confusing by sleeping.
52$sleep
53
54$AUTOMAKE --no-force
55
56$sleep
57
58touch foo
59$ACLOCAL -I m4
60$AUTOMAKE --no-force
61
62# aclocal.m4 and Makefile.in should not have been updated, so `foo'
63# should be younger
64test `ls -1t aclocal.m4 Makefile.in sub/Makefile.in foo | sed 1q` = foo
65
66$sleep
67$ACLOCAL -I m4 --force
68test `ls -1t aclocal.m4 foo | sed 1q` = aclocal.m4
69# We still use --no-force for automake, but since aclocal.m4 has
70# changed all Makefile.ins should be updated.
71$sleep
72$AUTOMAKE --no-force
73test `ls -1t Makefile.in foo | sed 1q` = Makefile.in
74test `ls -1t sub/Makefile.in foo | sed 1q` = sub/Makefile.in
75
76touch m4/somedefs.m4
77$sleep
78touch foo
79$sleep
80$ACLOCAL -I m4
81$sleep
82$AUTOMAKE --no-force
83
84# aclocal.m4 should have been updated, although its contents haven't changed.
85test `ls -1t aclocal.m4 foo | sed 1q` = aclocal.m4
86test `ls -1t Makefile.in foo | sed 1q` = Makefile.in
87test `ls -1t sub/Makefile.in foo | sed 1q` = sub/Makefile.in
88
89touch fragment.inc
90$sleep
91touch foo
92$ACLOCAL -I m4
93$AUTOMAKE --no-force
94# Only ./Makefile.in should change.
95test `ls -1t aclocal.m4 foo | sed 1q` = foo
96test `ls -1t Makefile.in foo | sed 1q` = Makefile.in
97test `ls -1t sub/Makefile.in foo | sed 1q` = foo
98
99grep README Makefile.in && exit 1
100
101: > README
102$sleep
103touch foo
104$AUTOMAKE --no-force
105# Even if no dependency change, the content changed.
106test `ls -1t Makefile.in foo | sed 1q` = Makefile.in
107test `ls -1t sub/Makefile.in foo | sed 1q` = foo
108
109grep README Makefile.in
110
111: > sub/Makefile.in
112$sleep
113touch foo
114$ACLOCAL -I m4
115$AUTOMAKE --no-force
116# Only sub/Makefile.in should change.
117test `ls -1t aclocal.m4 foo | sed 1q` = foo
118test `ls -1t Makefile.in foo | sed 1q` = foo
119test `ls -1t sub/Makefile.in foo | sed 1q` = sub/Makefile.in
Note: See TracBrowser for help on using the repository browser.