From 21c99d4de03c9a90115abdf24344bf4ecc79575c Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 18 Apr 2020 08:11:37 -0700 Subject: configure: simplify shell viability test. * configure: the golden trick is simply to test whether PS4 contains "+ ". PS2 is not a useful variable, because even crappy old 1980's vintage System V shells set that up. It turns out that Zsh in POSIX mode (when run as /bin/sh) handles configuring and building TXR just fine. And Zsh does set PS4 to "+ " in that mode. However, it does not set PS2, unless run interactively. When run interactively as /bin/sh, Zsh sets PS2 to "> ". So, let us drop the Bash variable tests, and the test for PS2 being "> " and only test PS4. --- configure | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 75e1604e..180a3966 100755 --- a/configure +++ b/configure @@ -39,20 +39,12 @@ while true ; do break fi - # Evidence we are running on Bash in POSIX mode. - if test x$POSIXLY_CORRECT = y ; then - break - fi - - # Evidence we are running on Bash in regular mode. - if test x$BASH_VERSION != x ; then - break - fi - - # If the shell has PS2 and PS4 with these values, it is - # probably a good shell: late-model Ash, Dash or the XPG - # shell on Solaris and perhaps others. - if test "x$PS2" = "x> " && test "x$PS4" = "x+ " ; then + # If PS4 is set to "+ ", we are probably running on a good shell: GNU + # Bash sets it like this, as does late-model Ash, Dash, Korn Shell 93, + # and the XPG shell on Solaris 10. Zsh sets PS4 to "+ " this in its + # POSIX mode, which handles our script, but to some other value in its + # regular mode which doesn't handle our script. + if test "x$PS4" = "x+ " ; then break fi -- cgit v1.2.3