Files
meta-external-toolchain/classes/external-toolchain-cross.bbclass
Christopher Larson 0beb66b376 Split up external-sourcery-toolchain into separate recipes
common-license.bbclass will set LIC_FILES_CHKSUM to a common license file
based on LICENSE, which is appropriate for a case where we have no sources to
refer to.
external-toolchain.bbclass, among other things, handles extraction of files in
the external toolchain sysroot, based on patterns in the FILES variables,
checking alternate locations to better support any arbitrary toolchain, and
has basic mirror handling for checking multiple paths within the sysroots.

Under normal circumstances, I'd want this to use highly granular commits, but
this branch has been extremely long lived (>1yr) and is such an invasive
refactoring that attempting to break it down now would be of limited
usefulness.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
2014-12-19 10:35:25 -07:00

40 lines
975 B
Plaintext

inherit external-toolchain cross
EXTERNAL_CROSS_BINARIES ?= ""
EXTERNAL_CROSS_NOPSEUDO = "gcc g++ cpp"
wrap_bin () {
bin="$1"
shift
script="${D}${bindir}/${TARGET_PREFIX}$bin"
printf '#!/bin/sh\n' >$script
for arg in "$@"; do
printf '%s\n' "$arg"
done >>"$script"
printf 'exec ${EXTERNAL_TOOLCHAIN}/bin/${TARGET_PREFIX}%s "$@"\n' "$bin" >>"$script"
chmod +x "$script"
}
do_install () {
install -d ${D}${bindir}
for bin in ${EXTERNAL_CROSS_BINARIES}; do
if [ ! -e "${EXTERNAL_TOOLCHAIN}/bin/${TARGET_PREFIX}$bin" ]; then
continue
fi
disable=0
for nopseudo in ${EXTERNAL_CROSS_NOPSEUDO}; do
case "$bin" in
*$nopseudo)
disable=1
;;
esac
done
if [ $disable -eq 1 ]; then
wrap_bin "$bin" "export PSEUDO_UNLOAD=1"
else
wrap_bin "$bin"
fi
done
}