[OE-core] [PATCH] package.bbclass: Add ASSUME_SONAME variable
Aymeric Dumaz
aymeric.dumaz at gmail.com
Wed Aug 13 00:20:13 UTC 2014
When libraries don't have a SONAME in their section, their name aren't added in
the .list file generated during do_package.
Other recipes are able to build against them but are not able to find them
afterwards, leading to missing dependencies.
For example, with qtbase and proprietary libraries for the OMAP3:
NOTE: Couldn't find shared library provider for libGLESv2.so, used by files:
[...]
This patch add the possibility to manually define a list of librairies that will
be exported in the .list file.
A hack in a lacking-SONAME recipe can be made on package_do_shlibs_append to
copy .list file manually made, but files from others PACKAGES in this recipe
will produce similar warnings during their creation because their name aren't in
the shlib_provider variable.
The darwin_so is not patched because it isn't relying on SONAME.
Signed-off-by: Aymeric Dumaz <aymeric.dumaz at gmail.com>
---
meta/classes/package.bbclass | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 6a552d9..766e118 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1399,7 +1399,7 @@ python package_do_shlibs() {
shlib_provider[s[0]] = {}
shlib_provider[s[0]][s[1]] = (dep_pkg, s[2])
- def linux_so(file, needed, sonames, renames, pkgver):
+ def linux_so(file, needed, sonames, renames, assumed_sonames, pkgver):
needs_ldconfig = False
ldir = os.path.dirname(file).replace(pkgdest + "/" + pkg, '')
cmd = d.getVar('OBJDUMP', True) + " -p " + pipes.quote(file) + " 2>/dev/null"
@@ -1419,8 +1419,15 @@ python package_do_shlibs() {
if dep not in needed[pkg]:
needed[pkg].append((dep, file, rpath))
m = re.match("\s+SONAME\s+([^\s]*)", l)
+ this_soname = None
if m:
this_soname = m.group(1)
+ if not this_soname:
+ file_basename = os.path.basename(file)
+ for s in assumed_sonames:
+ if s in file_basename:
+ this_soname = s
+ if this_soname:
prov = (this_soname, ldir, pkgver)
if not prov in sonames:
# if library is private (only used by package) then do not build shlib for it
@@ -1513,6 +1520,7 @@ python package_do_shlibs() {
needed[pkg] = []
sonames = list()
renames = list()
+ assumed_sonames = (d.getVar('ASSUME_SONAME_' + pkg, True) or "").split()
for file in pkgfiles[pkg]:
soname = None
if cpath.islink(file):
@@ -1520,7 +1528,7 @@ python package_do_shlibs() {
if targetos == "darwin" or targetos == "darwin8":
darwin_so(file, needed, sonames, renames, pkgver)
elif os.access(file, os.X_OK) or lib_re.match(file):
- ldconfig = linux_so(file, needed, sonames, renames, pkgver)
+ ldconfig = linux_so(file, needed, sonames, renames, assumed_sonames, pkgver)
needs_ldconfig = needs_ldconfig or ldconfig
for (old, new) in renames:
bb.note("Renaming %s to %s" % (old, new))
--
1.9.1
More information about the Openembedded-core
mailing list