shutils/common.sh: define CARGO_BUILD_JOBS and

CARGO_TARGE_${RUST_TAGRGET}_LINKER.
This commit is contained in:
maxice8 2019-01-19 14:26:25 -02:00 committed by maxice8
parent 56460d9463
commit 54040e4b1b
1 changed files with 12 additions and 0 deletions

View File

@ -463,6 +463,11 @@ setup_pkg() {
export LDFLAGS_FOR_BUILD="$XBPS_LDFLAGS"
export FFLAGS_FOR_BUILD="$XBPS_FFLAGS"
# Define equivalent of TOML config in environment
# [build]
# jobs = $XBPS_MAKEJOBS
export CARGO_BUILD_JOBS="$XBPS_MAKEJOBS"
if [ -n "$cross" ]; then
# Regular tools names
export CC="${XBPS_CROSS_TRIPLET}-gcc"
@ -523,6 +528,13 @@ setup_pkg() {
export RUSTFLAGS="$XBPS_CROSS_RUSTFLAGS"
# Rust target, which differs from our triplets
export RUST_TARGET="$XBPS_CROSS_RUST_TARGET"
# Define equivalent of TOML config in environment
# [target.${RUST_TARGET}]
# linker = ${CC}
_XBPS_CROSS_RUST_TARGET_ENV="${XBPS_CROSS_RUST_TARGET^^}"
_XBPS_CROSS_RUST_TARGET_ENV="${_XBPS_CROSS_RUST_TARGET_ENV//-/_}"
export CARGO_TARGET_${_XBPS_CROSS_RUST_TARGET_ENV}_LINKER="$CC"
unset _XBPS_CROSS_RUST_TARGET_ENV
else
export CC="cc"
export CXX="g++"