diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-11-05 22:19:21 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-11-06 06:47:38 +0900 |
commit | 1454f8f219890b8134f68e868d8cb1d0a9d2aa20 (patch) | |
tree | 114d8258874bec8560e4485b05adc8110b85a7f8 /configure.ac | |
parent | 10fd1d9507a87bc9cdb1592cdb10c7890e52eb30 (diff) |
Add `--target` option to RUSTC when cross-compiling
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6677
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac index 7b0c6014b2..9e2ba81a51 100644 --- a/configure.ac +++ b/configure.ac @@ -3733,7 +3733,7 @@ AS_IF([test x"$MJIT_SUPPORT" = "xyes"], AC_SUBST(MJIT_SUPPORT) -AC_CHECK_TOOL(RUSTC, [rustc], [no]) +AC_CHECK_PROG(RUSTC, [rustc], [rustc], [no]) dnl no ac_tool_prefix dnl check if we can build YJIT on this target platform AS_CASE(["$target_cpu-$target_os"], @@ -3757,10 +3757,7 @@ AC_ARG_ENABLE(yjit, [ AS_IF([test x"$RUSTC" != "xno"], AS_IF([ echo "fn main() { let x = 1; format!(\"{x}\"); }" | $RUSTC - --emit asm=/dev/null ], - AS_IF([test x"$YJIT_TARGET_OK" != "xno"], - [YJIT_SUPPORT=yes], - [YJIT_SUPPORT=no] - ), + [YJIT_SUPPORT="$YJIT_TARGET_OK"], [YJIT_SUPPORT=no] ), [YJIT_SUPPORT=no] @@ -3776,10 +3773,10 @@ AS_CASE(["${YJIT_SUPPORT}"], AS_IF([test x"$enable_jit_support" = "xno"], AC_MSG_ERROR([--disable-jit-support but --enable-yjit. YJIT requires JIT support]) ) - AC_CHECK_TOOL(RUSTC, [rustc], [no]) AS_IF([test x"$RUSTC" = "xno"], AC_MSG_ERROR([rustc is required. Installation instructions available at https://www.rust-lang.org/tools/install]) ) + AS_IF([test "$cross_compiling" = yes], [RUSTC="$RUSTC --target=$target"]) AS_CASE(["${YJIT_SUPPORT}"], [yes], [ |