From: Thomas Schwinge <tschwinge@baylibre.com>
To: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>,
gcc-patches@gcc.gnu.org, gcc-rust@gcc.gnu.org
Cc: Arthur Cohen <arthur.cohen@embecosm.com>
Subject: build: Don't check for host-prefixed 'cargo' program (was: [PATCH] build: Check for cargo when building rust language)
Date: Mon, 15 Apr 2024 13:50:30 +0200 [thread overview]
Message-ID: <87a5luetfd.fsf@euler.schwinge.ddns.net> (raw)
In-Reply-To: <87edb6ev31.fsf@euler.schwinge.ddns.net>
[-- Attachment #1: Type: text/plain, Size: 849 bytes --]
Hi!
On 2024-04-15T13:14:42+0200, I wrote:
> On 2024-04-08T18:33:38+0200, pierre-emmanuel.patry@embecosm.com wrote:
>> The rust frontend requires cargo to build some of it's components,
>
> In GCC upstream still: 's%requires%is going to require'. ;-)
>
>> it's presence was not checked during configuration.
>
> After confirming the desired semantics/diagnostics, I've now pushed this
> to trunk branch in commit 3e1e73fc99584440e5967577f2049573eeaf4596
> "build: Check for cargo when building rust language".
>
>
> 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.
OK to push "build: Don't check for host-prefixed 'cargo' program", see
attached?
Grüße
Thomas
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-build-Don-t-check-for-host-prefixed-cargo-program.patch --]
[-- Type: text/x-diff, Size: 3979 bytes --]
From 913be0412665d02561f8aeb999860ce8d292c61e Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <tschwinge@baylibre.com>
Date: Mon, 15 Apr 2024 13:33:48 +0200
Subject: [PATCH] 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'.
---
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 dd96445ac4a..e254aa132b5 100755
--- a/configure
+++ b/configure
@@ -5818,10 +5818,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 :
@@ -5837,7 +5837,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
@@ -5857,59 +5857,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
--
2.34.1
next prev parent reply other threads:[~2024-04-15 11:50 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-08 16:33 [PATCH] build: Check for cargo when building rust language pierre-emmanuel.patry
2024-04-09 7:42 ` Richard Biener
2024-04-09 7:47 ` John Paul Adrian Glaubitz
2024-04-09 8:00 ` Jakub Jelinek
2024-04-09 8:29 ` John Paul Adrian Glaubitz
2024-04-09 10:40 ` Arthur Cohen
2024-04-09 8:55 ` Iain Sandoe
2024-04-09 12:01 ` Arthur Cohen
2024-04-09 10:09 ` Iain Sandoe
2024-04-09 13:53 ` Arthur Cohen
2024-04-09 14:12 ` Andrew Pinski
2024-04-09 14:25 ` Arthur Cohen
2024-04-15 11:14 ` Thomas Schwinge
2024-04-15 11:50 ` Thomas Schwinge [this message]
2024-04-15 12:18 ` build: Don't check for host-prefixed 'cargo' program Pierre-Emmanuel Patry
2024-04-15 12:44 ` build: Use of cargo not yet supported here in Canadian cross configurations (was: [PATCH] build: Check for cargo when building rust language) Thomas Schwinge
2024-04-15 16:36 ` build: Use of cargo not yet supported here in Canadian cross configurations Pierre-Emmanuel Patry
2024-04-16 8:55 ` Arthur Cohen
2024-04-16 20:34 ` [PATCH] build: Check for cargo when building rust language Andrew Pinski
2024-04-17 8:13 ` Rainer Orth
2024-04-17 14:54 ` Arthur Cohen
2024-04-23 8:52 ` Rainer Orth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a5luetfd.fsf@euler.schwinge.ddns.net \
--to=tschwinge@baylibre.com \
--cc=arthur.cohen@embecosm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=gcc-rust@gcc.gnu.org \
--cc=pierre-emmanuel.patry@embecosm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).