[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 01-as-require-shell-fn.patch
From: |
Akim Demaille |
Subject: |
Re: 01-as-require-shell-fn.patch |
Date: |
Mon, 24 Nov 2003 16:47:19 +0100 |
User-agent: |
Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux) |
Public please.
>> Autotest, or via a spy in Autoconf, to real check what matters: shfn
>> support, and not "shfn support amongst shells supporting LINENO". If,
>> out of chance, there happens to be a shell that supports LINENO but
>> not shfn, then we have to go through another full cycle, and this
>> LONG... :(
> What about putting a spy in AS_INIT that checks there happens to be a
> shell that supports LINENO but not shfn, and to mail address@hidden
> if so? See the attached diff; it is intended to keep things as
> low-tech as possible in the shell detection script. (I remember the
> "Present but Cannot Be Compiled" e-mail bursts, but these messages
> will hopefully be less frequent).
As I already said, if it ever happens that such a shell exists
(supports LINENO but not shfn), then we lose one round. Sounds
useless a risk to take.
Apply the same idea with an embedded M4sh script containing a simple
AS_INIT_WITH_SHELL_FUNCTIONS
and I'm happy.
>> I admit I understood your patch as the first step towards using shfn
>> in Autoconf, but I'm wrong, sorry.
>>
> It is, but is more long term than you thought (and sorry if I gave
> that impression). For example, all the patches I committed are the
> result of inspecting the source for the m4 list (AS_FOREACH) patch,
> which is something that I'd like to have in, surely after I test it on
> real life examples, but also before shell functions.
> Paolo
> Index: m4sh.m4
> ===================================================================
> RCS file: /cvsroot/autoconf/autoconf/lib/m4sugar/m4sh.m4,v
> retrieving revision 1.107
> diff -u -r1.107 m4sh.m4
> --- m4sh.m4 24 Nov 2003 10:44:52 -0000 1.107
> +++ m4sh.m4 24 Nov 2003 14:58:02 -0000
> @@ -195,6 +195,46 @@
> # Name of the executable.
> as_me=`AS_BASENAME("$[0]")`
> +$SHELL <<\EOF
> +func_return () {
> + (exit [$]1)
> +}
> +
> +func_success () {
> + func_return 0
> +}
> +
> +func_failure () {
> + func_return 1
> +}
> +
> +func_ret_success () {
> + return 0
> +}
> +
> +func_ret_failure () {
> + return 1
> +}
> +
> +if func_success; then
> + if func_failure; then
> + echo 'Your system does not have working shell functions.'
> + echo 'Please write to address@hidden (func_failure succeeded).'
> + fi
> +else
> + echo 'Your system does not have working shell functions.'
> + echo 'Please write to address@hidden (func_success failed).'
> +fi
> +if func_ret_success; then
> + if func_ret_failure; then
> + echo 'Your system does not have working shell functions.'
> + echo 'Please write to address@hidden (func_ret_failure succeeded).'
> + fi
> +else
> + echo 'Your system does not have working shell functions.'
> + echo 'Please write to address@hidden (func_ret_success failed).'
> +fi
> +EOF
> ])
Looks good!
- 01-as-require-shell-fn.patch, Paolo Bonzini, 2003/11/14
- Re: 01-as-require-shell-fn.patch, Akim Demaille, 2003/11/21
- Re: 01-as-require-shell-fn.patch, Paolo Bonzini, 2003/11/22
- Re: 01-as-require-shell-fn.patch, Paul Eggert, 2003/11/24
- Re: 01-as-require-shell-fn.patch, Akim Demaille, 2003/11/24
- Re: 01-as-require-shell-fn.patch, Paolo Bonzini, 2003/11/24
- Re: 01-as-require-shell-fn.patch, Akim Demaille, 2003/11/24
- Message not available
- Re: 01-as-require-shell-fn.patch,
Akim Demaille <=
- Re: 01-as-require-shell-fn.patch, Bonzini, 2003/11/25
- Re: 01-as-require-shell-fn.patch, Akim Demaille, 2003/11/26
- Re: 01-as-require-shell-fn.patch, Paolo Bonzini, 2003/11/26
- Re: 01-as-require-shell-fn.patch, Akim Demaille, 2003/11/26
- Re: 01-as-require-shell-fn.patch, Paolo Bonzini, 2003/11/27
- Re: 01-as-require-shell-fn.patch, Akim Demaille, 2003/11/27
- Re: 01-as-require-shell-fn.patch, Paul Eggert, 2003/11/24
- Re: 01-as-require-shell-fn.patch, Paolo Bonzini, 2003/11/25
- Re: 01-as-require-shell-fn.patch, Akim Demaille, 2003/11/26
- Re: 01-as-require-shell-fn.patch, Akim Demaille, 2003/11/26