2 # Copyright (C) 2010, 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 # Test basic remake rules for Makefiles, for a *VPATH build*.
18 # This testcase checks dependency of generated Makefile from Makefile.am,
19 # configure.ac, acinclude.m4, aclocal.m4, and extra m4 files considered
21 # Keep this in sync with sister test `remake8a.test', which performs the
22 # same checks for a in-tree build.
26 mv -f configure.
in configure.stub
28 cat > Makefile.am
<<'END'
38 cat configure.stub
- > configure.
in <<'END'
48 srcdir
='..' # To make syncing with remake8a.test easier.
59 # Modify just Makefile.am.
63 cat > $srcdir/Makefile.am
<<'END'
70 test ! -r $(srcdir)/foo
75 using_gmake ||
$MAKE Makefile
84 # Modify Makefile.am and configure.in.
88 cat > $srcdir/Makefile.am
<<'END'
92 test ! -r $(srcdir)/bar
96 cat $srcdir/configure.stub
- > $srcdir/configure.
in <<'END'
97 AC_CONFIG_FILES([quux])
98 AC_SUBST([QUUX], [Zardoz])
102 cat > $srcdir/quux.
in <<'END'
106 using_gmake ||
$MAKE Makefile
115 # Modify Makefile.am to add a directory of extra m4 files
116 # considered by aclocal.
122 cat > $srcdir/Makefile.am
<<'END'
123 ACLOCAL_AMFLAGS = -I m4
127 test x'$(QUUX)' = x'%Foo%'
130 $MAKE # This should place aclocal flags in Makefile.
131 grep '.*-I m4' Makefile
# Sanity check.
133 # Modify configure.in and aclocal.m4.
137 cat $srcdir/configure.stub
- > $srcdir/configure.
in <<'END'
138 AC_CONFIG_FILES([quux])
143 cat >> $srcdir/aclocal.
m4 <<'END'
144 AC_DEFUN([MY_CUSTOM_MACRO], [AC_SUBST([QUUX], [%Foo%])])
152 # Modify Makefile.am, remove aclocal.m4, and add a new m4 file to
153 # the directory of extra m4 files considered by aclocal. This new
154 # file should now provide a macro required by configure.in and that
155 # was previously provided by aclocal.m4.
159 sed 's/%Foo%/%Bar%/g' $srcdir/Makefile.am
> t
160 mv -f t
$srcdir/Makefile.am
161 cat $srcdir/Makefile.am
162 rm -f $srcdir/aclocal.
m4
163 cat > $srcdir/m
4/blah.
m4 <<'END'
164 AC_DEFUN([MY_CUSTOM_MACRO], [AC_SUBST([QUUX], [%Bar%])])
172 # Modify Makefile.am, remove all the extra m4 files to considered
173 # by aclocal, and add an acinclude.m4 file. This last file should
174 # now provide a macro required by configure.in, and that was
175 # previously provided by the extra m4 files considered by aclocal.
179 rm -f $srcdir/m
4/*.
m4
180 sed 's/%Bar%/%Quux%/g' $srcdir/Makefile.am
> t
181 mv -f t
$srcdir/Makefile.am
182 cat $srcdir/Makefile.am
183 cat > $srcdir/acinclude.
m4 <<'END'
184 AC_DEFUN([MY_CUSTOM_MACRO], [AC_SUBST([QUUX], [%Quux%])])