blob: 7f2692c51a3211908b947577c23cab22f118ac4f [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001# SDK packages are built either explicitly by the user,
2# or indirectly via dependency. No need to be in 'world'.
3EXCLUDE_FROM_WORLD = "1"
4
5STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${SDK_ARCH}${SDK_VENDOR}-${SDK_OS}"
6
7# libc for the SDK can be different to that of the target
8NATIVESDKLIBC ?= "libc-glibc"
9LIBCOVERRIDE = ":${NATIVESDKLIBC}"
10CLASSOVERRIDE = "class-nativesdk"
11MACHINEOVERRIDES = ""
Andrew Geisslerb7d28612020-07-24 16:15:54 -050012MACHINE_FEATURES = ""
Patrick Williamsc124f4f2015-09-15 14:41:29 -050013
Patrick Williamsc0f7c042017-02-23 20:41:17 -060014MULTILIBS = ""
15
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080016# we need consistent staging dir whether or not multilib is enabled
17STAGING_DIR_HOST = "${WORKDIR}/recipe-sysroot"
18STAGING_DIR_TARGET = "${WORKDIR}/recipe-sysroot"
19RECIPE_SYSROOT = "${WORKDIR}/recipe-sysroot"
20
Patrick Williamsc124f4f2015-09-15 14:41:29 -050021#
22# Update PACKAGE_ARCH and PACKAGE_ARCHS
23#
24PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}"
25PACKAGE_ARCHS = "${SDK_PACKAGE_ARCHS}"
26
27#
28# We need chrpath >= 0.14 to ensure we can deal with 32 and 64 bit
29# binaries
30#
31DEPENDS_append = " chrpath-replacement-native"
32EXTRANATIVEPATH += "chrpath-native"
33
Brad Bishop6e60e8b2018-02-01 10:27:11 -050034PKGDATA_DIR = "${TMPDIR}/pkgdata/${SDK_SYS}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050035
36HOST_ARCH = "${SDK_ARCH}"
37HOST_VENDOR = "${SDK_VENDOR}"
38HOST_OS = "${SDK_OS}"
39HOST_PREFIX = "${SDK_PREFIX}"
40HOST_CC_ARCH = "${SDK_CC_ARCH}"
41HOST_LD_ARCH = "${SDK_LD_ARCH}"
42HOST_AS_ARCH = "${SDK_AS_ARCH}"
43#HOST_SYS = "${HOST_ARCH}${TARGET_VENDOR}-${HOST_OS}"
44
45TARGET_ARCH = "${SDK_ARCH}"
46TARGET_VENDOR = "${SDK_VENDOR}"
47TARGET_OS = "${SDK_OS}"
48TARGET_PREFIX = "${SDK_PREFIX}"
49TARGET_CC_ARCH = "${SDK_CC_ARCH}"
50TARGET_LD_ARCH = "${SDK_LD_ARCH}"
51TARGET_AS_ARCH = "${SDK_AS_ARCH}"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050052TARGET_CPPFLAGS = "${BUILDSDK_CPPFLAGS}"
53TARGET_CFLAGS = "${BUILDSDK_CFLAGS}"
54TARGET_CXXFLAGS = "${BUILDSDK_CXXFLAGS}"
55TARGET_LDFLAGS = "${BUILDSDK_LDFLAGS}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050056TARGET_FPU = ""
57EXTRA_OECONF_GCC_FLOAT = ""
58
59CPPFLAGS = "${BUILDSDK_CPPFLAGS}"
60CFLAGS = "${BUILDSDK_CFLAGS}"
Andrew Geisslerb7d28612020-07-24 16:15:54 -050061CXXFLAGS = "${BUILDSDK_CXXFLAGS}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050062LDFLAGS = "${BUILDSDK_LDFLAGS}"
63
64# Change to place files in SDKPATH
65base_prefix = "${SDKPATHNATIVE}"
66prefix = "${SDKPATHNATIVE}${prefix_nativesdk}"
67exec_prefix = "${SDKPATHNATIVE}${prefix_nativesdk}"
68baselib = "lib"
69sbindir = "${bindir}"
70
71export PKG_CONFIG_DIR = "${STAGING_DIR_HOST}${libdir}/pkgconfig"
72export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR_HOST}"
73
74python nativesdk_virtclass_handler () {
Brad Bishop6e60e8b2018-02-01 10:27:11 -050075 pn = e.data.getVar("PN")
Patrick Williamsc124f4f2015-09-15 14:41:29 -050076 if not (pn.endswith("-nativesdk") or pn.startswith("nativesdk-")):
77 return
78
Brad Bishop6e60e8b2018-02-01 10:27:11 -050079 # Set features here to prevent appends and distro features backfill
80 # from modifying nativesdk distro features
81 features = set(d.getVar("DISTRO_FEATURES_NATIVESDK").split())
82 filtered = set(bb.utils.filter("DISTRO_FEATURES", d.getVar("DISTRO_FEATURES_FILTER_NATIVESDK"), d).split())
83 d.setVar("DISTRO_FEATURES", " ".join(sorted(features | filtered)))
84
Patrick Williamsc124f4f2015-09-15 14:41:29 -050085 e.data.setVar("MLPREFIX", "nativesdk-")
Brad Bishop6e60e8b2018-02-01 10:27:11 -050086 e.data.setVar("PN", "nativesdk-" + e.data.getVar("PN").replace("-nativesdk", "").replace("nativesdk-", ""))
Patrick Williamsc124f4f2015-09-15 14:41:29 -050087}
88
89python () {
Brad Bishop6e60e8b2018-02-01 10:27:11 -050090 pn = d.getVar("PN")
Patrick Williamsc124f4f2015-09-15 14:41:29 -050091 if not pn.startswith("nativesdk-"):
92 return
93
94 import oe.classextend
95
96 clsextend = oe.classextend.NativesdkClassExtender("nativesdk", d)
97 clsextend.rename_packages()
Brad Bishop6e60e8b2018-02-01 10:27:11 -050098 clsextend.rename_package_variables((d.getVar("PACKAGEVARS") or "").split())
Patrick Williamsc124f4f2015-09-15 14:41:29 -050099
100 clsextend.map_depends_variable("DEPENDS")
101 clsextend.map_packagevars()
102 clsextend.map_variable("PROVIDES")
103 clsextend.map_regexp_variable("PACKAGES_DYNAMIC")
Brad Bishopa34c0302019-09-23 22:34:48 -0400104 d.setVar("LIBCEXTENSION", "")
105 d.setVar("ABIEXTENSION", "")
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500106}
107
108addhandler nativesdk_virtclass_handler
109nativesdk_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise"
110
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500111do_packagedata[stamp-extra-info] = ""
112
113USE_NLS = "${SDKUSE_NLS}"
Brad Bishop37a0e4d2017-12-04 01:01:44 -0500114
115OLDEST_KERNEL = "${SDK_OLDEST_KERNEL}"