2011-06-10 Stefano Lattarini <stefano.lattarini@gmail.com>
+ maintcheck: DISTCHECK_CONFIGURE_FLAGS can be defined on make cmdline
+ * Makefile.am (sc_tests_overriding_macros_on_cmdline): It's now
+ acceptable that the test scripts override DISTCHECK_CONFIGURE_FLAGS
+ on the make command line. Update comments accordingly. Since we
+ are at it, make the relevant grepping rules slightly tighter.
+
+2011-06-10 Stefano Lattarini <stefano.lattarini@gmail.com>
+
distcheck: add support for AM_DISTCHECK_CONFIGURE_FLAGS
* doc/automake.texi (Checking the Distribution): Suggest to use
AM_DISTCHECK_CONFIGURE_FLAGS, not DISTCHECK_CONFIGURE_FLAGS, to
done
## 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. V and DESTDIRS are exceptions,
-## too, as package authors are urged not to initialize them anywhere.
+## recursive targets are used. Better use an envvar. SHELL is an
+## exception, POSIX says it can't come from the environment. DESTDIR and
+## DISTCHECK_CONFIGURE_FLAGS and V are exceptions, too, as package authors
+## are urged not to initialize them anywhere.
sc_tests_overriding_macros_on_cmdline:
@if grep -E '\$$MAKE .*(SHELL=.*=|=.*SHELL=)' $(srcdir)/tests/*.test; then \
echo 'Rewrite "$$MAKE foo=bar SHELL=$$SHELL" as "foo=bar $$MAKE -e SHELL=$$SHELL"' 1>&2; \
echo ' in the above lines, it is more portable.' 1>&2; \
exit 1; \
fi
- @if sed 's/DESTDIR=[^ ]*//; s/SHELL=[^ ]*//; s/V=[^ ]*//' $(srcdir)/tests/*.test | \
- grep '\$$MAKE .*=' ; then \
+ @if sed -e 's/ DESTDIR=[^ ]*/ /' -e 's/ SHELL=[^ ]*/ /' \
+ -e 's/ V=[^ ]*/ /' -e 's///' \
+## DISTCHECK_CONFIGURE_FLAGS is allowed to contain whitespace in its
+## definition, so the more complex substitutions below.
+ -e "s/ DISTCHECK_CONFIGURE_FLAGS='[^']*'/ /" \
+ -e 's/ DISTCHECK_CONFIGURE_FLAGS="[^"]*"/ /' \
+ -e 's/ DISTCHECK_CONFIGURE_FLAGS=[^ ]/ /' \
+ $(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; \
echo ' in the above lines, it is more portable.' 1>&2; \
exit 1; \
fi
- @if sed 's/DESTDIR=[^ ]*//; s/SHELL=[^ ]*//; s/V=[^ ]*//' $(srcdir)/tests/*.test | \
- grep '\$$MAKE .*=' ; then \
+ @if sed -e 's/ DESTDIR=[^ ]*/ /' -e 's/ SHELL=[^ ]*/ /' \
+ -e 's/ V=[^ ]*/ /' -e 's///' \
+ -e "s/ DISTCHECK_CONFIGURE_FLAGS='[^']*'/ /" \
+ -e 's/ DISTCHECK_CONFIGURE_FLAGS="[^"]*"/ /' \
+ -e 's/ DISTCHECK_CONFIGURE_FLAGS=[^ ]/ /' \
+ $(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; \