On Wed, Jun 19, 2024 at 11:13:58PM +0300, Manos Pitsidianakis wrote:
Add options for Rust in meson_options.txt, meson.build, configure to
prepare for adding Rust code in the followup commits.
`rust` is a reserved meson name, so we have to use an alternative.
`with_rust` was chosen.
A cargo_wrapper.py script is added that is heavily based on the work of
Marc-André Lureau from 2021.
https://patchew.org/QEMU/20210907121943.3498701-1-marcandre.lureau@redhat.com/
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
---
MAINTAINERS | 5 +
configure | 11 ++
meson.build | 11 ++
meson_options.txt | 4 +
scripts/cargo_wrapper.py | 279 ++++++++++++++++++++++++++++++++++
scripts/meson-buildoptions.sh | 6 +
6 files changed, 316 insertions(+)
create mode 100644 scripts/cargo_wrapper.py
diff --git a/configure b/configure
index 38ee257701..6894d7c2d1 100755
--- a/configure
+++ b/configure
@@ -302,6 +302,9 @@ else
objcc="${objcc-${cross_prefix}clang}"
fi
[..snip..]
+with_rust_target_triple=""
+
ar="${AR-${cross_prefix}ar}"
as="${AS-${cross_prefix}as}"
ccas="${CCAS-$cc}"
@@ -760,6 +763,12 @@ for opt do
;;
--gdb=*) gdb_bin="$optarg"
;;
+ --enable-with-rust) with_rust=enabled
+ ;;
+ --disable-with-rust) with_rust=disabled
+ ;;
--enable-with-XXX / --disable-with-XXX is pretty unsual naming.
Normally you'd see either --enable-XXX or --with-XXX and their
corresponding --disable-XXX or --without-XXX.