]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
libtool: make fork minimisation compatible with dash and zsh.
authorGary V. Vaughan <gary@gnu.org>
Sun, 18 Dec 2011 13:41:10 +0000 (20:41 +0700)
committerGary V. Vaughan <gary@gnu.org>
Sun, 18 Dec 2011 13:46:47 +0000 (20:46 +0700)
* build-aub/general.m4sh (lt_HAVE_PLUSEQ_OP): Instead of using
$((..)) arithmetic, which causes an error on dash, use a case
based bash version check.
(lt_HAVE_ARITH_OP, lt_HAVE_XSI_OPS): Also short circuit the
feature probing forks and set these automatically when zsh is
detected.
Reported by Stefano Lattarini.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
build-aux/general.m4sh

index e96c0e4bff20667ba9048f971383c864fed11650..3cfecee76703c194f8c23ecf00440954136dc360 100644 (file)
@@ -75,14 +75,16 @@ basename='s|^.*/||'
 
 
 # We should try to minimise forks, especially on Windows where they are
-# unreasonably slow, so skip the feature probes when bash is being used:
-if test set = "${BASH_VERSION+set}"; then
+# unreasonably slow, so skip the feature probes when bash or zsh are
+# being used:
+if test set = "${BASH_VERSION+set}${ZSH_VERSION}"; then
     : ${lt_HAVE_ARITH_OP="yes"}
     : ${lt_HAVE_XSI_OPS="yes"}
     # The += operator was introduced in bash 3.1
-    test -z "$lt_HAVE_PLUSEQ_OP" \
-      && test 3000 -lt "$((${BASH_VERSINFO[0]}*1000 + ${BASH_VERSINFO[1]}))" \
-      && lt_HAVE_PLUSEQ_OP=yes
+    case $BASH_VERSION in
+      [12].* | 3.0 | 3.0.*) ;;
+      *)                    lt_HAVE_PLUSEQ_OP=yes ;;
+    esac
 fi