diff options
Diffstat (limited to 'meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch')
-rw-r--r-- | meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch b/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch new file mode 100644 index 0000000000..1912e94358 --- /dev/null +++ b/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch | |||
@@ -0,0 +1,113 @@ | |||
1 | From c5692cac9c555664281377a82bf8b1e46934f437 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alexander Kanavin <alex.kanavin@gmail.com> | ||
3 | Date: Fri, 4 Aug 2017 16:16:41 +0300 | ||
4 | Subject: [PATCH 1/3] gtkdoc: fix issues that arise when cross-compiling | ||
5 | |||
6 | Specifically: | ||
7 | 1) Make it possible to specify a wrapper for executing binaries | ||
8 | (usually, some kind of target hardware emulator, such as qemu) | ||
9 | 2) Explicitly provide CC and LD via command line, as otherwise gtk-doc will | ||
10 | try to guess them, incorrectly. | ||
11 | 3) If things break down, print the full command with arguments, | ||
12 | not just the binary name. | ||
13 | 4) Correctly determine the compiler/linker executables and cross-options when cross-compiling | ||
14 | |||
15 | Upstream-Status: Pending | ||
16 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> | ||
17 | |||
18 | --- | ||
19 | mesonbuild/modules/gnome.py | 18 +++++++++++++++--- | ||
20 | mesonbuild/scripts/gtkdochelper.py | 9 +++++++-- | ||
21 | 2 files changed, 22 insertions(+), 5 deletions(-) | ||
22 | |||
23 | diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py | ||
24 | index 56765a5..4f7fe30 100644 | ||
25 | --- a/mesonbuild/modules/gnome.py | ||
26 | +++ b/mesonbuild/modules/gnome.py | ||
27 | @@ -769,6 +769,10 @@ This will become a hard error in the future.''') | ||
28 | '--mode=' + mode] | ||
29 | if namespace: | ||
30 | args.append('--namespace=' + namespace) | ||
31 | + gtkdoc_exe_wrapper = state.environment.cross_info.config["properties"].get('gtkdoc_exe_wrapper', None) | ||
32 | + if gtkdoc_exe_wrapper is not None: | ||
33 | + args.append('--gtkdoc-exe-wrapper=' + gtkdoc_exe_wrapper) | ||
34 | + | ||
35 | args += self._unpack_args('--htmlargs=', 'html_args', kwargs) | ||
36 | args += self._unpack_args('--scanargs=', 'scan_args', kwargs) | ||
37 | args += self._unpack_args('--scanobjsargs=', 'scanobjs_args', kwargs) | ||
38 | @@ -796,14 +800,22 @@ This will become a hard error in the future.''') | ||
39 | raise MesonException( | ||
40 | 'Gir include dirs should be include_directories().') | ||
41 | cflags.update(get_include_args(inc_dirs)) | ||
42 | + | ||
43 | + cross_c_args = " ".join(state.environment.cross_info.config["properties"].get('c_args', "")) | ||
44 | + cross_link_args = " ".join(state.environment.cross_info.config["properties"].get('c_link_args', "")) | ||
45 | + | ||
46 | if cflags: | ||
47 | - args += ['--cflags=%s' % ' '.join(cflags)] | ||
48 | + args += ['--cflags=%s %s' % (cross_c_args,' '.join(cflags))] | ||
49 | if ldflags: | ||
50 | - args += ['--ldflags=%s' % ' '.join(ldflags)] | ||
51 | + args += ['--ldflags=%s %s' % (cross_link_args, ' '.join(ldflags))] | ||
52 | compiler = state.environment.coredata.compilers.get('c') | ||
53 | - if compiler: | ||
54 | + cross_compiler = state.environment.coredata.cross_compilers.get('c') | ||
55 | + if compiler and not state.environment.is_cross_build(): | ||
56 | args += ['--cc=%s' % ' '.join(compiler.get_exelist())] | ||
57 | args += ['--ld=%s' % ' '.join(compiler.get_linker_exelist())] | ||
58 | + elif cross_compiler and state.environment.is_cross_build(): | ||
59 | + args += ['--cc=%s' % ' '.join(cross_compiler.get_exelist())] | ||
60 | + args += ['--ld=%s' % ' '.join(cross_compiler.get_linker_exelist())] | ||
61 | |||
62 | return args | ||
63 | |||
64 | diff --git a/mesonbuild/scripts/gtkdochelper.py b/mesonbuild/scripts/gtkdochelper.py | ||
65 | index 4406b28..b846827 100644 | ||
66 | --- a/mesonbuild/scripts/gtkdochelper.py | ||
67 | +++ b/mesonbuild/scripts/gtkdochelper.py | ||
68 | @@ -44,13 +44,14 @@ parser.add_argument('--ignore-headers', dest='ignore_headers', default='') | ||
69 | parser.add_argument('--namespace', dest='namespace', default='') | ||
70 | parser.add_argument('--mode', dest='mode', default='') | ||
71 | parser.add_argument('--installdir', dest='install_dir') | ||
72 | +parser.add_argument('--gtkdoc-exe-wrapper', dest='gtkdoc_exe_wrapper') | ||
73 | |||
74 | def gtkdoc_run_check(cmd, cwd): | ||
75 | # Put stderr into stdout since we want to print it out anyway. | ||
76 | # This preserves the order of messages. | ||
77 | p, out = Popen_safe(cmd, cwd=cwd, stderr=subprocess.STDOUT)[0:2] | ||
78 | if p.returncode != 0: | ||
79 | - err_msg = ["{!r} failed with status {:d}".format(cmd[0], p.returncode)] | ||
80 | + err_msg = ["{!r} failed with status {:d}".format(cmd, p.returncode)] | ||
81 | if out: | ||
82 | err_msg.append(out) | ||
83 | raise MesonException('\n'.join(err_msg)) | ||
84 | @@ -58,7 +59,7 @@ def gtkdoc_run_check(cmd, cwd): | ||
85 | def build_gtkdoc(source_root, build_root, doc_subdir, src_subdirs, | ||
86 | main_file, module, | ||
87 | html_args, scan_args, fixxref_args, mkdb_args, | ||
88 | - gobject_typesfile, scanobjs_args, ld, cc, ldflags, cflags, | ||
89 | + gobject_typesfile, scanobjs_args, gtkdoc_exe_wrapper, ld, cc, ldflags, cflags, | ||
90 | html_assets, content_files, ignore_headers, namespace, | ||
91 | expand_content_files, mode): | ||
92 | print("Building documentation for %s" % module) | ||
93 | @@ -111,6 +112,9 @@ def build_gtkdoc(source_root, build_root, doc_subdir, src_subdirs, | ||
94 | if gobject_typesfile: | ||
95 | scanobjs_cmd = ['gtkdoc-scangobj'] + scanobjs_args + ['--types=' + gobject_typesfile, | ||
96 | '--module=' + module, | ||
97 | + '--run=' + gtkdoc_exe_wrapper, | ||
98 | + '--cc=' + cc, | ||
99 | + '--ld=' + ld, | ||
100 | '--cflags=' + cflags, | ||
101 | '--ldflags=' + ldflags, | ||
102 | '--ld=' + ld] | ||
103 | @@ -207,6 +211,7 @@ def run(args): | ||
104 | mkdbargs, | ||
105 | options.gobject_typesfile, | ||
106 | scanobjsargs, | ||
107 | + options.gtkdoc_exe_wrapper, | ||
108 | options.ld, | ||
109 | options.cc, | ||
110 | options.ldflags, | ||
111 | -- | ||
112 | 2.15.0 | ||
113 | |||