autoconf-patches
[Top][All Lists]
Advanced

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

Re: more efficient AS_EXIT


From: Ralf Wildenhues
Subject: Re: more efficient AS_EXIT
Date: Sat, 25 Oct 2008 11:36:23 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

Hi Eric,

* Eric Blake wrote on Thu, Oct 23, 2008 at 10:04:56PM CEST:
> So, based on the recent discussion, does this patch look sane?  I also tried 
> to 
> clean up _AS_PREPARE, so that it doesn't require a duplicate listing of 
> as_func_mkdir_p just to work around AS_REQUIRE* issues.

Hmm, this patch seems to squash in a couple of changes that could be
done independently.

For bonus points, is it possible to defun AS_EXIT as plain exit for as
long as the trap isn't in place, or as '(exit X); exit X' for as long
as we are before any shell function, and the redefun it as the cool
version at that point?  That way you could keep using AS_EXIT
everywhere, consistently.

I wouldn't bother much about performance here BTW, it's not like it's
common to execute many AS_EXITs during one script run.  :-)
(And it's not much of a text reduction either.)

FWIW, I didn't try your patch because it seemed to be mangled on the
way, but it looks like the function you're using to exit does not avoid
the zsh exit status in function bug.  (Yes, I know the shell is supposed
to be rejected, but if poor sap has no other one?)

So all in all I'm kind of wondering if this patch is worth the hassles
it introduces.

Cheers,
Ralf

> From: Eric Blake <address@hidden>
> Date: Thu, 23 Oct 2008 11:27:11 -0600
> Subject: [PATCH] Add AS_SET_STATUS, make AS_EXIT more efficient.
> 
> * lib/m4sugar/m4sh.m4 (_AS_EXIT_PREPARE, AS_SET_STATUS): New
> macros.
> (AS_EXIT): Rewrite to avoid forks.
> (_AS_DETECT_REQUIRED, _AS_DETECT_SUGGESTED)
> (_AS_DETECT_BETTER_SHELL, _AS_SHELL_SANITIZE): Avoid AS_EXIT in
> contexts prior to shell functions.
> (AS_REQUIRE_SHELL_FN): Factor...
> (_AS_REQUIRE_SHELL_FN): ...into new helper macro.
> (AS_PREPARE): Prepare the functions.
> (_AS_PREPARE): Likewise.  Temporarily redefine AS_REQUIRE_SHELL_FN
> to make this task easier.
> (_AS_LINENO_PREPARE): Make more efficient.
> (_AS_MKDIR_P_PREPARE): Simplify use in _AS_PREPARE.
> * doc/autoconf.texi (Common Shell Constructs) <AS_EXIT>,
> <AS_SET_STATUS>: Document.
> (Limitations of Builtins): Mention AS_EXIT.
> * NEWS: Mention new macro.
> * bin/autoconf.as: Use AS_EXIT consistently.




reply via email to

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