Skip to contentSkip to conversation

configure: Only build s390-ccw BIOS when system emulation is built

PATCH In review Philippe Mathieu-Daudé 2 participants 2 messages Jan 25, 2021 – Jan 26, 2021

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 configure: Only build s390-ccw BIOS when system emulation is built

It is pointless to build the s390-ccw BIOS when only user-mode emulation is built. Only build it when s390 system mode emulation is selected.

---
v3: Restrict to s390x host (thuth)
v2: Restrict to s390x-softmmu target (thuth)

---
 configure | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
configure +7 -1
index dcc5ea7d630..4751d3e352d 100755
@@ -5372,8 +5372,14 @@ if { test "$cpu" = "i386" || test "$cpu" = "x86_64"; } && \
     done
 fi
 
+s390_ccw_bios=no
+# Only build s390-ccw bios if we're targetting s390x system emulation
+case $target_list in
+  *"s390x-softmmu"*) s390_ccw_bios=yes
+  ;;
+esac
 # Only build s390-ccw bios if we're on s390x and the compiler has -march=z900
-if test "$cpu" = "s390x" ; then
+if test "$cpu" = "s390x" && test "$s390_ccw_bios" = yes; then
   write_c_skeleton
   if compile_prog "-march=z900" ""; then
     roms="$roms s390-ccw"
Signature · 1 line
2.26.2
#1 lore raw
Quoted 19 lines · Philippe Mathieu-Daudé

It is pointless to build the s390-ccw BIOS when only user-mode emulation is built. Only build it when s390 system mode emulation is selected.

---
v3: Restrict to s390x host (thuth)
v2: Restrict to s390x-softmmu target (thuth)

---
  configure | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
configure +0 -0
index dcc5ea7d630..4751d3e352d 100755
@@ -5372,8 +5372,14 @@ if { test "$cpu" = "i386" || test "$cpu" = "x86_64"; } && \
      done
  fi

configure if { test "$cpu" = "i386" || test "$cpu" = "x86_64"; } && \ · line 5382

Quoted 10 lines
configure +7 -1
 
+s390_ccw_bios=no
+# Only build s390-ccw bios if we're targetting s390x system emulation
+case $target_list in
+  *"s390x-softmmu"*) s390_ccw_bios=yes
+  ;;
+esac
  # Only build s390-ccw bios if we're on s390x and the compiler has -march=z900
-if test "$cpu" = "s390x" ; then
+if test "$cpu" = "s390x" && test "$s390_ccw_bios" = yes; then

Looks good to me now ... but maybe it could even be done simpler (without the case statement) by simply doing:

if test "$cpu" = "s390x" && echo "$target_list" | grep -q s390x-softmmu ; then
...

?

Thomas