2002-03-26 Alexandre Duret-Lutz <duret_g@epita.fr>
+ * Makefile.am (maintainer-check): Catch occurrences of
+ `$MAKE foo=bar' in the testsuite. Suggest using
+ `foo=bar $MAKE -e' instead.
+ * tests/ansi3.test, tests/ansi5.test, tests/subobj3.test:
+ Use $MAKE -e. This fixes a ansi5.test failure with Solaris make.
+ * tests/defs: Unset $srcdir, and set $testsrcdir to its old value.
+ * tests/installsh.test (AUTOMAKE, ACLOCAL): Use $testsrcdir.
+
+2002-03-26 Alexandre Duret-Lutz <duret_g@epita.fr>
+
Fix for PR automake/310:
* lib/am/depend2.am, lib/am/lex.am, lib/am/yacc.am: Quote %SOURCE%
so it never appears as a plain word.
fi
## Tests should never call make directly.
@if grep -v '^#' $(srcdir)/tests/*.test | egrep ':[ ]*make'; then \
- echo 'Do not run "make" in the above tests. Use "$$MAKE" instead.' \
+ echo 'Do not run "make" in the above tests. Use "$$MAKE" instead.' 1>&2; \
exit 1; \
fi
## Tests should never call autoconf directly.
@if grep -v '^#' $(srcdir)/tests/*.test | egrep ':[ ]*autoconf'; then \
- echo 'Do not run "autoconf" in the above tests. Use "$$AUTOCONF" instead.' \
+ echo 'Do not run "autoconf" in the above tests. Use "$$AUTOCONF" instead.' 1>&2; \
exit 1; \
fi
## Tests should never call automake directly.
@if grep -v '^#' $(srcdir)/tests/*.test | egrep ':[ ]*automake'; then \
- echo 'Do not run "automake" in the above tests. Use "$$AUTOMAKE" instead.' \
+ echo 'Do not run "automake" in the above tests. Use "$$AUTOMAKE" instead.' 1>&2; \
exit 1; \
fi
## Tests should never call aclocal directly.
@if grep -v '^#' $(srcdir)/tests/*.test | egrep ':[ ]*aclocal'; then \
- echo 'Do not run "aclocal" in the above tests. Use "$$ACLOCAL" instead.' \
+ echo 'Do not run "aclocal" in the above tests. Use "$$ACLOCAL" instead.' 1>&2; \
exit 1; \
fi
## Tests should never call perl directly.
@if grep -v '^#' $(srcdir)/tests/*.test | egrep ':[ ]*perl'; then \
- echo 'Do not run "perl" in the above tests. Use "$$PERL" instead.' \
+ echo 'Do not run "perl" in the above tests. Use "$$PERL" instead.' 1>&2; \
exit 1; \
fi
+## Overriding a Makefile macro on the command line is not portable when
+## recursive targets are used. Better use an envvar. SHELL is an exception,
+## POSIX says it can't come from the environment.
+ @if egrep '\$$MAKE .*(SHELL=.*=|=.*SHELL=)' $(srcdir)/tests/*.test; then \
+ echo 'Rewrite "$$MAKE foo=bar SHELL=/bin/sh" as "foo=bar $$MAKE -e SHELL=/bin/sh"' 1>&2; \
+ echo ' in the above lines, it is more portable.' 1>&2; \
+ exit 1; \
+ fi
+ @if grep -v SHELL $(srcdir)/tests/*.test | grep '\$$MAKE .*=' ; then \
+ echo 'Rewrite "$$MAKE foo=bar" as "foo=bar $$MAKE -e" in the above lines,' 1>&2; \
+ echo 'it is more portable.' 1>&2; \
+ exit 1; \
+ fi
+ @if egrep 'SHELL=.*\$$MAKE' $(srcdir)/tests/*.test; then \
+ echo '$$MAKE ignores the SHELL envvar, use "$$MAKE SHELL=/bin/sh" in' 1>&2; \
+ echo 'the above lines.' 1>&2; \
+ exit 1; \
+ fi
+
# Tag before making distribution. Also, don't make a distribution if
# checks fail. Also, make sure the NEWS file is up-to-date.
exit 1; \
fi
@if grep -v '^#' $(srcdir)/tests/*.test | egrep ':[ ]*make'; then \
- echo 'Do not run "make" in the above tests. Use "$$MAKE" instead.' \
+ echo 'Do not run "make" in the above tests. Use "$$MAKE" instead.' 1>&2; \
exit 1; \
fi
@if grep -v '^#' $(srcdir)/tests/*.test | egrep ':[ ]*autoconf'; then \
- echo 'Do not run "autoconf" in the above tests. Use "$$AUTOCONF" instead.' \
+ echo 'Do not run "autoconf" in the above tests. Use "$$AUTOCONF" instead.' 1>&2; \
exit 1; \
fi
@if grep -v '^#' $(srcdir)/tests/*.test | egrep ':[ ]*automake'; then \
- echo 'Do not run "automake" in the above tests. Use "$$AUTOMAKE" instead.' \
+ echo 'Do not run "automake" in the above tests. Use "$$AUTOMAKE" instead.' 1>&2; \
exit 1; \
fi
@if grep -v '^#' $(srcdir)/tests/*.test | egrep ':[ ]*aclocal'; then \
- echo 'Do not run "aclocal" in the above tests. Use "$$ACLOCAL" instead.' \
+ echo 'Do not run "aclocal" in the above tests. Use "$$ACLOCAL" instead.' 1>&2; \
exit 1; \
fi
@if grep -v '^#' $(srcdir)/tests/*.test | egrep ':[ ]*perl'; then \
- echo 'Do not run "perl" in the above tests. Use "$$PERL" instead.' \
+ echo 'Do not run "perl" in the above tests. Use "$$PERL" instead.' 1>&2; \
+ exit 1; \
+ fi
+ @if egrep '\$$MAKE .*(SHELL=.*=|=.*SHELL=)' $(srcdir)/tests/*.test; then \
+ echo 'Rewrite "$$MAKE foo=bar SHELL=/bin/sh" as "foo=bar $$MAKE -e SHELL=/bin/sh"' 1>&2; \
+ echo ' in the above lines, it is more portable.' 1>&2; \
+ exit 1; \
+ fi
+ @if grep -v SHELL $(srcdir)/tests/*.test | grep '\$$MAKE .*=' ; then \
+ echo 'Rewrite "$$MAKE foo=bar" as "foo=bar $$MAKE -e" in the above lines,' 1>&2; \
+ echo 'it is more portable.' 1>&2; \
+ exit 1; \
+ fi
+ @if egrep 'SHELL=.*\$$MAKE' $(srcdir)/tests/*.test; then \
+ echo '$$MAKE ignores the SHELL envvar, use "$$MAKE SHELL=/bin/sh" in' 1>&2; \
+ echo 'the above lines.' 1>&2; \
exit 1; \
fi
&& $AUTOCONF \
&& $AUTOMAKE -a \
&& CC='gcc' ./configure \
- && $MAKE ANSI2KNR=./ansi2knr U=_ \
+ && ANSI2KNR=./ansi2knr U=_ $MAKE -e \
&& ./hello
mv one/Makefile one/Makefile.old
sed -e 's,ANSI2KNR =,ANSI2KNR = ./ansi2knr,' < one/Makefile.old > one/Makefile
-$MAKE U=_
+U=_ $MAKE -e
./one/joe
./two/maude
# generated for the tests do not use the installed tools.
export AUTOMAKE ACLOCAL
+# The tests call `make -e' but we do not want $srcdir from the evironment
+# to override the definition from the Makefile.
+testsrcdir=$srcdir
+unset srcdir
+
# Turn on shell traces when VERBOSE=x.
if test "x$VERBOSE" = xx; then
set -x
;;
esac
-AUTOMAKE="$PERL ../../../automake --libdir=$srcdir/../lib --foreign --Werror"
-ACLOCAL="$PERL ../../../aclocal -I ../../../m4 --acdir=$srcdir/../m4"
+AUTOMAKE="$PERL ../../../automake --libdir=$testsrcdir/../lib --foreign --Werror"
+ACLOCAL="$PERL ../../../aclocal -I ../../../m4 --acdir=$testsrcdir/../m4"
# Now we proceed with the test
$ACLOCAL || exit 1
&& $AUTOCONF \
&& $AUTOMAKE -a \
&& CC='gcc' ./configure \
- && $MAKE ANSI2KNR=./ansi2knr U=_ \
+ && ANSI2KNR=./ansi2knr U=_ $MAKE -e \
&& ./hello