+2011-06-02 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests: don't require GNU make where it's not strictly needed
+ * tests/autohdr3.test: Rewrite to be stricter when make is GNU
+ make. Drop the requirement of GNU make.
+ * tests/aclocal5.test: Drop GNU make requirement, it's not truly
+ needed. Add reference to similar tests `remake-subdir*.test'.
+ * remake-subdir-gnu.test, remake-subdir-from-subdir.test,
+ remake-subdir.test, remake-subdir2.test: Add reference to
+ each other, and to related test `aclocal5.test'.
+ * tests/aclocal6.test: Drop GNU make requirement, it's not
+ truly needed.
+ * tests/confh6.test: Likewise.
+ * tests/lex3.test: Likewise.
+ * tests/remake11.test: Likewise.
+ * tests/subdir5.test: Likewise.
+ * tests/subdir8.test: Likewise.
+ * tests/werror2.test: Likewise.
+ * tests/conff.test: Likewise, and ensure verbose printing of
+ captured make output.
+ * tests/lex5.test: Tweak so that GNU make is no more required.
+ * tests/version7.test: Likewise.
+ * tests/maken2.test: Add explicative comment for why this test
+ requires GNU make.
+ * tests/maken4.test: Let it run also with BSD makes supporting
+ the `.MAKE' special target.
+ * tests/output6.test: Use proper m4 quoting in configure.in.
+ Expand make macros with one-character name using `$(x)', not
+ `$x', for portability. Move checks in the makefiles, rather
+ than relying on grepping the output from make. Drop the now
+ unneeded GNU make requirement.
+
2011-05-29 Stefano Lattarini <stefano.lattarini@gmail.com>
remake: behave better with non-GNU make in subdirectories
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Test to make sure that aclocal.m4's dependencies are honored
-# in sub-directories.
+# Test to make sure that aclocal.m4's dependencies are honored in
+# sub-directories. See also related tests `remake-subdir*.test'.
-# This test assumes that the `make' utility is able to start
-# over and reload Makefiles which have been remade (a non-POSIX feature).
-required='GNUmake'
. ./defs || Exit 1
cat >> configure.in << 'END'
# Make sure aclocal.m4 is rebuilt whenever a configure
# dependency changes. Test for acinclude.m4 and VPATH too.
-required='GNUmake'
. ./defs || Exit 1
cat >> configure.in << 'END'
# Check rebuild rules for autoheader.
-required=GNUmake
. ./defs || Exit 1
cat >>configure.in <<EOF
AC_OUTPUT
EOF
-: > Makefile.am
: > foo.m4
+cat > Makefile.am <<'END'
+.PHONY: test
+check-local: test
+test:
+ cat $(srcdir)/config.hin ;: For debugging.
+ cat config.h ;: Likewise.
+ grep '#.*GREPME' $(srcdir)/config.hin
+ grep '#.*define.*GREPME' config.h
+END
+
$ACLOCAL
$AUTOCONF
$AUTOHEADER
$sleep
echo 'AC_DEFINE([GREPME], 1, [Doc for GREPME])' > foo.m4
-$MAKE
-grep GREPME config.hin
-grep GREPME config.h
-
+using_gmake || $MAKE
+$MAKE test
$MAKE distcheck
+
+:
# Make sure rebuild rules work even when AC_CONFIG_FILES uses colons.
# Report from Alexander Turbov.
-required=GNUmake
. ./defs || Exit 1
cat >> configure.in << 'END'
$MAKE
cd bar
-$MAKE top-rule >stdout
+$MAKE top-rule >stdout || { cat stdout; Exit 1; }
cat stdout
grep 'top rule' stdout
-$MAKE bot-rule >stdout
+$MAKE bot-rule >stdout || { cat stdout; Exit 1; }
cat stdout
grep 'bot rule' stdout
cd ..
$MAKE
cd bar
-$MAKE top-rule >stdout
+$MAKE top-rule >stdout || { cat stdout; Exit 1; }
cat stdout
grep 'top2 rule' stdout
-$MAKE bot-rule >stdout
+$MAKE bot-rule >stdout || { cat stdout; Exit 1; }
cat stdout
grep 'bot rule' stdout
cd ..
$MAKE
cd bar
-$MAKE top-rule >stdout
+$MAKE top-rule >stdout || { cat stdout; Exit 1; }
cat stdout
grep 'top2 rule' stdout
-$MAKE bot-rule >stdout
+$MAKE bot-rule >stdout || { cat stdout; Exit 1; }
cat stdout
grep 'bot2 rule' stdout
cd ..
# idea is that if config.h is in a subdir, and there is no Makefile in
# that subdir, then we want to build config.h as the top level.
-required=GNUmake
. ./defs || Exit 1
cat >> configure.in << 'END'
# Test associated with PR 19.
# From Matthew D. Langston.
-required='cc flex GNUmake'
+required='cc flex'
. ./defs || Exit 1
cat >> configure.in << 'END'
# Test for subdir lexers.
-required='cc GNUmake flex'
+required='cc flex'
. ./defs || Exit 1
cat >> configure.in << 'END'
test -f ./ylwrap
cd sub
+using_gmake || $MAKE Makefile
$MAKE foo/foo2.o
test -f foo/foo2.c
test -f foo/foo2.o
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Ensure that `make -n dist' and `make -n distcheck' show what would happen.
-# This currently works for GNU make only.
+# Ensure that `make -n dist' and `make -n distcheck' show what would
+# happen. This currently works for GNU make, but might fail with other
+# make implementations (e.g., FreeBSD's or NetBSD's).
# Please keep this test in sync with sister test maken.test.
# Please keep this test in sync with sister test maken3.test.
-required=GNUmake
. ./defs || Exit 1
+if using_gmake; then
+ : Good, make is GNU make.
+else
+ unindent > mk.tmp << 'END'
+ targ.tmp:
+ : > $@
+ .MAKE: targ.tmp
+END
+ if $MAKE -n -f mk.tmp targ.tmp && test -f targ.tmp; then
+ : Good, make supports the '.MAKE' special target.
+ else
+ skip_ "GNU or BSD make required"
+ fi
+ rm -f *.tmp
+fi
+
mkdir sub sub2
cat >> configure.in << 'END'
# Check for support for colon separated input files in AC_CONFIG_FILES
-required=GNUmake
. ./defs || Exit 1
cat > configure.in << END
AC_INIT([$me], [1.0])
AM_INIT_AUTOMAKE
-AC_CONFIG_FILES(foo:a.in:b.in:c.in:d.in)
+AC_CONFIG_FILES([foo:a.in:b.in:c.in:d.in])
AC_OUTPUT
END
c = C
d = C
-print:
- @echo $a$b$c$d
+.PHONY: test1 test2
+test1:
+ test $(a)$(b)$(c)$(d) = ABCD
+test2:
+ test $(a)$(b)$(c)$(d) = GFCD
EOF
echo 'd = D' > d.in
$AUTOCONF
$AUTOMAKE
./configure
-$MAKE -f foo print | grep 'ABCD'
+$MAKE -f foo test1
$sleep
cat >b.in <<'EOF'
d = F
EOF
-# This involves the rebuild rule, hence it requires GNUmake
-$MAKE -f foo print | grep 'GFCD'
+using_gmake || $MAKE -f foo
+$MAKE -f foo test2
+
+:
#! /bin/sh
-# Copyright (C) 2009 Free Software Foundation, Inc.
+# Copyright (C) 2009, 2011 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# Check that remake rules works for adding a new subdirectory from a
# pre-existing subdirectory.
+# See also the other similar tests `remake-subdir*.test', and the
+# related test `aclocal5.test'.
. ./defs || Exit 1
# Check that remake rules works from subdirectories, even using
# `GNUmakefile' as makefiles name. This obviously requires GNU
# make.
+# See also the other similar tests `remake-subdir*.test', and the
+# related test `aclocal5.test'
required=GNUmake
. ./defs || Exit 1
# Check that remake rules works from subdirectories, even with non-GNU
# make implementations.
+# See also the other similar tests `remake-subdir*.test', and the
+# related test `aclocal5.test'
. ./defs || Exit 1
# Check that remake rules works from subdirectories, even when makefiles
# are not named "Makefile".
+# See also the other similar tests `remake-subdir*.test', and the
+# related test `aclocal5.test'
. ./defs || Exit 1
# rules don't break in obvious ways in a slightly "heavier than usual"
# setup.
-required=GNUmake
. ./defs || Exit 1
ocwd=`pwd` || Exit 1
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Test to make sure that adding a new directory works.
-# This test runs `make' from the top-level directory, subdir8.test
-# do it from a subdirectory.
+# This test runs `make' from the top-level directory, the sister test
+# `subdir8.test' do it from a subdirectory.
# PR automake/46
-# This test assumes that the `make' utility is able to start
-# over and reload Makefiles which have been remade (a non-POSIX feature).
-# See also the related test subdir8.test.
-required=GNUmake
. ./defs || Exit 1
cat >> configure.in << 'END'
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Test to make sure that adding a new directory works, even from
-# subdirectories. (subdir5.test makes sure it works when make
-# is run from the top-level directory.)
+# subdirectories. The sister test `subdir5.test' makes sure it works
+# when make is run from the top-level directory.
# PR automake/46
-# This test assumes that the `make' utility is able to start
-# over and reload Makefiles which have been remade (a non-POSIX feature).
-# See also the related test subdir5.test.
-required=GNUmake
. ./defs || Exit 1
cat >> configure.in << 'END'
# is to make sure Makefile.ins get rebuilt when a m4_included file
# changes -- we don't support this feature on non-GNU Makes).
-required='makeinfo tex texi2dvi GNUmake'
+required='makeinfo tex texi2dvi'
. ./defs || Exit 1
cat >configure.in <<END
$sleep
echo 'm4_define([THE_VERSION], [3.141])' > version.m4
+using_gmake || $MAKE Makefile
$MAKE distcheck
./configure --version | grep '3\.141'
grep '3\.141' version.texi
# succeed if make is run a second time immediately afterwards.
# Report from Harlan Stenn.
-required=GNUmake
. ./defs || Exit 1
echo AC_OUTPUT>>configure.in
foo_SOURCES = unused
END
+# This repetition is deliberate; see heading comments.
$MAKE && Exit 1
-
$MAKE && Exit 1
: