Building and linking shared libaries for multipledifferentversionsof UNIX

Michael Sweet mike at easysw.com
Wed May 16 17:31:35 GMT 2001


Steve Langasek wrote:
> ...
> If you're going to have versioned libraries, you'll also need to
> pass an option to the linker to specify the versioned soname --
> otherwise, programs which link against the library won't actually
> know they need libFoo.so.93.

What we do is to link the DSO with the version number, e.g.:

    cc -shared -o libfoo.so.99 *.o

(this is a ficticious command, of course)

Then you make the symlink to .so (so the linker can find the DSO
when you link the other apps), but the soname used is "libfoo.so.99".
This isn't universally supported, so there is an added -soname (or
whatever) in the DSO link on some platforms, but that is the basic
idea.

-- 
______________________________________________________________________
Michael Sweet, Easy Software Products                  mike at easysw.com
Printing Software for UNIX                       http://www.easysw.com




More information about the samba-technical mailing list