libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FYI [PATCH] libtool: minimise forks per invocation under bash.


From: Stefano Lattarini
Subject: Re: FYI [PATCH] libtool: minimise forks per invocation under bash.
Date: Sun, 18 Dec 2011 10:52:30 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.24) Gecko/20111114 Icedove/3.1.16

On 12/18/2011 06:15 AM, Gary V. Vaughan wrote:
+# 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
+    : ${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
+fi
This will likely break with dash 0.5.2:

  $ cat foo.sh
  #!/bin/sh
  if test set = "${BASH_VERSION+set}"; 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
  fi
  $ dash foo.sh
  foo.sh: 7: Syntax error: Bad substitution

Regards,
    Stefano



reply via email to

[Prev in Thread] Current Thread [Next in Thread]