maintcheck: DISTCHECK_CONFIGURE_FLAGS can be defined on make cmdline
authorStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 10 Jun 2011 15:13:17 +0000 (17:13 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 10 Jun 2011 15:13:17 +0000 (17:13 +0200)
* 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
Makefile.am
Makefile.in

index 1a11eb2..6d8233e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 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
index f0cc95e..b25a30a 100644 (file)
@@ -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; \
index d6743e4..6539f3c 100644 (file)
@@ -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; \