diff options
author | Zack Weinberg <zackw@panix.com> | 2020-08-26 15:08:26 -0400 |
---|---|---|
committer | Zack Weinberg <zackw@panix.com> | 2020-08-26 15:08:26 -0400 |
commit | 88e0d39a46b2f9c43fa48fda50da09607f6a9d9b (patch) | |
tree | d52a8c3badabd55980d6aea42aeb68d177981772 | |
parent | df1866fd0c5d9b91a08856856601c7bc9da5fca3 (diff) | |
download | autoconf-88e0d39a46b2f9c43fa48fda50da09607f6a9d9b.tar.gz |
Add NetBSD /bin/sh to the -n whitelist.
NetBSD’s /bin/sh sets a special variable “NETBSD_SHELL” to identify
itself. This means we can whitelist it as not having a buggy -n
implementation.
* configure.ac: Assume -n mode works in shells that have a preset
variable named NETBSD_SHELL.
-rw-r--r-- | configure.ac | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index 38a8ff95..56d27549 100644 --- a/configure.ac +++ b/configure.ac @@ -64,7 +64,7 @@ AC_CACHE_CHECK([for a shell whose -n mode is known to work], # follow with a hardwired list of shells that are known to work and can # be identified as such, starting with the ones with the fewest # syntactic extensions. Unfortunately, several shells that are also -# known to work can't be easily identified (e.g. BSD sh, dash). +# known to work can't be easily identified (e.g. some BSD shells and dash). # Try ksh93, which is often buggy, and plain ksh and sh last. for cand_sh in "$SHELL" pdksh bash zsh ksh93 ksh sh do @@ -72,8 +72,9 @@ do unset BASH_VERSION ZSH_VERSION "$cand_sh" -c ' test ${BASH_VERSION+y} || # Bash - test ${KSH_VERSION+y} || # pdksh - test ${ZSH_VERSION+y} || # zsh + test ${KSH_VERSION+y} || # pdksh + test ${ZSH_VERSION+y} || # zsh + test ${NETBSD_SHELL+y} || # NetBSD sh test -n "${.sh.version}" # ksh93; put this last since its syntax is dodgy ' ) 2>/dev/null |