Look harder for a shell whose -n is known to work.
commit25014b40e0a9d194f87e6047c394e9a45b5ae938
authorZack Weinberg <zackw@panix.com>
Tue, 30 Jun 2020 01:40:48 +0000 (29 18:40 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 30 Jun 2020 06:17:15 +0000 (29 23:17 -0700)
treed37cc0d3d6b9aa4cd9f1fbe6dd001e973579b484
parent834b866d39860f34fffda92ff8087133fcb3d0e9
Look harder for a shell whose -n is known to work.

The test suite was insisting on using /bin/sh -n for syntax checking,
which meant that if /bin/sh wasn’t one of the short list of shells
whose -n is known to work, we would skip all of the syntax-check
tests, even if some other shell was available that would work.

Instead do like _AS_DETECT_BETTER_SHELL, and loop over possible
shells, starting with $SHELL and going on to a hardwired list of
known-good possibilities.  The result is written to the substitution
variable @SHELL_N@ and the testsuite uses that.

(Should we invoke AC_PATH_PROG on the result of the search if it’s not
already absolute?)

* configure.ac: Search for a shell whose -n mode is known to
        work, instead of just checking /bin/sh.  Set @SHELL_N@ to
        what we find.
        * tests/atlocal.in: Propagate @SHELL_N@ to testsuite.
        * tests/local.at (AT_CHECK_SHELL_SYNTAX): Use $SHELL_N instead
        of hardcoding /bin/sh.  Update test for usable shell -n.
        (AT_CHECK_AUTOCONF): Update test for usable shell -n.
        * tests/tools.at: Update test for usable shell -n.
configure.ac
tests/atlocal.in
tests/local.at
tests/tools.at