]> code.ossystems Code Review - openembedded-core.git/blob
e1776bc9b40bb350f8aa4c8e55f7042fbeb2ff3b
[openembedded-core.git] /
1 From a02076fe916ade6c3f78f6d35072ec53482e9446 Mon Sep 17 00:00:00 2001
2 From: Alexander Kanavin <alex.kanavin@gmail.com>
3 Date: Wed, 3 Jan 2018 17:02:01 +0200
4 Subject: [PATCH] giscanner: add a --lib-dirs-envvar option
5
6 By default LD_LIBRARY_PATH is set to the list of target library paths;
7 this breaks down in cross-compilation environment, as we need to run a
8 native emulation wrapper rather than the target binary itself. This patch
9 allows exporting those paths to a different environment variable
10 which can be picked up and used by the wrapper.
11
12 Upstream-Status: Pending
13 Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
14 ---
15  giscanner/ccompiler.py   | 6 ++++--
16  giscanner/dumper.py      | 3 ++-
17  giscanner/scannermain.py | 3 +++
18  3 files changed, 9 insertions(+), 3 deletions(-)
19
20 diff --git a/giscanner/ccompiler.py b/giscanner/ccompiler.py
21 index 29de0ee..e969337 100644
22 --- a/giscanner/ccompiler.py
23 +++ b/giscanner/ccompiler.py
24 @@ -109,14 +109,16 @@ class CCompiler(object):
25  
26              self._cflags_no_deprecation_warnings = "-Wno-deprecated-declarations"
27  
28 -    def get_internal_link_flags(self, args, libtool, libraries, extra_libraries, libpaths):
29 +    def get_internal_link_flags(self, args, libtool, libraries, extra_libraries, libpaths, lib_dirs_envvar):
30          # An "internal" link is where the library to be introspected
31          # is being built in the current directory.
32  
33          runtime_path_envvar = []
34          runtime_paths = []
35  
36 -        if self.check_is_msvc():
37 +        if lib_dirs_envvar:
38 +            runtime_path_envvar = [lib_dirs_envvar]
39 +        elif self.check_is_msvc():
40              runtime_path_envvar = ['LIB', 'PATH']
41          else:
42              runtime_path_envvar = ['LD_LIBRARY_PATH']
43 diff --git a/giscanner/dumper.py b/giscanner/dumper.py
44 index 7f77bd2..db96df6 100644
45 --- a/giscanner/dumper.py
46 +++ b/giscanner/dumper.py
47 @@ -259,7 +259,8 @@ class DumpCompiler(object):
48                                                     libtool,
49                                                     self._options.libraries,
50                                                     self._options.extra_libraries,
51 -                                                   self._options.library_paths)
52 +                                                   self._options.library_paths,
53 +                                                   self._options.lib_dirs_envvar)
54              args.extend(pkg_config_libs)
55  
56          else:
57 diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py
58 index 38a45c1..b603850 100755
59 --- a/giscanner/scannermain.py
60 +++ b/giscanner/scannermain.py
61 @@ -130,6 +130,9 @@ def _get_option_parser():
62      parser.add_option("", "--use-ldd-wrapper",
63                        action="store", dest="ldd_wrapper", default=None,
64                        help="wrapper to use instead of ldd (useful when cross-compiling)")
65 +    parser.add_option("", "--lib-dirs-envvar",
66 +                      action="store", dest="lib_dirs_envvar", default=None,
67 +                      help="environment variable to write a list of library directories to (for running the transient binary), instead of standard LD_LIBRARY_PATH")
68      parser.add_option("", "--program-arg",
69                        action="append", dest="program_args", default=[],
70                        help="extra arguments to program")
71 -- 
72 2.15.1
73