+2011-05-03 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests: check some remake features with non-GNU make too
+ * tests/acloca14.test ($required): Drop "GNUmake". This test
+ works as-is with non-GNU make implementations.
+ * tests/remake1a.test: Likewise.
+ * tests/aclocal4.test ($required): Drop "GNUmake".
+ Modify the test to have it work also with non-GNU make.
+ * tests/remake5.test: Likewise.
+ * tests/remake8a.test: Likewise.
+ * tests/remake8b.test: Likewise.
+ * tests/remake9a.test: Likewise.
+ * tests/remake9b.test: Likewise.
+ * tests/remake9c.test: Likewise.
+ * tests/remake9d.test: Likewise.
+ * tests/remake10a.test: Likewise.
+ * tests/remake10b.test: Likewise.
+ * tests/remake10c.test: Likewise.
+ * tests/remake12.test: ($required): Drop "GNUmake".
+ Adapt the test to make it work also with non-GNU make (if
+ it supports an "include" directive).
+
2011-05-01 Stefano Lattarini <stefano.lattarini@gmail.com>
tests: extend tests on dependency tracking with VPATH
# Make sure m4_included files are also scanned for definitions.
# Report from Phil Edwards.
-required=GNUmake
. ./defs || Exit 1
cat >> configure.in << 'END'
# Make sure dependencies on aclocal.m4 are set correctly.
# Report from Jim Meyering.
-# We need GNU make for the `rebuild rules' to be triggered.
-required=GNUmake
. ./defs || Exit 1
cat >>configure.in <<EOF
$MAKE check-not-foo
# Update one of the macros. This should cause ./configure, Makefile.in,
-# Makefile, lib/Makefile.in, and lib/Makfile to be updated. This assumes
-# GNU make.
+# Makefile, lib/Makefile.in, and lib/Makefile to be updated.
cat >m4/mymacro.m4 <<'EOF'
AC_DEFUN([MY_MACRO], [AC_LIBOBJ([foo])])
EOF
+using_gmake || $MAKE
$MAKE check-foo
+
+:
# configure.ac.
# Keep in sync with sister tests `remake10b.test' and `remake10c.test'.
-required=GNUmake
. ./defs || Exit 1
magic1=::MagicStringOne::
magic2=__MagicStringTwo__
magic3=%%MagicStringThree%%
+if using_gmake; then
+ remake="$MAKE nil"
+else
+ remake="$MAKE Makefile"
+fi
+
cat >> configure.in <<END
m4_include([foo.m4])
AC_SUBST([FINGERPRINT], [my_fingerprint])
$sleep
echo "m4_define([my_fingerprint], [$magic1])" > $top_srcdir/foo.m4
- $MAKE nil
+ $remake
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile
$sleep
echo "m4_define([my_fingerprint], [$magic2])" > $top_srcdir/foo.m4
- $MAKE nil
+ $remake
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile && Exit 1
$FGREP $magic2 Makefile
$sleep
echo "m4_include([bar.m4])" > $top_srcdir/foo.m4
echo "m4_define([my_fingerprint], [$magic3])" > $top_srcdir/bar.m4
- $MAKE nil
+ $remake
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile && Exit 1
$FGREP $magic2 Makefile && Exit 1
$sleep
echo "m4_define([my_fingerprint], [$magic1])" > $top_srcdir/bar.m4
- $MAKE nil
+ $remake
$FGREP $magic2 Makefile && Exit 1
$FGREP $magic3 Makefile && Exit 1
$FGREP $magic1 Makefile
$sleep
echo "m4_define([my_fingerprint], [DummyValue])" > $top_srcdir/foo.m4
+ using_gmake || $remake
$MAKE distcheck
$FGREP $magic1 Makefile && Exit 1 # sanity check
$FGREP $magic2 Makefile && Exit 1 # likewise
# Makefile.am.
# Keep in sync with sister tests `remake10a.test' and `remake10c.test'.
-required=GNUmake
. ./defs || Exit 1
magic1=::MagicStringOne::
magic2=__MagicStringTwo__
magic3=%%MagicStringThree%%
+if using_gmake; then
+ remake="$MAKE nil"
+else
+ remake="$MAKE Makefile"
+fi
+
cat >> configure.in <<'END'
AC_OUTPUT
END
$sleep
echo "FINGERPRINT = $magic1" > $top_srcdir/foo.am
- $MAKE nil
+ $remake
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile
$sleep
echo "FINGERPRINT = $magic2" > $top_srcdir/foo.am
- $MAKE nil
+ $remake
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile && Exit 1
$FGREP $magic2 Makefile
$sleep
echo 'include $(top_srcdir)/bar.am' > $top_srcdir/foo.am
echo "FINGERPRINT = $magic3" > $top_srcdir/bar.am
- $MAKE nil
+ $remake
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile && Exit 1
$FGREP $magic2 Makefile && Exit 1
$sleep
echo "FINGERPRINT = $magic1" > $top_srcdir/bar.am
- $MAKE nil
+ $remake
$FGREP $magic2 Makefile && Exit 1
$FGREP $magic3 Makefile && Exit 1
$FGREP $magic1 Makefile
$sleep
echo "FINGERPRINT = DummyValue" > $top_srcdir/foo.am
+ using_gmake || $remake
$MAKE distcheck
$FGREP $magic1 Makefile && Exit 1 # sanity check
$FGREP $magic2 Makefile && Exit 1 # likewise
# aclocal.m4.
# Keep in sync with sister tests `remake10a.test' and `remake10b.test'.
-required=GNUmake
. ./defs || Exit 1
magic1=::MagicStringOne::
magic2=__MagicStringTwo__
magic3=%%MagicStringThree%%
+if using_gmake; then
+ remake="$MAKE nil"
+else
+ remake="$MAKE Makefile"
+fi
+
cat >> configure.in <<END
FINGERPRINT='my_fingerprint'
AC_SUBST([FINGERPRINT])
$sleep
echo "AC_DEFUN([my_fingerprint], [$magic1])" > $top_srcdir/m4/foo.m4
- $MAKE nil
+ $remake
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile
$sleep
echo "AC_DEFUN([my_fingerprint], [$magic2])" > $top_srcdir/m4/foo.m4
- $MAKE nil
+ $remake
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile && Exit 1
$FGREP $magic2 Makefile
$sleep
echo "m4_include([m4/bar.m4])" > $top_srcdir/m4/foo.m4
echo "AC_DEFUN([my_fingerprint], [$magic3])" > $top_srcdir/m4/bar.m4
- $MAKE nil
+ $remake
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile && Exit 1
$FGREP $magic2 Makefile && Exit 1
$sleep
echo "AC_DEFUN([my_fingerprint], [$magic1])" > $top_srcdir/m4/bar.m4
- $MAKE nil
+ $remake
$FGREP $magic2 Makefile && Exit 1
$FGREP $magic3 Makefile && Exit 1
$FGREP $magic1 Makefile
$sleep
echo "AC_DEFUN([my_fingerprint], [DummyValue])" > $top_srcdir/m4/foo.m4
echo "AC_DEFUN([AM_UNUSED], [NoSuchMacro])" > $top_srcdir/m4/bar.m4
- $MAKE nil # required to work around limitation of GNU make 3.82
+ using_gmake || $remake
$MAKE distcheck
$FGREP $magic1 Makefile && Exit 1 # sanity check
$FGREP $magic2 Makefile && Exit 1 # likewise
# Test basic remake rules for Makefiles with non-default names
# and/or with multiple sources.
-required=GNUmake
. ./defs || Exit 1
magic1=::MagicStringOne::
magic2=__MagicStringTwo__
magic3=%%MagicStringThree%%
+# See if the user's make implementation support an include directive.
+# We need it in this test.
+echo 'all:; @echo include is supported' > incl.mk
+echo 'include incl.mk' > gnu-style.mk
+echo '.include "incl.mk"' > bsd-style.mk
+if $MAKE -f gnu-style.mk | grep 'include is supported'; then
+ echo "$me: GNU make include style supported"
+ include_zardoz='include zardoz'
+elif $MAKE -f bsd-style.mk | grep 'include is supported'; then
+ echo "$me: BSD make include style supported"
+ include_zardoz='.include "zardoz"'
+else
+ skip_ "make doesn't support any \"include\" directive"
+fi
+
cat > configure.in <<END
AC_INIT([$me], [1.0])
AM_INIT_AUTOMAKE
END
cat > Makefile <<END
-include zardoz
+$include_zardoz
nil:
.PHONY: nil
END
./configure
-$MAKE nil
+if using_gmake; then
+ $MAKE nil
+else
+ $MAKE Makefile
+fi
grep '^#H:' zardoz.in # for debugging
$FGREP $magic1 zardoz
$FGREP $magic1 zardoz.in
END
mv -f t zardoz.am
cat zardoz.am # for debugging
-$MAKE nil
+if using_gmake; then
+ $MAKE nil
+else
+ $MAKE zardoz
+fi
$FGREP my-check zardoz # sanity check
$FGREP $magic1 zardoz zardoz.in && Exit 1
$FGREP $magic2 zardoz
echo 'FOO = dummy' >> quux.am
echo 'BAR = $(BAZ)' > top.in
echo "BAZ = $magic3" > bot.in
+is_gmake || $MAKE zardoz
$MAKE test
$FGREP my-check zardoz # sanity check
$FGREP $magic3 quux.in && Exit 1
# After the remake above, the files `zardoz.am' and `zardoz.in'
# should be no more needed
echo 'endif' > zardoz.am # put in syntax error
+is_gmake || $MAKE zardoz
$MAKE test
rm -f zardoz.in zardoz.am # get rid of them
+is_gmake || $MAKE zardoz
$MAKE test
echo 'FOO = $(BAR)' >> quux.am
+is_gmake || $MAKE zardoz
$MAKE distcheck
:
# Make sure remaking rules in subdir are correctly generated.
# See also sister "grepping" test `remake.test'.
-required=GNUmake
. ./defs || Exit 1
fingerprint='=/FiNgErPrInT/='
# but not all.
# Report from Ralf Corsepius.
-required=GNUmake
. ./defs || Exit 1
+if using_gmake; then
+ remake="$MAKE"
+else
+ remake="$MAKE Makefile"
+fi
+
cat >>configure.in <<'EOF'
AM_MAINTAINER_MODE
m4_include([foo.m4])
# tools are set to false.)
$sleep
touch aclocal.m4 Makefile.am configure.in foo.m4
-$MAKE
+$remake
# Make sure the rebuild rule for Makefile is triggered.
$sleep
echo '# GrEpMe' >>Makefile.in
-$MAKE
+$remake
grep GrEpMe Makefile
# Make sure the rebuild rule for config.status is triggered.
grep 'AUTOCONF.*=.*false' Makefile
: > rebuild_ok
./configure --no-create
-$MAKE
+$remake
grep 'AUTOCONF.*=.*false' Makefile && Exit 1
# Make sure rebuild rules do work if --enable-maintainer-mode is given.
./configure --enable-maintainer-mode
$sleep
echo 'AC_SUBST([YIPPY_YIPPY_YEAH])' >foo.m4
-$MAKE
+$remake
grep YIPPY_YIPPY_YEAH Makefile
# Try the distribution, for completeness.
# Keep this in sync with sister test `remake8b.test', which performs the
# same checks for a VPATH build.
-required=GNUmake
. ./defs || Exit 1
mv -f configure.in configure.stub
CLEANFILES = bar
END
+using_gmake || $MAKE Makefile
$MAKE
cat bar
grep '!Baz!' bar
$sleep
cat > $srcdir/Makefile.am <<'END'
-all-local: quux
check-local:
cat quux
grep '!Zardoz!' quux
!@QUUX@!
END
+using_gmake || $MAKE Makefile
$MAKE
cat quux
grep '!Zardoz!' quux
cat > $srcdir/Makefile.am <<'END'
ACLOCAL_AMFLAGS = -I m4
-all-local: quux
check-local:
cat quux
grep '%Foo%' quux
# Keep this in sync with sister test `remake8a.test', which performs the
# same checks for a in-tree build.
-required=GNUmake
. ./defs || Exit 1
mv -f configure.in configure.stub
CLEANFILES = bar
END
+using_gmake || $MAKE Makefile
$MAKE
cat bar
grep '!Baz!' bar
$sleep
cat > $srcdir/Makefile.am <<'END'
-all-local: quux
check-local:
cat quux
grep '!Zardoz!' quux
!@QUUX@!
END
+using_gmake || $MAKE Makefile
$MAKE
cat quux
grep '!Zardoz!' quux
cat > $srcdir/Makefile.am <<'END'
ACLOCAL_AMFLAGS = -I m4
-all-local: quux
check-local:
cat quux
grep '%Foo%' quux
# Test remake rules when configure.in or its prerequisites change.
# Keep in sync with the other sister tests `remake9*.test'.
-required=GNUmake
. ./defs || Exit 1
magic1=::MagicStringOne::
magic2=__MagicStringTwo__
+if using_gmake; then
+ remake_() { $MAKE nil; }
+else
+ remake_() { $MAKE Makefile && $MAKE foo.sh; }
+fi
+
cat >> configure.in <<END
FINGERPRINT=BadBadBad
AC_SUBST([FINGERPRINT])
$sleep
sed "s/^\\(FINGERPRINT\\)=.*/\\1=$magic1/" $srcdir/configure.in >t
mv -f t $srcdir/configure.in
- $MAKE nil
+ remake_
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile
test x"`./foo.sh`" = x"$magic1"
$sleep
echo 'sed "s/^\\(FINGERPRINT\\)=.*/\\1='$magic2'/"' \
> $srcdir/tweak-configure-in
- $MAKE nil
+ remake_
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile && Exit 1
$FGREP $magic2 Makefile
echo cat > $srcdir/tweak-configure-in # no-op again
sed "s/^\\(FINGERPRINT\\)=.*/\\1=DummyValue/" $srcdir/configure.in >t
mv -f t $srcdir/configure.in
+ using_gmake || remake_
$MAKE distcheck
$FGREP $magic1 Makefile && Exit 1 # sanity check
$FGREP $magic2 Makefile && Exit 1 # likewise
# Test remake rules when Makefile.am or its prerequisites change.
# Keep in sync with the other sister tests `remake9*.test'.
-required=GNUmake
. ./defs || Exit 1
+if using_gmake; then
+ remake_() { $MAKE nil; }
+else
+ remake_() { $MAKE Makefile && $MAKE foo.sh; }
+fi
+
magic1=::MagicStringOne::
magic2=__MagicStringTwo__
$sleep
sed "s/^\\(FINGERPRINT\\) *=.*/\\1 = $magic1/" $srcdir/Makefile.am >t
mv -f t $srcdir/Makefile.am
- $MAKE nil
+ remake_
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile
test x"`./foo.sh`" = x"$magic1"
$sleep
echo 'sed "s/^\\(FINGERPRINT\\) *=.*/\\1 = '$magic2'/"' \
> $srcdir/tweak-makefile-am
- $MAKE nil
+ remake_
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile && Exit 1
$FGREP $magic2 Makefile
echo cat > $srcdir/tweak-makefile-am # no-op again
sed "s/^\\(FINGERPRINT\\) *=.*/\\1 = DummyValue/" $srcdir/Makefile.am >t
mv -f t $srcdir/Makefile.am
+ using_gmake || remake_
$MAKE distcheck
$FGREP $magic1 Makefile && Exit 1 # sanity check
$FGREP $magic2 Makefile && Exit 1 # likewise
# Test remake rules when acinclude.m4 or its prerequisites change.
# Keep in sync with the other sister tests `remake9*.test'.
-required=GNUmake
. ./defs || Exit 1
magic1=::MagicStringOne::
magic2=__MagicStringTwo__
+if using_gmake; then
+ remake_() { $MAKE nil; }
+else
+ remake_() { $MAKE Makefile && $MAKE foo.sh; }
+fi
+
cat >> configure.in <<END
FINGERPRINT='my_fingerprint'
AC_SUBST([FINGERPRINT])
$sleep
echo "AC_DEFUN([my_fingerprint], [$magic1])" > $srcdir/acinclude.m4
- $MAKE nil
+ remake_
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile
test x"`./foo.sh`" = x"$magic1"
$sleep
echo "echo 'AC_DEFUN([my_fingerprint], [$magic2])'" \
> $srcdir/tweak-acinclude-m4
- $MAKE nil
+ remake_
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile && Exit 1
$FGREP $magic2 Makefile
$sleep
echo : > $srcdir/tweak-acinclude-m4 # no-op again
echo "AC_DEFUN([my_fingerprint], [DummyValue])" > $srcdir/acinclude.m4
+ using_gmake || remake_
$MAKE distcheck
$FGREP $magic1 Makefile && Exit 1 # sanity check
$FGREP $magic2 Makefile && Exit 1 # likewise
# Test remake rules when aclocal.m4 or its prerequisites change.
# Keep in sync with the other sister tests `remake9*.test'.
-required=GNUmake
. ./defs || Exit 1
magic1=::MagicStringOne::
magic2=__MagicStringTwo__
+if using_gmake; then
+ remake_() { $MAKE nil; }
+else
+ remake_() { $MAKE Makefile && $MAKE foo.sh; }
+fi
+
cat >> configure.in <<END
FINGERPRINT='my_fingerprint'
AC_SUBST([FINGERPRINT])
$sleep
echo "AC_DEFUN([my_fingerprint], [$magic1])dnl %%%" >> $srcdir/aclocal.m4
- $MAKE nil
+ remake_
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile
test x"`./foo.sh`" = x"$magic1"
$sleep
echo "sed 's/.*dnl *%%%.*/AC_DEFUN([my_fingerprint], [$magic2])/'" \
> $srcdir/tweak-aclocal-m4
- $MAKE nil
+ remake_
$FGREP FINGERPRINT Makefile # for debugging
$FGREP $magic1 Makefile && Exit 1
$FGREP $magic2 Makefile
$sleep
echo cat > $srcdir/tweak-aclocal-m4 # no-op again
echo 'AC_DEFUN([my_fingerprint], [DummyValue])' >> $srcdir/aclocal.m4
+ using_gmake || remake_
$MAKE distcheck
$FGREP $magic1 Makefile && Exit 1 # sanity check
$FGREP $magic2 Makefile && Exit 1 # likewise