2 # Copyright (C) 2003, 2006, 2011 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.in << 'END'
24 AC_CONFIG_FILES([sub/Makefile])
30 cat >> Makefile.am << 'END'
38 echo 'AC_DEFUN([SOME_DEFS], [])' > m4/somedefs.m4
44 # Automake will take aclocal.m4 to be newer if it has the same timestamp
45 # as Makefile.in. Avoid the confusing by sleeping.
56 # aclocal.m4 and Makefile.in should not have been updated, so `foo'
58 test `ls -1t aclocal.m4 Makefile.in sub/Makefile.in foo | sed 1q` = foo
61 $ACLOCAL -I m4 --force
62 test `ls -1t aclocal.m4 foo | sed 1q` = aclocal.m4
63 # We still use --no-force for automake, but since aclocal.m4 has
64 # changed all Makefile.ins should be updated.
67 test `ls -1t Makefile.in foo | sed 1q` = Makefile.in
68 test `ls -1t sub/Makefile.in foo | sed 1q` = sub/Makefile.in
78 # aclocal.m4 should have been updated, although its contents haven't changed.
79 test `ls -1t aclocal.m4 foo | sed 1q` = aclocal.m4
80 test `ls -1t Makefile.in foo | sed 1q` = Makefile.in
81 test `ls -1t sub/Makefile.in foo | sed 1q` = sub/Makefile.in
89 # Only ./Makefile.in should change.
90 test `ls -1t aclocal.m4 foo | sed 1q` = foo
91 test `ls -1t Makefile.in foo | sed 1q` = Makefile.in
92 test `ls -1t sub/Makefile.in foo | sed 1q` = foo
94 grep README Makefile.in && Exit 1
101 # Even if no dependency change, the content changed.
102 test `ls -1t Makefile.in foo | sed 1q` = Makefile.in
103 test `ls -1t sub/Makefile.in foo | sed 1q` = foo
105 grep README Makefile.in
113 # Only sub/Makefile.in should change.
114 test `ls -1t aclocal.m4 foo | sed 1q` = foo
115 test `ls -1t Makefile.in foo | sed 1q` = foo
116 test `ls -1t sub/Makefile.in foo | sed 1q` = sub/Makefile.in