automake-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-commit] [SCM] GNU Automake branch, master, updated. v1.12-101-


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, master, updated. v1.12-101-g12405c9
Date: Tue, 08 May 2012 10:51:40 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=12405c9fccb92791116c0391cbd7669ea00e9a04

The branch, master has been updated
       via  12405c9fccb92791116c0391cbd7669ea00e9a04 (commit)
       via  33c59ec5252efb1021b2e52a8cad40918670362b (commit)
       via  f974da70780271a64295ad87dc92f096b90e9908 (commit)
       via  1cf7d18839c7f9d878a322f841e1be8845d83514 (commit)
       via  6b641de5fc4ecf679d77a7542f83b1d04402c798 (commit)
       via  2d68fd9b481762a31847cf412fedb68decf6e8fd (commit)
       via  21d1b9342743efdb196110093b3b6ee156688b83 (commit)
       via  1cab373b21e94ce0b5ed833106228ce02ee612fb (commit)
       via  27136dfe02926ac596c853fced7c17825ef3cf68 (commit)
      from  adb834ebf078a00ed67ebc325c692452e6e5dcf6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 12405c9fccb92791116c0391cbd7669ea00e9a04
Merge: adb834e 33c59ec
Author: Stefano Lattarini <address@hidden>
Date:   Tue May 8 12:49:36 2012 +0200

    Merge branch 'maint'
    
    * maint:
      tests: fix a spurious failure with dash
      test defs: fix indentation (cosmetic change)
      tests: remove obsolete uses of $sh_errexit_works
      configure: search a sturdy POSIX shell to be used in the testsuite
      tests: shell running test scripts is now named AM_TEST_RUNNER_SHELL
      fixup: distribute t/README
      init: warn against obsolete usage of AM_INIT_AUTOMAKE
    
    Signed-off-by: Stefano Lattarini <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 Makefile.am                                        |    6 +-
 NEWS                                               |   16 ++
 automake.in                                        |    4 +
 configure.ac                                       |  185 ++++++++++++++++++--
 defs                                               |  124 +++++++-------
 defs-static.in                                     |   11 +-
 doc/automake.texi                                  |    3 +-
 m4/init.m4                                         |    5 +-
 t/ac-output-old.tap                                |    2 +
 ...s-no-more.sh => aminit-moreargs-deprecation.sh} |   41 +++--
 t/backcompat.sh                                    |    2 +-
 t/backcompat3.sh                                   |    2 +
 t/backcompat5.sh                                   |    4 +-
 t/backcompat6.sh                                   |    2 +-
 t/confsub.sh                                       |    9 +-
 t/install2.sh                                      |   12 +-
 t/list-of-tests.mk                                 |    1 +
 t/pr2.sh                                           |    9 +-
 t/pr87.sh                                          |   14 +-
 t/self-check-cleanup.tap                           |   21 +--
 t/self-check-dir.tap                               |    9 +-
 t/self-check-env-sanitize.tap                      |    4 +-
 t/self-check-exit.tap                              |   35 ++---
 t/self-check-explicit-skips.sh                     |   17 +-
 t/self-check-me.tap                                |    8 +-
 t/self-check-reexec.tap                            |   18 ++-
 t/self-check-sanity.sh                             |    8 +-
 t/self-check-tap.sh                                |   16 +-
 t/version.sh                                       |    2 +-
 t/version2.sh                                      |    2 +-
 30 files changed, 393 insertions(+), 199 deletions(-)
 copy t/{cygnus-no-more.sh => aminit-moreargs-deprecation.sh} (55%)

diff --git a/Makefile.am b/Makefile.am
index 060cd4b..a6129c3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -309,8 +309,8 @@ EXTRA_DIST += m4/amversion.in
 ##  Testsuite.  ##
 ## ------------ ##
 
-# Run the tests with the shell detected at configure time.
-LOG_COMPILER = $(SHELL)
+# Run the tests with a proper shell detected at configure time.
+LOG_COMPILER = $(AM_TEST_RUNNER_SHELL)
 
 TEST_EXTENSIONS = .pl .sh .tap
 SH_LOG_COMPILER = $(LOG_COMPILER)
@@ -322,7 +322,7 @@ TAP_LOG_DRIVER = AM_TAP_AWK='$(AWK)' $(SHELL) 
$(srcdir)/lib/tap-driver.sh
 
 AM_TAP_LOG_DRIVER_FLAGS = --merge
 
-EXTRA_DIST += t/ax/is
+EXTRA_DIST += t/README t/ax/is
 
 TESTS = ## Will be updated later.
 
diff --git a/NEWS b/NEWS
index fe6467d..fcfbc6f 100644
--- a/NEWS
+++ b/NEWS
@@ -79,6 +79,11 @@ New in 1.12.1:
 
 * Deprecated obsolescent features:
 
+  - Use of the long-deprecated two- and three-arguments invocation forms
+    of the AM_INIT_AUTOMAKE macro now elicits a warning in the 'obsolete'
+    category.  Starting from the next major Automake release (1.13), such
+    usages won't be allowed anymore.
+
   - Support for the "Cygnus-style" trees (enabled by the 'cygnus' option) is
     now deprecated (its use triggers a warning in the 'obsolete' category).
     It will be removed in the next major Automake release (1.13).
@@ -88,6 +93,17 @@ New in 1.12.1:
     m4 macro are deprecated, eliciting a warning in the 'obsolete'
     category.  They will be removed in the next major version (1.13).
 
+* Miscellaneous changes:
+
+  - The Automake test cases now require a proper POSIX-conforming shell.
+    Older non-POSIX Bourne shells (like Solaris 10 /bin/sh) won't be
+    accepted anymore.  In most cases, the user shouldn't have to specify
+    such POSIX shell explicitly, since it will be looked up at configure
+    time.  Still, when this lookup fails, or when the user wants to
+    override its conclusion, the variable 'AM_TEST_RUNNER_SHELL' can be
+    used (pointing to the shell that will be used to run the Automake
+    test cases).
+
 Bugs fixed in 1.12.1:
 
 * Bugs introduced by 1.12:
diff --git a/automake.in b/automake.in
index 9c632e2..2baaf61 100644
--- a/automake.in
+++ b/automake.in
@@ -5352,6 +5352,10 @@ sub scan_autoconf_traces ($)
          $seen_init_automake = $where;
          if (defined $args[2])
            {
+              msg 'obsolete', $where, <<'EOF';
+AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.  For more 
info, see:
+http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation
+EOF
              $package_version = $args[2];
              $package_version_location = $where;
            }
diff --git a/configure.ac b/configure.ac
index 51d10c0..ec38426 100644
--- a/configure.ac
+++ b/configure.ac
@@ -211,25 +211,182 @@ case $build in
 esac
 AC_SUBST([MODIFICATION_DELAY])
 
-# Test for things needed by the test suite.
+## ------------------------------------------- ##
+##  Test for things needed by the test suite.  ##
+## ------------------------------------------- ##
+
 AC_PROG_EGREP
 AC_PROG_FGREP
 
