summaryrefslogtreecommitdiffstats
path: root/meta/classes-recipe/cross.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes-recipe/cross.bbclass')
-rw-r--r--meta/classes-recipe/cross.bbclass103
1 files changed, 103 insertions, 0 deletions
diff --git a/meta/classes-recipe/cross.bbclass b/meta/classes-recipe/cross.bbclass
new file mode 100644
index 0000000000..93de9a5274
--- /dev/null
+++ b/meta/classes-recipe/cross.bbclass
@@ -0,0 +1,103 @@
1#
2# Copyright OpenEmbedded Contributors
3#
4# SPDX-License-Identifier: MIT
5#
6
7inherit relocatable
8
9# Cross packages are built indirectly via dependency,
10# no need for them to be a direct target of 'world'
11EXCLUDE_FROM_WORLD = "1"
12
13CLASSOVERRIDE = "class-cross"
14PACKAGES = ""
15PACKAGES_DYNAMIC = ""
16PACKAGES_DYNAMIC:class-native = ""
17
18HOST_ARCH = "${BUILD_ARCH}"
19HOST_VENDOR = "${BUILD_VENDOR}"
20HOST_OS = "${BUILD_OS}"
21HOST_PREFIX = "${BUILD_PREFIX}"
22HOST_CC_ARCH = "${BUILD_CC_ARCH}"
23HOST_LD_ARCH = "${BUILD_LD_ARCH}"
24HOST_AS_ARCH = "${BUILD_AS_ARCH}"
25
26# No strip sysroot when DEBUG_BUILD is enabled
27INHIBIT_SYSROOT_STRIP ?= "${@oe.utils.vartrue('DEBUG_BUILD', '1', '', d)}"
28
29export lt_cv_sys_lib_dlsearch_path_spec = "${libdir} ${base_libdir} /lib /lib64 /usr/lib /usr/lib64"
30
31STAGING_DIR_HOST = "${RECIPE_SYSROOT_NATIVE}"
32
33PACKAGE_ARCH = "${BUILD_ARCH}"
34
35MULTIMACH_TARGET_SYS = "${BUILD_ARCH}${BUILD_VENDOR}-${BUILD_OS}"
36
37export PKG_CONFIG_DIR = "${exec_prefix}/lib/pkgconfig"
38export PKG_CONFIG_SYSROOT_DIR = ""
39
40TARGET_CPPFLAGS = ""
41TARGET_CFLAGS = ""
42TARGET_CXXFLAGS = ""
43TARGET_LDFLAGS = ""
44
45CPPFLAGS = "${BUILD_CPPFLAGS}"
46CFLAGS = "${BUILD_CFLAGS}"
47CXXFLAGS = "${BUILD_CFLAGS}"
48LDFLAGS = "${BUILD_LDFLAGS}"
49
50TOOLCHAIN_OPTIONS = ""
51
52# This class encodes staging paths into its scripts data so can only be
53# reused if we manipulate the paths.
54SSTATE_SCAN_CMD ?= "${SSTATE_SCAN_CMD_NATIVE}"
55
56# Path mangling needed by the cross packaging
57# Note that we use := here to ensure that libdir and includedir are
58# target paths.
59target_base_prefix := "${root_prefix}"
60target_prefix := "${prefix}"
61target_exec_prefix := "${exec_prefix}"
62target_base_libdir = "${target_base_prefix}/${baselib}"
63target_libdir = "${target_exec_prefix}/${baselib}"
64target_includedir := "${includedir}"
65
66# Overrides for paths
67CROSS_TARGET_SYS_DIR = "${TARGET_SYS}"
68prefix = "${STAGING_DIR_NATIVE}${prefix_native}"
69base_prefix = "${STAGING_DIR_NATIVE}"
70exec_prefix = "${STAGING_DIR_NATIVE}${prefix_native}"
71bindir = "${exec_prefix}/bin/${CROSS_TARGET_SYS_DIR}"
72sbindir = "${bindir}"
73base_bindir = "${bindir}"
74base_sbindir = "${bindir}"
75libdir = "${exec_prefix}/lib/${CROSS_TARGET_SYS_DIR}"
76libexecdir = "${exec_prefix}/libexec/${CROSS_TARGET_SYS_DIR}"
77
78do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}/${STAGING_DIR_NATIVE}/"
79do_packagedata[stamp-extra-info] = ""
80
81USE_NLS = "no"
82
83export CC = "${BUILD_CC}"
84export CXX = "${BUILD_CXX}"
85export FC = "${BUILD_FC}"
86export CPP = "${BUILD_CPP}"
87export LD = "${BUILD_LD}"
88export CCLD = "${BUILD_CCLD}"
89export AR = "${BUILD_AR}"
90export AS = "${BUILD_AS}"
91export RANLIB = "${BUILD_RANLIB}"
92export STRIP = "${BUILD_STRIP}"
93export NM = "${BUILD_NM}"
94
95inherit nopackages
96
97python do_addto_recipe_sysroot () {
98 bb.build.exec_func("extend_recipe_sysroot", d)
99}
100addtask addto_recipe_sysroot after do_populate_sysroot
101do_addto_recipe_sysroot[deptask] = "do_populate_sysroot"
102
103PATH:prepend = "${COREBASE}/scripts/cross-intercept:"