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.bbclass106
1 files changed, 106 insertions, 0 deletions
diff --git a/meta/classes/nativesdk.bbclass b/meta/classes/nativesdk.bbclass
new file mode 100644
index 0000000000..d1b429488b
--- /dev/null
+++ b/meta/classes/nativesdk.bbclass
@@ -0,0 +1,106 @@
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
5# Save MULTIMACH_ARCH
6OLD_MULTIMACH_ARCH := "${MULTIMACH_ARCH}"
7# Save PACKAGE_ARCH
8OLD_PACKAGE_ARCH := ${PACKAGE_ARCH}
9PACKAGE_ARCH = "${BUILD_ARCH}-${OLD_PACKAGE_ARCH}-nativesdk"
10# Also save BASE_PACKAGE_ARCH since HOST_ARCH can influence it
11OLD_BASE_PACKAGE_ARCH := "${BASE_PACKAGE_ARCH}"
12BASE_PACKAGE_ARCH = "${OLD_BASE_PACKAGE_ARCH}"
13
14STAGING_DIR_HOST = "${STAGING_DIR}/${HOST_SYS}-sdk"
15STAGING_DIR_TARGET = "${STAGING_DIR}/${OLD_MULTIMACH_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
16
17HOST_ARCH = "${BUILD_ARCH}"
18HOST_VENDOR = "${BUILD_VENDOR}"
19HOST_OS = "${BUILD_OS}"
20HOST_PREFIX = "${BUILD_PREFIX}"
21HOST_CC_ARCH = "${BUILD_CC_ARCH}"
22#HOST_SYS = "${HOST_ARCH}${TARGET_VENDOR}-${HOST_OS}"
23
24CPPFLAGS = "${BUILDSDK_CPPFLAGS}"
25CFLAGS = "${BUILDSDK_CFLAGS}"
26CXXFLAGS = "${BUILDSDK_CFLAGS}"
27LDFLAGS = "${BUILDSDK_LDFLAGS}"
28
29# Path prefixes
30prefix = "${SDKPATH}"
31exec_prefix = "${prefix}"
32base_prefix = "${prefix}"
33
34# Base paths
35export base_bindir = "${prefix}/bin"
36export base_sbindir = "${prefix}/bin"
37export base_libdir = "${prefix}/lib"
38
39# Architecture independent paths
40export datadir = "${prefix}/share"
41export sysconfdir = "${prefix}/etc"
42export sharedstatedir = "${datadir}/com"
43export localstatedir = "${prefix}/var"
44export infodir = "${datadir}/info"
45export mandir = "${datadir}/man"
46export docdir = "${datadir}/doc"
47export servicedir = "${prefix}/srv"
48
49# Architecture dependent paths
50export bindir = "${prefix}/bin"
51export sbindir = "${prefix}/bin"
52export libexecdir = "${prefix}/libexec"
53export libdir = "${prefix}/lib"
54export includedir = "${prefix}/include"
55export oldincludedir = "${prefix}/include"
56
57FILES_${PN} = "${prefix}"
58FILES_${PN}-dbg += "${prefix}/.debug \
59 ${prefix}/bin/.debug \
60 "
61
62export PKG_CONFIG_DIR = "${STAGING_DIR_HOST}${libdir}/pkgconfig"
63export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR_HOST}"
64
65python () {
66 barch = bb.data.getVar('BUILD_ARCH', d, True)
67 archs = bb.data.getVar('PACKAGE_ARCHS', d, True).split()
68 sdkarchs = []
69 for arch in archs:
70 sdkarchs.append(barch + '-' + arch + '-sdk')
71 bb.data.setVar('PACKAGE_ARCHS', " ".join(sdkarchs), d)
72}
73
74python __anonymous () {
75 pn = bb.data.getVar("PN", d, True)
76 depends = bb.data.getVar("DEPENDS", d, True)
77 deps = bb.utils.explode_deps(depends)
78 if "sdk" in (bb.data.getVar('BBCLASSEXTEND', d, True) or ""):
79 autoextend = True
80 else:
81 autoextend = False
82 for dep in deps:
83 if dep.endswith("-native") or dep.endswith("-cross"):
84 continue
85 if not dep.endswith("-nativesdk"):
86 if autoextend:
87 depends = depends.replace(dep, dep + "-nativesdk")
88 elif pn == 'gcc-cross-nativesdk':
89 continue
90 else:
91 bb.note("%s has depends %s which doesn't end in -nativesdk?" % (pn, dep))
92 bb.data.setVar("DEPENDS", depends, d)
93 provides = bb.data.getVar("PROVIDES", d, True)
94 for prov in provides.split():
95 if prov.find(pn) != -1:
96 continue
97 if not prov.endswith("-nativesdk"):
98 if autoextend:
99 provides = provides.replace(prov, prov + "-nativesdk")
100 #else:
101 # bb.note("%s has rouge PROVIDES of %s which doesn't end in -sdk?" % (pn, prov))
102 bb.data.setVar("PROVIDES", provides, d)
103
104}
105
106