diff options
Diffstat (limited to 'meta/classes/nativesdk.bbclass')
-rw-r--r-- | meta/classes/nativesdk.bbclass | 106 |
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'. | ||
3 | EXCLUDE_FROM_WORLD = "1" | ||
4 | |||
5 | # Save MULTIMACH_ARCH | ||
6 | OLD_MULTIMACH_ARCH := "${MULTIMACH_ARCH}" | ||
7 | # Save PACKAGE_ARCH | ||
8 | OLD_PACKAGE_ARCH := ${PACKAGE_ARCH} | ||
9 | PACKAGE_ARCH = "${BUILD_ARCH}-${OLD_PACKAGE_ARCH}-nativesdk" | ||
10 | # Also save BASE_PACKAGE_ARCH since HOST_ARCH can influence it | ||
11 | OLD_BASE_PACKAGE_ARCH := "${BASE_PACKAGE_ARCH}" | ||
12 | BASE_PACKAGE_ARCH = "${OLD_BASE_PACKAGE_ARCH}" | ||
13 | |||
14 | STAGING_DIR_HOST = "${STAGING_DIR}/${HOST_SYS}-sdk" | ||
15 | STAGING_DIR_TARGET = "${STAGING_DIR}/${OLD_MULTIMACH_ARCH}${TARGET_VENDOR}-${TARGET_OS}" | ||
16 | |||
17 | HOST_ARCH = "${BUILD_ARCH}" | ||
18 | HOST_VENDOR = "${BUILD_VENDOR}" | ||
19 | HOST_OS = "${BUILD_OS}" | ||
20 | HOST_PREFIX = "${BUILD_PREFIX}" | ||
21 | HOST_CC_ARCH = "${BUILD_CC_ARCH}" | ||
22 | #HOST_SYS = "${HOST_ARCH}${TARGET_VENDOR}-${HOST_OS}" | ||
23 | |||
24 | CPPFLAGS = "${BUILDSDK_CPPFLAGS}" | ||
25 | CFLAGS = "${BUILDSDK_CFLAGS}" | ||
26 | CXXFLAGS = "${BUILDSDK_CFLAGS}" | ||
27 | LDFLAGS = "${BUILDSDK_LDFLAGS}" | ||
28 | |||
29 | # Path prefixes | ||
30 | prefix = "${SDKPATH}" | ||
31 | exec_prefix = "${prefix}" | ||
32 | base_prefix = "${prefix}" | ||
33 | |||
34 | # Base paths | ||
35 | export base_bindir = "${prefix}/bin" | ||
36 | export base_sbindir = "${prefix}/bin" | ||
37 | export base_libdir = "${prefix}/lib" | ||
38 | |||
39 | # Architecture independent paths | ||
40 | export datadir = "${prefix}/share" | ||
41 | export sysconfdir = "${prefix}/etc" | ||
42 | export sharedstatedir = "${datadir}/com" | ||
43 | export localstatedir = "${prefix}/var" | ||
44 | export infodir = "${datadir}/info" | ||
45 | export mandir = "${datadir}/man" | ||
46 | export docdir = "${datadir}/doc" | ||
47 | export servicedir = "${prefix}/srv" | ||
48 | |||
49 | # Architecture dependent paths | ||
50 | export bindir = "${prefix}/bin" | ||
51 | export sbindir = "${prefix}/bin" | ||
52 | export libexecdir = "${prefix}/libexec" | ||
53 | export libdir = "${prefix}/lib" | ||
54 | export includedir = "${prefix}/include" | ||
55 | export oldincludedir = "${prefix}/include" | ||
56 | |||
57 | FILES_${PN} = "${prefix}" | ||
58 | FILES_${PN}-dbg += "${prefix}/.debug \ | ||
59 | ${prefix}/bin/.debug \ | ||
60 | " | ||
61 | |||
62 | export PKG_CONFIG_DIR = "${STAGING_DIR_HOST}${libdir}/pkgconfig" | ||
63 | export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR_HOST}" | ||
64 | |||
65 | python () { | ||
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 | |||
74 | python __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 | |||