Commit f0b76ab6 authored by Fabrice Fontaine's avatar Fabrice Fontaine

Add RUST_TARGET variable

Add RUST_TARGET environment variable through AC_ARG_VAR to allow the
user to override the rust target name. Indeed, using $host when
cross-compiling is not always the good option especially when vendor
part of target is not set to unknown but to another value such as
buildroot.
Indeed, in this case aarch64-buildroot-linux-gnu won't be recognised as
a valid target by rust/cargo.
Signed-off-by: Fabrice Fontaine's avatarFabrice Fontaine <fontaine.fabrice@gmail.com>
parent 978a87b3
......@@ -136,7 +136,7 @@ CARGO_RELEASE_ARGS=--release
endif
if CROSS_COMPILING
CARGO_TARGET_ARGS=--target=$(host)
CARGO_TARGET_ARGS=--target=$(RUST_TARGET)
endif
CARGO_VERBOSE = $(cargo_verbose_$(V))
......
......@@ -286,9 +286,14 @@ else
fi
AM_CONDITIONAL([DEBUG_RELEASE], [test "x$debug_release" = "xyes"])
AC_ARG_VAR(RUST_TARGET, [Set rust target (default=$host)])
if test "x$RUST_TARGET" == x; then
RUST_TARGET=$host
fi
AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes)
if test "x$cross_compiling" = "xyes" ; then
RUST_TARGET_SUBDIR="$host/$RUST_TARGET_SUBDIR"
RUST_TARGET_SUBDIR="$RUST_TARGET/$RUST_TARGET_SUBDIR"
fi
AC_SUBST([RUST_TARGET_SUBDIR])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment