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

Re: Problems using libtool



On Thu, Apr 05, 2001 at 09:27:12AM -0400, Dale Scheetz wrote:
> On Thu, 5 Apr 2001, Ganesan R wrote:
> 
> > On Wed, Apr 04, 2001 at 01:59:18PM -0400, Dale Scheetz wrote:
> > > Apparently the .la file must be installed using libtool, but the manpage
> > > is rather incomplete about what happens when you supply --mode=install
> > > option. libtool --help is a bit more help, but what it says isn't what
> > > happens. The implication of the help is that what follows the mode option
> > > is either the word install or cp and that all that follows is passed as
> > > options to that command. Apparently libtool does more than that. When I
> > > try to use it in the rules file I get:
> > > 
> > > install -m 644 ./.libs/libgmp.a debian/tmp/usr/lib/.
> > > libtool --mode=install \
> > >    install -m 644 ./.libs/libgmp.la `pwd`/debian/tmp/usr/lib/.
> > > install -m 644 ./.libs/.libs/libgmp.so.3.1.1
> > > /home/dwarf/build/libgmp3-3.1.1/debian/tmp/usr/lib/./libgmp.so.3.1.1
> > > install: cannot stat `./.libs/.libs/libgmp.so.3.1.1': No such file or
> > > directory
> > > make: *** [binary] Error 1
> > > 
> > > 
> > > The first three lines are directly from my rules file.
> > 
> > That's your problem. You are depending on libtool internals which is sure to
> > cause you grief. 
> 
> So, besides the source, where are these "internals" documented?

I think the documentation does mention some of this; I don't know about
libraries, but I am sure the documentation describes that "binaries" created
with libtool are actually shell scripts in the build directory, when you
actually install them it automagically installs the binary with correct
library dependencies. 

> > Just use libtool --mode=install with libgmp.la in the
> > top-level directory (not the one in .libs). This will install the .la file,
> > .so files as well as the .a. You can then move the .a, .la and the .so
> > symlink to then -dev package. HTH.
> 
> Is this the way the tool is supposed to be used?

That's right. You are not even supposed to know that the shared library has
an .so extension. On HP-UX the extension will be .sl. On Win32 it will be
.dll. The whole idea of libtool is to hide these implementation issues. 

> Why is libtool trying to install the .so file when I only asked for the
> .la file to be installed? (This is probably down in those internals ;-)

Because the .la file is the "whole library" as far as libtool is concerned.
You can't portably install the actual .so without libtool help.

> It appears that if I specify ./libgmp.la in the install line,
> ./.lib/libgmp.so.3.1.1 will be "installed" which is not desired, but I can
> ignore that file for the package. I've never used this tool before and the
> behavior is fairly undeciferable...

I don't understand why you don't want libgmp.so.3.1.1. That's the actual
library. If you intended to created only static libraries, what you need to
do is run configure with --disable-shared option. libtool will only create
.a files in that case. 

Ganesan

-- 
Ganesan R <rganesan@myrealbox.com>   | Ph: 91-422-549 860 (Home)
Novell India, Bangalore              | #include <std_disclaimer.h>



Reply to: