Skip to contentSkip to conversation

configure: Let SDL support be optional on OpenBSD

PATCH In review Philippe Mathieu-Daudé 3 participants 4 messages Jan 22, 2019 – Jan 24, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configure: Let SDL support be optional on OpenBSD

Currently if we try to build QEMU on OpenBSD with SDL disabled, we get:

  $ ./configure --cc=x86_64-unknown-openbsd6.1-gcc-4.9.4 --python=python2.7 --disable-sdl

ERROR: sdl not found or disabled, can not use sdl audio driver

Since SDL is not a requirement for OpenBSD, let it be optional (we remove it from $audio_drv_list but it stays available in $audio_possible_drivers). If no audio backends are available, QEMU falls back to the null driver.

This does not change the default behavior:

  $ ./configure --cc=x86_64-unknown-openbsd6.1-gcc-4.9.4 --python=python2.7
  SDL support       yes (1.2.15)

WARNING: Use of SDL 1.2 is deprecated and will be removed in
WARNING: future releases. Please switch to using SDL 2.0

GEN config-host.h
...

but allows to build without SDL:

  $ ./configure --cc=x86_64-unknown-openbsd6.1-gcc-4.9.4 --python=python2.7 --disable-sdl
  SDL support       no
  GEN     config-host.h
  ...

---
See https://lists.gnu.org/archive/html/qemu-devel/2019-01/msg02732.html

 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure +1 -1
index de768e2343..98fc4fa84a 100755
@@ -828,7 +828,7 @@ NetBSD)
 OpenBSD)
   bsd="yes"
   make="${MAKE-gmake}"
-  audio_drv_list="sdl"
+  audio_drv_list=""
   audio_possible_drivers="sdl"
   HOST_VARIANT_DIR="openbsd"
   supported_os="yes"
Signature · 1 line
2.20.1
#1 lore raw
Quoted 14 lines · Philippe Mathieu-Daudé

Currently if we try to build QEMU on OpenBSD with SDL disabled, we get:

  $ ./configure --cc=x86_64-unknown-openbsd6.1-gcc-4.9.4 --python=python2.7 --disable-sdl

ERROR: sdl not found or disabled, can not use sdl audio driver

Since SDL is not a requirement for OpenBSD, let it be optional (we remove it from $audio_drv_list but it stays available in $audio_possible_drivers). If no audio backends are available, QEMU falls back to the null driver.

configure NetBSD) · line 834

Quoted 8 lines
configure +1 -1
@@ -828,7 +828,7 @@ NetBSD)
 OpenBSD)
   bsd="yes"
   make="${MAKE-gmake}"
-  audio_drv_list="sdl"
+  audio_drv_list=""
   audio_possible_drivers="sdl"
   HOST_VARIANT_DIR="openbsd"
   supported_os="yes"

This will mean that configure will by default not enable a real audio backend, even if we do have sdl.

Looking at the logic, "audio_possible_drivers" is only used for printing the help message. The thing that drives which audio drivers to test with is "audio_drv_list", and the expectation is that you put things on that only if it's possible to build with them. (For instance we only add 'dsound' for mingw if the dsound.h header is present, and so on.)

So we need to do one of:
(1) only put "sdl" into audio_drv_list if SDL is available (this probably doesn't work as we haven't probed for SDL at the point where we initialize it)
(2) have the sdl probe delete "sdl" from audio_drv_list if the probe fails
(3) some more complicated restructuring :-)
(eg rather than having audio_drv_list be set to an initial list based on the host OS, just have a full list of drivers, insist that each has a proper probe routine, and use whichever ones we can successfully probe)

thanks
-- PMM

#2 lore raw
Quoted 35 lines · Peter Maydell
Quoted 14 lines · Philippe Mathieu-Daudé

Currently if we try to build QEMU on OpenBSD with SDL disabled, we get:

  $ ./configure --cc=x86_64-unknown-openbsd6.1-gcc-4.9.4 --python=python2.7 --disable-sdl

