Files
meta-external-toolchain/classes/external-toolchain-cross.bbclass
Christopher Larson 6d927006cd Don't hardcode ${EXTERNAL_TOOLCHAIN}/bin as bindir
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
2019-10-24 22:17:12 +05:00

27 lines
621 B
Plaintext

inherit external-toolchain cross
EXTERNAL_CROSS_BINARIES ?= ""
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
wrap_bin "$bin"
done
}