aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2024-04-08 18:33:38 +0200
committerThomas Schwinge <tschwinge@baylibre.com>2024-04-15 13:03:35 +0200
commit3e1e73fc99584440e5967577f2049573eeaf4596 (patch)
tree93d83541e76e625f388ad305c7c7c77dee82499e /configure.ac
parente3fda76af4f342ad1ba8bd901a72d811e8357e99 (diff)
build: Check for cargo when building rust language
Prevent rust language from building when cargo is missing. config/ChangeLog: * acx.m4: Add a macro to check for rust components. ChangeLog: * configure: Regenerate. * configure.ac: Emit an error message when cargo is missing. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac18
1 files changed, 18 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 1a19c07a27b..a0191e5c1e0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1411,6 +1411,7 @@ fi
ACX_PROG_GNAT
ACX_PROG_GDC
+ACX_PROG_CARGO
ACX_PROG_CMP_IGNORE_INITIAL
AC_ARG_ENABLE([bootstrap],
@@ -2305,6 +2306,23 @@ directories, to avoid imposing the performance cost of
;;
esac
+ # Disable Rust if cargo is unavailable.
+ case ${add_this_lang}:${language}:${have_cargo} in
+ yes:rust:no)
+ # Specifically requested language; tell them.
+ AC_MSG_ERROR([cargo is required to build $language])
+ ;;
+ all:rust:no)
+ AC_MSG_WARN([cargo is required to build $language])
+ add_this_lang=unsupported
+ ;;
+ *:rust:no)
+ # Silently disable.
+ add_this_lang=unsupported
+ ;;
+ esac
+
+
# Disable a language that is unsupported by the target.
case "${add_this_lang}: $unsupported_languages " in
no:*) ;;