TipsAndTricks/PackagingNonversionedLibrary: Difference between revisions

From Yocto Project
Jump to navigationJump to search
Line 1: Line 1:
= How to Package an Unversioned Library =
= How to Package an Unversioned Library =


In general, libraries in Linux systems are versioned, so that it's possible to have multiple versions of the same library installed to ease upgrades or support older software.  In versioned libraries the actual library binary is for example called <tt>libfoo.so.1.2</tt>, and then there will be a <tt>libfoo.so.1</tt> symbolic link to <tt>libfoo.so.1.2</tt>, and finally a <tt>libfoo.so</tt> symbolic link to <tt>libfoo.so.1.2</tt>.  When linking a binary against a library then you typically just tell it the unversioned file name (for example, <tt>-lfoo</tt> to the linker) but the linker will follow the symbolic links and actually link against the fully-versioned filename.  The unversioned symbolic link is only used at development time, so in OpenEmbedded (as with all other Linux distros) gets packaged along with the headers in a development package, in our case <tt>${PN}-dev</tt>.
First some background: in general libraries in Linux systems are versioned so that it's possible to have multiple versions of the same library installed, to ease upgrades or support older software.  In versioned libraries the actual library binary is for example called <tt>libfoo.so.1.2</tt>, and then there will be a <tt>libfoo.so.1</tt> symbolic link to <tt>libfoo.so.1.2</tt>, and finally a <tt>libfoo.so</tt> symbolic link to <tt>libfoo.so.1.2</tt>.  When linking a binary against a library then you typically just tell it the unversioned file name (for example, <tt>-lfoo</tt> to the linker) but the linker will follow the symbolic links and actually link against the fully-versioned filename.  The unversioned symbolic link is only used at development time, so in OpenEmbedded (as with all other Linux distros) gets packaged along with the headers in development package <tt>${PN}-dev</tt>.
 





Revision as of 13:40, 28 July 2016

How to Package an Unversioned Library

First some background: in general libraries in Linux systems are versioned so that it's possible to have multiple versions of the same library installed, to ease upgrades or support older software. In versioned libraries the actual library binary is for example called libfoo.so.1.2, and then there will be a libfoo.so.1 symbolic link to libfoo.so.1.2, and finally a libfoo.so symbolic link to libfoo.so.1.2. When linking a binary against a library then you typically just tell it the unversioned file name (for example, -lfoo to the linker) but the linker will follow the symbolic links and actually link against the fully-versioned filename. The unversioned symbolic link is only used at development time, so in OpenEmbedded (as with all other Linux distros) gets packaged along with the headers in development package ${PN}-dev.


tl;dr:

SOLIBS = ".so"
FILES_SOLIBSDEV = ""

(TODO: write more)