Skip to contentSkip to conversation

configure: add '--disable-cocoa' switch

PATCH In review Pavel Borzenkov 4 participants 7 messages Nov 9, 2011 – Nov 11, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configure: add '--disable-cocoa' switch

When SDL support is disabled, there is no way to build QEMU without Cocoa support on MacOS X. This patch adds '--disable-cocoa' switch and allows to build QEMU without both SDL and Cocoa frontends.

---
 configure |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
configure +6 -5
index 9e5da44..ba3a830 100755
@@ -669,6 +669,8 @@ for opt do
   ;;
   --enable-profiler) profiler="yes"
   ;;
+  --disable-cocoa) cocoa="no"
+  ;;
   --enable-cocoa)
       cocoa="yes" ;
       sdl="no" ;
@@ -979,7 +981,10 @@ echo "  --disable-sdl            disable SDL"
 echo "  --enable-sdl             enable SDL"
 echo "  --disable-vnc            disable VNC"
 echo "  --enable-vnc             enable VNC"
-echo "  --enable-cocoa           enable COCOA (Mac OS X only)"
+if test "$darwin" = "yes" ; then
+    echo "  --disable-cocoa          disable COCOA"
+    echo "  --enable-cocoa           enable COCOA"
+fi
 echo "  --audio-drv-list=LIST    set audio drivers list:"
 echo "                           Available drivers: $audio_possible_drivers"
 echo "  --audio-card-list=LIST   set list of emulated audio cards [$audio_card_list]"
@@ -1424,10 +1429,6 @@ EOF
   if compile_prog "$sdl_cflags" "$sdl_libs" ; then
     if test "$_sdlversion" -lt 121 ; then
       sdl_too_old=yes
-    else
-      if test "$cocoa" = "no" ; then
-        sdl=yes
-      fi
     fi
 
     # static link with sdl ? (note: sdl.pc's --static --libs is broken)
Signature · 1 line
1.7.5.4
#1 lore raw

Am 09.11.2011 19:54, schrieb Pavel Borzenkov:

Quoted 5 lines

When SDL support is disabled, there is no way to build QEMU without Cocoa support on MacOS X. This patch adds '--disable-cocoa' switch and allows to build QEMU without both SDL and Cocoa frontends.

This is a new feature and therefore too late for 1.0. Only bugfixes now.

I remember there was a similar patch once but some issue with it kept us from applying it - something unrelated to the frontend was influenced by it I think... block layer?

Quoted 10 lines
---
 configure |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
configure +0 -0
index 9e5da44..ba3a830 100755

configure EOF · line 1430

Quoted 7 lines
configure +0 -4
@@ -1424,10 +1429,6 @@ EOF
   if compile_prog "$sdl_cflags" "$sdl_libs" ; then
     if test "$_sdlversion" -lt 121 ; then
       sdl_too_old=yes
-    else
-      if test "$cocoa" = "no" ; then
-        sdl=yes
-      fi

Without looking at the context, this hunk looks weird. You sure you're not breaking the SDL default for other platforms?

configure EOF · line 1434

Quoted 3 lines
configure +0 -0
     fi
 
     # static link with sdl ? (note: sdl.pc's --static --libs is broken)

Anyway, I would much more appreciate a bugfix or suggestion how to make Cocoa build than to disable it altogether (and then only based on a configure option).

Andreas

#2 lore raw
Quoted 3 lines · Andreas Färber

I remember there was a similar patch once but some issue with it kept us from applying it - something unrelated to the frontend was influenced by it I think... block layer?

Yeah, block/raw-posix.c has a pile of #ifdef CONFIG_COCOA in it, which it looks like it's using to mean "am I on MacOSX?"

-- PMM

#3 lore raw
Quoted 7 lines · Peter Maydell
Quoted 3 lines · Andreas Färber

I remember there was a similar patch once but some issue with it kept us from applying it - something unrelated to the frontend was influenced by it I think... block layer?

Yeah, block/raw-posix.c has a pile of #ifdef CONFIG_COCOA in it, which it looks like it's using to mean "am I on MacOSX?"

Yes, I see it now. I'll modify the file to use some pre-defined Mac OS X macro, so CONFIG_COCOA will control only Cocoa frontend build.

Signature · 1 line
Pavel
Quoted 3 lines

-- PMM

#4 lore raw
Quoted 6 lines · Pavel Borzenkov
Quoted 5 lines · Peter Maydell
Quoted 3 lines · Andreas Färber

