All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] configure: Don't permit SDL or GTK on OSX
@ 2015-08-14 15:10 Peter Maydell
  2015-08-14 15:27 ` Daniel P. Berrange
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Peter Maydell @ 2015-08-14 15:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Programmingkid, Andreas Färber, patches

The cocoa GUI frontend assumes it is the only GUI (it redefines
main() so it always gets control before the rest of QEMU), so
it does not play well with other UIs like SDL or GTK. (Mostly
people building QEMU on OSX don't have the necessary dependencies
available for configure to build those other front ends, so
mostly this problem goes unnoticed.)

Make configure automatically disable the SDL and GTK front ends
if the cocoa front end is enabled. (We were sort of attempting
to do this for SDL before, but not in a way that worked very well.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
In an ideal world, we'd fix the Cocoa UI front end to play nicely
with others, but in the meantime, let's at least give a helpful
message to users if they try to select combinations of configure
options that won't work.

 configure | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/configure b/configure
index cd219d8..826858e 100755
--- a/configure
+++ b/configure
@@ -956,7 +956,6 @@ for opt do
   ;;
   --enable-cocoa)
       cocoa="yes" ;
-      sdl="no" ;
       audio_drv_list="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
   ;;
   --disable-system) softmmu="no"
@@ -1711,6 +1710,21 @@ else
 fi
 
 ##########################################
+# cocoa implies not SDL or GTK
+# (the cocoa UI code currently assumes it is always the active UI
+# and doesn't interact well with other UI frontend code)
+if test "$cocoa" = "yes"; then
+    if test "$sdl" = "yes"; then
+        error_exit "Cocoa and SDL UIs cannot both be enabled at once"
+    fi
+    if test "$gtk" = "yes"; then
+        error_exit "Cocoa and GTK UIs cannot both be enabled at once"
+    fi
+    gtk=no
+    sdl=no
+fi
+
+##########################################
 # L2TPV3 probe
 
 cat > $TMPC <<EOF
@@ -2287,9 +2301,7 @@ EOF
     if test "$_sdlversion" -lt 121 ; then
       sdl_too_old=yes
     else
-      if test "$cocoa" = "no" ; then
-        sdl=yes
-      fi
+      sdl=yes
     fi
 
     # static link with sdl ? (note: sdl.pc's --static --libs is broken)
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: Don't permit SDL or GTK on OSX
  2015-08-14 15:10 [Qemu-devel] [PATCH] configure: Don't permit SDL or GTK on OSX Peter Maydell
@ 2015-08-14 15:27 ` Daniel P. Berrange
  2015-08-14 18:36 ` Programmingkid
  2015-08-19 19:30 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel P. Berrange @ 2015-08-14 15:27 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Programmingkid, Andreas Färber, qemu-devel, patches

On Fri, Aug 14, 2015 at 04:10:52PM +0100, Peter Maydell wrote:
> The cocoa GUI frontend assumes it is the only GUI (it redefines
> main() so it always gets control before the rest of QEMU), so
> it does not play well with other UIs like SDL or GTK. (Mostly
> people building QEMU on OSX don't have the necessary dependencies
> available for configure to build those other front ends, so
> mostly this problem goes unnoticed.)
> 
> Make configure automatically disable the SDL and GTK front ends
> if the cocoa front end is enabled. (We were sort of attempting
> to do this for SDL before, but not in a way that worked very well.)
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> In an ideal world, we'd fix the Cocoa UI front end to play nicely
> with others, but in the meantime, let's at least give a helpful
> message to users if they try to select combinations of configure
> options that won't work.
> 
>  configure | 20 ++++++++++++++++----
>  1 file changed, 16 insertions(+), 4 deletions(-)

Reviewed-by: Daniel P. berrange <berrange@redhat.com>

> 
> diff --git a/configure b/configure
> index cd219d8..826858e 100755
> --- a/configure
> +++ b/configure
> @@ -956,7 +956,6 @@ for opt do
>    ;;
>    --enable-cocoa)
>        cocoa="yes" ;
> -      sdl="no" ;
>        audio_drv_list="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
>    ;;
>    --disable-system) softmmu="no"
> @@ -1711,6 +1710,21 @@ else
>  fi
>  
>  ##########################################
> +# cocoa implies not SDL or GTK
> +# (the cocoa UI code currently assumes it is always the active UI
> +# and doesn't interact well with other UI frontend code)
> +if test "$cocoa" = "yes"; then
> +    if test "$sdl" = "yes"; then
> +        error_exit "Cocoa and SDL UIs cannot both be enabled at once"
> +    fi
> +    if test "$gtk" = "yes"; then
> +        error_exit "Cocoa and GTK UIs cannot both be enabled at once"
> +    fi
> +    gtk=no
> +    sdl=no
> +fi
> +
> +##########################################
>  # L2TPV3 probe
>  
>  cat > $TMPC <<EOF
> @@ -2287,9 +2301,7 @@ EOF
>      if test "$_sdlversion" -lt 121 ; then
>        sdl_too_old=yes
>      else
> -      if test "$cocoa" = "no" ; then
> -        sdl=yes
> -      fi
> +      sdl=yes
>      fi
>  
>      # static link with sdl ? (note: sdl.pc's --static --libs is broken)
> -- 
> 1.9.1
> 
> 

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: Don't permit SDL or GTK on OSX
  2015-08-14 15:10 [Qemu-devel] [PATCH] configure: Don't permit SDL or GTK on OSX Peter Maydell
  2015-08-14 15:27 ` Daniel P. Berrange
