diff options
Diffstat (limited to 'giscanner/shlibs.py')
-rw-r--r-- | giscanner/shlibs.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/giscanner/shlibs.py b/giscanner/shlibs.py index 9579e7e6..1241827d 100644 --- a/giscanner/shlibs.py +++ b/giscanner/shlibs.py @@ -20,13 +20,13 @@ # import os -import re import platform +import re import subprocess -import os from .utils import get_libtool_command, extract_libtool_shlib + # For .la files, the situation is easy. def _resolve_libtool(options, binary, libraries): shlibs = [] @@ -37,6 +37,7 @@ def _resolve_libtool(options, binary, libraries): return shlibs + # Assume ldd output is something vaguely like # # libpangoft2-1.0.so.0 => /usr/lib/libpangoft2-1.0.so.0 (0x006c1000) @@ -52,6 +53,7 @@ def _ldd_library_pattern(library_name): return re.compile("(?<![A-Za-z0-9_-])(lib*%s[^A-Za-z0-9_-][^\s\(\)]*)" % re.escape(library_name)) + # This is a what we do for non-la files. We assume that we are on an # ELF-like system where ldd exists and the soname extracted with ldd is # a filename that can be opened with dlopen(). @@ -69,7 +71,7 @@ def _resolve_non_libtool(options, binary, libraries): if not libraries: return [] - if os.uname()[0] == 'OpenBSD': + if platform.platform().startswith('OpenBSD'): # Hack for OpenBSD when using the ports' libtool which uses slightly # different directories to store the libraries in. So rewite binary.args[0] # by inserting '.libs/'. @@ -119,6 +121,7 @@ def _resolve_non_libtool(options, binary, libraries): return shlibs + # We want to resolve a set of library names (the <foo> of -l<foo>) # against a library to find the shared library name. The shared # library name is suppose to be what you pass to dlopen() (or |