From: Paolo Bonzini Date: Tue, 14 Oct 2008 09:16:47 +0000 (+0200) Subject: Trim down the size of the better-shell test. X-Git-Tag: v2.63b~254 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6265de13feb09b7bb67a8fbe406dd71a2554f61c;p=thirdparty%2Fautoconf.git Trim down the size of the better-shell test. * lib/m4sugar/m4sh.at (_AT_DETECT_BETTER_SHELL): Store the common snippets into shell variables. (_AS_RUN): Rewrite. --- diff --git a/ChangeLog b/ChangeLog index 1f2bb12b..7cbb6704 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-10-15 Paolo Bonzini + + Trim down the size of the better-shell test. + * lib/m4sugar/m4sh.at (_AT_DETECT_BETTER_SHELL): Store the common + snippets into shell variables. + (_AS_RUN): Rewrite. + 2008-10-15 Paolo Bonzini Support a stack of LINENO values for AS_MESSAGE. diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4 index 1051ef5d..20b57724 100644 --- a/lib/m4sugar/m4sh.m4 +++ b/lib/m4sugar/m4sh.m4 @@ -197,11 +197,13 @@ dnl Remove any tests from suggested that are also required [m4_set_remove([_AS_DETECT_SUGGESTED_BODY], _m4_defn([AS_snippet]))])])dnl m4_set_empty([_AS_DETECT_REQUIRED_BODY], [as_have_required=yes], - [AS_IF([_AS_RUN(m4_set_contents([_AS_DETECT_REQUIRED_BODY])) 2>/dev/null], + [as_bourne_compatible="AS_ESCAPE(m4_expand([_AS_BOURNE_COMPATIBLE]))" + as_required="AS_ESCAPE(m4_expand(m4_set_contents([_AS_DETECT_REQUIRED_BODY])))" + as_suggested="AS_ESCAPE(m4_expand(m4_set_contents([_AS_DETECT_SUGGESTED_BODY])))" + AS_IF([_AS_RUN(["$as_required"])], [as_have_required=yes], [as_have_required=no])]) - AS_IF([test $as_have_required = yes &&dnl - _AS_RUN(m4_set_contents([_AS_DETECT_SUGGESTED_BODY])) 2> /dev/null], + AS_IF([test $as_have_required = yes && _AS_RUN(["$as_suggested"])], [], [as_candidate_shells= _AS_PATH_WALK([/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH], @@ -215,14 +217,11 @@ dnl Remove any tests from suggested that are also required for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. AS_IF([{ test -f "$as_shell" || test -f "$as_shell.exe"; } && - _AS_RUN(m4_set_contents([_AS_DETECT_REQUIRED_BODY]), - [("$as_shell") 2> /dev/null])], + _AS_RUN(["$as_required"], ["$as_shell"])], [CONFIG_SHELL=$as_shell as_have_required=yes m4_set_empty([_AS_DETECT_SUGGESTED_BODY], [break], - [AS_IF([_AS_RUN(m4_set_contents([_AS_DETECT_SUGGESTED_BODY]), - ["$as_shell" 2> /dev/null])], - [break])])]) + [AS_IF([_AS_RUN(["$as_suggested"], ["$as_shell"])], [break])])]) done AS_IF([test "x$CONFIG_SHELL" != x], @@ -329,13 +328,8 @@ $2 # Run TEST under the current shell (if one parameter is used) # or under the given SHELL, protecting it from syntax errors. m4_define([_AS_RUN], -[m4_ifval([$2], -[{ $2 <<\_ASEOF -_AS_BOURNE_COMPATIBLE -$1 -_ASEOF -}], -[(eval "AS_ESCAPE(m4_expand([$1]))")])]) +[m4_ifval([$2], [{ $as_echo "$as_bourne_compatible"$1 | ($2); }], + [(eval $1)]) 2>/dev/null]) # _AS_SHELL_FN_WORK