2006-10-09 Stepan Kasal * lib/m4sugar/m4sh.m4 (AS_BOURNE_COMPATIBLE): Move the initialization which is not inherited through the environment (_AS_BOURNE_COMPATIBLE): ... to this new macro. (_AS_RUN): Call _AS_BOURNE_COMPATIBLE, not AS_BOURNE_COMPATIBLE. --- lib/m4sugar/m4sh.m4 2006-10-09 16:13:03.000000000 +0200 +++ lib/m4sugar/m4sh.m4 2006-10-09 16:07:03.000000000 +0200 @@ -167,18 +167,24 @@ # configure; apparently this would include UnixWare, as described in # . m4_define([AS_BOURNE_COMPATIBLE], -[# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh +[# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +_$0 +]) + +# _AS_BOURNE_COMPATIBLE +# --------------------- +# This is the part of AS_BOURNE_COMPATIBLE which has to be repeated inside +# each instance. +m4_define([_AS_BOURNE_COMPATIBLE], +[AS_IF([test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1], + [emulate sh NULLCMD=: [#] Zsh 3.x and 4.x performs word splitting on ${1+"address@hidden"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"address@hidden"}'='"address@hidden"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac -fi -DUALCASE=1; export DUALCASE # for MKS sh + setopt NO_GLOB_SUBST], + [AS_CASE([`(set -o) 2>/dev/null`], [*posix*], [set -o posix])]) ]) @@ -189,7 +195,7 @@ m4_define([_AS_RUN], [m4_ifval([$2], [{ $2 <<\_ASEOF -AS_BOURNE_COMPATIBLE +_AS_BOURNE_COMPATIBLE $1 _ASEOF }],