summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2018-01-22 11:20:49 +0100
committerChristoph Reiter <creiter@src.gnome.org>2018-01-23 00:32:10 +0100
commite56d70da837bd309bf8cddbce309a5a773e098b6 (patch)
tree9c9581eda8ff737b2b43b34604f1f14f82ec1418
parentcafe43fa9def848bb5c974aab818d7dd7ed1f0d7 (diff)
downloadgobject-introspection-e56d70da837bd309bf8cddbce309a5a773e098b6.tar.gz
scanner: Fix library lookup under MinGW without libtool
When executing the scanner binary use the PATH/LIB env vars also under MinGW, since LD_LIBRARY_PATH/rpath doesn't work there. When resolving the library name from the import library look into the user provided library paths first before falling back to the default gcc search path. This fixes the gir/typelib generation for meson under MSYS2. Note that MSYS2 ships various patches, so this might not fix it for all MinGW users. https://bugzilla.gnome.org/show_bug.cgi?id=791902
-rw-r--r--giscanner/ccompiler.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/giscanner/ccompiler.py b/giscanner/ccompiler.py
index 29de0ee5..a8bd5b13 100644
--- a/giscanner/ccompiler.py
+++ b/giscanner/ccompiler.py
@@ -116,7 +116,7 @@ class CCompiler(object):
runtime_path_envvar = []
runtime_paths = []
- if self.check_is_msvc():
+ if os.name == 'nt':
runtime_path_envvar = ['LIB', 'PATH']
else:
runtime_path_envvar = ['LD_LIBRARY_PATH']
@@ -288,9 +288,10 @@ class CCompiler(object):
proc = subprocess.Popen([self.compiler_cmd, '-print-search-dirs'],
stdout=subprocess.PIPE)
o, e = proc.communicate()
+ libsearch = options.library_paths
for line in o.decode('ascii').splitlines():
if line.startswith('libraries: '):
- libsearch = line[len('libraries: '):].split(os.pathsep)
+ libsearch += line[len('libraries: '):].split(os.pathsep)
shlibs = []
not_resolved = []