mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-22 09:24:54 +01:00
configure: check whether shell is capable of parameter substring processing
'configure' script uses parameter substring extensively. It is Posix shell feature. Original Bourne shell does not have such features. Some systems still ships such shells as /bin/sh (for compatibility reasons -- shell scripts written on those platforms are expected to work on 1990's systems). Just testing whether parameter substring processing works will make the shell exit due to syntax error if it is not compatible. Therefore the test is executed in a subshell -- subshell exits with nonzero value when the operation in question fails. As 'if ! ...' does not work in Bourne shell, Short-circuiting construct '||' is used to print information message and exit when expected.
This commit is contained in:
parent
a89a2b276f
commit
4cedb2a3ea
1 changed files with 14 additions and 0 deletions
14
configure
vendored
14
configure
vendored
|
@ -1,5 +1,19 @@
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
|
# Test whether this shell is capable of parameter substring processing.
|
||||||
|
( option='a/b'; : ${option#*/} ) 2>/dev/null || {
|
||||||
|
echo "
|
||||||
|
The shell interpreting '$0' is lacking some required features.
|
||||||
|
|
||||||
|
To work around this problem you may try to execute:
|
||||||
|
|
||||||
|
ksh $0 $*
|
||||||
|
or
|
||||||
|
bash $0 $*
|
||||||
|
"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
# Store original IFS value so it can be changed (and restored) in many places.
|
# Store original IFS value so it can be changed (and restored) in many places.
|
||||||
readonly DEFAULT_IFS="$IFS"
|
readonly DEFAULT_IFS="$IFS"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue