Advertisement
Guest User

supported-machine.bbclass

a guest
Jan 30th, 2017
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. # This class can be used to make it possible to RRECOMMENDS_${PN} a package
  2. # that may not be possible to create for the current machine. It is used by
  3. # specifying the supported machines in SUPPORTED_MACHINE (it works exactly as
  4. # COMPATIBLE_MACHINE). If not building for one of the supported machines, an
  5. # empty package will be created and a warning is produced.
  6.  
  7. python() {
  8. need_machine = d.getVar('SUPPORTED_MACHINE', True)
  9. if need_machine:
  10. import re
  11. compat_machines = (d.getVar('MACHINEOVERRIDES', True) or "").split(":")
  12. for m in compat_machines:
  13. if re.match(need_machine, m):
  14. break
  15. else:
  16. d.setVar('SRC_URI', '')
  17. bb.build.deltask('configure', d)
  18. bb.build.deltask('compile', d)
  19. bb.build.deltask('install', d)
  20.  
  21. # Produce a warning when packaging
  22. for t in ['do_package_write_deb',
  23. 'do_package_write_ipk',
  24. 'do_package_write_rpm',
  25. 'do_package_write_deb_setscene',
  26. 'do_package_write_ipk_setscene',
  27. 'do_package_write_rpm_setscene']:
  28. d.prependVarFlag(t, 'prefuncs', 'warn_non_supported_machine ')
  29. }
  30.  
  31. warn_non_supported_machine() {
  32. bbwarn "Creating an empty package since the current machine is unsupported!"
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement