external-toolchain-cross-canadian.bbclass 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. inherit external-toolchain cross-canadian
  2. # Toolchain binaries are expected to run on both this host and SDKMACHINE, so
  3. # we should be able to use host tools.
  4. STRIP:task-package = "strip"
  5. STRIP:task-populate-sysroot = "strip"
  6. OBJCOPY:task-package = "objcopy"
  7. PACKAGE_DEPENDS:remove = "virtual/${TARGET_PREFIX}binutils"
  8. # Scan just toolchains root directory, but include some additional mirrors
  9. EXTERNAL_INSTALL_SOURCE_PATHS = "${EXTERNAL_TOOLCHAIN}"
  10. FILES_MIRRORS += "\
  11. ${bindir}/|/bin/\n \
  12. ${libdir}/|/lib/\n \
  13. ${libexecdir}/|/libexec/\n \
  14. ${prefix}/|${target_prefix}/\n \
  15. ${prefix}/|${target_base_prefix}/\n \
  16. ${exec_prefix}/|${target_exec_prefix}/\n \
  17. ${exec_prefix}/|${target_base_prefix}/\n \
  18. ${base_prefix}/|${target_base_prefix}/\n \
  19. "
  20. # Align with more typical toolchain layout. Everything is already isolated by
  21. # EXTERNAL_TARGET_SYS, we don't need cross-canadian.bbclass to do it for us.
  22. bindir = "${exec_prefix}/bin"
  23. libdir = "${exec_prefix}/lib"
  24. libexecdir = "${exec_prefix}/libexec"
  25. # We're relying on a compatible host libc, not one from a nativesdk build
  26. INSANE_SKIP:${PN} += "build-deps file-rdeps"
  27. do_install:append () {
  28. for i in ${D}${bindir}/${EXTERNAL_TARGET_SYS}-*; do
  29. if [ -e "$i" ]; then
  30. j="$(basename "$i")"
  31. #ln -sv "$j" "${D}${bindir}/${TARGET_PREFIX}${j#${EXTERNAL_TARGET_SYS}-}"
  32. fi
  33. done
  34. }
  35. python add_files_links () {
  36. prefix = d.getVar('EXTERNAL_TARGET_SYS') + '-'
  37. full_prefix = os.path.join(d.getVar('bindir'), prefix)
  38. new_prefix = d.getVar('TARGET_PREFIX')
  39. for pkg in d.getVar('PACKAGES').split():
  40. files = (d.getVar('FILES:%s' % pkg) or '').split()
  41. new_files = []
  42. for f in files:
  43. if f.startswith(full_prefix):
  44. new_files.append(f.replace(prefix, new_prefix))
  45. if new_files:
  46. d.appendVar('FILES:%s' % pkg, ' ' + ' '.join(new_files))
  47. }
  48. do_package[prefuncs] += "add_files_links"