autoconf
[Top][All Lists]
Advanced

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

Re: [CFT] Shell functionization patch (if you don't know what that means


From: Paolo Bonzini
Subject: Re: [CFT] Shell functionization patch (if you don't know what that means, it's faster Autoconf and leaner configure scripts)
Date: Fri, 17 Oct 2008 09:18:30 +0200
User-agent: Thunderbird 2.0.0.17 (Macintosh/20080914)

>> Also, the zsh issue has to be understood better (and could be a deal
>> breaker, though I don't think so).
> 
> It basically means that you cannot call exit nor trap inside a shell
> function.  Nor can you use $? at the start of a function.  But you'll
> deal with that anyway since you will want to put something like
>   $as_debug
> 
> at the start of each function (either being empty, or 'set -x'), for
> ksh.

Do you want to put that in AS_REQUIRE_SHELL_FN?  It's fine by me.

> So, whenever you expand (or eval) arbitrary text into a shell function,
> there is a potential problem.

But it is not arbitrary text.  See my message in the other thread.

> I'm not quite sure how prevalent systems with this zsh are (but probably
> still too common to completely ignore them).  Even when we can ignore
> them, the script header should be sure to error out for such systems
> (because the corruption is silent, and hard to detect).

... and in fact IIRC this shell will be ignored by the better-shell loop
because it fails one of the tests; I think it is as_func_failure:

    as_func_return ()
    {
      (exit $1)
    }

    as_func_failure ()
    {
      as_func_return 1
    }

    as_func_failure && echo as_func_failure succeeded.

Paolo




reply via email to

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