summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/meson
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2018-09-25 16:18:43 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-09-25 23:15:49 +0100
commitbfeeefa5975fb293573de87dc89ed0bd8eb2ddae (patch)
tree81edcef23358135baca9bb3c66e9e44742ae1ef3 /meta/recipes-devtools/meson
parentfeb5e7ed50dc39f3a2fef37cc198543e0dc77344 (diff)
downloadpoky-bfeeefa5975fb293573de87dc89ed0bd8eb2ddae.tar.gz
meson: respect target/native flag distinction in G-I and gtk-doc
Remove the previous attempt at this from 0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch as it wasn't quite right, and the rest of the patch is adding the currently not upstreamable runner option. Add two new patches to fix both gobject-introspection and gtk-doc using native flags for target compiles. (From OE-Core rev: bf41247f52ffd40d91d94d1fc983f8a831b80e48) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/meson')
-rw-r--r--meta/recipes-devtools/meson/meson.inc2
-rw-r--r--meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch26
-rw-r--r--meta/recipes-devtools/meson/meson/gi-flags.patch35
-rw-r--r--meta/recipes-devtools/meson/meson/gtkdoc-flags.patch44
4 files changed, 81 insertions, 26 deletions
diff --git a/meta/recipes-devtools/meson/meson.inc b/meta/recipes-devtools/meson/meson.inc
index cfb831b106..205d2a4abd 100644
--- a/meta/recipes-devtools/meson/meson.inc
+++ b/meta/recipes-devtools/meson/meson.inc
@@ -11,6 +11,8 @@ SRC_URI = "https://github.com/mesonbuild/meson/releases/download/${PV}/meson-${P
11 file://0003-native_bindir.patch \ 11 file://0003-native_bindir.patch \
12 file://0002-Make-CPU-family-warnings-fatal.patch \ 12 file://0002-Make-CPU-family-warnings-fatal.patch \
13 file://0001-Support-building-allarch-recipes-again.patch \ 13 file://0001-Support-building-allarch-recipes-again.patch \
14 file://gi-flags.patch \
15 file://gtkdoc-flags.patch \
14 " 16 "
15SRC_URI[sha256sum] = "92d8afd921751261e36151643464efd3394162f69efbe8cd53e0a66b1cf395eb" 17SRC_URI[sha256sum] = "92d8afd921751261e36151643464efd3394162f69efbe8cd53e0a66b1cf395eb"
16SRC_URI[md5sum] = "31bda3519d8c0eb3438267268a78085e" 18SRC_URI[md5sum] = "31bda3519d8c0eb3438267268a78085e"
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
index 57cb678f2c..7ffd6c54cb 100644
--- 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
@@ -35,32 +35,6 @@ index cb69641..727eb6a 100644
35 args += self._unpack_args('--htmlargs=', 'html_args', kwargs) 35 args += self._unpack_args('--htmlargs=', 'html_args', kwargs)
36 args += self._unpack_args('--scanargs=', 'scan_args', kwargs) 36 args += self._unpack_args('--scanargs=', 'scan_args', kwargs)
37 args += self._unpack_args('--scanobjsargs=', 'scanobjs_args', kwargs) 37 args += self._unpack_args('--scanobjsargs=', 'scanobjs_args', kwargs)
38@@ -854,14 +858,22 @@ This will become a hard error in the future.''')
39 ldflags.update(internal_ldflags)
40 ldflags.update(state.environment.coredata.get_external_link_args('c'))
41 ldflags.update(external_ldflags)
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
64diff --git a/mesonbuild/scripts/gtkdochelper.py b/mesonbuild/scripts/gtkdochelper.py 38diff --git a/mesonbuild/scripts/gtkdochelper.py b/mesonbuild/scripts/gtkdochelper.py
65index 948dc5a..9c5bd19 100644 39index 948dc5a..9c5bd19 100644
66--- a/mesonbuild/scripts/gtkdochelper.py 40--- a/mesonbuild/scripts/gtkdochelper.py
diff --git a/meta/recipes-devtools/meson/meson/gi-flags.patch b/meta/recipes-devtools/meson/meson/gi-flags.patch
new file mode 100644
index 0000000000..9a4c296191
--- /dev/null
+++ b/meta/recipes-devtools/meson/meson/gi-flags.patch
@@ -0,0 +1,35 @@
1Pass the correct cflags/ldflags to the gobject-introspection tools.
2
3Upstream-Status: Submitted [https://github.com/mesonbuild/meson/pull/4261]
4Signed-off-by: Ross Burton <ross.burton@intel.com>
5
6diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
7index cb69641e..bb4449a0 100644
8--- a/mesonbuild/modules/gnome.py
9+++ b/mesonbuild/modules/gnome.py
10@@ -579,7 +579,10 @@ class GnomeModule(ExtensionModule):
11 external_ldflags += list(dep_external_ldflags)
12 scan_command += ['--cflags-begin']
13 scan_command += cflags
14- scan_command += state.environment.coredata.get_external_args(lang)
15+ if state.environment.is_cross_build():
16+ scan_command += state.environment.cross_info.config["properties"].get(lang + '_args', "")
17+ else:
18+ scan_command += state.environment.coredata.get_external_args(lang)
19 scan_command += ['--cflags-end']
20 # need to put our output directory first as we need to use the
21 # generated libraries instead of any possibly installed system/prefix
22@@ -614,7 +614,12 @@ class GnomeModule(ExtensionModule):
23 scan_command.append('-L' + d)
24 scan_command += ['--library', libname]
25
26- for link_arg in state.environment.coredata.get_external_link_args(lang):
27+ if state.environment.is_cross_build():
28+ link_args = state.environment.cross_info.config["properties"].get(lang + '_link_args', "")
29+ else:
30+ link_args = state.environment.coredata.get_external_link_args(lang)
31+
32+ for link_arg in link_args:
33 if link_arg.startswith('-L'):
34 scan_command.append(link_arg)
35 scan_command += list(external_ldflags)
diff --git a/meta/recipes-devtools/meson/meson/gtkdoc-flags.patch b/meta/recipes-devtools/meson/meson/gtkdoc-flags.patch
new file mode 100644
index 0000000000..ecf3489bbe
--- /dev/null
+++ b/meta/recipes-devtools/meson/meson/gtkdoc-flags.patch
@@ -0,0 +1,44 @@
1Ensure that in a cross compile only the target flags are passed to gtk-doc, and
2not the native flags.
3
4Upstream-Status: Submitted [https://github.com/mesonbuild/meson/pull/4261]
5Signed-off-by: Ross Burton <ross.burton@intel.com>
6
7diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
8index 4af33304..8751f53c 100644
9--- a/mesonbuild/modules/gnome.py
10+++ b/mesonbuild/modules/gnome.py
11@@ -851,17 +851,30 @@ This will become a hard error in the future.''')
12 if not isinstance(incd.held_object, (str, build.IncludeDirs)):
13 raise MesonException(
14 'Gir include dirs should be include_directories().')
15+
16 cflags.update(get_include_args(inc_dirs))
17- cflags.update(state.environment.coredata.get_external_args('c'))
18+ if state.environment.is_cross_build():
19+ cflags.update(state.environment.cross_info.config["properties"].get('c_args', ""))
20+ else:
21+ cflags.update(state.environment.coredata.get_external_args('c'))
22+
23 ldflags = OrderedSet()
24 ldflags.update(internal_ldflags)
25- ldflags.update(state.environment.coredata.get_external_link_args('c'))
26+ if state.environment.is_cross_build():
27+ ldflags.update(state.environment.cross_info.config["properties"].get('c_link_args', ""))
28+ else:
29+ ldflags.update(state.environment.coredata.get_external_link_args('c'))
30 ldflags.update(external_ldflags)
31+
32 if cflags:
33 args += ['--cflags=%s' % ' '.join(cflags)]
34 if ldflags:
35 args += ['--ldflags=%s' % ' '.join(ldflags)]
36- compiler = state.environment.coredata.compilers.get('c')
37+
38+ if state.environment.is_cross_build():
39+ compiler = state.environment.coredata.cross_compilers.get('c')
40+ else:
41+ compiler = state.environment.coredata.compilers.get('c')
42 if compiler:
43 args += ['--cc=%s' % ' '.join(compiler.get_exelist())]
44 args += ['--ld=%s' % ' '.join(compiler.get_linker_exelist())]