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

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

automake 1.10

File size: 3.0 KB
Line 
1#! /bin/sh
2# Copyright (C) 2003, 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# 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$sleep
93$ACLOCAL -I m4
94$AUTOMAKE --no-force
95# Only ./Makefile.in should change.
96test `ls -1t aclocal.m4 foo | sed 1q` = foo
97test `ls -1t Makefile.in foo | sed 1q` = Makefile.in
98test `ls -1t sub/Makefile.in foo | sed 1q` = foo
99
100grep README Makefile.in && exit 1
101
102: > README
103$sleep
104touch foo
105$sleep
106$AUTOMAKE --no-force
107# Even if no dependency change, the content changed.
108test `ls -1t Makefile.in foo | sed 1q` = Makefile.in
109test `ls -1t sub/Makefile.in foo | sed 1q` = foo
110
111grep README Makefile.in
112
113: > sub/Makefile.in
114$sleep
115touch foo
116$sleep
117$ACLOCAL -I m4
118$AUTOMAKE --no-force
119# Only sub/Makefile.in should change.
120test `ls -1t aclocal.m4 foo | sed 1q` = foo
121test `ls -1t Makefile.in foo | sed 1q` = foo
122test `ls -1t sub/Makefile.in foo | sed 1q` = sub/Makefile.in
Note: See TracBrowser for help on using the repository browser.