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