mirror of
https://github.com/thead-yocto-mirror/meta-external-toolchain
synced 2026-06-21 08:52:27 +02:00
Don't hardcode ${EXTERNAL_TOOLCHAIN}/bin as bindir
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
This commit is contained in:
@@ -10,14 +10,14 @@ wrap_bin () {
|
||||
for arg in "$@"; do
|
||||
printf '%s\n' "$arg"
|
||||
done >>"$script"
|
||||
printf 'exec ${EXTERNAL_TOOLCHAIN}/bin/${EXTERNAL_TARGET_SYS}-%s "$@"\n' "$bin" >>"$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
|
||||
if [ ! -e "${EXTERNAL_TOOLCHAIN_BIN}/${EXTERNAL_TARGET_SYS}-$bin" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
|
||||
@@ -23,15 +23,15 @@ def check_toolchain_sanity(d, generate_events=False):
|
||||
|
||||
# Test 2: EXTERNAL_TARGET_SYS is set correctly
|
||||
if d.getVar('EXTERNAL_TARGET_SYS', True) == 'UNKNOWN':
|
||||
raise_exttc_sanity_error('Unable to locate prefixed gcc binary for %s in EXTERNAL_TOOLCHAIN/bin (%s/bin)' % (d.getVar('TARGET_SYS', True), d.getVar('EXTERNAL_TOOLCHAIN', True)), d, generate_events)
|
||||
raise_exttc_sanity_error('Unable to locate prefixed gcc binary for %s in EXTERNAL_TOOLCHAIN_BIN (%s)' % (d.getVar('TARGET_SYS', True), d.getVar('EXTERNAL_TOOLCHAIN_BIN', True)), d, generate_events)
|
||||
|
||||
# Test 3: gcc binary exists
|
||||
gcc = d.expand('${EXTERNAL_TOOLCHAIN}/bin/${EXTERNAL_TARGET_SYS}-gcc')
|
||||
gcc = d.expand('${EXTERNAL_TOOLCHAIN_BIN}/${EXTERNAL_TARGET_SYS}-gcc')
|
||||
if not os.path.exists(gcc):
|
||||
raise_exttc_sanity_error('Compiler path `%s` does not exist' % gcc, d, generate_events)
|
||||
|
||||
# Test 4: we can run it to get the version
|
||||
cmd = d.expand('${EXTERNAL_TOOLCHAIN}/bin/${EXTERNAL_TARGET_SYS}-gcc -dumpversion')
|
||||
cmd = d.expand('${EXTERNAL_TOOLCHAIN_BIN}/${EXTERNAL_TARGET_SYS}-gcc -dumpversion')
|
||||
sourcery_version = exttc_sanity_run(shlex.split(cmd), d, generate_events)
|
||||
if cfgdata.get('sourcery_version') == sourcery_version:
|
||||
return
|
||||
@@ -48,7 +48,7 @@ def check_toolchain_sanity(d, generate_events=False):
|
||||
l.setVar('TOOLCHAIN_OPTIONS', '')
|
||||
l.setVar('TARGET_PREFIX', '${EXTERNAL_TARGET_SYS}-')
|
||||
l.setVar('HOST_CC_ARCH_remove', '--no-sysroot-suffix')
|
||||
cmd = l.expand('${EXTERNAL_TOOLCHAIN}/bin/${CC} ${CFLAGS} ${LDFLAGS} test.c -o test')
|
||||
cmd = l.expand('${EXTERNAL_TOOLCHAIN_BIN}/${CC} ${CFLAGS} ${LDFLAGS} test.c -o test')
|
||||
exttc_sanity_run(shlex.split(cmd), d, generate_events, tmpdir)
|
||||
|
||||
with open(sanity_file, 'w') as f:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# Configuration to use external Sourcery G++ toolchain
|
||||
EXTERNAL_TOOLCHAIN ?= "UNDEFINED"
|
||||
EXTERNAL_TARGET_SYS ??= "${TARGET_ARCH}-${TARGET_OS}"
|
||||
EXTERNAL_TOOLCHAIN_BIN ??= "${EXTERNAL_TOOLCHAIN}/bin"
|
||||
|
||||
# Prefer our recipes which extract files from the external toolchain
|
||||
PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc ?= "gcc-external-cross-${TARGET_ARCH}"
|
||||
|
||||
Reference in New Issue
Block a user