I remember there was a similar patch once but some issue with it kept us from applying it - something unrelated to the frontend was influenced by it I think... block layer?

Quoted 7 lines
Quoted 2 lines

Yeah, block/raw-posix.c has a pile of #ifdef CONFIG_COCOA in it, which it looks like it's using to mean "am I on MacOSX?"

Yes, I see it now. I'll modify the file to use some pre-defined Mac OS X macro, so CONFIG_COCOA will control only Cocoa frontend build.

From last time this came up, to save you reinventing the wheel:

http://lists.gnu.org/archive/html/qemu-devel/2011-05/msg03158.html

-- PMM

#5 lore raw
In reply to Andreas Färber
Quoted 22 lines · Andreas Färber

Am 09.11.2011 19:54, schrieb Pavel Borzenkov:

Quoted 5 lines

When SDL support is disabled, there is no way to build QEMU without Cocoa support on MacOS X. This patch adds '--disable-cocoa' switch and allows to build QEMU without both SDL and Cocoa frontends.

This is a new feature and therefore too late for 1.0. Only bugfixes now.

I remember there was a similar patch once but some issue with it kept us from applying it - something unrelated to the frontend was influenced by it I think... block layer?

Quoted 8 lines

---
 configure |   11 ++++++-----

 1 files changed, 6 insertions(+), 5 deletions(-)
configure +0 -0
index 9e5da44..ba3a830 100755
Quoted 11 lines
Quoted 8 lines
configure +0 -0
@@ -1424,10 +1429,6 @@ EOF

   if compile_prog "$sdl_cflags" "$sdl_libs" ; then if test "$_sdlversion" -lt 121 ; then sdl_too_old=yes
-    else
-      if test "$cocoa" = "no" ; then
-        sdl=yes
-      fi

Without looking at the context, this hunk looks weird. You sure you're not breaking the SDL default for other platforms?

Yeah, I did break it, at least for Linux. I'll fix this in the next version.

Signature · 1 line
Pavel
Quoted 12 lines
Quoted 4 lines

     fi

     # static link with sdl ? (note: sdl.pc's --static --libs is broken)

Anyway, I would much more appreciate a bugfix or suggestion how to make Cocoa build than to disable it altogether (and then only based on a configure option).

Andreas

#6 lore raw
In reply to Pavel Borzenkov
Quoted 5 lines · Pavel Borzenkov

When SDL support is disabled, there is no way to build QEMU without Cocoa support on MacOS X. This patch adds '--disable-cocoa' switch and allows to build QEMU without both SDL and Cocoa frontends.

This breaks SDL probing on Linux.

Quoted 30 lines
---
  configure |   11 ++++++-----
  1 files changed, 6 insertions(+), 5 deletions(-)
configure +6 -1
index 9e5da44..ba3a830 100755
@@ -669,6 +669,8 @@ for opt do
    ;;
    --enable-profiler) profiler="yes"
    ;;
+  --disable-cocoa) cocoa="no"
+  ;;
    --enable-cocoa)
        cocoa="yes" ;
        sdl="no" ;
@@ -979,7 +981,10 @@ echo "  --disable-sdl            disable SDL"
  echo "  --enable-sdl             enable SDL"
  echo "  --disable-vnc            disable VNC"
  echo "  --enable-vnc             enable VNC"
-echo "  --enable-cocoa           enable COCOA (Mac OS X only)"
+if test "$darwin" = "yes" ; then
+    echo "  --disable-cocoa          disable COCOA"
+    echo "  --enable-cocoa           enable COCOA"
+fi
  echo "  --audio-drv-list=LIST    set audio drivers list:"
  echo "                           Available drivers: $audio_possible_drivers"
  echo "  --audio-card-list=LIST   set list of emulated audio cards [$audio_card_list]"

configure EOF · line 1430

Quoted 7 lines
configure +0 -4
@@ -1424,10 +1429,6 @@ EOF
    if compile_prog "$sdl_cflags" "$sdl_libs" ; then
      if test "$_sdlversion" -lt 121 ; then
        sdl_too_old=yes
-    else
-      if test "$cocoa" = "no" ; then
-        sdl=yes
-      fi

This is what normally enables SDL.

Regards,

Anthony Liguori

Quoted 3 lines
configure +0 -0
      fi
 
      # static link with sdl ? (note: sdl.pc's --static --libs is broken)