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