[Top][All Lists]

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

Re: libtool rearranging library paths

From: Ralf Wildenhues
Subject: Re: libtool rearranging library paths
Date: Fri, 2 Dec 2005 17:48:05 +0100
User-agent: Mutt/1.5.11

* Christopher Hulbert wrote on Fri, Dec 02, 2005 at 05:31:52PM CET:
> > On another note, why does libtool add an entire static archive (.a) if
> > it wasn't created with libtool?  I did an nm on a convenience library
> > and it had a .a stuck in there and nm complained that it didn't know
> > what file type that was.  It was also missing the symbols from inside
> > that archive (the objects were in an archive in an archive).  I think
> > I also did this for a shared object and got the same results.
> Sorry, should have mentioned that it happens when putting the library
> in the automake _LIBADD variable.  It's friday right? :)

D'oh.  I know what you mean.  Don't use
  libtool --mode=link $CC -o foo.lo libbar.a

but instead use
  libtool --mode=link $CC -o foo.lo -L. -lbar

which is more portable.  Well, not really, but at least it does what
you'd expect from libtool: not add libbar to either the archive nor the
shared library, but add its name in the dependency_libs entry of, so that programs linked against will pick it up.

Sure this may be regarded as a libtool limitation.  Just as putting a
/path/to/ right on the command line.  Both is bad: on some
systems, the latter will hardcode the path into the output -- not really
what you'd expect in any case.


reply via email to

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