[vlc-commits] [Git][videolan/vlc][master] configure: add rust (--enable-rust) modules

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Fri Jul 7 20:58:08 UTC 2023



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
64699b81 by Loïc at 2023-07-07T20:24:47+00:00
configure: add rust (--enable-rust) modules

This add an --enable-rust option in the configure that checks for the
presence of rustc and cargo (Rust package manager and build system).
The option is disable by default.

- - - - -


1 changed file:

- configure.ac


Changes:

=====================================
configure.ac
=====================================
@@ -1838,6 +1838,34 @@ AS_IF([test "${enable_sout}" != "no"], [
 ])
 AM_CONDITIONAL([ENABLE_SOUT], [test "${enable_sout}" != "no"])
 
+dnl
+dnl Rust Modules
+dnl
+AC_ARG_ENABLE([rust],
+  AS_HELP_STRING([--enable-rust],
+    [enable building Rust modules (default disabled)]))
+AS_IF([test "${enable_rust}" = "yes"],[
+  AC_CHECK_PROGS(RUSTC, [rustc], [no])
+  AS_IF([test "$RUSTC" = "no"],[
+    AC_MSG_ERROR([rustc not found but required to build Rust modules])
+  ])
+  AS_IF([test "${host}" = "${build}"],[
+    AC_CACHE_CHECK([rustc host target], [ac_cv_rustc_host_target],
+                     [ac_cv_rustc_host_target=$($RUSTC --verbose --version | grep "host:" | cut -d" " -f2-)])
+    AS_IF([test -n "${ac_cv_rustc_host_target}"],
+           [AC_SUBST([RUST_TARGET], ["$ac_cv_rustc_host_target"])],
+           [AC_MSG_ERROR(failed to extract rustc host target)])
+  ],[
+    AC_MSG_ERROR([cross compilation is not yet supported for Rust modules (${host} != ${build})])
+  ])
+  AC_CHECK_PROGS(CARGO, [cargo], [no])
+  AS_IF([test "$CARGO" = "no"],[
+    AC_MSG_ERROR([cargo not found. cargo is required to build Rust modules])
+  ])
+  AC_DEFINE(ENABLE_RUST, 1, [Define to 1 for building rust modules.])
+])
+AM_CONDITIONAL([HAVE_RUST], [test "${enable_rust}" = "yes"])
+
 dnl Lua modules
 AC_ARG_ENABLE([lua],
   AS_HELP_STRING([--disable-lua],



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/64699b81bda213c81e8069e00ba5eba7b37e1439

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/64699b81bda213c81e8069e00ba5eba7b37e1439
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list