diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2020-04-18 08:11:37 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2020-04-18 08:11:37 -0700 |
commit | 21c99d4de03c9a90115abdf24344bf4ecc79575c (patch) | |
tree | c008e248937b5c1a0b075090292c0fea38ead500 /configure | |
parent | 7a2e3b99fa181385c8aff9cced40ff46602daf4d (diff) | |
download | txr-21c99d4de03c9a90115abdf24344bf4ecc79575c.tar.gz txr-21c99d4de03c9a90115abdf24344bf4ecc79575c.tar.bz2 txr-21c99d4de03c9a90115abdf24344bf4ecc79575c.zip |
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.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 20 |
1 files changed, 6 insertions, 14 deletions
@@ -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 |