allarch.bbclass 2.1 KB

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