blob: 5bd5c44a2767beebe0b7b733fc3ba0d7156a44ee [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001#
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05002# This class is used for architecture independent recipes/data files (usually scripts)
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003#
4
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08005python 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
15addhandler allarch_package_arch_handler
16allarch_package_arch_handler[eventmask] = "bb.event.RecipePreFinalise"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050017
18python () {
19 # Allow this class to be included but overridden - only set
20 # the values if we're still "all" package arch.
Brad Bishop6e60e8b2018-02-01 10:27:11 -050021 if d.getVar("PACKAGE_ARCH") == "all":
Patrick Williamsc124f4f2015-09-15 14:41:29 -050022 # 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 Williamsc0f7c042017-02-23 20:41:17 -060027 d.setVar("baselib", "lib")
Patrick Williamsc124f4f2015-09-15 14:41:29 -050028 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 Bishop6e60e8b2018-02-01 10:27:11 -050035 # 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 Williamsc124f4f2015-09-15 14:41:29 -050038 d.setVar("SDK_ARCH", "none")
39 d.setVar("SDK_CC_ARCH", "none")
Patrick Williamsf1e5d692016-03-30 15:21:19 -050040 d.setVar("TARGET_CPPFLAGS", "none")
41 d.setVar("TARGET_CFLAGS", "none")
42 d.setVar("TARGET_CXXFLAGS", "none")
43 d.setVar("TARGET_LDFLAGS", "none")
Brad Bishop6e60e8b2018-02-01 10:27:11 -050044 d.setVar("POPULATESYSROOTDEPS", "")
Patrick Williamsc124f4f2015-09-15 14:41:29 -050045
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 Williamsc0f7c042017-02-23 20:41:17 -060055
56 # These multilib values shouldn't change allarch packages so exclude them
Brad Bishopd7bf8c12018-02-25 22:55:05 -050057 d.appendVarFlag("emit_pkgdata", "vardepsexclude", " MULTILIB_VARIANTS")
58 d.appendVarFlag("write_specfile", "vardepsexclude", " MULTILIBS")
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080059 d.appendVarFlag("do_package", "vardepsexclude", " package_do_shlibs")
Patrick Williamsc124f4f2015-09-15 14:41:29 -050060 elif bb.data.inherits_class('packagegroup', d) and not bb.data.inherits_class('nativesdk', d):
Brad Bishop6e60e8b2018-02-01 10:27:11 -050061 bb.error("Please ensure recipe %s sets PACKAGE_ARCH before inherit packagegroup" % d.getVar("FILE"))
Patrick Williamsc124f4f2015-09-15 14:41:29 -050062}
63