On 12/17/2011 10:22 PM, Gary V. Vaughan wrote: > libtool: minimise forks per invocation under bash. > > * build-aux/general.m4sh (lt_HAVE_PLUSEQ_OP, lt_HAVE_ARITH_OP) > (lt_HAVE_XSI_OPS): Set these without forking a test script when > running under bash, to avoid a few unnecessary forks. >
> +# 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]}))"
> \
This MUST be hidden behind an eval. Otherwise, shells like Solaris
/bin/sh will choke on trying to parse this line:
$ /bin/sh -c 'echo "$((${BASH_VERSINFO[0]}*1000 + \
${BASH_VERSINFO[1]}))"'
/bin/sh: bad substitution
--
Eric Blake [email protected] +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
