summaryrefslogtreecommitdiffstats
path: root/meta/classes/nativesdk.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/nativesdk.bbclass')
-rw-r--r--meta/classes/nativesdk.bbclass94
1 files changed, 94 insertions, 0 deletions
diff --git a/meta/classes/nativesdk.bbclass b/meta/classes/nativesdk.bbclass
new file mode 100644
index 0000000..7f94258
--- /dev/null
+++ b/meta/classes/nativesdk.bbclass
@@ -0,0 +1,94 @@
1# 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"
11
12#
13# Update PACKAGE_ARCH and PACKAGE_ARCHS
14#
15PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}"
16PACKAGE_ARCHS = "${SDK_PACKAGE_ARCHS}"
17
18#
19# We need chrpath >= 0.14 to ensure we can deal with 32 and 64 bit
20# binaries
21#
22DEPENDS_append = " chrpath-replacement-native"
23EXTRANATIVEPATH += "chrpath-native"
24
25STAGING_DIR_HOST = "${STAGING_DIR}/${MULTIMACH_HOST_SYS}"
26STAGING_DIR_TARGET = "${STAGING_DIR}/${MULTIMACH_TARGET_SYS}"
27
28HOST_ARCH = "${SDK_ARCH}"
29HOST_VENDOR = "${SDK_VENDOR}"
30HOST_OS = "${SDK_OS}"
31HOST_PREFIX = "${SDK_PREFIX}"
32HOST_CC_ARCH = "${SDK_CC_ARCH}"
33HOST_LD_ARCH = "${SDK_LD_ARCH}"
34HOST_AS_ARCH = "${SDK_AS_ARCH}"
35#HOST_SYS = "${HOST_ARCH}${TARGET_VENDOR}-${HOST_OS}"
36
37TARGET_ARCH = "${SDK_ARCH}"
38TARGET_VENDOR = "${SDK_VENDOR}"
39TARGET_OS = "${SDK_OS}"
40TARGET_PREFIX = "${SDK_PREFIX}"
41TARGET_CC_ARCH = "${SDK_CC_ARCH}"
42TARGET_LD_ARCH = "${SDK_LD_ARCH}"
43TARGET_AS_ARCH = "${SDK_AS_ARCH}"
44TARGET_FPU = ""
45EXTRA_OECONF_FPU = ""
46
47CPPFLAGS = "${BUILDSDK_CPPFLAGS}"
48CFLAGS = "${BUILDSDK_CFLAGS}"
49CXXFLAGS = "${BUILDSDK_CFLAGS}"
50LDFLAGS = "${BUILDSDK_LDFLAGS}"
51
52# Change to place files in SDKPATH
53base_prefix = "${SDKPATHNATIVE}"
54prefix = "${SDKPATHNATIVE}${prefix_nativesdk}"
55exec_prefix = "${SDKPATHNATIVE}${prefix_nativesdk}"
56baselib = "lib"
57
58export PKG_CONFIG_DIR = "${STAGING_DIR_HOST}${libdir}/pkgconfig"
59export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR_HOST}"
60
61python nativesdk_virtclass_handler () {
62 pn = e.data.getVar("PN", True)
63 if not (pn.endswith("-nativesdk") or pn.startswith("nativesdk-")):
64 return
65
66 e.data.setVar("MLPREFIX", "nativesdk-")
67 e.data.setVar("PN", "nativesdk-" + e.data.getVar("PN", True).replace("-nativesdk", "").replace("nativesdk-", ""))
68 e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + ":virtclass-nativesdk")
69}
70
71python () {
72 pn = d.getVar("PN", True)
73 if not pn.startswith("nativesdk-"):
74 return
75
76 import oe.classextend
77
78 clsextend = oe.classextend.NativesdkClassExtender("nativesdk", d)
79 clsextend.rename_packages()
80 clsextend.rename_package_variables((d.getVar("PACKAGEVARS", True) or "").split())
81
82 clsextend.map_depends_variable("DEPENDS")
83 clsextend.map_packagevars()
84 clsextend.map_variable("PROVIDES")
85 clsextend.map_regexp_variable("PACKAGES_DYNAMIC")
86}
87
88addhandler nativesdk_virtclass_handler
89nativesdk_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise"
90
91do_populate_sysroot[stamp-extra-info] = ""
92do_packagedata[stamp-extra-info] = ""
93
94USE_NLS = "${SDKUSE_NLS}"