broken more

This commit is contained in:
Cody P Schafer
2014-11-13 17:12:15 -05:00
parent d1c3e49ac2
commit e2d129ca8c
4 changed files with 149 additions and 78 deletions
+14 -19
View File
@@ -1,7 +1,5 @@
RUSTC = "rustc"
RUSTC_ARCHFLAGS += "--target=target"
RUSTC_ARCHFLAGS += "--target=${TARGET_SYS} -C rpath"
# BUILD_LDFLAGS
# ${STAGING_LIBDIR_NATIVE}
@@ -19,7 +17,10 @@ RUSTC_ARCHFLAGS += "--target=target"
RUST_PATH_NATIVE="${STAGING_LIBDIR_NATIVE}:${STAGING_BASE_LIBDIR_NATIVE}"
# FIXME: set based on whether we are native vs cross vs buildsdk, etc
RUST_PATH = "${RUST_PATH_NATIVE}"
export RUST_PATH ??= "${RUST_PATH_NATIVE}"
# FIXME: set this to something (sysroot?) for each of target,native,cross
export RUST_TARGET_PATH = "${datadir}/rust/target"
CARGO = "cargo"
@@ -38,25 +39,20 @@ oe_cargo_config () {
# NOTE: we cannot pass more flags via this interface, the 'linker' is
# assumed to be a path to a binary. If flags are needed, a wrapper must
# be used.
cat >.cargo/config <<EOF
paths = [
EOF
for p in ${OECARGO_PATH}; do
printf "\"%s\" " "$p"
done | sed -e 's/[ \n]+/,/g' -e 's/,$//' >>.cargo/config
cat >>.cargo/config <<EOF
]
echo "paths = [" >.cargo/config
[target.${RUST_TARGET_SYS}]
ar = "${TARGET_PREFIX}ar"
linker = "${TARGET_PREFIX}gcc"
EOF
for p in ${OECARGO_PATH}; do
printf "\"%s\" " "$p"
done | sed -e 's/[ \n]+/,/g' -e 's/,$//' >>.cargo/config
echo "]" >>.cargo/config
}
oe_cargo_patch () {
cat >>Cargo.toml <<EOF
[profile.dev]
rpath = true
[profile.release]
rpath = true
EOF
}
@@ -64,8 +60,7 @@ oe_runcargo_build () {
# FIXME: if there is already an entry for this target, in an existing
# cargo/config, this won't work.
which cargo
bbnote ${CARGO} build --target ${RUST_TARGET_SYS} "$@"
bbnote ${CARGO} build --target ${TARGET_SYS} "$@"
oe_cargo_config
export RUST_PATH="${RUST_PATH}"
"${CARGO}" build -v --target "${RUST_TARGET_SYS}" --release "$@"
"${CARGO}" build -v --target "${TARGET_SYS}" --release "$@"
}