diff options
author | Douglas Royds via Openembedded-core <openembedded-core@lists.openembedded.org> | 2019-10-01 17:20:18 +1300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-10-23 16:30:36 +0100 |
commit | 0130498a8ff950b5b22d8da23e020b367801e959 (patch) | |
tree | 0dbf9d0f56a244f682af27512d338eaa66cd291f /meta/classes/icecc.bbclass | |
parent | 7fef74ae95bc8d4342b06974f6a651b5ded81054 (diff) | |
download | poky-0130498a8ff950b5b22d8da23e020b367801e959.tar.gz |
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).
(From OE-Core rev: 40d74cb1d0ddce930267e49764cacb263b244091)
Signed-off-by: Douglas Royds <douglas.royds@taitradio.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/icecc.bbclass')
-rw-r--r-- | meta/classes/icecc.bbclass | 32 |
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() { | |||
356 | return | 356 | return |
357 | fi | 357 | fi |
358 | 358 | ||
359 | # Create symlinks to icecc in the recipe-sysroot directory | ||
360 | mkdir -p ${ICE_PATH} | ||
361 | if [ -n "${KERNEL_CC}" ]; then | ||
362 | compilers="${@get_cross_kernel_cc(bb,d)}" | ||
363 | else | ||
364 | compilers="${HOST_PREFIX}gcc ${HOST_PREFIX}g++" | ||
365 | fi | ||
366 | for compiler in $compilers; do | ||
367 | ln -sf ${ICECC_BIN} ${ICE_PATH}/$compiler | ||
368 | done | ||
369 | |||
370 | ICECC_CC="${@icecc_get_and_check_tool(bb, d, "gcc")}" | 359 | ICECC_CC="${@icecc_get_and_check_tool(bb, d, "gcc")}" |
371 | ICECC_CXX="${@icecc_get_and_check_tool(bb, d, "g++")}" | 360 | ICECC_CXX="${@icecc_get_and_check_tool(bb, d, "g++")}" |
372 | # cannot use icecc_get_and_check_tool here because it assumes as without target_sys prefix | 361 | # cannot use icecc_get_and_check_tool here because it assumes as without target_sys prefix |
@@ -385,6 +374,26 @@ set_icecc_env() { | |||
385 | return | 374 | return |
386 | fi | 375 | fi |
387 | 376 | ||
377 | # Create symlinks to icecc and wrapper-scripts in the recipe-sysroot directory | ||
378 | mkdir -p $ICE_PATH/symlinks | ||
379 | if [ -n "${KERNEL_CC}" ]; then | ||
380 | compilers="${@get_cross_kernel_cc(bb,d)}" | ||
381 | else | ||
382 | compilers="${HOST_PREFIX}gcc ${HOST_PREFIX}g++" | ||
383 | fi | ||
384 | for compiler in $compilers; do | ||
385 | ln -sf $ICECC_BIN $ICE_PATH/symlinks/$compiler | ||
386 | rm -f $ICE_PATH/$compiler | ||
387 | cat <<-__EOF__ > $ICE_PATH/$compiler | ||
388 | #!/bin/sh -e | ||
389 | export ICECC_VERSION=$ICECC_VERSION | ||
390 | export ICECC_CC=$ICECC_CC | ||
391 | export ICECC_CXX=$ICECC_CXX | ||
392 | $ICE_PATH/symlinks/$compiler "\$@" | ||
393 | __EOF__ | ||
394 | chmod 775 $ICE_PATH/$compiler | ||
395 | done | ||
396 | |||
388 | ICECC_AS="`${ICECC_CC} -print-prog-name=as`" | 397 | ICECC_AS="`${ICECC_CC} -print-prog-name=as`" |
389 | # for target recipes should return something like: | 398 | # for target recipes should return something like: |
390 | # /OE/tmp-eglibc/sysroots/x86_64-linux/usr/libexec/arm920tt-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.8.2/as | 399 | # /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() { | |||
417 | export CCACHE_PATH="$PATH" | 426 | export CCACHE_PATH="$PATH" |
418 | export CCACHE_DISABLE="1" | 427 | export CCACHE_DISABLE="1" |
419 | 428 | ||
420 | export ICECC_VERSION ICECC_CC ICECC_CXX | ||
421 | export PATH="$ICE_PATH:$PATH" | 429 | export PATH="$ICE_PATH:$PATH" |
422 | 430 | ||
423 | bbnote "Using icecc path: $ICE_PATH" | 431 | bbnote "Using icecc path: $ICE_PATH" |