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