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