2 # Copyright (C) 2011-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 # Test remake rules when m4 files get renamed.
21 cat >> configure.ac <<'END'
26 cat > Makefile.am <<'END'
27 ACLOCAL_AMFLAGS = -I m4
30 test '$(the_answer)' -eq 42
35 cat > m4/macros.m4 <<'END'
36 AC_DEFUN([MY_MACRO], [FOO])
39 cat > m4/foo.m4 <<'END'
40 AC_DEFUN([FOO], [the_answer=42; AC_SUBST([the_answer])])
50 # Rename one file at the time.
52 mv m4/foo.m4 m4/bar.m4
53 using_gmake || $MAKE Makefile
56 ls -l $distdir $distdir/*
57 test -f $distdir/m4/bar.m4
58 test ! -f $distdir/m4/foo.m4
60 mv m4/macros.m4 m4/defs.m4
61 using_gmake || $MAKE Makefile
64 ls -l $distdir $distdir/*
65 test -f $distdir/m4/defs.m4
66 test ! -f $distdir/m4/macros.m4
68 # Rename both files at once.
70 mv m4/bar.m4 m4/quux.m4
71 mv m4/defs.m4 acinclude.m4
72 using_gmake || $MAKE Makefile
75 ls -l $distdir $distdir/*
76 test -f $distdir/m4/quux.m4
77 test -f $distdir/acinclude.m4
78 test ! -f $distdir/m4/foo.m4
79 test ! -f $distdir/m4/bar.m4
80 test ! -f $distdir/m4/macros.m4
81 test ! -f $distdir/m4/defs.m4