diff options
| author | Randy MacLeod <Randy.MacLeod@windriver.com> | 2021-08-10 13:52:19 -0400 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-08-26 22:09:43 +0100 |
| commit | 61e1570c6a09c1984e919e8c0a82a74c1a08d821 (patch) | |
| tree | accab4b08aa3c62f098c9bb19399efb46906256a /meta/classes/rust.bbclass | |
| parent | 705b1d757fa221614f4f72cabf0fac5884cb6bfd (diff) | |
| download | poky-61e1570c6a09c1984e919e8c0a82a74c1a08d821.tar.gz | |
rust: initial merge of most of meta-rust
In the meta-rust repo at commit:
448047c Upgrade to 1.54.0 (#359)
Make the required directories:
mkdir ../oe-core/meta/recipes-devtools/rust
mkdir ../oe-core/meta/recipes-devtools/cargo
mkdir ../oe-core/meta/recipes-example
and then:
cp recipes-devtools/rust/* ../oe-core/meta/recipes-devtools/rust
cp recipes-devtools/cargo/* ../oe-core/meta/recipes-devtools/cargo
cp lib/crate.py ../oe-core/meta/lib
cp recipes-example/* ../oe-core/meta/recipes-example
cp conf/distro/include/rust_* ../oe-core/meta/conf/distro/include/
cp classes/* ../oe-core/meta/classes/
cp recipes-core/packagegroups/packagegroup-rust-cross-canadian.bb ../oe-core/meta/recipes-core/packagegroups
(From OE-Core rev: 3ed57578cca93ff1ba4e0bf3f25566e10659a2f9)
Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/rust.bbclass')
| -rw-r--r-- | meta/classes/rust.bbclass | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/meta/classes/rust.bbclass b/meta/classes/rust.bbclass new file mode 100644 index 0000000000..5c8938d09f --- /dev/null +++ b/meta/classes/rust.bbclass | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | inherit rust-common | ||
| 2 | |||
| 3 | RUSTC = "rustc" | ||
| 4 | |||
| 5 | RUSTC_ARCHFLAGS += "--target=${HOST_SYS} ${RUSTFLAGS}" | ||
| 6 | |||
| 7 | def rust_base_dep(d): | ||
| 8 | # Taken from meta/classes/base.bbclass `base_dep_prepend` and modified to | ||
| 9 | # use rust instead of gcc | ||
| 10 | deps = "" | ||
| 11 | if not d.getVar('INHIBIT_DEFAULT_RUST_DEPS'): | ||
| 12 | if (d.getVar('HOST_SYS') != d.getVar('BUILD_SYS')): | ||
| 13 | deps += " virtual/${TARGET_PREFIX}rust ${RUSTLIB_DEP}" | ||
| 14 | else: | ||
| 15 | deps += " rust-native" | ||
| 16 | return deps | ||
| 17 | |||
| 18 | DEPENDS:append = " ${@rust_base_dep(d)}" | ||
| 19 | |||
| 20 | # BUILD_LDFLAGS | ||
| 21 | # ${STAGING_LIBDIR_NATIVE} | ||
| 22 | # ${STAGING_BASE_LIBDIR_NATIVE} | ||
| 23 | # BUILDSDK_LDFLAGS | ||
| 24 | # ${STAGING_LIBDIR} | ||
| 25 | # #{STAGING_DIR_HOST} | ||
| 26 | # TARGET_LDFLAGS ????? | ||
| 27 | #RUSTC_BUILD_LDFLAGS = "\ | ||
| 28 | # --sysroot ${STAGING_DIR_NATIVE} \ | ||
| 29 | # -L${STAGING_LIBDIR_NATIVE} \ | ||
| 30 | # -L${STAGING_BASE_LIBDIR_NATIVE} \ | ||
| 31 | #" | ||
| 32 | |||
| 33 | # XXX: for some reason bitbake sets BUILD_* & TARGET_* but uses the bare | ||
| 34 | # variables for HOST. Alias things to make it easier for us. | ||
| 35 | HOST_LDFLAGS ?= "${LDFLAGS}" | ||
| 36 | HOST_CFLAGS ?= "${CFLAGS}" | ||
| 37 | HOST_CXXFLAGS ?= "${CXXFLAGS}" | ||
| 38 | HOST_CPPFLAGS ?= "${CPPFLAGS}" | ||
| 39 | |||
| 40 | rustlib_suffix="${TUNE_ARCH}${TARGET_VENDOR}-${TARGET_OS}/rustlib/${HOST_SYS}/lib" | ||
| 41 | # Native sysroot standard library path | ||
| 42 | rustlib_src="${prefix}/lib/${rustlib_suffix}" | ||
| 43 | # Host sysroot standard library path | ||
| 44 | rustlib="${libdir}/${rustlib_suffix}" | ||
| 45 | rustlib:class-native="${libdir}/rustlib/${BUILD_SYS}/lib" | ||
