summaryrefslogtreecommitdiffstats
path: root/meta/classes/cross.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/cross.bbclass')
-rw-r--r--meta/classes/cross.bbclass80
1 files changed, 80 insertions, 0 deletions
diff --git a/meta/classes/cross.bbclass b/meta/classes/cross.bbclass
new file mode 100644
index 0000000..bd14489
--- /dev/null
+++ b/meta/classes/cross.bbclass
@@ -0,0 +1,80 @@
1inherit relocatable
2
3# Cross packages are built indirectly via dependency,
4# no need for them to be a direct target of 'world'
5EXCLUDE_FROM_WORLD = "1"
6
7CLASSOVERRIDE = "class-cross"
8PACKAGES = ""
9PACKAGES_DYNAMIC = ""
10PACKAGES_DYNAMIC_class-native = ""
11
12HOST_ARCH = "${BUILD_ARCH}"
13HOST_VENDOR = "${BUILD_VENDOR}"
14HOST_OS = "${BUILD_OS}"
15HOST_PREFIX = "${BUILD_PREFIX}"
16HOST_CC_ARCH = "${BUILD_CC_ARCH}"
17HOST_LD_ARCH = "${BUILD_LD_ARCH}"
18HOST_AS_ARCH = "${BUILD_AS_ARCH}"
19
20STAGING_DIR_HOST = "${STAGING_DIR}/${HOST_ARCH}${HOST_VENDOR}-${HOST_OS}"
21
22export PKG_CONFIG_DIR = "${STAGING_DIR}/${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}${libdir}/pkgconfig"
23export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR}/${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}"
24
25CPPFLAGS = "${BUILD_CPPFLAGS}"
26CFLAGS = "${BUILD_CFLAGS}"
27CXXFLAGS = "${BUILD_CFLAGS}"
28LDFLAGS = "${BUILD_LDFLAGS}"
29LDFLAGS_build-darwin = "-L${STAGING_LIBDIR_NATIVE}"
30
31TOOLCHAIN_OPTIONS = ""
32
33DEPENDS_GETTEXT = "gettext-native"
34
35# Path mangling needed by the cross packaging
36# Note that we use := here to ensure that libdir and includedir are
37# target paths.
38target_base_prefix := "${base_prefix}"
39target_prefix := "${prefix}"
40target_exec_prefix := "${exec_prefix}"
41target_base_libdir = "${target_base_prefix}/${baselib}"
42target_libdir = "${target_exec_prefix}/${baselib}"
43target_includedir := "${includedir}"
44
45# Overrides for paths
46CROSS_TARGET_SYS_DIR = "${MULTIMACH_TARGET_SYS}"
47prefix = "${STAGING_DIR_NATIVE}${prefix_native}"
48base_prefix = "${STAGING_DIR_NATIVE}"
49exec_prefix = "${STAGING_DIR_NATIVE}${prefix_native}"
50bindir = "${exec_prefix}/bin/${CROSS_TARGET_SYS_DIR}"
51sbindir = "${bindir}"
52base_bindir = "${bindir}"
53base_sbindir = "${bindir}"
54libdir = "${exec_prefix}/lib/${CROSS_TARGET_SYS_DIR}"
55libexecdir = "${exec_prefix}/libexec/${CROSS_TARGET_SYS_DIR}"
56
57do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}/${STAGING_DIR_NATIVE}/"
58do_populate_sysroot[stamp-extra-info] = ""
59do_packagedata[stamp-extra-info] = ""
60
61python cross_virtclass_handler () {
62 classextend = e.data.getVar('BBCLASSEXTEND', True) or ""
63 if "cross" not in classextend:
64 return
65
66 pn = e.data.getVar("PN", True)
67 if not pn.endswith("-cross"):
68 return
69
70 bb.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + ":virtclass-cross", e.data)
71}
72
73addhandler cross_virtclass_handler
74cross_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise"
75
76do_install () {
77 oe_runmake 'DESTDIR=${D}' install
78}
79
80USE_NLS = "no"