diff options
| author | Ross Burton <ross.burton@arm.com> | 2024-05-20 10:18:31 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-05-22 10:21:26 +0100 |
| commit | e1fa32477dcbdb317f858de2265be10c42ba91a4 (patch) | |
| tree | ad3dfbf376552778ab2fbedc05d5664e5d281a3f | |
| parent | b53b198840ed80b7fd1a19e5e6d348a653cebe04 (diff) | |
| download | poky-e1fa32477dcbdb317f858de2265be10c42ba91a4.tar.gz | |
toolchain-scripts: export the target endianism and word size
Some build systems (notably, Meson) like to be told when cross-compiling
what the target endian and word size is. We don't have these exported
via the variables, so add them using siteinfo as a source of data.
(From OE-Core rev: c2fee816cae6dbedcb40f15be4a1b9ee91757a64)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/classes-recipe/toolchain-scripts.bbclass | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/meta/classes-recipe/toolchain-scripts.bbclass b/meta/classes-recipe/toolchain-scripts.bbclass index 6bfe0b6de0..cbef412e79 100644 --- a/meta/classes-recipe/toolchain-scripts.bbclass +++ b/meta/classes-recipe/toolchain-scripts.bbclass | |||
| @@ -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,8 @@ 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 | ||
| 66 | 75 | ||
| 67 | echo 'unset command_not_found_handle' >> $script | 76 | echo 'unset command_not_found_handle' >> $script |
| 68 | 77 | ||
