From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1643) id 0E9CE3858D35; Tue, 16 Apr 2024 07:44:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0E9CE3858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713253457; bh=ajxu/QP8z55yD9ZfLcKlg5uaK+BsW0u5xqTNd/OIQu8=; h=From:To:Subject:Date:From; b=IqYpOwi3nPDFptrIAX4BehPciLxHrP9vEre+DPdVdMG7NMuBfnBQQcxHTG1rzlrPU zJHmu6SbF8WOuF8ohBmI/EISF7tswt4J+GmOsLZ/TqxjAVxzzFSRkQ3dBu4l30o8l1 xGP9lJbG0bZnmiH4hQOasLnD8PlNS/BV/CTFs11M= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Thomas Schwinge To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-9988] build: Don't check for host-prefixed 'cargo' program X-Act-Checkin: gcc X-Git-Author: Thomas Schwinge X-Git-Refname: refs/heads/trunk X-Git-Oldrev: 79ff53453e88e40c4f2ecf6f7f7409afc41b46fc X-Git-Newrev: 3ebc7898a55988e84ab3625700a827e3e82b016f Message-Id: <20240416074417.0E9CE3858D35@sourceware.org> Date: Tue, 16 Apr 2024 07:44:16 +0000 (GMT) List-Id: https://gcc.gnu.org/g:3ebc7898a55988e84ab3625700a827e3e82b016f commit r14-9988-g3ebc7898a55988e84ab3625700a827e3e82b016f Author: Thomas Schwinge Date: Mon Apr 15 13:33:48 2024 +0200 build: Don't check for host-prefixed 'cargo' program Follow-up to commit 3e1e73fc99584440e5967577f2049573eeaf4596 "build: Check for cargo when building rust language": On 2024-04-15T13:14:42+0200, I wrote: > I now wonder: instead of 'AC_CHECK_TOOL', shouldn't this use > 'AC_CHECK_PROG'? (We always want plain 'cargo', not host-prefixed > 'aarch64-linux-gnu-cargo' etc., right?) I'll look into changing this. * configure: Regenerate. config/ * acx.m4 (ACX_PROG_CARGO): Use 'AC_CHECK_PROGS'. Diff: --- config/acx.m4 | 3 +-- configure | 64 +++++++---------------------------------------------------- 2 files changed, 8 insertions(+), 59 deletions(-) diff --git a/config/acx.m4 b/config/acx.m4 index 3c5fe67342e..c45e55e7f51 100644 --- a/config/acx.m4 +++ b/config/acx.m4 @@ -427,8 +427,7 @@ fi # Test for Rust # We require cargo and rustc for some parts of the rust compiler. AC_DEFUN([ACX_PROG_CARGO], -[AC_REQUIRE([AC_CHECK_TOOL_PREFIX]) -AC_CHECK_TOOL(CARGO, cargo, no) +[AC_CHECK_PROGS(CARGO, cargo, no) if test "x$CARGO" != xno; then have_cargo=yes else diff --git a/configure b/configure index 705fc6b19e2..1a5513ce061 100755 --- a/configure +++ b/configure @@ -5787,10 +5787,10 @@ else have_gdc=no fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cargo", so it can be a program name with args. -set dummy ${ac_tool_prefix}cargo; ac_word=$2 +for ac_prog in cargo +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CARGO+:} false; then : @@ -5806,7 +5806,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CARGO="${ac_tool_prefix}cargo" + ac_cv_prog_CARGO="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -5826,59 +5826,9 @@ $as_echo "no" >&6; } fi -fi -if test -z "$ac_cv_prog_CARGO"; then - ac_ct_CARGO=$CARGO - # Extract the first word of "cargo", so it can be a program name with args. -set dummy cargo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CARGO+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CARGO"; then - ac_cv_prog_ac_ct_CARGO="$ac_ct_CARGO" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CARGO="cargo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi + test -n "$CARGO" && break done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CARGO=$ac_cv_prog_ac_ct_CARGO -if test -n "$ac_ct_CARGO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CARGO" >&5 -$as_echo "$ac_ct_CARGO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CARGO" = x; then - CARGO="no" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CARGO=$ac_ct_CARGO - fi -else - CARGO="$ac_cv_prog_CARGO" -fi +test -n "$CARGO" || CARGO="no" if test "x$CARGO" != xno; then have_cargo=yes