From f84f54f530c8aa0fd3dcd7a31506eef169958a0a Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Fri, 10 Jun 2011 17:13:17 +0200 Subject: [PATCH] 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. --- ChangeLog | 8 ++++++++ Makefile.am | 17 ++++++++++++----- Makefile.in | 8 ++++++-- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1a11eb2..6d8233e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2011-06-10 Stefano Lattarini + 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 + 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 diff --git a/Makefile.am b/Makefile.am index f0cc95e..b25a30a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -442,17 +442,24 @@ sc_tests_required_after_defs: 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; \ diff --git a/Makefile.in b/Makefile.in index d6743e4..6539f3c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1141,8 +1141,12 @@ sc_tests_overriding_macros_on_cmdline: 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; \ -- 2.7.4