]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* 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 bc2c85d70b16ed1cb9c0c3cda197ef80f8794c9b..28d5612d6d6c7213a84db5901fe18f6f8f3c30d7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+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:
index 51977c7db8c7b3bbd9c2732fd3a3d91fc5e3b187..837cdbc87e8fe0c48ba0dd4712ed564c0e629ed0 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 5cc11e216797cc1d201d487d8c653764c37d552b..dad2fbde1da06f5849470a8492d8b6ce94b5674c 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 cb0662046462a19e0b1e5e48b334cd55e9748505..ef7e7fb2d7ac4c1d16fe1a824f3eced512864783 100755 (executable)
@@ -41,5 +41,5 @@ $ACLOCAL \
    && $AUTOCONF \
    && $AUTOMAKE -a \
    && CC='gcc' ./configure \
-   && $MAKE ANSI2KNR=./ansi2knr U=_ \
+   && ANSI2KNR=./ansi2knr U=_ $MAKE -e \
    && ./hello
index f4c88e21abc90ac8697ebdf4ec2b84e4bb3a416e..f9d56b5b6396be2478e40511180db49540d1b1f1 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 835e964ebc87362b53eb5a33afb9f9a9ff8ac978..45bf2f867549bbb74fbf7060183a18f14bbb80e8 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 d21ca2c9489cf643e6e016067a6d8bc62d1302b2..7f7c7f1e619dfa243e458f8aab62f6de939515d0 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 97b7f6a25d0dfd88af2f5be5dad508cca58f2f8a..9be2fa81407a37061ead76f5003d21d2a8dbbf20 100755 (executable)
@@ -45,5 +45,5 @@ $ACLOCAL \
    && $AUTOCONF \
    && $AUTOMAKE -a \
    && CC='gcc' ./configure \
-   && $MAKE ANSI2KNR=./ansi2knr U=_ \
+   && ANSI2KNR=./ansi2knr U=_ $MAKE -e \
    && ./hello