-AC_CACHE_CHECK([whether $SHELL has working 'set -e' with exit trap],
-[am_cv_sh_errexit_works],
-[if $SHELL -ec "trap 'exit \$?' 0; (exit 77); exit 77"; test $? = 77
-then
-  am_cv_sh_errexit_works=yes
+dnl FIXME: could we extract this in a simpler way through autoconf
+dnl FIXME: idioms or internals?
+AC_DEFUN(
+  [_AM_INIT_BOURNE_COMPATIBLE_VAR],
+  [am_bourne_compatible="AS_ESCAPE(_m4_expand([AS_BOURNE_COMPATIBLE]))"])
+
+dnl
+dnl Arguments to this macro:
+dnl
+dnl   $1 - shell to test
+dnl   $2 - description of the tested feature
+dnl   $3 - shell code used to check the feature; to indicate success,
+dnl        it can either exit with status 77, or have the last command
+dnl        returning with exit status of zero
+dnl   $4 - shell code to execute if the check on the shell is successful
+dnl        (defaults to nothing)
+dnl   $5 - shell code to execute if the check on the shell is not
+dnl        successful (defaults to nothing)
+dnl
+AC_DEFUN([_AM_CHECK_SHELL_FEATURE],
+  [AC_REQUIRE([_AM_INIT_BOURNE_COMPATIBLE_VAR])
+  AC_MSG_CHECKING([whether $1 $2])
+  if { $1 -c "$am_bourne_compatible
+AS_ESCAPE([$3])
+test \$? -eq 0 || exit 1
+# Use 77 to indicate success (rather than 0), in case some shell
+# acts like Solaris 10's /bin/sh, exiting successfully on some
+# syntax errors.
+exit 77" >&AS_MESSAGE_LOG_FD 2>&1; test $? -eq 77; }
+  then
+    AC_MSG_RESULT([yes])
+    $4
+  else
+    AC_MSG_RESULT([no])
+    $5
+  fi])
+
+# AM_CHECK_CANDIDATE_TEST_SHELL(SHELL-PATH)
+# -----------------------------------------
+#
+# Check if the given shell is good enough to run our test scripts.
+# Inspired to gnulib's 'tests/init.sh'.
+#
+# We require POSIX and XSI features (e.g., '$(...)' for command
+# substitutions, '$((...))' for shell arithmetic, and support for
+# '${var#...}' and '${var%...}' parameter expansions).
+#
+# We require that the shell can correctly trap EXIT when 'set -e' is in
+# effect (OSF1/Tru64 sh failed to do so, see commit v1.10b-52-g9fe8259).
+#
+# We also prefer shells that, when 'set -x' is in effect, do not also
+# redirect traces upon stderr redirections.  For example,
+#  $ set -x; echo x 2>file
+# would emit "+ echo x" into file with older zsh versions.  Similarly,
+#   $ set -x; P=1 true 2>file
+# would emit "P=1" into file with /usr/xpg4/bin/sh from Solaris 10 and
+# /bin/sh from SunOS 5.11 and OpenBSD 4.7.
+#
+# Finally, we look for weird bugs and portability problems mentioned in
+# the Autoconf manual, and reject shells that suffers from them. (TODO)
+#
+# Use '$am_score' to indicate the degree of acceptability of the shell.
+# A score of "10" means that the shell is good enough for our needs;
+# a score of "9" means that the shell has some minor bugs or limitation,
+# but is still (barely) acceptable for our uses.  Any other score means
+# that the shell is broken or unfit.
+#
+AC_DEFUN([_AM_CHECK_CANDIDATE_SHELL],
+  [am_score=10
+  while :; do
+
+    _AM_CHECK_SHELL_FEATURE([$1],
+      [supports \$(cmd)],
+      [test "$(echo x)" = x],
+      [], [am_score=1; break])
+
+    _AM_CHECK_SHELL_FEATURE([$1],
+      [supports \$((expr))],
+      [test $((1 + 2 * 3)) = 7],
+      [], [am_score=1; break])
+
+    _AM_CHECK_SHELL_FEATURE([$1],
+      [supports address@hidden:@glob}],
+      [v=a/b/c; test address@hidden:@*/} = b/c],
+      [], [am_score=1; break])
+
+    _AM_CHECK_SHELL_FEATURE([$1],
+      [supports address@hidden:@@%:@glob}],
+      [v=a/b/c; test address@hidden:@@%:@*/} = c],
+      [], [am_score=1; break])
+
+    _AM_CHECK_SHELL_FEATURE([$1],
+      [supports \${var%glob}],
+      [v=a.b.c; test ${v%.*} = a.b],
+      [], [am_score=1; break])
+
+    _AM_CHECK_SHELL_FEATURE([$1],
+      [supports \${var%%glob}],
+      [v=a.b.c; test ${v%%.*} = a],
+      [], [am_score=1; break])
+
+    _AM_CHECK_SHELL_FEATURE([$1],
+      ["set -e" preserves exit traps],
+      [set -e; trap 'exit $?' 0; (exit 77); exit 77],
+      [], [am_score=1; break])
+
+    _AM_CHECK_SHELL_FEATURE([$1],
+      ["set -x" corrupts stderr],
+      [(set -x; P=1 true 2>&3) 3>&1 2>/dev/null | grep P=1],
+      [am_score=9], [])
+
+    break
+  done])
+
+# These messages only goes to the config.log file.
+AC_MSG_NOTICE([will now look for a sturdy POSIX shell, for our testsuite])
+
+AC_CACHE_VAL(
+  [ac_cv_AM_TEST_RUNNER_SHELL],
+  [if test "$AM_TEST_RUNNER_SHELL"; then
+    # Let the user override it.
+    ac_cv_AM_TEST_RUNNER_SHELL=$AM_TEST_RUNNER_SHELL
+  else
+    ac_cv_AM_TEST_RUNNER_SHELL=no
+    am_candidate_shells=${CONFIG_SHELL-}
+    # For the benefit of Solaris.
+    am_PATH=$PATH$PATH_SEPARATOR/usr/xpg6/bin$PATH_SEPARATOR/usr/xpg4/bin
+    for am_sh in sh sh5 dash ash bash zsh ksh pdksh; do
+      AC_PATH_PROG([am_candidate_sh], [$am_sh], [], [$am_PATH])
+      if test -n "$am_candidate_sh"; then
+        am_candidate_shells="$am_candidate_shells $am_candidate_sh"
+      fi
+      AM_SUBST_NOTMAKE([am_candidate_sh])
+      # Must nullify these in order not to interfere with the checks in
+      # the next loop.
+      AS_UNSET([am_candidate_sh])
+      AS_UNSET([ac_cv_path_am_candidate_sh])
+    done
+    AS_UNSET([am_PATH]) # Not required anymore
+    for am_sh in $am_candidate_shells; do
+      am_score=0
+      _AM_CHECK_CANDIDATE_SHELL([$am_sh])
+      if test $am_score -eq 9; then
+        # The shell is barely acceptable for our needs.  We might
+        # still find one that is even better, so continue looking.
+        AC_MSG_NOTICE([shell $am_sh is acceptable, but we might do better])
+        ac_cv_AM_TEST_RUNNER_SHELL=$am_sh
+      elif test $am_score -eq 10; then
+        AC_MSG_NOTICE([shell $am_sh is good enough, stop looking])
+        ac_cv_AM_TEST_RUNNER_SHELL=$am_sh
+        break
+      fi
+    done
+  fi
+  AM_TEST_RUNNER_SHELL=$ac_cv_AM_TEST_RUNNER_SHELL])
+
+if test $AM_TEST_RUNNER_SHELL = no; then
+  AC_MSG_FAILURE([m4_normalize([no POSIX shell found that is good
+                                enough to be used in our testsuite])])
 else
