diff options
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/nativesdk.bbclass | 105 |
1 files changed, 38 insertions, 67 deletions
diff --git a/meta/classes/nativesdk.bbclass b/meta/classes/nativesdk.bbclass index 59d3320c3c..964d39955b 100644 --- a/meta/classes/nativesdk.bbclass +++ b/meta/classes/nativesdk.bbclass | |||
@@ -2,59 +2,51 @@ | |||
2 | # or indirectly via dependency. No need to be in 'world'. | 2 | # or indirectly via dependency. No need to be in 'world'. |
3 | EXCLUDE_FROM_WORLD = "1" | 3 | EXCLUDE_FROM_WORLD = "1" |
4 | 4 | ||
5 | # Save MULTIMACH_ARCH | 5 | # |
6 | OLD_MULTIMACH_ARCH := "${MULTIMACH_ARCH}" | 6 | # Update BASE_PACKAGE_ARCH and PACKAGE_ARCHS |
7 | # Save PACKAGE_ARCH | 7 | # |
8 | OLD_PACKAGE_ARCH := ${PACKAGE_ARCH} | 8 | OLD_PACKAGE_ARCH := ${BASE_PACKAGE_ARCH} |
9 | PACKAGE_ARCH = "${BUILD_ARCH}-${OLD_PACKAGE_ARCH}-nativesdk" | 9 | BASE_PACKAGE_ARCH = "${HOST_ARCH}-${OLD_PACKAGE_ARCH}-nativesdk" |
10 | # Also save BASE_PACKAGE_ARCH since HOST_ARCH can influence it | 10 | python () { |
11 | OLD_BASE_PACKAGE_ARCH := "${BASE_PACKAGE_ARCH}" | 11 | barch = bb.data.getVar('HOST_ARCH', d, True) |
12 | BASE_PACKAGE_ARCH = "${OLD_BASE_PACKAGE_ARCH}" | 12 | archs = bb.data.getVar('PACKAGE_ARCHS', d, True).split() |
13 | sdkarchs = [] | ||
14 | for arch in archs: | ||
15 | sdkarchs.append(barch + '-' + arch + '-nativesdk') | ||
16 | bb.data.setVar('PACKAGE_ARCHS', " ".join(sdkarchs), d) | ||
17 | } | ||
18 | |||
19 | #STAGING_DIR_HOST = "${STAGING_DIR}/${HOST_SYS}-nativesdk" | ||
20 | #STAGING_DIR_TARGET = "${STAGING_DIR}/${BASEPKG_TARGET_SYS}-nativesdk" | ||
21 | |||
22 | CROSS_DIR = "${TMPDIR}/cross/${HOST_ARCH}" | ||
13 | 23 | ||
14 | STAGING_DIR_HOST = "${STAGING_DIR}/${HOST_SYS}-sdk" | 24 | TARGET_LDFLAGS += "-Wl,-dynamic-linker=${SDKPATH}/lib/ld-linux.so.2" |
15 | STAGING_DIR_TARGET = "${STAGING_DIR}/${OLD_MULTIMACH_ARCH}${TARGET_VENDOR}-${TARGET_OS}" | ||
16 | 25 | ||
17 | HOST_ARCH = "${BUILD_ARCH}" | 26 | HOST_ARCH = "${SDK_ARCH}" |
18 | HOST_VENDOR = "${BUILD_VENDOR}" | 27 | HOST_VENDOR = "${SDK_VENDOR}" |
19 | HOST_OS = "${BUILD_OS}" | 28 | HOST_OS = "${SDK_OS}" |
20 | HOST_PREFIX = "${BUILD_PREFIX}" | 29 | HOST_PREFIX = "${SDK_PREFIX}" |
21 | HOST_CC_ARCH = "${BUILD_CC_ARCH}" | 30 | HOST_CC_ARCH = "${SDK_CC_ARCH}" |
22 | #HOST_SYS = "${HOST_ARCH}${TARGET_VENDOR}-${HOST_OS}" | 31 | #HOST_SYS = "${HOST_ARCH}${TARGET_VENDOR}-${HOST_OS}" |
23 | 32 | ||
33 | TARGET_ARCH = "${SDK_ARCH}" | ||
34 | TARGET_VENDOR = "${SDK_VENDOR}" | ||
35 | TARGET_OS = "${SDK_OS}" | ||
36 | TARGET_PREFIX = "${SDK_PREFIX}" | ||
37 | TARGET_CC_ARCH = "${SDK_CC_ARCH}" | ||
38 | |||
24 | CPPFLAGS = "${BUILDSDK_CPPFLAGS}" | 39 | CPPFLAGS = "${BUILDSDK_CPPFLAGS}" |
25 | CFLAGS = "${BUILDSDK_CFLAGS}" | 40 | CFLAGS = "${BUILDSDK_CFLAGS}" |
26 | CXXFLAGS = "${BUILDSDK_CFLAGS}" | 41 | CXXFLAGS = "${BUILDSDK_CFLAGS}" |
27 | LDFLAGS = "${BUILDSDK_LDFLAGS}" | 42 | LDFLAGS = "${BUILDSDK_LDFLAGS}" |
28 | 43 | ||
29 | # Path prefixes | 44 | # Change to place files in SDKPATH |
30 | prefix = "${SDKPATH}" | 45 | prefix = "${SDKPATH}" |
31 | exec_prefix = "${prefix}" | 46 | exec_prefix = "${SDKPATH}" |
32 | base_prefix = "${prefix}" | 47 | base_prefix = "${SDKPATH}" |
33 | |||
34 | # Base paths | ||
35 | export base_bindir = "${prefix}/bin" | ||
36 | export base_sbindir = "${prefix}/bin" | ||
37 | export base_libdir = "${prefix}/lib" | ||
38 | 48 | ||
39 | # Architecture independent paths | 49 | FILES_${PN} += "${prefix}" |
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 \ | 50 | FILES_${PN}-dbg += "${prefix}/.debug \ |
59 | ${prefix}/bin/.debug \ | 51 | ${prefix}/bin/.debug \ |
60 | " | 52 | " |
@@ -62,35 +54,18 @@ FILES_${PN}-dbg += "${prefix}/.debug \ | |||
62 | export PKG_CONFIG_DIR = "${STAGING_DIR_HOST}${libdir}/pkgconfig" | 54 | export PKG_CONFIG_DIR = "${STAGING_DIR_HOST}${libdir}/pkgconfig" |
63 | export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR_HOST}" | 55 | export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR_HOST}" |
64 | 56 | ||
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 () { | 57 | python __anonymous () { |
75 | pn = bb.data.getVar("PN", d, True) | 58 | pn = bb.data.getVar("PN", d, True) |
76 | depends = bb.data.getVar("DEPENDS", d, True) | 59 | depends = bb.data.getVar("DEPENDS", d, True) |
77 | deps = bb.utils.explode_deps(depends) | 60 | deps = bb.utils.explode_deps(depends) |
78 | newdeps = [] | 61 | newdeps = [] |
79 | if "nativesdk" in (bb.data.getVar('BBCLASSEXTEND', d, True) or ""): | ||
80 | autoextend = True | ||
81 | else: | ||
82 | autoextend = False | ||
83 | for dep in deps: | 62 | for dep in deps: |
84 | if dep.endswith("-native") or dep.endswith("-cross"): | 63 | if dep.endswith("-native") or dep.endswith("-cross"): |
85 | newdeps.append(dep) | 64 | newdeps.append(dep) |
65 | elif dep.endswith("-gcc-intermediate") or dep.endswith("-gcc-initial") or dep.endswith("-gcc"): | ||
66 | newdeps.append(dep + "-crosssdk") | ||
86 | elif not dep.endswith("-nativesdk"): | 67 | elif not dep.endswith("-nativesdk"): |
87 | if autoextend: | 68 | newdeps.append(dep + "-nativesdk") |
88 | newdeps.append(dep + "-nativesdk") | ||
89 | elif pn == 'gcc-cross-nativesdk': | ||
90 | newdeps.append(dep) | ||
91 | else: | ||
92 | newdeps.append(dep) | ||
93 | bb.note("%s has depends %s which doesn't end in -nativesdk?" % (pn, dep)) | ||
94 | else: | 69 | else: |
95 | newdeps.append(dep) | 70 | newdeps.append(dep) |
96 | bb.data.setVar("DEPENDS", " ".join(newdeps), d) | 71 | bb.data.setVar("DEPENDS", " ".join(newdeps), d) |
@@ -99,12 +74,8 @@ python __anonymous () { | |||
99 | if prov.find(pn) != -1: | 74 | if prov.find(pn) != -1: |
100 | continue | 75 | continue |
101 | if not prov.endswith("-nativesdk"): | 76 | if not prov.endswith("-nativesdk"): |
102 | if autoextend: | 77 | provides = provides.replace(prov, prov + "-nativesdk") |
103 | provides = provides.replace(prov, prov + "-nativesdk") | ||
104 | #else: | ||
105 | # bb.note("%s has rouge PROVIDES of %s which doesn't end in -sdk?" % (pn, prov)) | ||
106 | bb.data.setVar("PROVIDES", provides, d) | 78 | bb.data.setVar("PROVIDES", provides, d) |
107 | |||
108 | } | 79 | } |
109 | 80 | ||
110 | 81 | ||