diff options
Diffstat (limited to 'meta/recipes-devtools/meson/meson')
10 files changed, 76 insertions, 304 deletions
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 bcccfabd17..8ea7c35950 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,43 +1,45 @@ -From b64032a2eb1fb760f4ffd5b4b666e2433cf80d39 Mon Sep 17 00:00:00 2001 +From b77cbe67df5fa0998946503f207c256ee740bb5f Mon Sep 17 00:00:00 2001 From: Ross Burton <ross.burton@intel.com> Date: Tue, 3 Jul 2018 13:59:09 +0100 -Subject: [PATCH 1/2] Make CPU family warnings fatal +Subject: [PATCH] Make CPU family warnings fatal Upstream-Status: Inappropriate [OE specific] Signed-off-by: Ross Burton <ross.burton@intel.com> + --- - mesonbuild/envconfig.py | 2 +- - mesonbuild/environment.py | 4 +--- - 2 files changed, 2 insertions(+), 4 deletions(-) + mesonbuild/envconfig.py | 4 ++-- + mesonbuild/environment.py | 6 ++---- + 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py -index c6a4df3..4d58c91 100644 +index 07f1229..a35c356 100644 --- a/mesonbuild/envconfig.py +++ b/mesonbuild/envconfig.py -@@ -266,7 +266,7 @@ class MachineInfo: +@@ -285,8 +285,8 @@ class MachineInfo(HoldableObject): + 'but is missing {}.'.format(minimum_literal - set(literal))) cpu_family = literal['cpu_family'] - if cpu_family not in known_cpu_families: +- if cpu_family not in known_cpu_families: - mlog.warning(f'Unknown CPU family {cpu_family}, please report this at https://github.com/mesonbuild/meson/issues/new') ++ if cpu_family not in known_cpu_families and cpu_family != "riscv": + raise EnvironmentException('Unknown CPU family {}, see https://wiki.yoctoproject.org/wiki/Meson/UnknownCPU for directions.'.format(cpu_family)) endian = literal['endian'] if endian not in ('little', 'big'): diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py -index fc9b703..eea8345 100644 +index 2ba2054..d798e3b 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py -@@ -436,9 +436,7 @@ def detect_cpu_family(compilers: CompilersDict) -> str: - trial = 'ppc64' +@@ -359,10 +359,8 @@ def detect_cpu_family(compilers: CompilersDict) -> str: + if compilers and not any_compiler_has_define(compilers, '__mips64'): + trial = 'mips' - if trial not in known_cpu_families: -- mlog.warning('Unknown CPU family {!r}, please report this at ' +- if trial not in known_cpu_families: +- mlog.warning(f'Unknown CPU family {trial!r}, please report this at ' - 'https://github.com/mesonbuild/meson/issues/new with the ' -- 'output of `uname -a` and `cat /proc/cpuinfo`'.format(trial)) +- 'output of `uname -a` and `cat /proc/cpuinfo`') ++ if trial not in known_cpu_families and trail != "riscv": + raise EnvironmentException('Unknown CPU family %s, see https://wiki.yoctoproject.org/wiki/Meson/UnknownCPU for directions.' % trial) return trial --- -2.24.0 - 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 deleted file mode 100644 index ce90e515da..0000000000 --- a/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 2f9c59e0489e569c5382404667c10f5c200a72ad Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Fri, 4 Aug 2017 16:16:41 +0300 -Subject: [PATCH] gtkdoc: fix issues that arise when cross-compiling - -Specifically: -1) Make it possible to specify a wrapper for executing binaries -(usually, some kind of target hardware emulator, such as qemu) -2) Explicitly provide CC and LD via command line, as otherwise gtk-doc will -try to guess them, incorrectly. -3) If things break down, print the full command with arguments, -not just the binary name. -4) Correctly determine the compiler/linker executables and cross-options when cross-compiling - -Upstream-Status: Pending -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> - ---- - mesonbuild/modules/gnome.py | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py -index dc2979e..c9ff9bd 100644 ---- a/mesonbuild/modules/gnome.py -+++ b/mesonbuild/modules/gnome.py -@@ -1053,6 +1053,10 @@ class GnomeModule(ExtensionModule): - args.append(f'--{program_name}={path}') - if namespace: - args.append('--namespace=' + namespace) -+ gtkdoc_exe_wrapper = state.environment.properties.host.get('gtkdoc_exe_wrapper', None) -+ if gtkdoc_exe_wrapper is not None: -+ args.append('--run=' + gtkdoc_exe_wrapper) -+ - args += self._unpack_args('--htmlargs=', 'html_args', kwargs) - args += self._unpack_args('--scanargs=', 'scan_args', kwargs) - args += self._unpack_args('--scanobjsargs=', 'scanobjs_args', kwargs) diff --git a/meta/recipes-devtools/meson/meson/0001-modules-python.py-do-not-substitute-python-s-install.patch b/meta/recipes-devtools/meson/meson/0001-modules-python.py-do-not-substitute-python-s-install.patch deleted file mode 100644 index 231414fcb6..0000000000 --- a/meta/recipes-devtools/meson/meson/0001-modules-python.py-do-not-substitute-python-s-install.patch +++ /dev/null @@ -1,41 +0,0 @@ -From f8f67c8d5c3f374b1e30e2d40cb56a79f0544471 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Thu, 18 Apr 2019 17:36:11 +0200 -Subject: [PATCH] modules/python.py: do not substitute python's install prefix - with meson's - -Not sure why this is being done, but it -a) relies on Python's internal variable substitution which may break in the future -b) shouldn't be necessary as Python's prefix ought to be correct in the first place - -Upstream-Status: Pending -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> - ---- - mesonbuild/modules/python.py | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py -index eda70ce..18edd15 100644 ---- a/mesonbuild/modules/python.py -+++ b/mesonbuild/modules/python.py -@@ -251,7 +251,7 @@ INTROSPECT_COMMAND = '''import sysconfig - import json - import sys - --install_paths = sysconfig.get_paths(scheme='posix_prefix', vars={'base': '', 'platbase': '', 'installed_base': ''}) -+install_paths = sysconfig.get_paths(scheme='posix_prefix') - - def links_against_libpython(): - from distutils.core import Distribution, Extension -@@ -280,8 +280,8 @@ class PythonInstallation(ExternalProgramHolder): - self.variables = info['variables'] - self.paths = info['paths'] - install_paths = info['install_paths'] -- self.platlib_install_path = os.path.join(prefix, install_paths['platlib'][1:]) -- self.purelib_install_path = os.path.join(prefix, install_paths['purelib'][1:]) -+ self.platlib_install_path = install_paths['platlib'] -+ self.purelib_install_path = install_paths['purelib'] - self.version = info['version'] - self.platform = info['platform'] - self.is_pypy = info['is_pypy'] diff --git a/meta/recipes-devtools/meson/meson/0001-python-module-do-not-manipulate-the-environment-when.patch b/meta/recipes-devtools/meson/meson/0001-python-module-do-not-manipulate-the-environment-when.patch index fdadc6869b..2e0a4b1bbe 100644 --- a/meta/recipes-devtools/meson/meson/0001-python-module-do-not-manipulate-the-environment-when.patch +++ b/meta/recipes-devtools/meson/meson/0001-python-module-do-not-manipulate-the-environment-when.patch @@ -1,4 +1,4 @@ -From 2264e67d7c2c22ca634fd26ea8ada6f0344ab280 Mon Sep 17 00:00:00 2001 +From e85683698aa3556bf14fc6d35f2c067f16af520b Mon Sep 17 00:00:00 2001 From: Alexander Kanavin <alex.kanavin@gmail.com> Date: Mon, 19 Nov 2018 14:24:26 +0100 Subject: [PATCH] python module: do not manipulate the environment when calling @@ -8,36 +8,30 @@ Upstream-Status: Inappropriate [oe-core specific] Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> --- - mesonbuild/modules/python.py | 12 ------------ - 1 file changed, 12 deletions(-) + mesonbuild/dependencies/python.py | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) -diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py -index 422155b..aaf5844 100644 ---- a/mesonbuild/modules/python.py -+++ b/mesonbuild/modules/python.py -@@ -70,11 +70,6 @@ class PythonDependency(ExternalDependency): - old_pkg_libdir = os.environ.get('PKG_CONFIG_LIBDIR') - old_pkg_path = os.environ.get('PKG_CONFIG_PATH') +diff --git a/mesonbuild/dependencies/python.py b/mesonbuild/dependencies/python.py +index 9aea6bd..8c13ede 100644 +--- a/mesonbuild/dependencies/python.py ++++ b/mesonbuild/dependencies/python.py +@@ -380,9 +380,6 @@ def python_factory(env: 'Environment', for_machine: 'MachineChoice', + empty.name = 'python' + return empty -- os.environ.pop('PKG_CONFIG_PATH', None) -- -- if pkg_libdir: -- os.environ['PKG_CONFIG_LIBDIR'] = pkg_libdir -- +- old_pkg_libdir = os.environ.pop('PKG_CONFIG_LIBDIR', None) +- old_pkg_path = os.environ.pop('PKG_CONFIG_PATH', None) +- os.environ['PKG_CONFIG_LIBDIR'] = pkg_libdir try: - self.pkgdep = PkgConfigDependency(pkg_name, environment, kwargs) - mlog.debug(f'Found "{pkg_name}" via pkgconfig lookup in LIBPC ({pkg_libdir})') -@@ -83,13 +78,6 @@ class PythonDependency(ExternalDependency): - mlog.debug(f'"{pkg_name}" could not be found in LIBPC ({pkg_libdir})') - mlog.debug(e) - -- if old_pkg_path is not None: -- os.environ['PKG_CONFIG_PATH'] = old_pkg_path -- -- if old_pkg_libdir is not None: -- os.environ['PKG_CONFIG_LIBDIR'] = old_pkg_libdir -- else: -- os.environ.pop('PKG_CONFIG_LIBDIR', None) - else: - mlog.debug(f'"{pkg_name}" could not be found in LIBPC ({pkg_libdir}), this is likely due to a relocated python installation') + return PythonPkgConfigDependency(name, env, kwargs, installation, True) + finally: +@@ -391,8 +388,7 @@ def python_factory(env: 'Environment', for_machine: 'MachineChoice', + os.environ[name] = value + elif name in os.environ: + del os.environ[name] +- set_env('PKG_CONFIG_LIBDIR', old_pkg_libdir) +- set_env('PKG_CONFIG_PATH', old_pkg_path) ++ pass + candidates.append(functools.partial(wrap_in_pythons_pc_dir, pkg_name, env, kwargs, installation)) + # We only need to check both, if a python install has a LIBPC. It might point to the wrong location, 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 dcc1ce9c27..a8396f30bb 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,21 +1,22 @@ -From 656bf55fed01df2d2e2ad6d9d9887173cb16b85c Mon Sep 17 00:00:00 2001 +From 6fb8db54929b40e1fd7ac949ef44f0d37df0bae9 Mon Sep 17 00:00:00 2001 From: Peter Kjellerstedt <pkj@axis.com> Date: Thu, 26 Jul 2018 16:32:49 +0200 -Subject: [PATCH 2/2] Support building allarch recipes again +Subject: [PATCH] Support building allarch recipes again This registers "allarch" as a known CPU family. Upstream-Status: Inappropriate [OE specific] Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> + --- mesonbuild/envconfig.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py -index 4d58c91..ff01ad1 100644 +index a35c356..436355f 100644 --- a/mesonbuild/envconfig.py +++ b/mesonbuild/envconfig.py -@@ -36,6 +36,7 @@ from pathlib import Path +@@ -38,6 +38,7 @@ from pathlib import Path known_cpu_families = ( @@ -23,6 +24,3 @@ index 4d58c91..ff01ad1 100644 'aarch64', 'alpha', 'arc', --- -2.24.0 - diff --git a/meta/recipes-devtools/meson/meson/0003-native_bindir.patch b/meta/recipes-devtools/meson/meson/0003-native_bindir.patch deleted file mode 100644 index 89257b9e05..0000000000 --- a/meta/recipes-devtools/meson/meson/0003-native_bindir.patch +++ /dev/null @@ -1,94 +0,0 @@ -From 30e97d4090a3d3f5b7ddcaf27cfa17f3c8c1d462 Mon Sep 17 00:00:00 2001 -From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> -Date: Wed, 15 Nov 2017 15:05:01 +0100 -Subject: [PATCH] native_bindir - -Some libraries, like QT, have pre-processors that convert their input -files into something that the cross-compiler can process. We find the -path of those pre-processors via pkg-config-native instead of -pkg-config. - -This path forces the use of pkg-config-native for host_bins arguments. - -There are some discussions upstream to merge this patch, but I presonaly believe -that is is OE only. https://github.com/mesonbuild/meson/issues/1849#issuecomment-303730323 - -Upstream-Status: Inappropriate [OE specific] -Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> - ---- - mesonbuild/dependencies/base.py | 19 +++++++++++-------- - 1 file changed, 11 insertions(+), 8 deletions(-) - -diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py -index 14380d4..d0c443f 100644 ---- a/mesonbuild/dependencies/base.py -+++ b/mesonbuild/dependencies/base.py -@@ -179,7 +179,7 @@ class Dependency: - def get_exe_args(self, compiler): - return [] - -- def get_pkgconfig_variable(self, variable_name: str, kwargs: T.Dict[str, T.Any]) -> str: -+ def get_pkgconfig_variable(self, variable_name: str, kwargs: T.Dict[str, T.Any], use_native=False) -> str: - raise DependencyException(f'{self.name!r} is not a pkgconfig dependency') - - def get_configtool_variable(self, variable_name): -@@ -267,7 +267,7 @@ class InternalDependency(Dependency): - return True - return any(d.is_built() for d in self.ext_deps) - -- def get_pkgconfig_variable(self, variable_name: str, kwargs: T.Dict[str, T.Any]) -> str: -+ def get_pkgconfig_variable(self, variable_name: str, kwargs: T.Dict[str, T.Any], use_native=False) -> str: - raise DependencyException('Method "get_pkgconfig_variable()" is ' - 'invalid for an internal dependency') - -@@ -645,8 +645,11 @@ class PkgConfigDependency(ExternalDependency): - return s.format(self.__class__.__name__, self.name, self.is_found, - self.version_reqs) - -- def _call_pkgbin_real(self, args, env): -- cmd = self.pkgbin.get_command() + args -+ def _call_pkgbin_real(self, args, env, use_native=False): -+ if use_native: -+ cmd = [self.pkgbin.get_command()[0] + "-native"] + args -+ else: -+ cmd = self.pkgbin.get_command() + args - p, out, err = Popen_safe(cmd, env=env) - rc, out, err = p.returncode, out.strip(), err.strip() - call = ' '.join(cmd) -@@ -674,7 +677,7 @@ class PkgConfigDependency(ExternalDependency): - if key.startswith('PKG_'): - mlog.debug(f'env[{key}]: {value}') - -- def _call_pkgbin(self, args, env=None): -+ def _call_pkgbin(self, args, env=None, use_native=False): - # Always copy the environment since we're going to modify it - # with pkg-config variables - if env is None: -@@ -688,7 +691,7 @@ class PkgConfigDependency(ExternalDependency): - targs = tuple(args) - cache = PkgConfigDependency.pkgbin_cache - if (self.pkgbin, targs, fenv) not in cache: -- cache[(self.pkgbin, targs, fenv)] = self._call_pkgbin_real(args, env) -+ cache[(self.pkgbin, targs, fenv)] = self._call_pkgbin_real(args, env, use_native) - return cache[(self.pkgbin, targs, fenv)] - - def _convert_mingw_paths(self, args: T.List[str]) -> T.List[str]: -@@ -894,7 +897,7 @@ class PkgConfigDependency(ExternalDependency): - (self.name, out_raw)) - self.link_args, self.raw_link_args = self._search_libs(out, out_raw) - -- def get_pkgconfig_variable(self, variable_name: str, kwargs: T.Dict[str, T.Any]) -> str: -+ def get_pkgconfig_variable(self, variable_name: str, kwargs: T.Dict[str, T.Any], use_native=False) -> str: - options = ['--variable=' + variable_name, self.name] - - if 'define_variable' in kwargs: -@@ -907,7 +910,7 @@ class PkgConfigDependency(ExternalDependency): - - options = ['--define-variable=' + '='.join(definition)] + options - -- ret, out, err = self._call_pkgbin(options) -+ ret, out, err = self._call_pkgbin(options, use_native=use_native) - variable = '' - if ret != 0: - if self.required: diff --git a/meta/recipes-devtools/meson/meson/disable-rpath-handling.patch b/meta/recipes-devtools/meson/meson/disable-rpath-handling.patch deleted file mode 100644 index 7c766c61b0..0000000000 --- a/meta/recipes-devtools/meson/meson/disable-rpath-handling.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 27bbd3c9d8d86de545fcf6608564a14571c98a61 Mon Sep 17 00:00:00 2001 -From: Richard Purdie <richard.purdie@linuxfoundation.org> -Date: Fri, 23 Nov 2018 15:28:28 +0000 -Subject: [PATCH] meson: Disable rpath stripping at install time - -We need to allow our rpaths generated through the compiler flags to make it into -our binaries. Therefore disable the meson manipulations of these unless there -is a specific directive to do something differently in the project. - -RP 2018/11/23 - -Upstream-Status: Submitted [https://github.com/mesonbuild/meson/issues/2567] - ---- - mesonbuild/minstall.py | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -diff --git a/mesonbuild/minstall.py b/mesonbuild/minstall.py -index 212568a..06366d4 100644 ---- a/mesonbuild/minstall.py -+++ b/mesonbuild/minstall.py -@@ -653,8 +653,11 @@ class Installer: - if file_copied: - self.did_install_something = True - try: -- self.fix_rpath(outname, t.rpath_dirs_to_remove, install_rpath, final_path, -- install_name_mappings, verbose=False) -+ if install_rpath: -+ self.fix_rpath(outname, t.rpath_dirs_to_remove, install_rpath, final_path, -+ install_name_mappings, verbose=False) -+ else: -+ print("RPATH changes at install time disabled") - except SystemExit as e: - if isinstance(e.code, int) and e.code == 0: - pass diff --git a/meta/recipes-devtools/meson/meson/gi-target-dep.patch b/meta/recipes-devtools/meson/meson/gi-target-dep.patch deleted file mode 100644 index 29e164ccc7..0000000000 --- a/meta/recipes-devtools/meson/meson/gi-target-dep.patch +++ /dev/null @@ -1,41 +0,0 @@ -When building gobject-introspection we want the *native* binaries (as they need -to be executed) but *host* gobject-introspection libraries, as otherwise the -native pkg-config can be used and the build will try to link native and host -binaries together. - -Upstream-Status: Backport [589236226856f591c9e8daf0cb7aa1aef8862388] -Signed-off-by: Ross Burton <ross.burton@arm.com> - -diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py -index f9660838e..2eefc3fc7 100644 ---- a/mesonbuild/modules/gnome.py -+++ b/mesonbuild/modules/gnome.py -@@ -84,8 +84,8 @@ class GnomeModule(ExtensionModule): - mlog.bold('https://github.com/mesonbuild/meson/issues/1387'), - once=True) - -- def _get_native_dep(self, state, depname, required=True): -- kwargs = {'native': True, 'required': required} -+ def _get_dep(self, state, depname, native=False, required=True): -+ kwargs = {'native': native, 'required': required} - holder = self.interpreter.func_dependency(state.current_node, [depname], kwargs) - return holder.held_object - -@@ -101,7 +101,7 @@ class GnomeModule(ExtensionModule): - return ExternalProgram.from_entry(name, prog) - - # Check if pkgconfig has a variable -- dep = self._get_native_dep(state, depname, required=False) -+ dep = self._get_dep(state, depname, native=True, required=False) - if dep.found() and dep.type_name == 'pkgconfig': - value = dep.get_pkgconfig_variable(varname, {}) - if value: -@@ -481,7 +481,7 @@ class GnomeModule(ExtensionModule): - - def _get_gir_dep(self, state): - if not self.gir_dep: -- self.gir_dep = self._get_native_dep(state, 'gobject-introspection-1.0') -+ self.gir_dep = self._get_dep(state, 'gobject-introspection-1.0') - self.giscanner = self._get_native_binary(state, 'g-ir-scanner', 'gobject-introspection-1.0', 'g_ir_scanner') - self.gicompiler = self._get_native_binary(state, 'g-ir-compiler', 'gobject-introspection-1.0', 'g_ir_compiler') - return self.gir_dep, self.giscanner, self.gicompiler diff --git a/meta/recipes-devtools/meson/meson/meson-setup.py b/meta/recipes-devtools/meson/meson/meson-setup.py index 7ac4e3ad47..daaa551de2 100755 --- a/meta/recipes-devtools/meson/meson/meson-setup.py +++ b/meta/recipes-devtools/meson/meson/meson-setup.py @@ -27,9 +27,17 @@ except KeyError: template_file = os.path.join(sysroot, 'usr/share/meson/meson.cross.template') cross_file = os.path.join(sysroot, 'usr/share/meson/%smeson.cross' % os.environ["TARGET_PREFIX"]) +native_template_file = os.path.join(sysroot, 'usr/share/meson/meson.native.template') +native_file = os.path.join(sysroot, 'usr/share/meson/meson.native') with open(template_file) as in_file: template = in_file.read() output = Template(template).substitute(Environ()) with open(cross_file, "w") as out_file: out_file.write(output) + +with open(native_template_file) as in_file: + template = in_file.read() + output = Template(template).substitute({'OECORE_NATIVE_SYSROOT': os.environ['OECORE_NATIVE_SYSROOT']}) + with open(native_file, "w") as out_file: + out_file.write(output) diff --git a/meta/recipes-devtools/meson/meson/meson-wrapper b/meta/recipes-devtools/meson/meson/meson-wrapper index d4ffe60f9a..7455985297 100755 --- a/meta/recipes-devtools/meson/meson/meson-wrapper +++ b/meta/recipes-devtools/meson/meson/meson-wrapper @@ -1,7 +1,11 @@ #!/bin/sh if [ -z "$OECORE_NATIVE_SYSROOT" ]; then - echo "OECORE_NATIVE_SYSROOT not set; are you in a Yocto SDK environment?" >&2 + exec "meson.real" "$@" +fi + +if [ -z "$SSL_CERT_DIR" ]; then + export SSL_CERT_DIR="$OECORE_NATIVE_SYSROOT/etc/ssl/certs/" fi # If these are set to a cross-compile path, meson will get confused and try to @@ -9,6 +13,19 @@ fi # config is already in meson.cross. unset CC CXX CPP LD AR NM STRIP +case "$1" in +setup|configure|dist|install|introspect|init|test|wrap|subprojects|rewrite|compile|devenv|env2mfile|help) MESON_CMD="$1" ;; +*) echo meson-wrapper: Implicit setup command assumed; MESON_CMD=setup ;; +esac + +if [ "$MESON_CMD" = "setup" ]; then + MESON_SETUP_OPTS=" \ + --cross-file="$OECORE_NATIVE_SYSROOT/usr/share/meson/${TARGET_PREFIX}meson.cross" \ + --native-file="$OECORE_NATIVE_SYSROOT/usr/share/meson/meson.native" \ + " + echo meson-wrapper: Running meson with setup options: \"$MESON_SETUP_OPTS\" +fi + exec "$OECORE_NATIVE_SYSROOT/usr/bin/meson.real" \ - --cross-file "${OECORE_NATIVE_SYSROOT}/usr/share/meson/${TARGET_PREFIX}meson.cross" \ - "$@" + "$@" \ + $MESON_SETUP_OPTS |