summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/meson
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/meson')
-rw-r--r--meta/recipes-devtools/meson/meson.inc14
-rw-r--r--meta/recipes-devtools/meson/meson/0001-Linker-rules-move-cross_args-in-front-of-output_args.patch30
-rw-r--r--meta/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch35
-rw-r--r--meta/recipes-devtools/meson/meson/0001-environment.py-detect-windows-also-if-the-system-str.patch (renamed from meta/recipes-devtools/meson/meson/0002-environment.py-detect-windows-also-if-the-system-str.patch)16
-rw-r--r--meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch2
-rw-r--r--meta/recipes-devtools/meson/meson/0001-mesonbuild-environment.py-check-environment-for-vari.patch28
-rw-r--r--meta/recipes-devtools/meson/meson/0001-mesonbuild-environment.py-do-not-determine-whether-a.patch30
-rw-r--r--meta/recipes-devtools/meson/meson/0001-modules-windows-split-WINDRES-env-variable.patch26
-rw-r--r--meta/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch16
-rw-r--r--meta/recipes-devtools/meson/meson/0007-mesonbuild-allow-multiple-cross-file-options.patch (renamed from meta/recipes-devtools/meson/meson/many-cross.patch)162
-rw-r--r--meta/recipes-devtools/meson/meson/cross-libdir.patch35
-rw-r--r--meta/recipes-devtools/meson/meson/load-configs-generalise-search-path.patch50
-rw-r--r--meta/recipes-devtools/meson/meson_0.50.0.bb (renamed from meta/recipes-devtools/meson/meson_0.49.2.bb)0
-rw-r--r--meta/recipes-devtools/meson/nativesdk-meson_0.50.0.bb (renamed from meta/recipes-devtools/meson/nativesdk-meson_0.49.2.bb)0
14 files changed, 222 insertions, 222 deletions
diff --git a/meta/recipes-devtools/meson/meson.inc b/meta/recipes-devtools/meson/meson.inc
index 2d18f72c0c..6d743fbe14 100644
--- a/meta/recipes-devtools/meson/meson.inc
+++ b/meta/recipes-devtools/meson/meson.inc
@@ -7,18 +7,18 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"
7SRC_URI = "https://github.com/mesonbuild/meson/releases/download/${PV}/meson-${PV}.tar.gz \ 7SRC_URI = "https://github.com/mesonbuild/meson/releases/download/${PV}/meson-${PV}.tar.gz \
8 file://0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch \ 8 file://0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch \
9 file://0002-gobject-introspection-determine-g-ir-scanner-and-g-i.patch \ 9 file://0002-gobject-introspection-determine-g-ir-scanner-and-g-i.patch \
10 file://0001-Linker-rules-move-cross_args-in-front-of-output_args.patch \
11 file://0003-native_bindir.patch \ 10 file://0003-native_bindir.patch \
12 file://0001-python-module-do-not-manipulate-the-environment-when.patch \ 11 file://0001-python-module-do-not-manipulate-the-environment-when.patch \
13 file://disable-rpath-handling.patch \ 12 file://disable-rpath-handling.patch \
14 file://0001-modules-windows-split-WINDRES-env-variable.patch \
15 file://0002-environment.py-detect-windows-also-if-the-system-str.patch \
16 file://cross-prop-default.patch \ 13 file://cross-prop-default.patch \
17 file://many-cross.patch \ 14 file://load-configs-generalise-search-path.patch \
18 file://cross-libdir.patch \ 15 file://0007-mesonbuild-allow-multiple-cross-file-options.patch \
16 file://0001-environment.py-detect-windows-also-if-the-system-str.patch \
17 file://0001-mesonbuild-environment.py-do-not-determine-whether-a.patch \
18 file://0001-mesonbuild-environment.py-check-environment-for-vari.patch \
19 " 19 "
20SRC_URI[sha256sum] = "ef9f14326ec1e30d3ba1a26df0f92826ede5a79255ad723af78a2691c37109fd" 20SRC_URI[sha256sum] = "2a1bc42dda58206fb922cda5e1ca95cc03ad126321d26acc47d3493ec4e7021f"
21SRC_URI[md5sum] = "0267b0871266056184c484792572c682" 21SRC_URI[md5sum] = "433483107fda4616eaf33de7e7083a84"
22 22
23SRC_URI_append_class-native = " \ 23SRC_URI_append_class-native = " \
24 file://0001-Make-CPU-family-warnings-fatal.patch \ 24 file://0001-Make-CPU-family-warnings-fatal.patch \
diff --git a/meta/recipes-devtools/meson/meson/0001-Linker-rules-move-cross_args-in-front-of-output_args.patch b/meta/recipes-devtools/meson/meson/0001-Linker-rules-move-cross_args-in-front-of-output_args.patch
deleted file mode 100644
index 97778c32eb..0000000000
--- a/meta/recipes-devtools/meson/meson/0001-Linker-rules-move-cross_args-in-front-of-output_args.patch
+++ /dev/null
@@ -1,30 +0,0 @@
1From 4676224dbdff0f7107e8cbdbe0eab19c855f1454 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Fri, 17 Nov 2017 13:18:28 +0200
4Subject: [PATCH] Linker rules: move {cross_args} in front of {output_args}
5
6The previous order was found to break linking in some cases
7(e.g. when -no-pic -fno-PIC was present in {cross_args}.
8
9Upstream-Status: Pending
10Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
11---
12 mesonbuild/backend/ninjabackend.py | 2 +-
13 1 file changed, 1 insertion(+), 1 deletion(-)
14
15diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
16index bb281e1..969b70e 100644
17--- a/mesonbuild/backend/ninjabackend.py
18+++ b/mesonbuild/backend/ninjabackend.py
19@@ -1501,7 +1501,7 @@ int dummy;
20 rspfile_content = $ARGS {output_args} $in $LINK_ARGS {cross_args} $aliasing
21 '''
22 else:
23- command_template = ' command = {executable} $ARGS {output_args} $in $LINK_ARGS {cross_args} $aliasing\n'
24+ command_template = ' command = {executable} $ARGS {cross_args} {output_args} $in $LINK_ARGS $aliasing\n'
25 command = command_template.format(
26 executable=' '.join(compiler.get_linker_exelist()),
27 cross_args=' '.join(cross_args),
28--
292.15.0
30
diff --git a/meta/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch b/meta/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch
index fbc3f5ad82..2580b1e366 100644
--- a/meta/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch
+++ b/meta/recipes-devtools/meson/meson/0001-Make-CPU-family-warnings-fatal.patch
@@ -1,4 +1,4 @@
1From 2db829d865bb6464ac15dbb4a58c9a675e296866 Mon Sep 17 00:00:00 2001 1From f76d2bf09f7ffd871d068c4ac4c4be083f5fb07f Mon Sep 17 00:00:00 2001
2From: Ross Burton <ross.burton@intel.com> 2From: Ross Burton <ross.burton@intel.com>
3Date: Tue, 3 Jul 2018 13:59:09 +0100 3Date: Tue, 3 Jul 2018 13:59:09 +0100
4Subject: [PATCH] Make CPU family warnings fatal 4Subject: [PATCH] Make CPU family warnings fatal
@@ -7,15 +7,29 @@ Upstream-Status: Inappropriate [OE specific]
7Signed-off-by: Ross Burton <ross.burton@intel.com> 7Signed-off-by: Ross Burton <ross.burton@intel.com>
8 8
9--- 9---
10 mesonbuild/environment.py | 6 ++---- 10 mesonbuild/envconfig.py | 2 +-
11 1 file changed, 2 insertions(+), 4 deletions(-) 11 mesonbuild/environment.py | 4 +---
12 2 files changed, 2 insertions(+), 4 deletions(-)
12 13
14diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py
15index f2510c1..b9841fe 100644
16--- a/mesonbuild/envconfig.py
17+++ b/mesonbuild/envconfig.py
18@@ -178,7 +178,7 @@ class MachineInfo:
19
20 cpu_family = literal['cpu_family']
21 if cpu_family not in known_cpu_families:
22- mlog.warning('Unknown CPU family %s, please report this at https://github.com/mesonbuild/meson/issues/new' % cpu_family)
23+ raise EnvironmentException('Unknown CPU family %s, see https://wiki.yoctoproject.org/wiki/Meson/UnknownCPU for directions.' % cpu_family)
24
25 endian = literal['endian']
26 if endian not in ('little', 'big'):
13diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py 27diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
14index 2ccd31e..5fcf9df 100644 28index 4c1c5ac..a5a7461 100644
15--- a/mesonbuild/environment.py 29--- a/mesonbuild/environment.py
16+++ b/mesonbuild/environment.py 30+++ b/mesonbuild/environment.py
17@@ -265,9 +265,7 @@ def detect_cpu_family(compilers): 31@@ -242,9 +242,7 @@ def detect_cpu_family(compilers):
18 # below. 32 trial = 'parisc'
19 33
20 if trial not in known_cpu_families: 34 if trial not in known_cpu_families:
21- mlog.warning('Unknown CPU family {!r}, please report this at ' 35- mlog.warning('Unknown CPU family {!r}, please report this at '
@@ -25,12 +39,3 @@ index 2ccd31e..5fcf9df 100644
25 39
26 return trial 40 return trial
27 41
28@@ -1232,7 +1230,7 @@ class MachineInfo:
29
30 cpu_family = literal['cpu_family']
31 if cpu_family not in known_cpu_families:
32- mlog.warning('Unknown CPU family %s, please report this at https://github.com/mesonbuild/meson/issues/new' % cpu_family)
33+ raise EnvironmentException('Unknown CPU family %s, see https://wiki.yoctoproject.org/wiki/Meson/UnknownCPU for directions.' % cpu_family)
34
35 endian = literal['endian']
36 if endian not in ('little', 'big'):
diff --git a/meta/recipes-devtools/meson/meson/0002-environment.py-detect-windows-also-if-the-system-str.patch b/meta/recipes-devtools/meson/meson/0001-environment.py-detect-windows-also-if-the-system-str.patch
index 1be5d66329..f6043190af 100644
--- a/meta/recipes-devtools/meson/meson/0002-environment.py-detect-windows-also-if-the-system-str.patch
+++ b/meta/recipes-devtools/meson/meson/0001-environment.py-detect-windows-also-if-the-system-str.patch
@@ -1,20 +1,20 @@
1From 7bf4c2c02eb7fe1bf24b23e3ba2d7df36495e0aa Mon Sep 17 00:00:00 2001 1From 63b78b7990c5d60f7bc674a26f655caa0bec3c49 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com> 2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Wed, 13 Feb 2019 17:45:09 +0100 3Date: Mon, 25 Mar 2019 17:17:06 +0100
4Subject: [PATCH] environment.py: detect windows also if the system string 4Subject: [PATCH] environment.py: detect windows also if the system string
5 contains 'mingw' 5 contains 'mingw'
6 6
7Upstream-Status: Pending 7Upstream-Status: Pending
8Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> 8Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
9--- 9---
10 mesonbuild/environment.py | 2 +- 10 mesonbuild/envconfig.py | 2 +-
11 1 file changed, 1 insertion(+), 1 deletion(-) 11 1 file changed, 1 insertion(+), 1 deletion(-)
12 12
13diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py 13diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py
14index b4fc0dc..845077e 100644 14index f2510c1..5309ef4 100644
15--- a/mesonbuild/environment.py 15--- a/mesonbuild/envconfig.py
16+++ b/mesonbuild/environment.py 16+++ b/mesonbuild/envconfig.py
17@@ -1247,7 +1247,7 @@ class MachineInfo: 17@@ -194,7 +194,7 @@ class MachineInfo:
18 """ 18 """
19 Machine is windows? 19 Machine is windows?
20 """ 20 """
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 11fd9ed3ac..7c3238bf91 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
@@ -27,7 +27,7 @@ index bf49770..7c5a363 100644
27 '--mode=' + mode] 27 '--mode=' + mode]
28 if namespace: 28 if namespace:
29 args.append('--namespace=' + namespace) 29 args.append('--namespace=' + namespace)
30+ gtkdoc_exe_wrapper = state.environment.cross_info.config["properties"].get('gtkdoc_exe_wrapper', None) 30+ gtkdoc_exe_wrapper = state.environment.properties.host.get('gtkdoc_exe_wrapper', None)
31+ if gtkdoc_exe_wrapper is not None: 31+ if gtkdoc_exe_wrapper is not None:
32+ args.append('--run=' + gtkdoc_exe_wrapper) 32+ args.append('--run=' + gtkdoc_exe_wrapper)
33+ 33+
diff --git a/meta/recipes-devtools/meson/meson/0001-mesonbuild-environment.py-check-environment-for-vari.patch b/meta/recipes-devtools/meson/meson/0001-mesonbuild-environment.py-check-environment-for-vari.patch
new file mode 100644
index 0000000000..fadb2734f4
--- /dev/null
+++ b/meta/recipes-devtools/meson/meson/0001-mesonbuild-environment.py-check-environment-for-vari.patch
@@ -0,0 +1,28 @@
1From 63e79329b5dd00882f0cea56a6d907a831b94171 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Mon, 25 Mar 2019 18:52:48 +0100
4Subject: [PATCH] mesonbuild/environment.py: check environment for various
5 binaries
6
7Upstream-Status: Inappropriate [oe-core specific]
8Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
9---
10 mesonbuild/environment.py | 2 +-
11 1 file changed, 1 insertion(+), 1 deletion(-)
12
13diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
14index 6e5d689..bbfd87d 100644
15--- a/mesonbuild/environment.py
16+++ b/mesonbuild/environment.py
17@@ -398,7 +398,7 @@ class Environment:
18 config = MesonConfigFile.from_config_parser(
19 coredata.load_configs(self.coredata.cross_files, 'cross'))
20 self.properties.host = Properties(config.get('properties', {}), False)
21- self.binaries.host = BinaryTable(config.get('binaries', {}), False)
22+ self.binaries.host = BinaryTable(config.get('binaries', {}), True)
23 if 'host_machine' in config:
24 self.machines.host = MachineInfo.from_literal(config['host_machine'])
25 if 'target_machine' in config:
26--
272.17.1
28
diff --git a/meta/recipes-devtools/meson/meson/0001-mesonbuild-environment.py-do-not-determine-whether-a.patch b/meta/recipes-devtools/meson/meson/0001-mesonbuild-environment.py-do-not-determine-whether-a.patch
new file mode 100644
index 0000000000..e64e13b836
--- /dev/null
+++ b/meta/recipes-devtools/meson/meson/0001-mesonbuild-environment.py-do-not-determine-whether-a.patch
@@ -0,0 +1,30 @@
1From c040f0dbace3259c80f3710bc019433b9c817940 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Mon, 25 Mar 2019 18:18:33 +0100
4Subject: [PATCH] mesonbuild/environment.py: do not determine whether a build
5 is cross by comparing architectures
6
7This can, and does, go wrong when our host architecture is same as the target one(e.g. x86_64).
8
9Upstream-Status: Pending
10Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
11---
12 mesonbuild/environment.py | 2 +-
13 1 file changed, 1 insertion(+), 1 deletion(-)
14
15diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
16index 4c1c5ac..6e5d689 100644
17--- a/mesonbuild/environment.py
18+++ b/mesonbuild/environment.py
19@@ -478,7 +478,7 @@ class Environment:
20 self.first_invocation = True
21
22 def is_cross_build(self):
23- return not self.machines.matches_build_machine(MachineChoice.HOST)
24+ return self.need_exe_wrapper()
25
26 def dump_coredata(self):
27 return coredata.save(self.coredata, self.get_build_dir())
28--
292.17.1
30
diff --git a/meta/recipes-devtools/meson/meson/0001-modules-windows-split-WINDRES-env-variable.patch b/meta/recipes-devtools/meson/meson/0001-modules-windows-split-WINDRES-env-variable.patch
deleted file mode 100644
index c334e6dd66..0000000000
--- a/meta/recipes-devtools/meson/meson/0001-modules-windows-split-WINDRES-env-variable.patch
+++ /dev/null
@@ -1,26 +0,0 @@
1From 5293d0f5067b2aeefe9ce3c175c972de367589bc Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Wed, 13 Feb 2019 17:43:54 +0100
4Subject: [PATCH] modules/windows: split WINDRES env variable
5
6As it may contain not just the binary, but also the arguments to it.
7
8Upstream-Status: Pending
9Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
10---
11 mesonbuild/modules/windows.py | 2 +-
12 1 file changed, 1 insertion(+), 1 deletion(-)
13
14diff --git a/mesonbuild/modules/windows.py b/mesonbuild/modules/windows.py
15index d185d89..dbaeb9b 100644
16--- a/mesonbuild/modules/windows.py
17+++ b/mesonbuild/modules/windows.py
18@@ -56,7 +56,7 @@ class WindowsModule(ExtensionModule):
19 if 'WINDRES' in os.environ:
20 # Pick-up env var WINDRES if set. This is often used for
21 # specifying an arch-specific windres.
22- rescomp = ExternalProgram('windres', command=os.environ.get('WINDRES'), silent=True)
23+ rescomp = ExternalProgram('windres', command=os.environ.get('WINDRES').split(), silent=True)
24
25 if not rescomp or not rescomp.found():
26 # Take windres from the config file after the environment, which is
diff --git a/meta/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch b/meta/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch
index 81548cdfb8..f0ea61bac5 100644
--- a/meta/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch
+++ b/meta/recipes-devtools/meson/meson/0002-Support-building-allarch-recipes-again.patch
@@ -1,4 +1,4 @@
1From f8419d5f279f1fb9b5e7eead4f1579bce7cb0e4e Mon Sep 17 00:00:00 2001 1From 755902910ad124095c671b3c7f057e6513d9c0c6 Mon Sep 17 00:00:00 2001
2From: Peter Kjellerstedt <pkj@axis.com> 2From: Peter Kjellerstedt <pkj@axis.com>
3Date: Thu, 26 Jul 2018 16:32:49 +0200 3Date: Thu, 26 Jul 2018 16:32:49 +0200
4Subject: [PATCH] Support building allarch recipes again 4Subject: [PATCH] Support building allarch recipes again
@@ -9,15 +9,15 @@ Upstream-Status: Inappropriate [OE specific]
9Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> 9Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
10 10
11--- 11---
12 mesonbuild/environment.py | 1 + 12 mesonbuild/envconfig.py | 1 +
13 1 file changed, 1 insertion(+) 13 1 file changed, 1 insertion(+)
14 14
15diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py 15diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py
16index 5fcf9df..b4fc0dc 100644 16index b9841fe..9c0487e 100644
17--- a/mesonbuild/environment.py 17--- a/mesonbuild/envconfig.py
18+++ b/mesonbuild/environment.py 18+++ b/mesonbuild/envconfig.py
19@@ -72,6 +72,7 @@ from .compilers import ( 19@@ -34,6 +34,7 @@ from . import mlog
20 build_filename = 'meson.build' 20
21 21
22 known_cpu_families = ( 22 known_cpu_families = (
23+ 'allarch', 23+ 'allarch',
diff --git a/meta/recipes-devtools/meson/meson/many-cross.patch b/meta/recipes-devtools/meson/meson/0007-mesonbuild-allow-multiple-cross-file-options.patch
index d04c28b8a3..6c2949c0e8 100644
--- a/meta/recipes-devtools/meson/meson/many-cross.patch
+++ b/meta/recipes-devtools/meson/meson/0007-mesonbuild-allow-multiple-cross-file-options.patch
@@ -1,4 +1,7 @@
1mesonbuild: allow multiple --cross-file options 1From 07ae4f949b8402cff178dd12c210d9a726ffe2da Mon Sep 17 00:00:00 2001
2From: Ross Burton <ross.burton@intel.com>
3Date: Mon, 18 Mar 2019 17:27:57 +0000
4Subject: [PATCH] mesonbuild: allow multiple --cross-file options
2 5
3Just like --native-file, allow multiple --cross-file options. This is mostly 6Just like --native-file, allow multiple --cross-file options. This is mostly
4unifying the logic between cross_files and config_files. 7unifying the logic between cross_files and config_files.
@@ -6,11 +9,30 @@ unifying the logic between cross_files and config_files.
6Upstream-Status: Backport [will be in 0.50.1] 9Upstream-Status: Backport [will be in 0.50.1]
7Signed-off-by: Ross Burton <ross.burton@intel.com> 10Signed-off-by: Ross Burton <ross.burton@intel.com>
8 11
12---
13 .../markdown/snippets/multiple-cross-files.md | 3 ++
14 mesonbuild/backend/backends.py | 3 +-
15 mesonbuild/coredata.py | 52 +++----------------
16 mesonbuild/environment.py | 5 +-
17 mesonbuild/msetup.py | 4 +-
18 mesonbuild/munstable_coredata.py | 5 +-
19 6 files changed, 20 insertions(+), 52 deletions(-)
20 create mode 100644 docs/markdown/snippets/multiple-cross-files.md
21
22diff --git a/docs/markdown/snippets/multiple-cross-files.md b/docs/markdown/snippets/multiple-cross-files.md
23new file mode 100644
24index 0000000..de229be
25--- /dev/null
26+++ b/docs/markdown/snippets/multiple-cross-files.md
27@@ -0,0 +1,3 @@
28+## Multipe cross files can be specified
29+
30+`--cross-file` can be passed multiple times, with the configuration files overlaying the same way as `--native-file`.
9diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py 31diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
10index 40402513..4b9bcb59 100644 32index 4d35d22..5b270d3 100644
11--- a/mesonbuild/backend/backends.py 33--- a/mesonbuild/backend/backends.py
12+++ b/mesonbuild/backend/backends.py 34+++ b/mesonbuild/backend/backends.py
13@@ -726,8 +726,7 @@ class Backend: 35@@ -788,8 +788,7 @@ class Backend:
14 deps = [os.path.join(self.build_to_src, df) 36 deps = [os.path.join(self.build_to_src, df)
15 for df in self.interpreter.get_build_def_files()] 37 for df in self.interpreter.get_build_def_files()]
16 if self.environment.is_cross_build(): 38 if self.environment.is_cross_build():
@@ -21,39 +43,19 @@ index 40402513..4b9bcb59 100644
21 if os.path.exists(os.path.join(self.environment.get_source_dir(), 'meson_options.txt')): 43 if os.path.exists(os.path.join(self.environment.get_source_dir(), 'meson_options.txt')):
22 deps.append(os.path.join(self.build_to_src, 'meson_options.txt')) 44 deps.append(os.path.join(self.build_to_src, 'meson_options.txt'))
23diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py 45diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
24index c3f5a745..ff810683 100644 46index 066ad30..d80e9a0 100644
25--- a/mesonbuild/coredata.py 47--- a/mesonbuild/coredata.py
26+++ b/mesonbuild/coredata.py 48+++ b/mesonbuild/coredata.py
27@@ -201,8 +201,8 @@ class UserFeatureOption(UserComboOption): 49@@ -265,7 +265,7 @@ class CoreData:
28 return self.value == 'auto' 50 self.compiler_options = PerMachine({}, {}, {})
29
30
31-def load_configs(filenames):
32- """Load native files."""
33+def load_configs(filenames, subdir):
34+ """Load configuration files from a named subdirectory."""
35 def gen():
36 for f in filenames:
37 f = os.path.expanduser(os.path.expandvars(f))
38@@ -215,7 +215,7 @@ def load_configs(filenames):
39 os.environ.get('XDG_DATA_HOME', os.path.expanduser('~/.local/share')),
40 ] + os.environ.get('XDG_DATA_DIRS', '/usr/local/share:/usr/share').split(':')
41 for path in paths:
42- path_to_try = os.path.join(path, 'meson', 'native', f)
43+ path_to_try = os.path.join(path, 'meson', subdir, f)
44 if os.path.isfile(path_to_try):
45 yield path_to_try
46 break
47@@ -291,7 +291,7 @@ class CoreData:
48 self.compiler_options = {}
49 self.base_options = {} 51 self.base_options = {}
50 self.external_preprocess_args = {} # CPPFLAGS only 52 self.external_preprocess_args = PerMachine({}, {}, {}) # CPPFLAGS only
51- self.cross_file = self.__load_cross_file(options.cross_file) 53- self.cross_file = self.__load_cross_file(options.cross_file)
52+ self.cross_files = self.__load_config_files(options.cross_file) 54+ self.cross_files = self.__load_config_files(options.cross_file)
53 self.compilers = OrderedDict() 55 self.compilers = OrderedDict()
54 self.cross_compilers = OrderedDict() 56 self.cross_compilers = OrderedDict()
55 self.deps = OrderedDict() 57 self.deps = OrderedDict()
56@@ -301,52 +301,14 @@ class CoreData: 58@@ -276,57 +276,19 @@ class CoreData:
57 59
58 @staticmethod 60 @staticmethod
59 def __load_config_files(filenames): 61 def __load_config_files(filenames):
@@ -105,10 +107,16 @@ index c3f5a745..ff810683 100644
105- 107-
106- raise MesonException('Cannot find specified cross file: ' + filename) 108- raise MesonException('Cannot find specified cross file: ' + filename)
107- 109-
110 def libdir_cross_fixup(self):
111 # By default set libdir to "lib" when cross compiling since
112 # getting the "system default" is always wrong on multiarch
113 # platforms as it gets a value like lib/x86_64-linux-gnu.
114- if self.cross_file is not None:
115+ if self.cross_files:
116 self.builtins['libdir'].value = 'lib'
117
108 def sanitize_prefix(self, prefix): 118 def sanitize_prefix(self, prefix):
109 if not os.path.isabs(prefix): 119@@ -642,8 +604,8 @@ def read_cmd_line_file(build_dir, options):
110 raise MesonException('prefix value {!r} must be an absolute path'
111@@ -558,8 +520,8 @@ def read_cmd_line_file(build_dir, options):
112 options.cmd_line_options = d 120 options.cmd_line_options = d
113 121
114 properties = config['properties'] 122 properties = config['properties']
@@ -119,7 +127,7 @@ index c3f5a745..ff810683 100644
119 if not options.native_file: 127 if not options.native_file:
120 # This will be a string in the form: "['first', 'second', ...]", use 128 # This will be a string in the form: "['first', 'second', ...]", use
121 # literal_eval to get it into the list of strings. 129 # literal_eval to get it into the list of strings.
122@@ -570,7 +532,7 @@ def write_cmd_line_file(build_dir, options): 130@@ -654,7 +616,7 @@ def write_cmd_line_file(build_dir, options):
123 config = CmdLineFileParser() 131 config = CmdLineFileParser()
124 132
125 properties = {} 133 properties = {}
@@ -129,50 +137,26 @@ index c3f5a745..ff810683 100644
129 if options.native_file: 137 if options.native_file:
130 properties['native_file'] = options.native_file 138 properties['native_file'] = options.native_file
131diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py 139diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
132index 6d86daf9..406ab8b8 100644 140index c25ef33..4c1c5ac 100644
133--- a/mesonbuild/environment.py 141--- a/mesonbuild/environment.py
134+++ b/mesonbuild/environment.py 142+++ b/mesonbuild/environment.py
135@@ -355,8 +355,8 @@ class Environment: 143@@ -394,8 +394,9 @@ class Environment:
136 self.machines = MachineInfos() 144 self.binaries.build = BinaryTable(config.get('binaries', {}))
137 # Will be fully initialized later using compilers later. 145 self.paths.build = Directories(**config.get('paths', {}))
138 self.machines.detect_build()
139- if self.coredata.cross_file:
140- self.cross_info = CrossBuildInfo(self.coredata.cross_file)
141+ if self.coredata.cross_files:
142+ self.cross_info = CrossBuildInfo(self.coredata.cross_files)
143 if 'exe_wrapper' in self.cross_info.config['binaries']:
144 from .dependencies import ExternalProgram
145 self.exe_wrapper = ExternalProgram.from_bin_list(
146@@ -373,7 +373,7 @@ class Environment:
147 146
148 if self.coredata.config_files: 147- if self.coredata.cross_file is not None:
149 self.config_info = coredata.ConfigData( 148- config = MesonConfigFile.parse_datafile(self.coredata.cross_file)
150- coredata.load_configs(self.coredata.config_files)) 149+ if self.coredata.cross_files:
151+ coredata.load_configs(self.coredata.config_files, 'native')) 150+ config = MesonConfigFile.from_config_parser(
152 else: 151+ coredata.load_configs(self.coredata.cross_files, 'cross'))
153 self.config_info = coredata.ConfigData() 152 self.properties.host = Properties(config.get('properties', {}), False)
154 153 self.binaries.host = BinaryTable(config.get('binaries', {}), False)
155@@ -1113,13 +1113,8 @@ class CrossBuildInfo: 154 if 'host_machine' in config:
156 def ok_type(self, i):
157 return isinstance(i, (str, int, bool))
158
159- def parse_datafile(self, filename):
160- config = configparser.ConfigParser()
161- try:
162- with open(filename, 'r') as f:
163- config.read_file(f, filename)
164- except FileNotFoundError:
165- raise EnvironmentException('File not found: %s.' % filename)
166+ def parse_datafile(self, filenames):
167+ config = coredata.load_configs(filenames, 'cross')
168 # This is a bit hackish at the moment.
169 for s in config.sections():
170 self.config[s] = {}
171diff --git a/mesonbuild/msetup.py b/mesonbuild/msetup.py 155diff --git a/mesonbuild/msetup.py b/mesonbuild/msetup.py
172index 56a0e9a7..f0a1ae19 100644 156index 023afdb..6e8ca83 100644
173--- a/mesonbuild/msetup.py 157--- a/mesonbuild/msetup.py
174+++ b/mesonbuild/msetup.py 158+++ b/mesonbuild/msetup.py
175@@ -27,7 +27,9 @@ from .mesonlib import MesonException 159@@ -29,7 +29,9 @@ from .mesonlib import MesonException
176 160
177 def add_arguments(parser): 161 def add_arguments(parser):
178 coredata.register_builtin_arguments(parser) 162 coredata.register_builtin_arguments(parser)
@@ -183,25 +167,19 @@ index 56a0e9a7..f0a1ae19 100644
183 help='File describing cross compilation environment.') 167 help='File describing cross compilation environment.')
184 parser.add_argument('--native-file', 168 parser.add_argument('--native-file',
185 default=[], 169 default=[],
186diff --git a/run_unittests.py b/run_unittests.py 170diff --git a/mesonbuild/munstable_coredata.py b/mesonbuild/munstable_coredata.py
187index e6874b25..1d247291 100755 171index 78f3f34..913f942 100644
188--- a/run_unittests.py 172--- a/mesonbuild/munstable_coredata.py
189+++ b/run_unittests.py 173+++ b/mesonbuild/munstable_coredata.py
190@@ -529,7 +529,7 @@ class InternalTests(unittest.TestCase): 174@@ -81,8 +81,9 @@ def run(options):
191 config.write(configfile) 175 print('Last seen PKGCONFIG enviroment variable value: ' + v)
192 configfile.flush() 176 elif k == 'version':
193 configfile.close() 177 print('Meson version: ' + v)
194- detected_value = mesonbuild.environment.CrossBuildInfo(configfile.name).need_exe_wrapper() 178- elif k == 'cross_file':
195+ detected_value = mesonbuild.environment.CrossBuildInfo((configfile.name,)).need_exe_wrapper() 179- print('Cross File: ' + (v or 'None'))
196 os.unlink(configfilename) 180+ elif k == 'cross_files':
197 181+ if v:
198 desired_value = not detected_value 182+ print('Cross File: ' + ' '.join(v))
199@@ -541,7 +541,7 @@ class InternalTests(unittest.TestCase): 183 elif k == 'config_files':
200 configfilename = configfile.name 184 if v:
201 config.write(configfile) 185 print('Native File: ' + ' '.join(v))
202 configfile.close()
203- forced_value = mesonbuild.environment.CrossBuildInfo(configfile.name).need_exe_wrapper()
204+ forced_value = mesonbuild.environment.CrossBuildInfo((configfile.name,)).need_exe_wrapper()
205 os.unlink(configfilename)
206
207 self.assertEqual(forced_value, desired_value)
diff --git a/meta/recipes-devtools/meson/meson/cross-libdir.patch b/meta/recipes-devtools/meson/meson/cross-libdir.patch
deleted file mode 100644
index 7395fdbdaa..0000000000
--- a/meta/recipes-devtools/meson/meson/cross-libdir.patch
+++ /dev/null
@@ -1,35 +0,0 @@
1Upstream-Status: Backport
2Signed-off-by: Ross Burton <ross.burton@intel.com>
3
4From ce24f0d6a9be22ba61d80cd254e0409de2eaffd7 Mon Sep 17 00:00:00 2001
5From: Jussi Pakkanen <jpakkane@gmail.com>
6Date: Thu, 27 Dec 2018 23:43:35 +0200
7Subject: [PATCH] Default libdir is "lib" when cross compiling. Closes #2535.
8
9---
10diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
11index ff810683..9ee23a69 100644
12--- a/mesonbuild/coredata.py
13+++ b/mesonbuild/coredata.py
14@@ -298,6 +298,7 @@ class CoreData:
15 # Only to print a warning if it changes between Meson invocations.
16 self.pkgconf_envvar = os.environ.get('PKG_CONFIG_PATH', '')
17 self.config_files = self.__load_config_files(options.native_file)
18+ self.libdir_cross_fixup()
19
20 @staticmethod
21 def __load_config_files(filenames):
22@@ -309,6 +310,13 @@ class CoreData:
23 for f in filenames]
24 return filenames
25
26+ def libdir_cross_fixup(self):
27+ # By default set libdir to "lib" when cross compiling since
28+ # getting the "system default" is always wrong on multiarch
29+ # platforms as it gets a value like lib/x86_64-linux-gnu.
30+ if self.cross_files:
31+ self.builtins['libdir'].value = 'lib'
32+
33 def sanitize_prefix(self, prefix):
34 if not os.path.isabs(prefix):
35 raise MesonException('prefix value {!r} must be an absolute path'
diff --git a/meta/recipes-devtools/meson/meson/load-configs-generalise-search-path.patch b/meta/recipes-devtools/meson/meson/load-configs-generalise-search-path.patch
new file mode 100644
index 0000000000..fc02576f5b
--- /dev/null
+++ b/meta/recipes-devtools/meson/meson/load-configs-generalise-search-path.patch
@@ -0,0 +1,50 @@
1From d57dd1092e84e08ee15d7063b6c56bd6d864f2e1 Mon Sep 17 00:00:00 2001
2From: Ross Burton <ross.burton@intel.com>
3Date: Mon, 18 Mar 2019 16:16:56 +0000
4Subject: [PATCH] load_configs: generalise the search path
5
6Instead of hard-coding the fact that load_configs() searches for files under
7meson/native, pass in the subdirectory allowing the cross-file code to use the
8same logic.
9---
10 mesonbuild/coredata.py | 6 +++---
11 mesonbuild/environment.py | 2 +-
12 2 files changed, 4 insertions(+), 4 deletions(-)
13
14diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
15index fba90fa369..6e60917d10 100644
16--- a/mesonbuild/coredata.py
17+++ b/mesonbuild/coredata.py
18@@ -211,8 +211,8 @@ def is_auto(self):
19 return self.value == 'auto'
20
21
22-def load_configs(filenames):
23- """Load native files."""
24+def load_configs(filenames, subdir):
25+ """Load configuration files from a named subdirectory."""
26 def gen():
27 for f in filenames:
28 f = os.path.expanduser(os.path.expandvars(f))
29@@ -225,7 +225,7 @@ def gen():
30 os.environ.get('XDG_DATA_HOME', os.path.expanduser('~/.local/share')),
31 ] + os.environ.get('XDG_DATA_DIRS', '/usr/local/share:/usr/share').split(':')
32 for path in paths:
33- path_to_try = os.path.join(path, 'meson', 'native', f)
34+ path_to_try = os.path.join(path, 'meson', subdir, f)
35 if os.path.isfile(path_to_try):
36 yield path_to_try
37 break
38diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
39index 58adb06960..92a00dd7bf 100644
40--- a/mesonbuild/environment.py
41+++ b/mesonbuild/environment.py
42@@ -408,7 +408,7 @@ def __init__(self, source_dir, build_dir, options):
43
44 if self.coredata.config_files is not None:
45 config = MesonConfigFile.from_config_parser(
46- coredata.load_configs(self.coredata.config_files))
47+ coredata.load_configs(self.coredata.config_files, 'native'))
48 self.binaries.build = BinaryTable(config.get('binaries', {}))
49 self.paths.build = Directories(**config.get('paths', {}))
50
diff --git a/meta/recipes-devtools/meson/meson_0.49.2.bb b/meta/recipes-devtools/meson/meson_0.50.0.bb
index de9b905c12..de9b905c12 100644
--- a/meta/recipes-devtools/meson/meson_0.49.2.bb
+++ b/meta/recipes-devtools/meson/meson_0.50.0.bb
diff --git a/meta/recipes-devtools/meson/nativesdk-meson_0.49.2.bb b/meta/recipes-devtools/meson/nativesdk-meson_0.50.0.bb
index 1549357a55..1549357a55 100644
--- a/meta/recipes-devtools/meson/nativesdk-meson_0.49.2.bb
+++ b/meta/recipes-devtools/meson/nativesdk-meson_0.50.0.bb