Building and linking shared libaries formultipledifferentversions of UNIX

Steve Langasek vorlon at netexpress.net
Wed May 16 16:33:38 GMT 2001


On Thu, 17 May 2001, Richard Sharpe wrote:

> At 11:12 AM 5/16/01 -0400, David Collier-Brown wrote:
> >Richard Sharpe wrote:

> >> OK, great explanation. What action do I need to take when I install
> >> libsmbclient.so.x.0?

> >> Do I need to run ldconfig, and then create the link if it doesn't already
> >> exist?

> >	I think you do that in the opposite order, actually..
> >	ldconfig updates an in-memory table in older SunOSs
> >	(I don't have one on my Solaris 8 system).

> Well, Under Linux, it seems that ldconfig makes the symbolic link from the
> soname to the real name ... that is, if I copy libsmbclient.so.1.0 to
> $(LIBDIR) and then run ldconfig (and $(LIBDIR) is in /etc/ld.so.conf),
> ldconfig creates the symbolic link from libsmbclient.so.1 to
> libsmbclient.so.1.0 ...

It also updates /etc/ld.so.cache, which some Linux distributions deliberately
do not use; hence my suggestion that it may be better not to call ldconfig
from 'make install', instead creating the symlink directly.

You'll still need to create the foo.so -> foo.so.1.0 symlink, since ldconfig
doesn't do this (at least, not on all systems).

How much of the smbwrapper Makefile code can be reused for libsmbclient?
There seem to be enough shared libraries wandering around in the Samba tree
now to make this all worth centralizing.

Steve Langasek
postmodern programmer





More information about the samba-technical mailing list