diff options
Diffstat (limited to 'meta/classes-recipe/toolchain-scripts.bbclass')
-rw-r--r-- | meta/classes-recipe/toolchain-scripts.bbclass | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/meta/classes-recipe/toolchain-scripts.bbclass b/meta/classes-recipe/toolchain-scripts.bbclass index 6bfe0b6de0..3053cd0f1f 100644 --- a/meta/classes-recipe/toolchain-scripts.bbclass +++ b/meta/classes-recipe/toolchain-scripts.bbclass | |||
@@ -4,7 +4,7 @@ | |||
4 | # SPDX-License-Identifier: MIT | 4 | # SPDX-License-Identifier: MIT |
5 | # | 5 | # |
6 | 6 | ||
7 | inherit toolchain-scripts-base siteinfo kernel-arch | 7 | inherit toolchain-scripts-base siteinfo kernel-arch meson-routines |
8 | 8 | ||
9 | # We want to be able to change the value of MULTIMACH_TARGET_SYS, because it | 9 | # We want to be able to change the value of MULTIMACH_TARGET_SYS, because it |
10 | # doesn't always match our expectations... but we default to the stock value | 10 | # doesn't always match our expectations... but we default to the stock value |
@@ -16,6 +16,13 @@ DEBUG_PREFIX_MAP = "" | |||
16 | 16 | ||
17 | EXPORT_SDK_PS1 = "${@ 'export PS1=\\"%s\\"' % d.getVar('SDK_PS1') if d.getVar('SDK_PS1') else ''}" | 17 | EXPORT_SDK_PS1 = "${@ 'export PS1=\\"%s\\"' % d.getVar('SDK_PS1') if d.getVar('SDK_PS1') else ''}" |
18 | 18 | ||
19 | def siteinfo_with_prefix(d, prefix): | ||
20 | # Return a prefixed value from siteinfo | ||
21 | for item in siteinfo_data_for_machine(d.getVar("TARGET_ARCH"), d.getVar("TARGET_OS"), d): | ||
22 | if item.startswith(prefix): | ||
23 | return item.replace(prefix, "") | ||
24 | raise KeyError | ||
25 | |||
19 | # This function creates an environment-setup-script for use in a deployable SDK | 26 | # This function creates an environment-setup-script for use in a deployable SDK |
20 | toolchain_create_sdk_env_script () { | 27 | toolchain_create_sdk_env_script () { |
21 | # Create environment setup script. Remember that $SDKTARGETSYSROOT should | 28 | # Create environment setup script. Remember that $SDKTARGETSYSROOT should |
@@ -63,6 +70,12 @@ toolchain_create_sdk_env_script () { | |||
63 | echo 'export OECORE_BASELIB="${baselib}"' >> $script | 70 | echo 'export OECORE_BASELIB="${baselib}"' >> $script |
64 | echo 'export OECORE_TARGET_ARCH="${TARGET_ARCH}"' >>$script | 71 | echo 'export OECORE_TARGET_ARCH="${TARGET_ARCH}"' >>$script |
65 | echo 'export OECORE_TARGET_OS="${TARGET_OS}"' >>$script | 72 | echo 'export OECORE_TARGET_OS="${TARGET_OS}"' >>$script |
73 | echo 'export OECORE_TARGET_BITS="${@siteinfo_with_prefix(d, 'bit-')}"' >>$script | ||
74 | echo 'export OECORE_TARGET_ENDIAN="${@siteinfo_with_prefix(d, 'endian-')}"' >>$script | ||
75 | echo 'export OECORE_MESON_HOST_SYSTEM="${@meson_operating_system('TARGET_OS', d)}"' >>$script | ||
76 | echo 'export OECORE_MESON_HOST_CPU_FAMILY="${@meson_cpu_family('TARGET_ARCH', d)}"' >>$script | ||
77 | echo 'export OECORE_MESON_HOST_CPU="${TARGET_ARCH}"' >>$script | ||
78 | echo 'export OECORE_MESON_HOST_ENDIAN="${@meson_endian('TARGET', d)}"' >>$script | ||
66 | 79 | ||
67 | echo 'unset command_not_found_handle' >> $script | 80 | echo 'unset command_not_found_handle' >> $script |
68 | 81 | ||
@@ -90,6 +103,12 @@ toolchain_create_tree_env_script () { | |||
90 | echo 'export OECORE_BASELIB="${baselib}"' >> $script | 103 | echo 'export OECORE_BASELIB="${baselib}"' >> $script |
91 | echo 'export OECORE_TARGET_ARCH="${TARGET_ARCH}"' >>$script | 104 | echo 'export OECORE_TARGET_ARCH="${TARGET_ARCH}"' >>$script |
92 | echo 'export OECORE_TARGET_OS="${TARGET_OS}"' >>$script | 105 | echo 'export OECORE_TARGET_OS="${TARGET_OS}"' >>$script |
106 | echo 'export OECORE_TARGET_BITS="${@siteinfo_with_prefix(d, 'bit-')}"' >>$script | ||
107 | echo 'export OECORE_TARGET_ENDIAN="${@siteinfo_with_prefix(d, 'endian-')}"' >>$script | ||
108 | echo 'export OECORE_MESON_HOST_SYSTEM="${@meson_operating_system('TARGET_OS', d)}"' >>$script | ||
109 | echo 'export OECORE_MESON_HOST_CPU_FAMILY="${@meson_cpu_family('TARGET_ARCH', d)}"' >>$script | ||
110 | echo 'export OECORE_MESON_HOST_CPU="${TARGET_ARCH}"' >>$script | ||
111 | echo 'export OECORE_MESON_HOST_ENDIAN="${@meson_endian('TARGET', d)}"' >>$script | ||
93 | 112 | ||
94 | toolchain_shared_env_script | 113 | toolchain_shared_env_script |
95 | 114 | ||
@@ -192,7 +211,6 @@ EOF | |||
192 | 211 | ||
193 | #we get the cached site config in the runtime | 212 | #we get the cached site config in the runtime |
194 | TOOLCHAIN_CONFIGSITE_NOCACHE = "${@' '.join(siteinfo_get_files(d)[0])}" | 213 | TOOLCHAIN_CONFIGSITE_NOCACHE = "${@' '.join(siteinfo_get_files(d)[0])}" |
195 | TOOLCHAIN_CONFIGSITE_SYSROOTCACHE = "${STAGING_DIR}/${MLPREFIX}${MACHINE}/${target_datadir}/${TARGET_SYS}_config_site.d" | ||
196 | TOOLCHAIN_NEED_CONFIGSITE_CACHE ??= "virtual/${MLPREFIX}libc ncurses" | 214 | TOOLCHAIN_NEED_CONFIGSITE_CACHE ??= "virtual/${MLPREFIX}libc ncurses" |
197 | DEPENDS += "${TOOLCHAIN_NEED_CONFIGSITE_CACHE}" | 215 | DEPENDS += "${TOOLCHAIN_NEED_CONFIGSITE_CACHE}" |
198 | 216 | ||
@@ -214,14 +232,8 @@ toolchain_create_sdk_siteconfig () { | |||
214 | sitefile=`echo $sitefile | tr / _` | 232 | sitefile=`echo $sitefile | tr / _` |
215 | sitefile=`cat ${STAGING_DIR_TARGET}/sysroot-providers/$sitefile` | 233 | sitefile=`cat ${STAGING_DIR_TARGET}/sysroot-providers/$sitefile` |
216 | esac | 234 | esac |
217 | |||
218 | if [ -r ${TOOLCHAIN_CONFIGSITE_SYSROOTCACHE}/${sitefile}_config ]; then | ||
219 | cat ${TOOLCHAIN_CONFIGSITE_SYSROOTCACHE}/${sitefile}_config >> $siteconfig | ||
220 | fi | ||
221 | done | 235 | done |
222 | } | 236 | } |
223 | # The immediate expansion above can result in unwanted path dependencies here | ||
224 | toolchain_create_sdk_siteconfig[vardepsexclude] = "TOOLCHAIN_CONFIGSITE_SYSROOTCACHE" | ||
225 | 237 | ||
226 | python __anonymous () { | 238 | python __anonymous () { |
227 | import oe.classextend | 239 | import oe.classextend |