summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorHsia-Jun(Randy) Li <randy.li@synaptics.com>2021-10-25 11:37:44 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-10-27 09:46:41 +0100
commit4311fe03247c605bdb83706749203d553944a35e (patch)
tree7d8876f9a2ece04e946a1208d594274429688613 /meta
parent15487d272f4af9a62b81bc77e1195bd77ef7b7bb (diff)
downloadpoky-4311fe03247c605bdb83706749203d553944a35e.tar.gz
meson: install native file in sdk
Without a native environment file, find_program() can't locate the native program inside SDK. That stops wayland compositor using wayland scanner. (From OE-Core rev: c6aed1084006727e3baf70ab9d1f70d9d2d6c01f) Signed-off-by: Hsia-Jun(Randy) Li <randy.li@synaptics.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rwxr-xr-xmeta/recipes-devtools/meson/meson/meson-setup.py8
-rwxr-xr-xmeta/recipes-devtools/meson/meson/meson-wrapper1
-rw-r--r--meta/recipes-devtools/meson/nativesdk-meson_0.59.2.bb46
3 files changed, 55 insertions, 0 deletions
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:
27 27
28template_file = os.path.join(sysroot, 'usr/share/meson/meson.cross.template') 28template_file = os.path.join(sysroot, 'usr/share/meson/meson.cross.template')
29cross_file = os.path.join(sysroot, 'usr/share/meson/%smeson.cross' % os.environ["TARGET_PREFIX"]) 29cross_file = os.path.join(sysroot, 'usr/share/meson/%smeson.cross' % os.environ["TARGET_PREFIX"])
30native_template_file = os.path.join(sysroot, 'usr/share/meson/meson.native.template')
31native_file = os.path.join(sysroot, 'usr/share/meson/meson.native')
30 32
31with open(template_file) as in_file: 33with open(template_file) as in_file:
32 template = in_file.read() 34 template = in_file.read()
33 output = Template(template).substitute(Environ()) 35 output = Template(template).substitute(Environ())
34 with open(cross_file, "w") as out_file: 36 with open(cross_file, "w") as out_file:
35 out_file.write(output) 37 out_file.write(output)
38
39with open(native_template_file) as in_file:
40 template = in_file.read()
41 output = Template(template).substitute({'OECORE_NATIVE_SYSROOT': os.environ['OECORE_NATIVE_SYSROOT']})
42 with open(native_file, "w") as out_file:
43 out_file.write(output)
diff --git a/meta/recipes-devtools/meson/meson/meson-wrapper b/meta/recipes-devtools/meson/meson/meson-wrapper
index d4ffe60f9a..d4b5187f8d 100755
--- a/meta/recipes-devtools/meson/meson/meson-wrapper
+++ b/meta/recipes-devtools/meson/meson/meson-wrapper
@@ -11,4 +11,5 @@ unset CC CXX CPP LD AR NM STRIP
11 11
12exec "$OECORE_NATIVE_SYSROOT/usr/bin/meson.real" \ 12exec "$OECORE_NATIVE_SYSROOT/usr/bin/meson.real" \
13 --cross-file "${OECORE_NATIVE_SYSROOT}/usr/share/meson/${TARGET_PREFIX}meson.cross" \ 13 --cross-file "${OECORE_NATIVE_SYSROOT}/usr/share/meson/${TARGET_PREFIX}meson.cross" \
14 --native-file "${OECORE_NATIVE_SYSROOT}/usr/share/meson/meson.native" \
14 "$@" 15 "$@"
diff --git a/meta/recipes-devtools/meson/nativesdk-meson_0.59.2.bb b/meta/recipes-devtools/meson/nativesdk-meson_0.59.2.bb
index 5657397ddc..7b77041c7e 100644
--- a/meta/recipes-devtools/meson/nativesdk-meson_0.59.2.bb
+++ b/meta/recipes-devtools/meson/nativesdk-meson_0.59.2.bb
@@ -13,8 +13,54 @@ SRC_URI += "file://meson-setup.py \
13# real paths by meson-setup.sh when the SDK is extracted. 13# real paths by meson-setup.sh when the SDK is extracted.
14# - Some overrides aren't needed, since the SDK injects paths that take care of 14# - Some overrides aren't needed, since the SDK injects paths that take care of
15# them. 15# them.
16def var_list2str(var, d):
17 items = d.getVar(var).split()
18 return items[0] if len(items) == 1 else ', '.join(repr(s) for s in items)
19
20def generate_native_link_template(d):
21 val = ['-L@{OECORE_NATIVE_SYSROOT}${libdir_native}',
22 '-L@{OECORE_NATIVE_SYSROOT}${base_libdir_native}',
23 '-Wl,-rpath-link,@{OECORE_NATIVE_SYSROOT}${libdir_native}',
24 '-Wl,-rpath-link,@{OECORE_NATIVE_SYSROOT}${base_libdir_native}',
25 '-Wl,--allow-shlib-undefined'
26 ]
27 build_arch = d.getVar('BUILD_ARCH')
28 if 'x86_64' in build_arch:
29 loader = 'ld-linux-x86-64.so.2'
30 elif 'i686' in build_arch:
31 loader = 'ld-linux.so.2'
32 elif 'aarch64' in build_arch:
33 loader = 'ld-linux-aarch64.so.1'
34 elif 'ppc64le' in build_arch:
35 loader = 'ld64.so.2'
36
37 if loader:
38 val += ['-Wl,--dynamic-linker=@{OECORE_NATIVE_SYSROOT}${base_libdir_native}/' + loader]
39
40 return repr(val)
41
16do_install:append() { 42do_install:append() {
17 install -d ${D}${datadir}/meson 43 install -d ${D}${datadir}/meson
44
45 cat >${D}${datadir}/meson/meson.native.template <<EOF
46[binaries]
47c = ${@meson_array('BUILD_CC', d)}
48cpp = ${@meson_array('BUILD_CXX', d)}
49ar = ${@meson_array('BUILD_AR', d)}
50nm = ${@meson_array('BUILD_NM', d)}
51strip = ${@meson_array('BUILD_STRIP', d)}
52readelf = ${@meson_array('BUILD_READELF', d)}
53pkgconfig = 'pkg-config-native'
54
55[built-in options]
56c_args = ['-isystem@{OECORE_NATIVE_SYSROOT}${includedir_native}' , ${@var_list2str('BUILD_OPTIMIZATION', d)}]
57c_link_args = ${@generate_native_link_template(d)}
58cpp_args = ['-isystem@{OECORE_NATIVE_SYSROOT}${includedir_native}' , ${@var_list2str('BUILD_OPTIMIZATION', d)}]
59cpp_link_args = ${@generate_native_link_template(d)}
60[properties]
61sys_root = '@OECORE_NATIVE_SYSROOT'
62EOF
63
18 cat >${D}${datadir}/meson/meson.cross.template <<EOF 64 cat >${D}${datadir}/meson/meson.cross.template <<EOF
19[binaries] 65[binaries]
20c = @CC 66c = @CC