@ 2015-08-14 18:36 ` Programmingkid
  2015-08-19 19:30 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Programmingkid @ 2015-08-14 18:36 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Andreas Färber, qemu-devel, patches


On Aug 14, 2015, at 11:10 AM, Peter Maydell wrote:

> The cocoa GUI frontend assumes it is the only GUI (it redefines
> main() so it always gets control before the rest of QEMU), so
> it does not play well with other UIs like SDL or GTK. (Mostly
> people building QEMU on OSX don't have the necessary dependencies
> available for configure to build those other front ends, so
> mostly this problem goes unnoticed.)
> 
> Make configure automatically disable the SDL and GTK front ends
> if the cocoa front end is enabled. (We were sort of attempting
> to do this for SDL before, but not in a way that worked very well.)
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> In an ideal world, we'd fix the Cocoa UI front end to play nicely
> with others, but in the meantime, let's at least give a helpful
> message to users if they try to select combinations of configure
> options that won't work.
> 
> configure | 20 ++++++++++++++++----
> 1 file changed, 16 insertions(+), 4 deletions(-)
> 
> diff --git a/configure b/configure
> index cd219d8..826858e 100755
> --- a/configure
> +++ b/configure
> @@ -956,7 +956,6 @@ for opt do
>   ;;
>   --enable-cocoa)
>       cocoa="yes" ;
> -      sdl="no" ;
>       audio_drv_list="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
>   ;;
>   --disable-system) softmmu="no"
> @@ -1711,6 +1710,21 @@ else
> fi
> 
> ##########################################
> +# cocoa implies not SDL or GTK
> +# (the cocoa UI code currently assumes it is always the active UI
> +# and doesn't interact well with other UI frontend code)
> +if test "$cocoa" = "yes"; then
> +    if test "$sdl" = "yes"; then
> +        error_exit "Cocoa and SDL UIs cannot both be enabled at once"
> +    fi
> +    if test "$gtk" = "yes"; then
> +        error_exit "Cocoa and GTK UIs cannot both be enabled at once"
> +    fi
> +    gtk=no
> +    sdl=no
> +fi
> +
> +##########################################
> # L2TPV3 probe
> 
> cat > $TMPC <<EOF
> @@ -2287,9 +2301,7 @@ EOF
>     if test "$_sdlversion" -lt 121 ; then
>       sdl_too_old=yes
>     else
> -      if test "$cocoa" = "no" ; then
> -        sdl=yes
> -      fi
> +      sdl=yes
>     fi
> 
>     # static link with sdl ? (note: sdl.pc's --static --libs is broken)
> -- 
> 1.9.1
> 

Works on Mac OS 10.6. 

Reviewed-by: John Arbuckle <programmingkidx@gmail.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: Don't permit SDL or GTK on OSX
  2015-08-14 15:10 [Qemu-devel] [PATCH] configure: Don't permit SDL or GTK on OSX Peter Maydell
  2015-08-14 15:27 ` Daniel P. Berrange
  2015-08-14 18:36 ` Programmingkid
@ 2015-08-19 19:30 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2015-08-19 19:30 UTC (permalink / raw)
  To: QEMU Developers; +Cc: Programmingkid, Andreas Färber, Patch Tracking

On 14 August 2015 at 16:10, Peter Maydell <peter.maydell@linaro.org> wrote:
> The cocoa GUI frontend assumes it is the only GUI (it redefines
> main() so it always gets control before the rest of QEMU), so
> it does not play well with other UIs like SDL or GTK. (Mostly
> people building QEMU on OSX don't have the necessary dependencies
> available for configure to build those other front ends, so
> mostly this problem goes unnoticed.)
>
> Make configure automatically disable the SDL and GTK front ends
> if the cocoa front end is enabled. (We were sort of attempting
> to do this for SDL before, but not in a way that worked very well.)
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Applied to master, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-08-19 19:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-14 15:10 [Qemu-devel] [PATCH] configure: Don't permit SDL or GTK on OSX Peter Maydell
2015-08-14 15:27 ` Daniel P. Berrange
2015-08-14 18:36 ` Programmingkid
2015-08-19 19:30 ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.