libtool
[Top][All Lists]
Advanced

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

Re: multiple libraries with inter-dependencies and relinking with DESTDI


From: Mike Frysinger
Subject: Re: multiple libraries with inter-dependencies and relinking with DESTDIR
Date: Thu, 10 Jan 2008 14:56:33 -0500
User-agent: KMail/1.9.7

On Thursday 10 January 2008, Ralf Wildenhues wrote:
> * Mike Frysinger wrote on Thu, Jan 10, 2008 at 08:29:29PM CET:
> > On Thursday 10 January 2008, Ralf Wildenhues wrote:
> > > * Mike Frysinger wrote on Mon, Dec 31, 2007 at 09:52:36PM CET:
> > > > when doing `make install DESTDIR=/some/place`, the relinking is fine
> > > > for libone.la.  but when relinking libtwo.la, -L$libdir is
> > > > incorrectly added to the linking step.  an -L flag pointing to the
> > > > $DESTDIR/$libdir is added before this and that's great ... it means
> > > > libtwo.la is relinked against the new/current version of libone.la
> > > > and not some random old version in $libdir. the problem with
> > > > -L$libdir being added *at all* is cross-compiling.  this path can
> > > > easily be a host libpath which means it gets searched before the
> > > > normal cross-compiler library paths.
> > >
> > > My qualm with changing that code is: sometimes we do *need* to add both
> > > of those paths.  Otherwise, users will scream about breaking their
> > > legitimate setups.  Now, how to find out when it is needed and when
> > > not?
> >
> > can you describe such a legitimate setup ?  off the top of my head, i
> > cant think of one.
>
> I think this is such a setup (but I haven't tried it out now, please say
> so if you want me to try it):
>
> Non-cross-compiling:  I have a package, am not root.  Its libraries
> depend on some in /usr/lib.  I do
>   make install DESTDIR=/temp/dest
>
> (which needs relinking, thus needs the libraries from /usr/lib),
> create a tarball from /temp/dest/usr/local/...
> and hand that tarball over to the superuser to install it.
>
> FWIW, this setup avoids that the compiler is ever run by root.

sorry, but which libraries are we talking about here ?  it is my understanding 
that libtool would do the '-lfoo' => 'libfoo.la' translation already which 
means the paths for any libtool libraries would be discovered and used, and 
any system libraries (like the libc) are the domain of the toolchain to 
handle.

i'd also think that the libdir in any individual .la script makes a statement 
about that library and that library alone ... it implies nothing about the 
libraries' dependencies, after all isnt that the explicit purpose of 
$dependency_libs ?

why is the explicit -L$libdir required only when inter-dependencies are 
involved ?  in my original example, libone.la has its libdir set to /usr/lib 
yet libtool does not feel the need to add -L$libdir to it.

or am i mistaken as to the source of the -L$libdir (it comes from the 
libraries' own .la and not any other's .la) ?  so in the libone/libtwo 
example, is the -L$libdir from libone.la or libtwo.la ?  i was thinking that 
the libtwo relinking step was taking -L$libdir from libtwo.la and not from 
libone.la ...
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

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