libtool-patches
[Top][All Lists]
Advanced

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

Re: make libtool faster v3


From: Ralf Wildenhues
Subject: Re: make libtool faster v3
Date: Thu, 2 Dec 2004 10:36:23 +0100
User-agent: Mutt/1.4.1i

* Peter O'Gorman wrote on Wed, Dec 01, 2004 at 10:19:38AM CET:
> Ralf Wildenhues wrote:
> >We provide two implementations of each function, a Bourne shell com-
> >pliant one and an XSI compliant one (again, the latter without forks).
> >Since most systems either have a suitable shell already or are not used
> >primarily for application development anyway, this should benefit the
> >bulk of libtool users while /not/ compromising portability.
> 
> Can the shells capabilities not be checked in configure (in libtool.m4) and 
> the appropriate basename and dirname functions put in the generated libtool 
> script from config.status? Even chosing which version of dirname/basename 
> to call during configure is better than doing it every time libtool is 
> called.

Thanks for your suggestion.

Actually, one could go much further, namely look at AS_DIRNAME and
AS_BASENAME in Autoconf's m4sh.m4.  They could make use of XSI
constructs as well (the dirname would have to be more involved than
my proposed version, however), even configure scripts could benefit.
But I don't know how to make it work without forking, while keeping
the current interface.

But let's not delve into that (see side note below if interested).

How would I insert stuff into created `libtool' based on tests at
configure time?  I know AC_SUBST and AC_SUBST_FILE, but the former does
not work with multi-line output, and both do not work with the special
`libtool' output file.

If we could output the functions directly, that would also allow us to
replace
  $func_basename
with
  func_basename
which is even nicer than just computing $func_basename at configure
time.

Regards,
Ralf


Side note (more of a brain dump):

AS_BASENAME could expand to
| if $as_xsi_shell; then
|   func_basename_xsi $1  # how to quote this?
| else
|   # rest of basename methods
| fi

with some suitable _AS_BASENAME_PREP* once expanded to set
as_xsi_shell and define func_basename_xsi.  Hmm.  Do shells
understand conditional function declaration or at least skip
them if they don't know functions at all?  Like:

if $as_xsi_shell; then
  func_foo ()
  {
    # ...
  }
fi

If not, one could put the functions in a here document and source them.

But even with all this, you'd still have to fork/clone when using
| result=`AS_DIRNAME("$foo")`

At least that'd omit the exec("dirname"), which is also expensive.




reply via email to

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