external-sourcery: ensure the sysroot is available as a variable again

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
This commit is contained in:
Christopher Larson
2012-07-18 17:19:13 -07:00
parent b711585ce2
commit 9913c95405
2 changed files with 8 additions and 1 deletions

View File

@@ -63,10 +63,17 @@ python toolchain_metadata_setup () {
if not isinstance(e, bb.event.ConfigParsed):
return
import subprocess
d = e.data
l = d.createCopy()
l.finalize()
sysroot_cmd = "${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} -print-sysroot"
toolchain_sysroot = bb.process.run(bb.data.expand(sysroot_cmd, l),
stderr=subprocess.PIPE)[0].rstrip()
d.setVar('EXTERNAL_TOOLCHAIN_SYSROOT', toolchain_sysroot)
if os.path.exists(bb.data.expand('${EXTERNAL_TOOLCHAIN}/bin/gcc', l)):
d.setVar('TOOLCHAIN_PATH_ADD', '')

View File

@@ -30,7 +30,7 @@ SRC_URI = "file://SUPPORTED"
do_install() {
# Use optimized files if available
sysroot="$(${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} -print-sysroot)"
sysroot="${EXTERNAL_TOOLCHAIN_SYSROOT}"
cp -a $sysroot${base_libdir}/. ${D}${base_libdir}
cp -a $sysroot/etc/. ${D}${sysconfdir}