What are good practices regarding shared libraries on Linux?

I recently read a lot about shared libraries on Linux, and here is what I learnt:

  • A shared library should embed a soname including its major version number. Something like: libfoo.so.1
  • Its real filename should also include a minor version number. Something like: libfoo.so.1.0
  • When the library file is copied to, say /usr/local/lib, if ldconfig is run, it will read the soname and create a symlink named libfoo.so.1 pointing to libfoo.so.1.0.
  • If one wants to use this library for its developments it should first create a symlink without any version number to the real file, say libfoo.so pointing to libfoo.so.1.0. This is usually done by the development package (when the library is packaged).

Is this correct ?

10
задан ereOn 21 January 2011 в 09:16
поделиться