allarch.bbclass 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #
  2. # Copyright OpenEmbedded Contributors
  3. #
  4. #
  5. # This class is used for architecture independent recipes/data files (usually scripts)
  6. #
  7. python allarch_package_arch_handler () {
  8. if bb.data.inherits_class("native", d) or bb.data.inherits_class("nativesdk", d) \
  9. or bb.data.inherits_class("crosssdk", d):
  10. return
  11. variants = d.getVar("MULTILIB_VARIANTS")
  12. if not variants:
  13. d.setVar("PACKAGE_ARCH", "all" )
  14. }
  15. addhandler allarch_package_arch_handler
  16. allarch_package_arch_handler[eventmask] = "bb.event.RecipePreFinalise"
  17. python () {
  18. # Allow this class to be included but overridden - only set
  19. # the values if we're still "all" package arch.
  20. if d.getVar("PACKAGE_ARCH") == "all":
  21. # No need for virtual/libc or a cross compiler
  22. d.setVar("INHIBIT_DEFAULT_DEPS","1")
  23. # Set these to a common set of values, we shouldn't be using them other that for WORKDIR directory
  24. # naming anyway
  25. d.setVar("baselib", "lib")
  26. d.setVar("TARGET_ARCH", "allarch")
  27. d.setVar("TARGET_OS", "linux")
  28. d.setVar("TARGET_CC_ARCH", "none")
  29. d.setVar("TARGET_LD_ARCH", "none")
  30. d.setVar("TARGET_AS_ARCH", "none")
  31. d.setVar("TARGET_FPU", "")
  32. d.setVar("TARGET_PREFIX", "")
  33. # Expand PACKAGE_EXTRA_ARCHS since the staging code needs this
  34. # (this removes any dependencies from the hash perspective)
  35. d.setVar("PACKAGE_EXTRA_ARCHS", d.getVar("PACKAGE_EXTRA_ARCHS"))
  36. d.setVar("SDK_ARCH", "none")
  37. d.setVar("SDK_CC_ARCH", "none")
  38. d.setVar("TARGET_CPPFLAGS", "none")
  39. d.setVar("TARGET_CFLAGS", "none")
  40. d.setVar("TARGET_CXXFLAGS", "none")
  41. d.setVar("TARGET_LDFLAGS", "none")
  42. d.setVar("POPULATESYSROOTDEPS", "")
  43. # Avoid this being unnecessarily different due to nuances of
  44. # the target machine that aren't important for "all" arch
  45. # packages.
  46. d.setVar("LDFLAGS", "")
  47. # No need to do shared library processing or debug symbol handling
  48. d.setVar("EXCLUDE_FROM_SHLIBS", "1")
  49. d.setVar("INHIBIT_PACKAGE_DEBUG_SPLIT", "1")
  50. d.setVar("INHIBIT_PACKAGE_STRIP", "1")
  51. # These multilib values shouldn't change allarch packages so exclude them
  52. d.appendVarFlag("emit_pkgdata", "vardepsexclude", " MULTILIB_VARIANTS")
  53. d.appendVarFlag("write_specfile", "vardepsexclude", " MULTILIBS")
  54. d.appendVarFlag("do_package", "vardepsexclude", " package_do_shlibs")
  55. elif bb.data.inherits_class('packagegroup', d) and not bb.data.inherits_class('nativesdk', d):
  56. bb.error("Please ensure recipe %s sets PACKAGE_ARCH before inherit packagegroup" % d.getVar("FILE"))
  57. }
  58. def qemu_wrapper_cmdline(data, rootfs_path, library_paths):
  59. return 'false'