diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2022-07-22 20:39:11 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-07-28 11:50:17 +0100 |
commit | 29c52d7b268e254faa8ed8ca2d1d45275dc484b1 (patch) | |
tree | 2c0815f0a1f58e4732c129dba2dacf509b5e2c43 | |
parent | 9c45fd0b89db9ae7f4078ba8f7f097bdbaf37f75 (diff) | |
download | poky-29c52d7b268e254faa8ed8ca2d1d45275dc484b1.tar.gz |
toolchain-scripts.bbclass: adjust toolchain_create_tree_env_script to better replicate (e)SDK
Specifically:
1. Place the environment setup file into $B and not into $TMPDIR,
so that the recipe using the class can itself better decide what to do with the file.
2. Use global, unified sysroots (provided through build-sysroots recipe)
and not recipe-specific ones, as this allows flexible on-the-fly management of what
libraries are available to build applications, without having to modify any
recipes, similar to eSDK 'extensible' part.
This also requires adjustment of the sstate sametune_samegsigs test, as meta-ide-support
becomes dependent on $MACHINE (unified sysroots have it in their paths)
and needs to be excluded from the test.
3. Add a few missing settings that have been added to SDK environment files.
4. Add a snippet to the environment setup file that also runs the relocation scripts.
In regular SDKs this is executed by the SDK installer, in direct SDK we can do it when
setting up the environment.
(From OE-Core rev: db5dfd78ae441201778b1175f4fb9a3eba994899)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/toolchain-scripts.bbclass | 40 | ||||
-rw-r--r-- | meta/lib/oeqa/selftest/cases/sstatetests.py | 2 |
2 files changed, 32 insertions, 10 deletions
diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass index 1d7c703748..16f1e17607 100644 --- a/meta/classes/toolchain-scripts.bbclass +++ b/meta/classes/toolchain-scripts.bbclass | |||
@@ -63,24 +63,46 @@ toolchain_create_sdk_env_script () { | |||
63 | toolchain_shared_env_script | 63 | toolchain_shared_env_script |
64 | } | 64 | } |
65 | 65 | ||
66 | # This function creates an environment-setup-script in the TMPDIR which enables | 66 | # This function creates an environment-setup-script in B which enables |
67 | # a OE-core IDE to integrate with the build tree | 67 | # a OE-core IDE to integrate with the build tree |
68 | # Caller must ensure CONFIG_SITE is setup | 68 | # Caller must ensure CONFIG_SITE is setup |
69 | toolchain_create_tree_env_script () { | 69 | toolchain_create_tree_env_script () { |
70 | script=${TMPDIR}/environment-setup-${REAL_MULTIMACH_TARGET_SYS} | 70 | script=${B}/environment-setup-${REAL_MULTIMACH_TARGET_SYS} |
71 | rm -f $script | 71 | rm -f $script |
72 | touch $script | 72 | touch $script |
73 | echo 'standalone_sysroot_target="${STAGING_DIR}/${MACHINE}"' >> $script | ||
74 | echo 'standalone_sysroot_native="${STAGING_DIR}/${BUILD_ARCH}"' >> $script | ||
73 | echo 'orig=`pwd`; cd ${COREBASE}; . ./oe-init-build-env ${TOPDIR}; cd $orig' >> $script | 75 | echo 'orig=`pwd`; cd ${COREBASE}; . ./oe-init-build-env ${TOPDIR}; cd $orig' >> $script |
74 | echo 'export PATH=${STAGING_DIR_NATIVE}/usr/bin:${STAGING_BINDIR_TOOLCHAIN}:$PATH' >> $script | 76 | echo 'export PATH=$standalone_sysroot_native/${bindir_native}:$standalone_sysroot_native/${bindir_native}/${TARGET_SYS}:$PATH' >> $script |
75 | echo 'export PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR}' >> $script | 77 | echo 'export PKG_CONFIG_SYSROOT_DIR=$standalone_sysroot_target' >> $script |
76 | echo 'export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}' >> $script | 78 | echo 'export PKG_CONFIG_PATH=$standalone_sysroot_target'"$libdir"'/pkgconfig:$standalone_sysroot_target'"$prefix"'/share/pkgconfig' >> $script |
77 | echo 'export CONFIG_SITE="${CONFIG_SITE}"' >> $script | 79 | echo 'export CONFIG_SITE="${CONFIG_SITE}"' >> $script |
78 | echo 'export SDKTARGETSYSROOT=${STAGING_DIR_TARGET}' >> $script | 80 | echo 'export SDKTARGETSYSROOT=$standalone_sysroot_target' >> $script |
79 | echo 'export OECORE_NATIVE_SYSROOT="${STAGING_DIR_NATIVE}"' >> $script | 81 | echo 'export OECORE_NATIVE_SYSROOT=$standalone_sysroot_native' >> $script |
80 | echo 'export OECORE_TARGET_SYSROOT="${STAGING_DIR_TARGET}"' >> $script | 82 | echo 'export OECORE_TARGET_SYSROOT=$standalone_sysroot_target' >> $script |
81 | echo 'export OECORE_ACLOCAL_OPTS="-I ${STAGING_DIR_NATIVE}/usr/share/aclocal"' >> $script | 83 | echo 'export OECORE_ACLOCAL_OPTS="-I $standalone_sysroot_native/usr/share/aclocal"' >> $script |
84 | echo 'export OECORE_BASELIB="${baselib}"' >> $script | ||
85 | echo 'export OECORE_TARGET_ARCH="${TARGET_ARCH}"' >>$script | ||
86 | echo 'export OECORE_TARGET_OS="${TARGET_OS}"' >>$script | ||
82 | 87 | ||
83 | toolchain_shared_env_script | 88 | toolchain_shared_env_script |
89 | |||
90 | cat >> $script <<EOF | ||
91 | |||
92 | if [ -d "\$OECORE_NATIVE_SYSROOT/${datadir}/post-relocate-setup.d/" ]; then | ||
93 | for s in \$OECORE_NATIVE_SYSROOT/${datadir}/post-relocate-setup.d/*; do | ||
94 | if [ ! -x \$s ]; then | ||
95 | continue | ||
96 | fi | ||
97 | \$s "\$1" | ||
98 | status=\$? | ||
99 | if [ \$status != 0 ]; then | ||
100 | echo "post-relocate command \"\$s \$1\" failed with status \$status" >&2 | ||
101 | exit \$status | ||
102 | fi | ||
103 | done | ||
104 | fi | ||
105 | EOF | ||
84 | } | 106 | } |
85 | 107 | ||
86 | toolchain_shared_env_script () { | 108 | toolchain_shared_env_script () { |
diff --git a/meta/lib/oeqa/selftest/cases/sstatetests.py b/meta/lib/oeqa/selftest/cases/sstatetests.py index 4749f28ab8..63827f3068 100644 --- a/meta/lib/oeqa/selftest/cases/sstatetests.py +++ b/meta/lib/oeqa/selftest/cases/sstatetests.py | |||
@@ -444,7 +444,7 @@ BB_SIGNATURE_HANDLER = "OEBasicHash" | |||
444 | f = [] | 444 | f = [] |
445 | for root, dirs, files in os.walk(d): | 445 | for root, dirs, files in os.walk(d): |
446 | for name in files: | 446 | for name in files: |
447 | if "meta-environment" in root or "cross-canadian" in root: | 447 | if "meta-environment" in root or "cross-canadian" in root or 'meta-ide-support' in root: |
448 | continue | 448 | continue |
449 | if "qemux86copy-" in root or "qemux86-" in root: | 449 | if "qemux86copy-" in root or "qemux86-" in root: |
450 | continue | 450 | continue |