At Thursday 29 July 2010, Eric Blake wrote:
> On 07/29/2010 05:15 AM, Stefano Lattarini wrote:
> > Hello autoconfers.
> > 
> > There is any reason why the AS_BASENAME and AS_DIRNAME macros
> > don't have associated as_fn_* shells functions, like e.g.
> > AS_MKDIR_P or AS_UNSET do?  If there is no such reason, you
> > might find the attached patch useful.
> 
> The biggest reason is that I'd _really_ like to implement
> conditional support for XSI usage, so that on decent shells, we
> can perform dirname/basename without forking via ${a%/*} style
> manipulations, and where we no longer chop trailing newlines.  But
> to do that, we need a new interface:
> 
> AS_BASENAME_VAR([varname], [name-to-chop])
> 
> We tried deprecating AS_BASENAME in the past (and at one point, it
> was even undocumented; we had to reinstate the documentation
> because people use it) because it does not lend itself well to the
> faster implementation.
OK, makes sense.

> And once you have the support for XSI detection and a working
> AS_BASENAME_VAR function, we would then rewrite AS_BASENAME to
> something like:
> 
> m4_define([AS_BASENAME],
> [AS_BASENAME_VAR([as_name], [$1]); AS_ECHO([$as_name])])

Thanks for your explanation.

Regards,
   Stefano


Reply via email to