include meson.inc inherit meson-routines inherit nativesdk SRC_URI += "file://meson-setup.py \ file://meson-wrapper" # The cross file logic is similar but not identical to that in meson.bbclass, # since it's generating for an SDK rather than a cross-compile. Important # differences are: # - We can't set vars like CC, CXX, etc. yet because they will be filled in with # real paths by meson-setup.sh when the SDK is extracted. # - Some overrides aren't needed, since the SDK injects paths that take care of # them. def var_list2str(var, d): items = d.getVar(var).split() return items[0] if len(items) == 1 else ', '.join(repr(s) for s in items) def generate_native_link_template(d): val = ['-L@{OECORE_NATIVE_SYSROOT}${libdir_native}', '-L@{OECORE_NATIVE_SYSROOT}${base_libdir_native}', '-Wl,-rpath-link,@{OECORE_NATIVE_SYSROOT}${libdir_native}', '-Wl,-rpath-link,@{OECORE_NATIVE_SYSROOT}${base_libdir_native}', '-Wl,--allow-shlib-undefined' ] build_arch = d.getVar('BUILD_ARCH') if 'x86_64' in build_arch: loader = 'ld-linux-x86-64.so.2' elif 'i686' in build_arch: loader = 'ld-linux.so.2' elif 'aarch64' in build_arch: loader = 'ld-linux-aarch64.so.1' elif 'ppc64le' in build_arch: loader = 'ld64.so.2' if loader: val += ['-Wl,--dynamic-linker=@{OECORE_NATIVE_SYSROOT}${base_libdir_native}/' + loader] return repr(val) do_install:append() { install -d ${D}${datadir}/meson cat >${D}${datadir}/meson/meson.native.template <${D}${datadir}/meson/meson.cross.template <