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

How to link against non-public shared libraries?



My package contains binaries using a common shared library, which is not
intended to be used by other programs.  This is a regular shared
library, not a plugin or other object to be explicitly loaded by the
binaries, the binaries just normally link to it.

Debian Policy says:

     Shared object files (often `.so' files) that are not public libraries,
     that is, they are not meant to be linked to by third party executables
     (binaries of other packages), should be installed in subdirectories of
     the `/usr/lib' directory.  Such files are exempt from the rules that
     govern ordinary shared libraries, except that they must not be
     installed executable and should be stripped.[2]

So the shared library should be put into /usr/lib/SOMETHING/, which is
of course a non-standard path for the linker.

My question is: How to ensure properly that the binaries can find the
library?  I can think of several solutions (putting the library into
/usr/lib/, modifying /etc/ld.so.conf, using -rpath), but I'm not sure
which of them is the right one.  I tried to RTFM and to find a similar
case in another package, but without success.

Thanks for an appropriate pointer to documentation or other advice.

Milan Zamazal

-- 
The seeker after truth should be humbler than the dust.  The world crushes the
dust under its feet, but the seeker after truth should so humble himself that
even the dust could crush him.                                 -- M. K. Gandhi



Reply to: