summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorNathan Rossi <nathan@nathanrossi.com>2017-02-21 23:17:28 +1000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-04 23:18:19 +0000
commitf3881e63fd0cfca36aa66afcc2ce0a7cecb71a0a (patch)
tree3d21ce6b6d0b8dbb437243a75e119d2d371c8768 /meta
parent09a253d09f1e89874e2e8c2aec9c3d01a0e198db (diff)
downloadpoky-f3881e63fd0cfca36aa66afcc2ce0a7cecb71a0a.tar.gz
package.bbclass: Add SHLIB detection support for mingw targets
Add support to detect dll files as shared objects as well as process Windows .dll and .exe files to determine the runtime libraries dependencies. This implementation is sufficient to detect and map runtime library dependencies between packages. And does not implement any version naming conventions that might apply for .dll files (e.g. lib*-x.dll). (From OE-Core rev: 7df031e1ffe409573753585ba2f1a82ff707ad7e) Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/package.bbclass21
1 files changed, 21 insertions, 0 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index d5c2d82bc8..299ea120d9 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1613,6 +1613,25 @@ python package_do_shlibs() {
1613 if name and name not in needed[pkg]: 1613 if name and name not in needed[pkg]:
1614 needed[pkg].append((name, file, [])) 1614 needed[pkg].append((name, file, []))
1615 1615
1616 def mingw_dll(file, needed, sonames, renames, pkgver):
1617 if not os.path.exists(file):
1618 return
1619
1620 if file.endswith(".dll"):
1621 # assume all dlls are shared objects provided by the package
1622 sonames.append((os.path.basename(file), os.path.dirname(file).replace(pkgdest + "/" + pkg, ''), pkgver))
1623
1624 if (file.endswith(".dll") or file.endswith(".exe")):
1625 # use objdump to search for "DLL Name: .*\.dll"
1626 p = sub.Popen([d.expand("${HOST_PREFIX}objdump"), "-p", file], stdout = sub.PIPE, stderr= sub.PIPE)
1627 out, err = p.communicate()
1628 # process the output, grabbing all .dll names
1629 if p.returncode == 0:
1630 for m in re.finditer("DLL Name: (.*?\.dll)$", out.decode(), re.MULTILINE | re.IGNORECASE):
1631 dllname = m.group(1)
1632 if dllname:
1633 needed[pkg].append((dllname, file, []))
1634
1616 if d.getVar('PACKAGE_SNAP_LIB_SYMLINKS') == "1": 1635 if d.getVar('PACKAGE_SNAP_LIB_SYMLINKS') == "1":
1617 snap_symlinks = True 1636 snap_symlinks = True
1618 else: 1637 else:
@@ -1644,6 +1663,8 @@ python package_do_shlibs() {
1644 continue 1663 continue
1645 if targetos == "darwin" or targetos == "darwin8": 1664 if targetos == "darwin" or targetos == "darwin8":
1646 darwin_so(file, needed, sonames, renames, pkgver) 1665 darwin_so(file, needed, sonames, renames, pkgver)
1666 elif targetos.startswith("mingw"):
1667 mingw_dll(file, needed, sonames, renames, pkgver)
1647 elif os.access(file, os.X_OK) or lib_re.match(file): 1668 elif os.access(file, os.X_OK) or lib_re.match(file):
1648 ldconfig = linux_so(file, needed, sonames, renames, pkgver) 1669 ldconfig = linux_so(file, needed, sonames, renames, pkgver)
1649 needs_ldconfig = needs_ldconfig or ldconfig 1670 needs_ldconfig = needs_ldconfig or ldconfig