ERROR: sdl not found or disabled, can not use sdl audio driver

Since SDL is not a requirement for OpenBSD, let it be optional (we remove it from $audio_drv_list but it stays available in $audio_possible_drivers). If no audio backends are available, QEMU falls back to the null driver.

configure NetBSD) · line 834

Quoted 8 lines
configure +1 -1
@@ -828,7 +828,7 @@ NetBSD)
 OpenBSD)
   bsd="yes"
   make="${MAKE-gmake}"
-  audio_drv_list="sdl"
+  audio_drv_list=""
   audio_possible_drivers="sdl"
   HOST_VARIANT_DIR="openbsd"
   supported_os="yes"

This will mean that configure will by default not enable a real audio backend, even if we do have sdl.

Looking at the logic, "audio_possible_drivers" is only used for printing the help message. The thing that drives which audio drivers to test with is "audio_drv_list", and the expectation is that you put things on that only if it's possible to build with them. (For instance we only add 'dsound' for mingw if the dsound.h header is present, and so on.)

Quoted 6 lines

So we need to do one of:
(1) only put "sdl" into audio_drv_list if SDL is available (this probably doesn't work as we haven't probed for SDL at the point where we initialize it)
(2) have the sdl probe delete "sdl" from audio_drv_list if the probe fails

This one sounds reasonable to me.

Quoted 6 lines

(3) some more complicated restructuring :-)
(eg rather than having audio_drv_list be set to an initial list based on the host OS, just have a full list of drivers, insist that each has a proper probe routine, and use whichever ones we can successfully probe)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#3 lore raw
Quoted 28 lines · Daniel P. Berrangé
Quoted 27 lines · Peter Maydell
Quoted 14 lines · Philippe Mathieu-Daudé

Currently if we try to build QEMU on OpenBSD with SDL disabled, we get:

  $ ./configure --cc=x86_64-unknown-openbsd6.1-gcc-4.9.4 --python=python2.7 --disable-sdl

ERROR: sdl not found or disabled, can not use sdl audio driver

Since SDL is not a requirement for OpenBSD, let it be optional (we remove it from $audio_drv_list but it stays available in $audio_possible_drivers). If no audio backends are available, QEMU falls back to the null driver.

configure NetBSD) · line 834

Quoted 8 lines
configure +1 -1
@@ -828,7 +828,7 @@ NetBSD)
 OpenBSD)
   bsd="yes"
   make="${MAKE-gmake}"
-  audio_drv_list="sdl"
+  audio_drv_list=""
   audio_possible_drivers="sdl"
   HOST_VARIANT_DIR="openbsd"
   supported_os="yes"

This will mean that configure will by default not enable a real audio backend, even if we do have sdl.

Quoted 7 lines
Quoted 7 lines

Looking at the logic, "audio_possible_drivers" is only used for printing the help message. The thing that drives which audio drivers to test with is "audio_drv_list", and the expectation is that you put things on that only if it's possible to build with them. (For instance we only add 'dsound' for mingw if the dsound.h header is present, and so on.)

Yes sorry I missed that Peter :S

Quoted 8 lines
Quoted 6 lines

So we need to do one of:
(1) only put "sdl" into audio_drv_list if SDL is available (this probably doesn't work as we haven't probed for SDL at the point where we initialize it)
(2) have the sdl probe delete "sdl" from audio_drv_list if the probe fails

This one sounds reasonable to me.

I went this way, but encountered unexpected problems, which makes me wonder who really use OpenBSD... Anyway the discussion deserves another thread.

Quoted 11 lines
Quoted 6 lines

(3) some more complicated restructuring :-)
(eg rather than having audio_drv_list be set to an initial list based on the host OS, just have a full list of drivers, insist that each has a proper probe routine, and use whichever ones we can successfully probe)

Regards,
Daniel