Files
meta-external-toolchain/classes/external-toolchain-cross.bbclass
Christopher Larson 2082315ed0 Drop the change of TARGET_PREFIX
Since the external-cross recipes link/wrap the binaries already, there's no
actual need to override TARGET_PREFIX anymore.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
2016-12-14 20:16:06 -07:00

40 lines
989 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/${EXTERNAL_TARGET_SYS}-%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/${EXTERNAL_TARGET_SYS}-$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
}