2 # Copyright (C) 2003-2012 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # Make sure aclocal does not overwrite aclocal.m4 needlessly.
18 # Also make sure automake --no-force does not overwrite Makefile.in needlessly.
22 cat >> configure.ac
<< 'END'
24 AC_CONFIG_FILES
([sub
/Makefile
])
30 cat >> Makefile.am
<< 'END'
38 echo 'AC_DEFUN([SOME_DEFS], [])' > m
4/somedefs.
m4
40 # Automake will take aclocal.m4 to be newer if it has the same timestamp
41 # as Makefile.in. Avoid the confusing by sleeping.
42 AUTOMAKE_after_aclocal
()
48 # aclocal will rewrite aclocal.m4 unless the input files are all older than the
49 # existing aclocal.m4 -- sleep to ensure somedefs.m4 has an older timestamp
50 # than the aclocal.m4 that the next aclocal call will generate.
54 AUTOMAKE_after_aclocal
59 AUTOMAKE_after_aclocal
60 # aclocal.m4 and Makefile.in should not have been updated, so 'foo'
62 is_newest foo aclocal.
m4 Makefile.
in sub
/Makefile.
in
65 $ACLOCAL -I m4 --force
66 is_newest aclocal.
m4 foo
67 # We still use --no-force for automake, but since aclocal.m4 has
68 # changed all Makefile.ins should be updated.
69 AUTOMAKE_after_aclocal
70 is_newest Makefile.
in aclocal.
m4 foo
71 is_newest sub
/Makefile.
in aclocal.
m4 foo
77 AUTOMAKE_after_aclocal
78 # aclocal.m4 should have been updated, although its contents haven't
80 is_newest aclocal.
m4 m
4/somedefs.
m4
81 is_newest Makefile.
in m
4/somedefs.
m4
82 is_newest sub
/Makefile.
in m
4/somedefs.
m4
88 AUTOMAKE_after_aclocal
89 # Only ./Makefile.in should change.
90 is_newest Makefile.
in fragment.inc
91 is_newest fragment.inc aclocal.
m4
92 is_newest fragment.inc sub
/Makefile.
in
94 grep README Makefile.
in && exit 1
100 # Even if no dependency change, the content changed.
101 is_newest Makefile.
in README
102 is_newest README sub
/Makefile.
in
104 grep README Makefile.
in
112 # Only sub/Makefile.in should change.
113 is_newest foo aclocal.
m4
114 is_newest foo Makefile.
in
115 is_newest sub
/Makefile.
in foo