summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2014-07-07 21:42:54 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-07-10 17:38:31 +0100
commita20cc90cdc084cf11c0389be82d6ad9f3c388f76 (patch)
treee8e61e9ba36f8b826d3f35cf680ce5b380d79e90 /meta/classes
parentadb89b15890201843c4e8423d114de90444fde47 (diff)
downloadpoky-a20cc90cdc084cf11c0389be82d6ad9f3c388f76.tar.gz
package.bbclass: Rewrite sonames data structure to include library path
In order to do more advanced processing of the shared libraries, we need to know where a given library is located on disk so we can know whether its a system path or a private directory for example. This patch adds this information into the 'sonames' data structure. (From OE-Core rev: 5f48d53c5ed94b5c6aad9f73ff177aa35af90397) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/package.bbclass23
1 files changed, 13 insertions, 10 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 1ef0c66ca0..bc91e9f866 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1384,7 +1384,7 @@ python package_do_shlibs() {
1384 1384
1385 def linux_so(file, needed, sonames, renames): 1385 def linux_so(file, needed, sonames, renames):
1386 needs_ldconfig = False 1386 needs_ldconfig = False
1387 ldir = os.path.dirname(file).replace(pkgdest, '') 1387 ldir = os.path.dirname(file).replace(pkgdest + "/" + pkg, '')
1388 cmd = d.getVar('OBJDUMP', True) + " -p " + pipes.quote(file) + " 2>/dev/null" 1388 cmd = d.getVar('OBJDUMP', True) + " -p " + pipes.quote(file) + " 2>/dev/null"
1389 fd = os.popen(cmd) 1389 fd = os.popen(cmd)
1390 lines = fd.readlines() 1390 lines = fd.readlines()
@@ -1404,10 +1404,11 @@ python package_do_shlibs() {
1404 m = re.match("\s+SONAME\s+([^\s]*)", l) 1404 m = re.match("\s+SONAME\s+([^\s]*)", l)
1405 if m: 1405 if m:
1406 this_soname = m.group(1) 1406 this_soname = m.group(1)
1407 if not this_soname in sonames: 1407 prov = (this_soname, ldir)
1408 if not prov in sonames:
1408 # if library is private (only used by package) then do not build shlib for it 1409 # if library is private (only used by package) then do not build shlib for it
1409 if not private_libs or this_soname not in private_libs: 1410 if not private_libs or this_soname not in private_libs:
1410 sonames.append(this_soname) 1411 sonames.append(prov)
1411 if libdir_re.match(os.path.dirname(file)): 1412 if libdir_re.match(os.path.dirname(file)):
1412 needs_ldconfig = True 1413 needs_ldconfig = True
1413 if snap_symlinks and (os.path.basename(file) != this_soname): 1414 if snap_symlinks and (os.path.basename(file) != this_soname):
@@ -1417,6 +1418,7 @@ python package_do_shlibs() {
1417 def darwin_so(file, needed, sonames, renames): 1418 def darwin_so(file, needed, sonames, renames):
1418 if not os.path.exists(file): 1419 if not os.path.exists(file):
1419 return 1420 return
1421 ldir = os.path.dirname(file).replace(pkgdest, '')
1420 1422
1421 def get_combinations(base): 1423 def get_combinations(base):
1422 # 1424 #
@@ -1438,7 +1440,8 @@ python package_do_shlibs() {
1438 combos = get_combinations(name) 1440 combos = get_combinations(name)
1439 for combo in combos: 1441 for combo in combos:
1440 if not combo in sonames: 1442 if not combo in sonames:
1441 sonames.append(combo) 1443 prov = (combo, ldir)
1444 sonames.append(prov)
1442 if file.endswith('.dylib') or file.endswith('.so'): 1445 if file.endswith('.dylib') or file.endswith('.so'):
1443 lafile = file.replace(os.path.join(pkgdest, pkg), d.getVar('PKGD', True)) 1446 lafile = file.replace(os.path.join(pkgdest, pkg), d.getVar('PKGD', True))
1444 # Drop suffix 1447 # Drop suffix
@@ -1521,13 +1524,13 @@ python package_do_shlibs() {
1521 if len(sonames): 1524 if len(sonames):
1522 fd = open(shlibs_file, 'w') 1525 fd = open(shlibs_file, 'w')
1523 for s in sonames: 1526 for s in sonames:
1524 if s in shlib_provider: 1527 if s[0] in shlib_provider:
1525 (old_pkg, old_pkgver) = shlib_provider[s] 1528 (old_pkg, old_pkgver) = shlib_provider[s[0]]
1526 if old_pkg != pkg: 1529 if old_pkg != pkg:
1527 bb.warn('%s-%s was registered as shlib provider for %s, changing it to %s-%s because it was built later' % (old_pkg, old_pkgver, s, pkg, pkgver)) 1530 bb.warn('%s-%s was registered as shlib provider for %s, changing it to %s-%s because it was built later' % (old_pkg, old_pkgver, s[0], pkg, pkgver))
1528 bb.debug(1, 'registering %s-%s as shlib provider for %s' % (pkg, pkgver, s)) 1531 bb.debug(1, 'registering %s-%s as shlib provider for %s' % (pkg, pkgver, s[0]))
1529 fd.write(s + '\n') 1532 fd.write(s[0] + '\n')
1530 shlib_provider[s] = (pkg, pkgver) 1533 shlib_provider[s[0]] = (pkg, pkgver)
1531 fd.close() 1534 fd.close()
1532 fd = open(shver_file, 'w') 1535 fd = open(shver_file, 'w')
1533 fd.write(pkgver + '\n') 1536 fd.write(pkgver + '\n')