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], [])' > m4/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 ()
49 AUTOMAKE_after_aclocal
54 AUTOMAKE_after_aclocal
55 # aclocal.m4 and Makefile.in should not have been updated, so 'foo'
57 is_newest foo aclocal.m4 Makefile.in sub/Makefile.in
60 $ACLOCAL -I m4 --force
61 is_newest aclocal.m4 foo
62 # We still use --no-force for automake, but since aclocal.m4 has
63 # changed all Makefile.ins should be updated.
64 AUTOMAKE_after_aclocal
65 is_newest Makefile.in aclocal.m4 foo
66 is_newest sub/Makefile.in aclocal.m4 foo
72 AUTOMAKE_after_aclocal
73 # aclocal.m4 should have been updated, although its contents haven't
75 is_newest aclocal.m4 m4/somedefs.m4
76 is_newest Makefile.in m4/somedefs.m4
77 is_newest sub/Makefile.in m4/somedefs.m4
83 AUTOMAKE_after_aclocal
84 # Only ./Makefile.in should change.
85 is_newest Makefile.in fragment.inc
86 is_newest fragment.inc aclocal.m4
87 is_newest fragment.inc sub/Makefile.in
89 grep README Makefile.in && exit 1
95 # Even if no dependency change, the content changed.
96 is_newest Makefile.in README
97 is_newest README sub/Makefile.in
99 grep README Makefile.in
107 # Only sub/Makefile.in should change.
108 is_newest foo aclocal.m4
109 is_newest foo Makefile.in
110 is_newest sub/Makefile.in foo