]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - configure.ac
doc: Remove references to FreeBSD 7 and older
[thirdparty/gcc.git] / configure.ac
index 1a19c07a27b84429bb48517ef58d157d8cb19cc8..042681c27be59fcc991a5bd573134ebadc1c05b5 100644 (file)
@@ -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,35 @@ directories, to avoid imposing the performance cost of
           ;;
         esac
 
+        # Pre-conditions to consider whether cargo being supported.
+        if test x"$have_cargo" = xyes \
+          && test x"$build" != x"$host"; then
+          # Until <https://github.com/Rust-GCC/gccrs/issues/2898>
+          # "'cargo' should build for the host system" is resolved:
+          AC_MSG_WARN([use of cargo not yet supported here in Canadian cross configurations])
+          have_cargo=no
+        else
+          # Assume that cargo-produced object files are compatible with what
+          # we're going to build here.
+          :
+        fi
+        # 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:*) ;;