summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDouglas Royds via Openembedded-core <openembedded-core@lists.openembedded.org>2019-10-01 17:20:18 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-10-29 08:20:37 +0000
commit0f47d4ef50d6b0732ac40f7ede31f554a757864c (patch)
tree21ad4998426596e9d5a3729daff6356aa6dcfac5
parent4aa5d551af3d0eb800c1640c98cbd591224726f8 (diff)
downloadopenembedded-core-0f47d4ef50d6b0732ac40f7ede31f554a757864c.tar.gz
openembedded-core-0f47d4ef50d6b0732ac40f7ede31f554a757864c.tar.bz2
openembedded-core-0f47d4ef50d6b0732ac40f7ede31f554a757864c.zip
icecc: Export ICECC_CC and friends via wrapper-script
By exporting ICECC_CC, ICECC_CXX, and ICECC_VERSION in a wrapper-script, and putting this wrapper-script in the PATH, the Makefiles generated by CMake or the autotools are able to function correctly outside of bitbake. This provides a convenient developer workflow in which the modify-compile-unittest cycle can happen directly in the ${B} directory. The `rm -f $ICE_PATH/$compiler` line is transitional, and can go at some later date (October 2020 or later, perhaps). Signed-off-by: Douglas Royds <douglas.royds@taitradio.com> Signed-off-by: Ross Burton <ross.burton@intel.com> (cherry picked from commit 40d74cb1d0ddce930267e49764cacb263b244091) Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta/classes/icecc.bbclass32
1 files changed, 20 insertions, 12 deletions
diff --git a/meta/classes/icecc.bbclass b/meta/classes/icecc.bbclass
index 4376aa37dc..bc3d6f4cc8 100644
--- a/meta/classes/icecc.bbclass
+++ b/meta/classes/icecc.bbclass
@@ -356,17 +356,6 @@ set_icecc_env() {
return
fi
- # Create symlinks to icecc in the recipe-sysroot directory
- mkdir -p ${ICE_PATH}
- if [ -n "${KERNEL_CC}" ]; then
- compilers="${@get_cross_kernel_cc(bb,d)}"
- else
- compilers="${HOST_PREFIX}gcc ${HOST_PREFIX}g++"
- fi
- for compiler in $compilers; do
- ln -sf ${ICECC_BIN} ${ICE_PATH}/$compiler
- done
-
ICECC_CC="${@icecc_get_and_check_tool(bb, d, "gcc")}"
ICECC_CXX="${@icecc_get_and_check_tool(bb, d, "g++")}"
# cannot use icecc_get_and_check_tool here because it assumes as without target_sys prefix
@@ -385,6 +374,26 @@ set_icecc_env() {
return
fi
+ # Create symlinks to icecc and wrapper-scripts in the recipe-sysroot directory
+ mkdir -p $ICE_PATH/symlinks
+ if [ -n "${KERNEL_CC}" ]; then
+ compilers="${@get_cross_kernel_cc(bb,d)}"
+ else
+ compilers="${HOST_PREFIX}gcc ${HOST_PREFIX}g++"
+ fi
+ for compiler in $compilers; do
+ ln -sf $ICECC_BIN $ICE_PATH/symlinks/$compiler
+ rm -f $ICE_PATH/$compiler
+ cat <<-__EOF__ > $ICE_PATH/$compiler
+ #!/bin/sh -e
+ export ICECC_VERSION=$ICECC_VERSION
+ export ICECC_CC=$ICECC_CC
+ export ICECC_CXX=$ICECC_CXX
+ $ICE_PATH/symlinks/$compiler "\$@"
+ __EOF__
+ chmod 775 $ICE_PATH/$compiler
+ done
+
ICECC_AS="`${ICECC_CC} -print-prog-name=as`"
# for target recipes should return something like:
# /OE/tmp-eglibc/sysroots/x86_64-linux/usr/libexec/arm920tt-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.8.2/as
@@ -417,7 +426,6 @@ set_icecc_env() {
export CCACHE_PATH="$PATH"
export CCACHE_DISABLE="1"
- export ICECC_VERSION ICECC_CC ICECC_CXX
export PATH="$ICE_PATH:$PATH"
bbnote "Using icecc path: $ICE_PATH"