* Makefile.am (maintainer-check): Catch occurrences of
authorAlexandre Duret-Lutz <adl@gnu.org>
Tue, 26 Mar 2002 09:38:47 +0000 (09:38 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Tue, 26 Mar 2002 09:38:47 +0000 (09:38 +0000)
`$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.

ChangeLog
Makefile.am
Makefile.in
tests/ansi3.test
tests/ansi5.test
tests/defs
tests/installsh.test
tests/subobj3.test

index bc2c85d..28d5612 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 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.
index 51977c7..837cdbc 100644 (file)
@@ -147,29 +147,48 @@ maintainer-check: automake aclocal
        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.
index 5cc11e2..dad2fbd 100644 (file)
@@ -655,23 +655,38 @@ maintainer-check: automake aclocal
          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
 
index cb06620..ef7e7fb 100755 (executable)
@@ -41,5 +41,5 @@ $ACLOCAL \
    && $AUTOCONF \
    && $AUTOMAKE -a \
    && CC='gcc' ./configure \
-   && $MAKE ANSI2KNR=./ansi2knr U=_ \
+   && ANSI2KNR=./ansi2knr U=_ $MAKE -e \
    && ./hello
index f4c88e2..f9d56b5 100755 (executable)
@@ -73,6 +73,6 @@ done
 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
index 835e964..45bf2f8 100644 (file)
@@ -127,6 +127,11 @@ esac
 # 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
index d21ca2c..7f7c7f1 100755 (executable)
@@ -25,8 +25,8 @@ case "$srcdir" in
     ;;
 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
index 97b7f6a..9be2fa8 100755 (executable)
@@ -45,5 +45,5 @@ $ACLOCAL \
    && $AUTOCONF \
    && $AUTOMAKE -a \
    && CC='gcc' ./configure \
-   && $MAKE ANSI2KNR=./ansi2knr U=_ \
+   && ANSI2KNR=./ansi2knr U=_ $MAKE -e \
    && ./hello