-  am_cv_sh_errexit_works=no
+  AC_MSG_NOTICE([will use $AM_TEST_RUNNER_SHELL as the testsuite shell])
 fi
-])
-if test $am_cv_sh_errexit_works = no; then
-  AC_MSG_WARN(["${MAKE-make} check" will leave leftover directories t/*.dir])
-  AC_MSG_WARN([you can clean them up manually using "${MAKE-make} clean" or])
-  AC_MSG_WARN(["cd t && ${MAKE-make} clean-local-check'])
-fi
-AC_SUBST([sh_errexit_works], [$am_cv_sh_errexit_works])
+
+AC_ARG_VAR([AM_TEST_RUNNER_SHELL],
+           [a sturdy POSIX shell for our testsuite])
+
+## ---------------------- ##
+##  Create output files.  ##
+## ---------------------- ##
 
 
 ###########################################################################
diff --git a/defs b/defs
index 7e9a554..fcdbb7d 100644
--- a/defs
+++ b/defs
@@ -20,7 +20,7 @@
 ########################################################
 
 # NOTE: This file should execute correctly with any system's /bin/sh
-# shell, and not only with configure-time detected $CONFIG_SHELL,
+# shell, and not only with configure-time detected $AM_TEST_RUNNER_SHELL,
 # *until differently and explicitly specified*.
 
 ## -------------------------------------------------------- ##
@@ -105,16 +105,16 @@ case ${AM_TESTS_REEXEC-yes} in
       *x*) opts=-x;;
       *) opts=;;
     esac
-    echo $me: exec $SHELL $opts "$0" "$*"
-    exec $SHELL $opts "$0" ${1+"$@"} || {
-      echo "$me: failed to re-execute with $SHELL" >&2
+    echo $me: exec $AM_TEST_RUNNER_SHELL $opts "$0" "$*"
+    exec $AM_TEST_RUNNER_SHELL $opts "$0" ${1+"$@"} || {
+      echo "$me: failed to re-execute with $AM_TEST_RUNNER_SHELL" >&2
       exit 99
     }
     ;;
 esac
 
 # NOTE: From this point on, we can assume this file is being executed
-# by the configure-time detected $CONFIG_SHELL.
+# by the configure-time detected $AM_TEST_RUNNER_SHELL.
 
 
 ## ----------------------- ##
@@ -1001,65 +1001,63 @@ case " $required " in *\ gettext*) . 
./t/gettext-macros.dir/get.sh;; esac
 distdir=$me-1.0
 
 # Set up the exit trap.
-if test "$sh_errexit_works" = yes; then
-  trap 'exit_status=$?
-    set +e
-    cd "$am_top_builddir"
-    if test $am_using_tap = yes; then
-      if test "$planned_" = later && test $exit_status -eq 0; then
-        plan_ "now"
-      fi
-      test $exit_status -eq 0 && test $tap_pass_count_ -eq $tap_count_ \
-        || keep_testdirs=yes
-    else
-      # This is to ensure that a test script does give a SKIP outcome just
-      # because a command in it happens to exit with status 77.  This
-      # behaviour, while from time to time useful to developers, is not
-      # meant to be enabled by default, as it could cause spurious failures
-      # in the wild.  Thus it will be enabled only when the variable
-      # "am_explicit_skips" is set to a "true" value.
-      case $am_explicit_skips in
-        [yY]|[yY]es|1)
-          if test $exit_status -eq 77 && test $am__test_skipped != yes; then
-            echo "$me: implicit skip turned into failure"
-            exit_status=78
-          fi;;
-      esac
-      test $exit_status -eq 0 || keep_testdirs=yes
+trap 'exit_status=$?
+  set +e
+  cd "$am_top_builddir"
+  if test $am_using_tap = yes; then
+    if test "$planned_" = later && test $exit_status -eq 0; then
+      plan_ "now"
     fi
-    am_keeping_testdirs || rm_rf_ $testSubDir
-    set +x
-    echo "$me: exit $exit_status"
-    exit $exit_status
-  ' 0
-  trap "fatal_ 'caught signal SIGHUP'" 1
-  trap "fatal_ 'caught signal SIGINT'" 2
-  trap "fatal_ 'caught signal SIGTERM'" 15
-  # Various shells seems to just ignore SIGQUIT under some circumstances,
-  # even if the signal is not blocked; however, if the signal it trapped,
-  # the trap gets correctly executed.  So we also trap SIGQUIT.
-  # Here is a list of some shells that have been verified to exhibit the
-  # problematic behavior with SIGQUIT:
-  #  - zsh 4.3.12 on Debian GNU/Linux
-  #  - /bin/ksh and /usr/xpg4/bin/sh on Solaris 10
-  #  - Bash 3.2.51 on Solaris 10 and bash 4.1.5 on Debian GNU/Linux
-  #  - AT&T ksh on Debian Gnu/Linux (deb package ksh, version 93u-1)
-  # OTOH, at least these shells that do *not* exhibit that behaviour:
-  #  - modern version of the Almquist Shell (at least 0.5.5.1), on
-  #    both Solaris and GNU/Linux
-  #  - Solaris 10 /bin/sh
-  #  - public domain Korn Shell, version 5.2.14, on Debian GNU/Linux
-  trap "fatal_ 'caught signal SIGQUIT'" 3
-  # Ignore further SIGPIPE in the trap code.  This is required to avoid
-  # a very weird issue with some shells, at least when the execution of
-  # the automake testsuite is driven by the 'prove' utility: if prove
-  # (or the make process that has spawned it) gets interrupted with
-  # Ctrl-C, the shell might go in a loop, continually getting a SIGPIPE,
-  # sometimes finally dumping core, other times hanging indefinitely.
-  # See also Test::Harness bug [rt.cpan.org #70855], archived at
-  # <https://rt.cpan.org/Ticket/Display.html?id=70855>
-  trap "trap '' 13; fatal_ 'caught signal SIGPIPE'" 13
-fi
+    test $exit_status -eq 0 && test $tap_pass_count_ -eq $tap_count_ \
+      || keep_testdirs=yes
+  else
+    # This is to ensure that a test script does give a SKIP outcome just
+    # because a command in it happens to exit with status 77.  This
+    # behaviour, while from time to time useful to developers, is not
+    # meant to be enabled by default, as it could cause spurious failures
+    # in the wild.  Thus it will be enabled only when the variable
+    # "am_explicit_skips" is set to a "true" value.
+    case $am_explicit_skips in
+      [yY]|[yY]es|1)
+        if test $exit_status -eq 77 && test $am__test_skipped != yes; then
+          echo "$me: implicit skip turned into failure"
+          exit_status=78
+        fi;;
+    esac
+    test $exit_status -eq 0 || keep_testdirs=yes
+  fi
+  am_keeping_testdirs || rm_rf_ $testSubDir
+  set +x
+  echo "$me: exit $exit_status"
+  exit $exit_status
+' 0
+trap "fatal_ 'caught signal SIGHUP'" 1
+trap "fatal_ 'caught signal SIGINT'" 2
+trap "fatal_ 'caught signal SIGTERM'" 15
+# Various shells seems to just ignore SIGQUIT under some circumstances,
+# even if the signal is not blocked; however, if the signal it trapped,
+# the trap gets correctly executed.  So we also trap SIGQUIT.
+# Here is a list of some shells that have been verified to exhibit the
+# problematic behavior with SIGQUIT:
+#  - zsh 4.3.12 on Debian GNU/Linux
+#  - /bin/ksh and /usr/xpg4/bin/sh on Solaris 10
+#  - Bash 3.2.51 on Solaris 10 and bash 4.1.5 on Debian GNU/Linux
+#  - AT&T ksh on Debian Gnu/Linux (deb package ksh, version 93u-1)
+# OTOH, at least these shells that do *not* exhibit that behaviour:
+#  - modern version of the Almquist Shell (at least 0.5.5.1), on
+#    both Solaris and GNU/Linux
+#  - Solaris 10 /bin/sh
+#  - public domain Korn Shell, version 5.2.14, on Debian GNU/Linux
+trap "fatal_ 'caught signal SIGQUIT'" 3
+# Ignore further SIGPIPE in the trap code.  This is required to avoid
+# a very weird issue with some shells, at least when the execution of
+# the automake testsuite is driven by the 'prove' utility: if prove
+# (or the make process that has spawned it) gets interrupted with
+# Ctrl-C, the shell might go in a loop, continually getting a SIGPIPE,
+# sometimes finally dumping core, other times hanging indefinitely.
+# See also Test::Harness bug [rt.cpan.org #70855], archived at
+# <https://rt.cpan.org/Ticket/Display.html?id=70855>
+trap "trap '' 13; fatal_ 'caught signal SIGPIPE'" 13
 
 # Create and populate the temporary directory, if and as required.
 if test x"$am_create_testdir" = x"no"; then
diff --git a/defs-static.in b/defs-static.in
index a8a17f0..44db309 100644
--- a/defs-static.in
+++ b/defs-static.in
@@ -22,7 +22,8 @@
 #   - Multiple inclusions of this file should be idempotent.
 #   - This code has to be 'set -e' clean.
 #   - This file should execute correctly with any system's /bin/sh
-#     shell, not only with configure-time detected $CONFIG_SHELL.
+#     shell, not only with configure-time detected $SHELL and/or
+#     $AM_TEST_RUNNER_SHELL.
 
 # Be more Bourne compatible.
 # (Snippet inspired to configure's initialization in Autoconf 2.64)
@@ -137,6 +138,11 @@ PATH_SEPARATOR='@PATH_SEPARATOR@'
 host_alias=${host_alias-'@host_alias@'}; export host_alias
 build_alias=${build_alias-'@build_alias@'}; export build_alias
 
+# The shell we use to run our own test scripts, determined at configure
+# time.  It is required in the self tests, and most importantly for the
+# the automatic re-execution of test scripts.
+AM_TEST_RUNNER_SHELL='@AM_TEST_RUNNER_SHELL@'
+
 # Make sure we override the user shell.  And do not read the value of
 # $SHELL from the environment (think to the non-uncommon situation where
 # e.g., $SHELL=/bin/tcsh).
@@ -216,9 +222,6 @@ 
GNU_GCJFLAGS=${AM_TESTSUITE_GNU_GCJFLAGS-${GNU_GCJFLAGS-'@GNU_GCJFLAGS@'}}
 # this variable.
 TEX=${AM_TESTSUITE_TEX-'@TEX@'}
 
-# Whether $SHELL has working 'set -e' with exit trap.
-sh_errexit_works='@sh_errexit_works@'
-
 # The amount we should wait after modifying files depends on the platform.
 # For instance, Windows '95, '98 and ME have 2-second granularity
 # and can be up to 3 seconds in the future w.r.t. the system clock.
diff --git a/doc/automake.texi b/doc/automake.texi
index f7fdbdf..0155853 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -3926,13 +3926,14 @@ each option were listed in @code{AUTOMAKE_OPTIONS} 
(@pxref{Options}).
 
 @acindex AC_INIT
 This macro can also be called in @emph{another, deprecated form} (support
-for which will be @emph{removed in the next major Automake release}):
+for which will be @emph{removed in the next major Automake release (1.13)}):
 @code{AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])}.  In this form,
 there are two required arguments: the package and the version number.
 This form is obsolete because the @var{package} and @var{version} can
 be obtained from Autoconf's @code{AC_INIT} macro (which itself has an
 old and a new form).
 
address@hidden AM_INIT_AUTOMAKE invocation}
 If your @file{configure.ac} has:
 
 @example
diff --git a/m4/init.m4 b/m4/init.m4
index a496154..0a6eefc 100644
--- a/m4/init.m4
+++ b/m4/init.m4
@@ -52,7 +52,10 @@ AC_SUBST([CYGPATH_W])
 # Define the identity of the package.
 dnl Distinguish between old-style and new-style calls.
 m4_ifval([$2],
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+[AC_DIAGNOSE([obsolete],
+[$0: two- and three-arguments forms are deprecated.  For more info, see:
+http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation])
+m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
  AC_SUBST([PACKAGE], [$1])dnl
  AC_SUBST([VERSION], [$2])],
 [_AM_SET_OPTIONS([$1])dnl
diff --git a/t/ac-output-old.tap b/t/ac-output-old.tap
index 5c906a2..5ba3d3e 100755
--- a/t/ac-output-old.tap
+++ b/t/ac-output-old.tap
@@ -24,6 +24,8 @@ plan_ 22
 
 rm -f configure.ac depcomp # Not required.
 
+AUTOMAKE="$AUTOMAKE -Wno-obsolete"
+
 # -----------------------------------------------------------------------
 
 # Test for bug reported by François Pinard.
diff --git a/t/cygnus-no-more.sh b/t/aminit-moreargs-deprecation.sh
similarity index 55%
copy from t/cygnus-no-more.sh
copy to t/aminit-moreargs-deprecation.sh
index 4be0561..ac91d1d 100755
--- a/t/cygnus-no-more.sh
+++ b/t/aminit-moreargs-deprecation.sh
@@ -14,33 +14,38 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Check that support for Cygnus-style trees is deprecated.
-# That feature will be removed in the next major Automake release.
-# See automake bug#11034.
+# Check that automake warns against old-style usages of AM_INIT_AUTOMAKE
+# (i.e., calls with two or three arguments).
 
 . ./defs || Exit 1
 
-warn_rx='support for Cygnus.*trees.*removed'
+warn_rx='AM_INIT_AUTOMAKE.* two-.* three-arguments form.*deprecated'
 
-$ACLOCAL
-
-# Use of 'cygnus' option must raise an unconditional error, not a
-# warning.
-AUTOMAKE="$am_original_AUTOMAKE -Wnone -Wno-error"
+cat > configure.ac <<'END'
+AC_INIT([Makefile.am])
+AM_INIT_AUTOMAKE([twoargs], [1.0])
+AC_CONFIG_FILES([Makefile])
+END
 
-# 'cygnus' option in Makefile.am
-echo "AUTOMAKE_OPTIONS = cygnus" > Makefile.am
-AUTOMAKE_fails
-grep "^Makefile\.am:1:.*$warn_rx" stderr
+$ACLOCAL
 
-rm -rf autom4te*.cache
+do_check()
+{
+  rm -rf autom4te*.cache
+  for cmd in "$AUTOCONF" "$AUTOMAKE"; do
+    $cmd -Werror -Wnone -Wobsolete 2>stderr && { cat stderr; Exit 1; }
+    cat stderr >&2
+    grep "^configure\.ac:2:.*$warn_rx" stderr
+    $cmd -Werror -Wall -Wno-obsolete || Exit 1
+  done
+}
 
-# 'cygnus' option in configure.ac
 : > Makefile.am
-sed "s|^\\(AM_INIT_AUTOMAKE\\).*|\1([cygnus])|" configure.ac > t
+do_check
+
+sed "/^AM_INIT_AUTOMAKE/s|)$|, [NODEFINE])|" configure.ac > t
 diff configure.ac t && fatal_ "failed to edit configure.ac"
 mv -f t configure.ac
-AUTOMAKE_fails
-grep "^configure\.ac:2:.*$warn_rx" stderr
+do_check
 
 :
diff --git a/t/backcompat.sh b/t/backcompat.sh
index ec8292c..8a93141 100755
--- a/t/backcompat.sh
+++ b/t/backcompat.sh
@@ -55,7 +55,7 @@ END
     cat configure.in # For debugging.
     $ACLOCAL
     $AUTOCONF
-    $AUTOMAKE
+    $AUTOMAKE -Wno-obsolete
     ./configure
     $MAKE test
   done
diff --git a/t/backcompat3.sh b/t/backcompat3.sh
index d19af05..985e774 100755
--- a/t/backcompat3.sh
+++ b/t/backcompat3.sh
@@ -22,6 +22,8 @@ am_create_testdir=empty
 
 empty=''
 
+AUTOMAKE="$AUTOMAKE -Wno-obsolete"
+
 cat > Makefile.am <<'END'
 ## Leading ':;' here required to work around bugs of (at least) bash 3.2
 got: Makefile
diff --git a/t/backcompat5.sh b/t/backcompat5.sh
index 3aa9067..6bfb1c2 100755
--- a/t/backcompat5.sh
+++ b/t/backcompat5.sh
@@ -94,10 +94,10 @@ END
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE -a
+$AUTOMAKE -a -Wno-obsolete
 test -f install-sh
 for f in $makefiles; do mv -f $f.in $f.sav; done
-$AUTOMAKE
+$AUTOMAKE -Wno-obsolete
 for f in $makefiles; do diff $f.sav $f.in; done
 
 ./configure
diff --git a/t/backcompat6.sh b/t/backcompat6.sh
index fde118b..4523a65 100755
--- a/t/backcompat6.sh
+++ b/t/backcompat6.sh
@@ -78,7 +78,7 @@ int main (void)
 END
 
 $ACLOCAL
-$AUTOMAKE --add-missing
+$AUTOMAKE -Wno-obsolete --add-missing
 $AUTOCONF
 
 ./configure
diff --git a/t/confsub.sh b/t/confsub.sh
index e788275..b13f26a 100755
--- a/t/confsub.sh
+++ b/t/confsub.sh
@@ -19,11 +19,10 @@
 
 . ./defs || Exit 1
 
-cat > configure.ac << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-AC_CONFIG_HEADERS(subdir/config.h:subdir/config.hin)
-AC_OUTPUT(Makefile subdir/Makefile)
+cat >> configure.ac << 'END'
+AC_CONFIG_FILES([subdir/Makefile])
+AM_CONFIG_HEADER([subdir/config.h:subdir/config.hin])
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
diff --git a/t/install2.sh b/t/install2.sh
index f1992e8..bd400f4 100755
--- a/t/install2.sh
+++ b/t/install2.sh
@@ -17,14 +17,16 @@
 # Test for bug in 'make dist'
 # From Pavel Roskin.
 
+am_create_testdir=empty
 . ./defs || Exit 1
 
-cat > configure.ac << 'END'
-AC_INIT
+cat > configure.ac << END
+AC_INIT([$me], [1.0])
 dnl Prevent automake from looking in .. and ../..
-AC_CONFIG_AUX_DIR(.)
-AM_INIT_AUTOMAKE(foo, 0.1)
-AC_OUTPUT(Makefile)
+AC_CONFIG_AUX_DIR([.])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index ecb5bf2..3852217 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -117,6 +117,7 @@ t/alpha2.sh \
 t/amhello-cflags.sh \
 t/amhello-cross-compile.sh \
 t/amhello-binpkg.sh \
+t/aminit-moreargs-deprecation.sh \
 t/amassign.sh \
 t/ammissing.sh \
 t/amopt.sh \
diff --git a/t/pr2.sh b/t/pr2.sh
index ffe4a81..9aa7bc5 100755
--- a/t/pr2.sh
+++ b/t/pr2.sh
@@ -29,11 +29,8 @@
 
 . ./defs || Exit 1
 
-# Please keep this underquoted and old-style.
-cat > configure.ac << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-AC_OUTPUT(README.foo:templ/README.foo.in Makefile)
+cat >> configure.ac << 'END'
+AC_OUTPUT([README.foo:templ/README.foo.in])
 END
 
 : > Makefile.am
@@ -46,6 +43,6 @@ $AUTOCONF
 $AUTOMAKE
 ./configure
 $MAKE distdir
-test -f nonesuch-nonesuch/templ/README.foo.in
+test -f $distdir/templ/README.foo.in
 
 :
diff --git a/t/pr87.sh b/t/pr87.sh
index d98b661..121328d 100755
--- a/t/pr87.sh
+++ b/t/pr87.sh
@@ -37,12 +37,16 @@ EOF
 done
 
 echo "SUBDIRS = $subdirs" > Makefile.am
-cat >configure.ac <<EOF
-AC_INIT(`echo $subdirs | sed 's|\([a-z][a-z]*\).*|\1/\1.c|'`)
-AC_CONFIG_AUX_DIR(.)
-AM_INIT_AUTOMAKE($me, 1.0)
+
+cat > configure.ac <<EOF
+AC_INIT([$me], [1.0])
+AC_CONFIG_SRCDIR([foo/foo.c])
+AC_CONFIG_AUX_DIR([.])
+AM_INIT_AUTOMAKE
 AC_PROG_CC
-AC_OUTPUT(Makefile `echo $subdirs | sed 's|\([a-z][a-z]*\)|\1/Makefile|g'`)
+AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([`echo $subdirs | sed 's|\([a-z][a-z]*\)|\1/Makefile|g'`])
+AC_OUTPUT
 EOF
 
 mkdir build
diff --git a/t/self-check-cleanup.tap b/t/self-check-cleanup.tap
index a56854b..21c6388 100755
--- a/t/self-check-cleanup.tap
+++ b/t/self-check-cleanup.tap
@@ -19,10 +19,6 @@
 
 . ./defs || Exit 1
 
-if test x"$sh_errexit_works" != x"yes"; then
-  skip_all_ "$me: no working exit trap with 'set -e'"
-fi
-
 plan_ 43
 
 # We still need a little hack to make ./defs work outside automake's
@@ -58,7 +54,8 @@ do_clean ()
 # the cleanup code not to be run, so that the temporary directories
 # are left on disk.
 command_ok_ '"keep_testdirs=yes" causes testdir to be kept around' eval '
-     keep_testdirs=yes $SHELL -c ". ./defs && echo okok >foo" t/dummy.sh \
+     env keep_testdirs=yes \
+       $AM_TEST_RUNNER_SHELL -c ". ./defs && echo okok >foo" t/dummy.sh \
      && test -f t/dummy.dir/foo \
      && test okok = `cat t/dummy.dir/foo`'
 
@@ -79,7 +76,7 @@ chmod 000 t/dummy.dir/sub/* t/dummy.dir/file
 test $have_symlinks = yes && chmod 000 t/dummy.dir/symlink
 chmod 500 t/dummy.dir/sub t/dummy.dir
 command_ok_ "pre-cleanup can deal with low-perms testdir" \
-            $SHELL -c  '. ./defs' t/dummy.sh
+            $AM_TEST_RUNNER_SHELL -c  '. ./defs' t/dummy.sh
 command_ok_ "pre-cleanup removed low-perms testdir" \
             eval 'test ! -f t/dummy.dir \
                && test ! -d t/dummy.dir \
@@ -90,7 +87,7 @@ do_clean
 # Check that post-test cleanup works also with directories with
 # "null" permissions, and containing broken symlinks.
 command_ok_ "post-cleanup can deal with low-perms testdir" \
-            $SHELL -c  '
+            $AM_TEST_RUNNER_SHELL -c  '
   stderr_fileno_=2
   . ./defs || Exit 1
   set -e
@@ -127,7 +124,7 @@ if test $have_symlinks = yes; then
   (cd t/dummy.dir && ln -s ../../dir ../../file .)
 
   command_ok_ "pre-cleanup with testdir with zero-perms symlinks" \
-               $SHELL -c '. ./defs' t/dummy.sh
+               $AM_TEST_RUNNER_SHELL -c '. ./defs' t/dummy.sh
   ls -l # For debugging.
   command_ok_ "pre-cleanup chmod doesn't follow symlinks to files" \
                eval 'ls -l file | grep "^----------.*file"'
@@ -135,7 +132,7 @@ if test $have_symlinks = yes; then
               eval 'ls -ld dir | grep "^d---------.*dir"'
 
   command_ok_ "post-cleanup with testdir with zero-perms symlinks" \
-              $SHELL -c '
+              $AM_TEST_RUNNER_SHELL -c '
     ocwd=`pwd` || exit 1
     stderr_fileno_=2
     . ./defs || Exit 1
@@ -162,7 +159,8 @@ do_clean
 # or when receiving a signal.
 
 for st in 1 2 3 10 77 99 126 127 130 255; do
-  command_ok_ "exit trap doesn't clobber exit status $st" not $SHELL -c "
+  command_ok_ "exit trap doesn't clobber exit status $st" \
+              not $AM_TEST_RUNNER_SHELL -c "
     stderr_fileno_=2
     . ./defs
     : > foo
@@ -178,7 +176,8 @@ for sig in 1 2 3 9 13 15; do
     skip_row_ 2 -r "signal $sig seems blocked"
     continue
   fi
-  command_ok_ "exit trap doesn't clobber signal $sig" not $SHELL -c "
+  command_ok_ "exit trap doesn't clobber signal $sig" \
+              not $AM_TEST_RUNNER_SHELL -c "
     stderr_fileno_=2
     . ./defs
     : > foo
diff --git a/t/self-check-dir.tap b/t/self-check-dir.tap
index 736238c..424367e 100755
--- a/t/self-check-dir.tap
+++ b/t/self-check-dir.tap
@@ -27,16 +27,17 @@ plan_ 5
 AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC
 keep_testdirs=; unset keep_testdirs
 
-# This needs to be consistent with what $SHELL deems to be the
-# current working directory.
-cwd=`$SHELL -c 'pwd'` || fatal_ "can't get current working directory"
+# This needs to be consistent with what $AM_TEST_RUNNER_SHELL
+# deems to be the current working directory.
+cwd=`$AM_TEST_RUNNER_SHELL -c 'pwd'` \
+  || fatal_ "can't get current working directory"
 echo "$cwd"
 
 do_check ()
 {
   test ! -d _self.dir || rm -rf _self.dir \
     || framework_failure_ "cleaning up _self.dir"
-  command_ok_ "$1 [$2]" $SHELL -c "
+  command_ok_ "$1 [$2]" $AM_TEST_RUNNER_SHELL -c "
     $2
     . ./defs || Exit 99
     # Don't fail if 'ls -l' fails; avoids possible racy spurious failures.
diff --git a/t/self-check-env-sanitize.tap b/t/self-check-env-sanitize.tap
index d4e6cdb..bc78186 100755
--- a/t/self-check-env-sanitize.tap
+++ b/t/self-check-env-sanitize.tap
@@ -40,12 +40,12 @@ vars='
 
 do_run ()
 {
-  env "$1=foo" $SHELL -c '. ./defs' foo.test
+  env "$1=foo" $AM_TEST_RUNNER_SHELL -c '. ./defs' foo.test
 }
 
 do_grep ()
 {
-  env "$1=foo" $SHELL -c '. ./defs' foo.test 2>&1 1>&5 \
+  env "$1=foo" $AM_TEST_RUNNER_SHELL -c '. ./defs' foo.test 2>&1 1>&5 \
     | grep "foo\.test:.* variable '$1'.* in the environment.*unsafe"
 }
 
diff --git a/t/self-check-exit.tap b/t/self-check-exit.tap
index c866dbc..0ad5651 100755
--- a/t/self-check-exit.tap
+++ b/t/self-check-exit.tap
@@ -38,12 +38,12 @@ AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC
 init='stderr_fileno_=2; unset am_explicit_skips; . ./defs'
 
 # Required so that the code in defs doesn't go crazy trying to creating a
-# temporary directory in the absolute dir of $SHELL.
+# temporary directory in the absolute dir of $AM_TEST_RUNNER_SHELL.
 dummy_test_script=t/$me.sh
 
 for st in 1 2 3 4 5 77 99 126 127 128 129 130 255; do
   for exit_cmd in "Exit $st" "sh -c 'exit $st'"; do
-    $SHELL -c  "$init; $exit_cmd; :" "$dummy_test_script"
+    $AM_TEST_RUNNER_SHELL -c "$init; $exit_cmd; :" "$dummy_test_script"
     command_ok_ "$exit_cmd" test $? -eq $st
   done
 done
@@ -54,29 +54,18 @@ for sig in 1 2 13 15; do
     continue
   fi
   if test $sig -eq 2; then
-    # Some Korn shells might otherwise get a spurious SIGINT signal when
-    # one is sent to the child $SHELL.  For more details, see:
+    # Some Korn shells might otherwise get a spurious SIGINT when one is
+    # sent to the child $AM_TEST_RUNNER_SHELL.  For more details, see:
     # <http://lists.gnu.org/archive/html/bug-autoconf/2011-09/msg00004.html>
     trap : 2
   fi
-  $SHELL -c  "$init; kill -$sig \$\$; :" "$dummy_test_script"
+  $AM_TEST_RUNNER_SHELL -c "$init; kill -$sig \$\$; :" "$dummy_test_script"
   rc=$?
   if test $sig -eq 2; then
     # Reset default SIGINT handler as portably as possible.
     trap 2 || trap - 2
   fi
-  if test x"$sh_errexit_works" = x"yes"; then
-    # The exit trap should turn into an hard errors any failure
-    # caused by signals.
-    command_ok_ "kill -$sig" test $rc -eq 99
-  else
-    # The exit trap is not installed, so that the shell should exit
-    # with status 128+n when receiving signal number n.  But don't
-    # be too strict in the check, as POSIX only says that "The exit
-    # status of a command that terminated because it received a
-    # signal shall be reported as greater than 128".
-    command_ok_ "kill -$sig" test $rc -gt 128
-  fi
+  command_ok_ "kill -$sig" test $rc -eq 99
   unset rc
 done
 
@@ -88,25 +77,27 @@ done
 #   3. a non-existing command is issued.
 # Note that the non-existent command is issued as the last command to
 # the shell in the next line; this is deliberate.
-if $SHELL -c 'set -e; trap "exit \$?" 0; non-existent-program'; then
+# FIXME: remove this workaround once we have a better configure-time
+# determination of '$AM_TEST_RUNNER_SHELL'.
+if $AM_TEST_RUNNER_SHELL -c 'set -e; trap "exit \$?" 0; non-existent-program'; 
then
   maybe_todo=TODO reason="known Solaris /bin/sh bug"
 else
   maybe_todo="" reason=""
 fi
-$SHELL -c  "$init; non-existent-program; :" "$dummy_test_script"
+$AM_TEST_RUNNER_SHELL -c "$init; non-existent-prog; :" "$dummy_test_script"
 command_ok_ "command not found" -D "$maybe_todo" -r "$reason" \
             -- test $? -gt 0
 
 : Non-executable command.
 test -f Makefile && test ! -x Makefile || \
   framowork_failure_ "no proper Makefile in the current directory"
-$SHELL -c  "$init; ./Makefile; :" "$dummy_test_script"
+$AM_TEST_RUNNER_SHELL -c "$init; ./Makefile; :" "$dummy_test_script"
 command_ok_ "permission denied" test $? -gt 0
 
 : Syntax errors in the test code.
-$SHELL -c  "$init; if :; then" "$dummy_test_script"
+$AM_TEST_RUNNER_SHELL -c "$init; if :; then" "$dummy_test_script"
 command_ok_ "syntax error 1" test $? -gt 0
-$SHELL -c  "$init; fi" "$dummy_test_script"
+$AM_TEST_RUNNER_SHELL -c "$init; true ( true )" "$dummy_test_script"
 command_ok_ "syntax error 2" test $? -gt 0
 
 :
diff --git a/t/self-check-explicit-skips.sh b/t/self-check-explicit-skips.sh
index 3e7a77c..7a92671 100755
--- a/t/self-check-explicit-skips.sh
+++ b/t/self-check-explicit-skips.sh
@@ -20,8 +20,6 @@
 am_create_testdir=empty
 . ./defs || Exit 1
 
-test x"$sh_errexit_works" = x"yes" || skip_ "no working shell exit trap"
-
 # We still need a little hack to make ./defs work outside automake's
 # tree 'tests' subdirectory.  Not a big deal.
 sed "s|^am_top_builddir=.*|am_top_builddir='`pwd`'|" \
@@ -35,22 +33,25 @@ set +e
 unset am_explicit_skips stderr_fileno_
 AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC
 
-$SHELL -c '. ./defs; (exit 77); exit 77' dummy.test
+# I'm a lazy typist.
+sh=$AM_TEST_RUNNER_SHELL
+
+$sh -c '. ./defs; (exit 77); exit 77' dummy.test
 test $? -eq 77 || Exit 1
 
-am_explicit_skips=no $SHELL -c '. ./defs; sh -c "exit 77"' dummy.test
+am_explicit_skips=no $sh -c '. ./defs; sh -c "exit 77"' dummy.test
 test $? -eq 77 || Exit 1
 
-am_explicit_skips=yes $SHELL -c '. ./defs; (exit 77); exit 77' dummy.test
+am_explicit_skips=yes $sh -c '. ./defs; (exit 77); exit 77' dummy.test
 test $? -eq 78 || Exit 1
 
-am_explicit_skips=y $SHELL -c '. ./defs; sh -c "exit 77"' dummy.test
+am_explicit_skips=y $sh -c '. ./defs; sh -c "exit 77"' dummy.test
 test $? -eq 78 || Exit 1
 
-am_explicit_skips=yes $SHELL -c '. ./defs; Exit 77' dummy.test
+am_explicit_skips=yes $sh -c '. ./defs; Exit 77' dummy.test
 test $? -eq 77 || Exit 1
 
-am_explicit_skips=y $SHELL -c '. ./defs; skip_ "foo"' dummy.test
+am_explicit_skips=y $sh -c '. ./defs; skip_ "foo"' dummy.test
 test $? -eq 77 || Exit 1
 
 :
diff --git a/t/self-check-me.tap b/t/self-check-me.tap
index 5c83ee6..cddc9b5 100755
--- a/t/self-check-me.tap
+++ b/t/self-check-me.tap
@@ -32,7 +32,7 @@ set +e
 
 do_check ()
 {
-  $SHELL -c '. ./defs && echo me=$me' "$1" | grep "^me=$2$"
+  $AM_TEST_RUNNER_SHELL -c '. ./defs && echo me=$me' "$1" | grep "^me=$2$"
   command_ok_ "me=$1" test $? -eq 0
 }
 
@@ -48,7 +48,7 @@ do_check abc. 'abc\.'
 
 # If we override $me, ./defs should not modify it.
 
-s=`$SHELL -c 'me=foo.sh && . ./defs && echo me=$me' bad.sh`
+s=`$AM_TEST_RUNNER_SHELL -c 'me=foo.sh && . ./defs && echo me=$me' bad.sh`
 command_ok_ "override of \$me before ./defs causes no error" \
             test $? -eq 0
 
@@ -59,8 +59,8 @@ result_ "$r" "override of \$me before ./defs is honored"
 unset r
 
 # Overriding $me after sourcing ./defs-static should work.
-s=`$SHELL -c '. ./defs-static && me=zardoz &&
-              . ./defs && echo me=$me' bad.sh`
+s=`$AM_TEST_RUNNER_SHELL -c '. ./defs-static && me=zardoz &&
+                             . ./defs && echo me=$me' bad.sh`
 command_ok_ "override of \$me after ./defs-static causes no error" \
             test $? -eq 0
 
diff --git a/t/self-check-reexec.tap b/t/self-check-reexec.tap
index 8237c08..7b91008 100755
--- a/t/self-check-reexec.tap
+++ b/t/self-check-reexec.tap
@@ -16,7 +16,7 @@
 
 # Sanity check for the automake testsuite.
 # Check that automatic re-execution of test script with the
-# configure-time $SHELL.
+# configure-time $AM_TEST_RUNNER_SHELL.
 
 am_create_testdir=empty
 . ./defs || Exit 1
@@ -32,7 +32,9 @@ cp "$am_top_builddir"/defs . || fatal_ "fetching 'defs' from 
top_builddir"
 # Search for required bash and non-bash shells.
 #
 
-for bash_shell in "$SHELL" bash bash3 bash4 :; do
+for bash_shell in \
+  "$SHELL" "$AM_TEST_RUNNER_SHELL" bash bash3 bash4 :
+do
   test "$bash_shell" = : && break
   $bash_shell --version || continue
   $bash_shell -c 'test -n "$BASH_VERSION"' || continue
@@ -41,7 +43,9 @@ done
 
 # This might not be optimal, but it's much better than writing wrapper
 # scripts acting as "fake" shells.
-for non_bash_shell in /bin/sh /bin/ksh "$SHELL" sh ksh ash dash pdksh :; do
+for non_bash_shell in \
+  /bin/sh /bin/ksh sh ksh ash dash pdksh "$SHELL" "$AM_TEST_RUNNER_SHELL" :
+do
   test "$non_bash_shell" = : && break
   $non_bash_shell -c 'exit 0' || continue
   $non_bash_shell -c 'test -n "$BASH_VERSION"' && continue
@@ -97,8 +101,9 @@ cat > need-bash.sh <<'END'
 (foo=abac && test xbxc = ${foo//a/x} && test -n "$BASH_VERSION")
 END
 
+sh_var=AM_TEST_RUNNER_SHELL
 sed -e "s|^am_top_builddir=.*|am_top_builddir='$cwd'|" \
-    -e 's|^SHELL=.*$|SHELL=bash; export SHELL|' \
+    -e "s|^$sh_var=.*$|$sh_var=bash; export $sh_var|" \
     < "$am_top_builddir"/defs-static >defs-static
 
 do_reexec ()
@@ -169,12 +174,13 @@ check_reexec_message ()
   dir=$1; shift
   get_ddata "$dir"
   $sh "${dir}${dsep}dummy.sh" "$@" \
-    | grep "^dummy: exec $SHELL ${dir}${dsep}dummy\\.sh $*\$" \
+    | grep "^dummy: exec $AM_TEST_RUNNER_SHELL ${dir}${dsep}dummy\\.sh $*\$" \
     && r='ok' || r='not ok'
   result_ "$r" "$sh display re-exec message [$dname] [args: $*]"
 }
 
-./dummy.sh a b | grep "^dummy: exec $SHELL \\./dummy\\.sh a b$" \
+./dummy.sh a b \
+  | grep "^dummy: exec $AM_TEST_RUNNER_SHELL \\./dummy\\.sh a b$" \
   && r='ok' || r='not ok'
 result_ "$r" "direct run display re-exec message [args: a b]"
 
diff --git a/t/self-check-sanity.sh b/t/self-check-sanity.sh
index 64e489c..8e31afa 100755
--- a/t/self-check-sanity.sh
+++ b/t/self-check-sanity.sh
@@ -32,7 +32,7 @@ AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC
 
 source_defs=". '$am_top_builddir/defs'"
 
-if $SHELL -c "$source_defs" dummy.test 2>stderr; then
+if $AM_TEST_RUNNER_SHELL -c "$source_defs" dummy.sh 2>stderr; then
   show_stderr
   Exit 1
 else
@@ -42,7 +42,7 @@ fi
 
 sed 's|^am_top_srcdir=.*|am_top_srcdir=foo|' \
   "$am_top_builddir"/defs-static > defs-static
-if $SHELL -c "$source_defs" t/dummy.test 2>stderr; then
+if $AM_TEST_RUNNER_SHELL -c "$source_defs" t/dummy.sh 2>stderr; then
   show_stderr
   Exit 1
 else
@@ -52,7 +52,7 @@ fi
 
 sed 's|^am_top_builddir=.*|am_top_builddir=foo|' \
   "$am_top_builddir"/defs-static > defs-static
-if $SHELL -c "$source_defs" t/dummy.test 2>stderr; then
+if $AM_TEST_RUNNER_SHELL -c "$source_defs" t/dummy.sh 2>stderr; then
   show_stderr
   Exit 1
 else
@@ -71,7 +71,7 @@ env \
   top_builddir=bad-dir top_srcdir=bad-dir \
   abs_builddir=bad-dir abs_srcdir=bad-dir \
   abs_top_builddir=bad-dir abs_top_srcdir=bad-dir \
-  $SHELL -c "$source_defs && echo '!OK!' > ../foo" t/dummy.test
+  $AM_TEST_RUNNER_SHELL -c "$source_defs && echo '!OK!' > ../foo" t/dummy.sh
 $FGREP '!OK!' t/foo
 
 :
diff --git a/t/self-check-tap.sh b/t/self-check-tap.sh
index 6a2d132..d7f788c 100755
--- a/t/self-check-tap.sh
+++ b/t/self-check-tap.sh
@@ -22,19 +22,21 @@
 
 set -ex
 
-$SHELL -c '. ./defs-static && test $am_using_tap = yes' foo.tap
-$SHELL -c '. ./defs-static && test $am_using_tap = no'  foo.test
-$SHELL -c '. ./defs-static && test $am_using_tap = no'  tap
-$SHELL -c '. ./defs-static && test $am_using_tap = no'  tap.test
-$SHELL -c '. ./defs-static && test $am_using_tap = no'  foo-tap
+$AM_TEST_RUNNER_SHELL -c \
+  '. ./defs-static && test $am_using_tap = yes' foo.tap
 
-$SHELL -c '
+for name in foo.test tap tap.test foo-tap; do
+  $AM_TEST_RUNNER_SHELL -c \
+    '. ./defs-static && test $am_using_tap = no' $name
+done
+
+$AM_TEST_RUNNER_SHELL -c '
   am_using_tap=no
   . ./defs-static
   test $am_using_tap = no
 ' foo.tap
 
-$SHELL -c '
+$AM_TEST_RUNNER_SHELL -c '
   am_using_tap=yes
   . ./defs-static
   test $am_using_tap = yes
diff --git a/t/version.sh b/t/version.sh
index 98664e2..431eb0d 100755
--- a/t/version.sh
+++ b/t/version.sh
@@ -38,4 +38,4 @@ END
 : > THANKS
 
 $ACLOCAL
-$AUTOMAKE --gnits
+$AUTOMAKE --gnits -Wno-obsolete
diff --git a/t/version2.sh b/t/version2.sh
index 71749f6..273bd36 100755
--- a/t/version2.sh
+++ b/t/version2.sh
@@ -38,4 +38,4 @@ END
 : > THANKS
 
 $ACLOCAL
-$AUTOMAKE --gnits
+$AUTOMAKE --gnits -Wno-obsolete


hooks/post-receive
-- 
GNU Automake



reply via email to

[Prev in Thread] Current Thread [Next in Thread]