1 .\" $OpenBSD: library-specs.7,v 1.10 2010/11/15 07:41:21 jmc Exp $
3 .\" Copyright (c) 2001-2010 Marc Espie
5 .\" All rights reserved.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
16 .\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
17 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 .\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
20 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 .Dd $Mdocdate: November 15 2010 $
32 .Nd shared library name specifications
36 item in the ports tree conforms to
37 .Bd -literal -offset indent
38 [path/]libname[=major[.minor]]
42 .Bd -literal -offset indent
43 [path/]libname[>=major[.minor]]
46 All libraries that a package needs must be mentioned in that list.
47 Except for system and X11 libraries, they all must be reachable through
51 directly, or indirectly through recursive dependencies.
53 Conversely, the ports tree
56 to check whether a given
58 will be required at runtime for shared libraries, and thus turn it into a
66 The package system will embed correct dependency checks in the built
67 package in the form of
69 lines, according to the normal shared library semantics: any library with
70 the same major number, and a greater or equal minor number will do.
72 Note that static libraries can only satisfy a library specification if
73 no shared library has been found.
74 Thus, if WANTLIB = foo>=5, and both libfoo.so.4.0 and libfoo.a are present,
77 Therefore, porters must strive to respect correct shared library semantics
78 in their own ports: by bumping the minor number each time the interface is
79 augmented, and by bumping the major number each time the interface changes.
80 Note that adding functions to a library is an interface augmentation.
81 Removing functions is an interface change.
83 The major.minor components of the library specification are used only as a
84 build-time check, the run-time checks are computed by
87 .Sq libname>=major[.minor] ,
88 any library which is more recent than the given major.minor version will
90 If a specific major number is needed, use the form
91 .Sq libname=major[.minor] .
92 If the minor component is left empty, any minor will do.
93 If both components are left empty, any version will do.
95 If a given architecture does not support shared libraries, all
97 will be turned into simple
102 if the port needs anything beyond libraries from the dependent port will
103 lead to strange errors on such architectures.
105 Most specifications won't mention a
108 will look in the default
110 path automatically, namely
114 It is generally a bad idea to put libraries elsewhere as they won't be
117 However, distinct ports may install different major versions of the same
120 and disambiguate the build by creating a link in a separate directory,
121 and specifying the right options to the linker.
123 These libraries will require a
125 component in the corresponding
127 to make sure the right library is resolved.
128 This path is rooted under
130 For instance, to refer to
131 .Pa /usr/local/lib/qt3/libqt-mt.so.33.0 ,
133 .Sq lib/qt3/qt-mt>=33 .
135 .Xr check-lib-depends 1 ,
142 .Xr packages-specs 7 ,
146 Full support for library specifications first appeared in
148 The format of specifications changed slightly to include
152 The interactions between
156 were modified and clarified for
158 The format of specifications changed again before
160 to remove extra noise.