libtool
[Top][All Lists]
Advanced

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

Re: Using libtool together with the ${ORIGIN} soname variable


From: Simon Richter
Subject: Re: Using libtool together with the ${ORIGIN} soname variable
Date: Tue, 8 Jul 2003 15:52:11 +0200
User-agent: Mutt/1.5.4i

Hi,

> This isn't about plugins, it's actually about a few helper libraries which 
> are needed by the main program.

There is nothing to say against installing these libraries into
$(libdir), although you can also simply link them statically when they
are used by only one program (gives you a 5% speed bonus on i386, as
shared libraries need one register to point to itself, as they may be
mapped to different virtual addresses in different process spaces).

> Well, the program used to be a win32-only program, so I would like to keep 
> everything in place like it used to be, makes things a bit easier for me 
> (and for the users as well, of which most will probably use the binary 
> distribution to install the program).

It does make things very difficult, rather. Unix people are used to
install software by telling it that it is going to be installed into
/usr/local, then installing into /some/other/place and symlinking the
files over.

A typical layout looks like this:

/usr/local:
drwxrwxr-x root dist DIR
drwxrwxr-x root dist bin
drwxrwxr-x root dist lib

/usr/local/DIR:
drwxrwxr-x user dist foo-1.0

/usr/local/DIR/foo-1.0:
drwxrwxr-x user dist bin
drwxrwxr-x user dist lib

/usr/local/DIR/foo-1.0/bin:
-rwxrwxr-x user dist foo [which loads libfoo.so.0 without an rpath]

/usr/local/DIR/foo-1.0/lib:
-rw-rw-r-- user dist libfoo.so.0.1
lrwxrwxrwx user dist libfoo.so.0 -> libfoo.so.0.1
lrwxrwxrwx user dist libfoo.so -> libfoo.so.0.1

/usr/local/bin:
lrwxrwxrwx user dist foo -> ../DIR/foo-1.0/bin/foo

/usr/local/lib:
lrwxrwxrwx user dist libfoo.so.0.1 -> ../DIR/foo-1.0/lib/libfoo.so.0.1
lrwxrwxrwx user dist libfoo.so.0 -> ../DIR/foo-1.0/lib/libfoo.so.0
lrwxrwxrwx user dist libfoo.so -> ../DIR/foo-1.0/lib/libfoo.so

You see, the packages are already separated this way, plus everything is
sorted like it should be. For example, the prelink program can speed up
loading by assigning address slots to all libraries (found in /lib
directories) and then adapting the executables accordingly, so you can
save the relocation time. Your program would not benefit from that when
the libraries are outside of the /lib directory.

> Also, it will not get installed into /usr/bin or /usr/local/bin.
> /usr/bin/programname would be possible.. (yes, everything needed to run the 
> program is inside that directory)

> (note: /opt/programname will be the default location suggested by the 
> installation program)

Erm, installation program? Don't do that, most admins won't use it
anyway, since they cannot control where stuff is installed other than by
putting it inside a chroot jail. Believe me, people are glad if you help
them by making this a no-surprises installation rather than an
easy-for-most-users installation. Who cannot install software that comes
in regular packages usually uses prepackaged software in .deb or .rpm
format or instructs their sysadmin to install the sw.

> You're right, but since I wasn't talking about plugins (see above) the 
> soname is actually used here.

Even then, paths in sonames are not portable and (in most cases) are
stripped anyway by the linker.

   Simon

-- 
GPG Fingerprint: 040E B5F7 84F1 4FBC CEAD  ADC6 18A0 CC8D 5706 A4B4

Attachment: pgpR_a35017Xt.pgp
Description: PGP signature


reply via email to

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