diff mbox series

[v3,04/26] configure: don't enable cross compilers unless in target_list

Message ID 20221020115209.1761864-5-alex.bennee@linaro.org
State New
Headers show
Series testing/next (docker, avocado, s390x, MAINTAINERS) | expand

Commit Message

Alex Bennée Oct. 20, 2022, 11:51 a.m. UTC
This avoids the unfortunate effect of always builds the pc-bios blobs
for targets the user isn't interested in.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 configure | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Richard Henderson Oct. 20, 2022, 10:10 p.m. UTC | #1
On 10/20/22 21:51, Alex Bennée wrote:
> This avoids the unfortunate effect of always builds the pc-bios blobs
> for targets the user isn't interested in.
> 
> Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>   configure | 9 +++++++++
>   1 file changed, 9 insertions(+)
> 
> diff --git a/configure b/configure
> index 81561be7c1..dd6f58dcde 100755
> --- a/configure
> +++ b/configure
> @@ -1877,6 +1877,15 @@ probe_target_compiler() {
>     container_cross_ranlib=
>     container_cross_strip=
>   
> +  # We shall skip configuring the target compiler if the user didn't
> +  # bother enabling an appropriate guest. This avoids building
> +  # extraneous firmware images and tests.
> +  if test "${target_list#*$1}" != "$1"; then
> +      break;
> +  else
> +      return 1
> +  fi
> +
>     target_arch=${1%%-*}
>     case $target_arch in
>       aarch64) container_hosts="x86_64 aarch64" ;;

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
Alex Bennée Jan. 2, 2023, 8:50 p.m. UTC | #2
Stefan Weil <sw@weilnetz.de> writes:

> Am 21.10.22 um 00:10 schrieb Richard Henderson:
>> On 10/20/22 21:51, Alex Bennée wrote:
>>> This avoids the unfortunate effect of always builds the pc-bios blobs
>>> for targets the user isn't interested in.
>>>
>>> Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
>>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>>> ---
>>>   configure | 9 +++++++++
>>>   1 file changed, 9 insertions(+)
>>>
>>> diff --git a/configure b/configure
>>> index 81561be7c1..dd6f58dcde 100755
>>> --- a/configure
>>> +++ b/configure
>>> @@ -1877,6 +1877,15 @@ probe_target_compiler() {
>>>     container_cross_ranlib=
>>>     container_cross_strip=
>>> +  # We shall skip configuring the target compiler if the user didn't
>>> +  # bother enabling an appropriate guest. This avoids building
>>> +  # extraneous firmware images and tests.
>>> +  if test "${target_list#*$1}" != "$1"; then
>>> +      break;
>
>
> Isn't break limited for exiting from for, while, or until loop? (*)
> If yes, it's wrongly used here. sh does not complain, but other
> shells do.

There is already a fix waiting in the PR:

  20221223172135.3450109-1-alex.bennee@linaro.org
  
>
> Stefan
>
> *) https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html
diff mbox series

Patch

diff --git a/configure b/configure
index 81561be7c1..dd6f58dcde 100755
--- a/configure
+++ b/configure
@@ -1877,6 +1877,15 @@  probe_target_compiler() {
   container_cross_ranlib=
   container_cross_strip=
 
+  # We shall skip configuring the target compiler if the user didn't
+  # bother enabling an appropriate guest. This avoids building
+  # extraneous firmware images and tests.
+  if test "${target_list#*$1}" != "$1"; then
+      break;
+  else
+      return 1
+  fi
+
   target_arch=${1%%-*}
   case $target_arch in
     aarch64) container_hosts="x86_64 aarch64" ;;