All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] Make GUI frontends optional on Mac OS X
@ 2011-11-10 18:40 Pavel Borzenkov
  2011-11-10 18:40 ` [Qemu-devel] [PATCH 1/3] raw-posix: Remove dead code Pavel Borzenkov
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Pavel Borzenkov @ 2011-11-10 18:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: andreas.faerber

After applying this small patch series, you'll be able to build QEMU on Mac OS
X without both SDL and Cocoa frontends.  First two patches deal with raw-posix,
which is the only CONFIG_COCOA user not related to GUI.  The third patch adds
'--disable-cocoa' switch to configure.

Pavel Borzenkov (3):
  raw-posix: Remove dead code
  raw-posix: Do not use CONFIG_COCOA macro
  configure: add '--disable-cocoa' switch

 block/raw-posix.c |   26 ++++----------------------
 configure         |    9 +++++++--
 2 files changed, 11 insertions(+), 24 deletions(-)

-- 
1.7.5.4

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

* [Qemu-devel] [PATCH 1/3] raw-posix: Remove dead code
  2011-11-10 18:40 [Qemu-devel] [PATCH 0/3] Make GUI frontends optional on Mac OS X Pavel Borzenkov
@ 2011-11-10 18:40 ` Pavel Borzenkov
  2011-12-14 12:03   ` Andreas Färber
  2011-11-10 18:40 ` [Qemu-devel] [PATCH 2/3] raw-posix: Do not use CONFIG_COCOA macro Pavel Borzenkov
  2011-11-10 18:40 ` [Qemu-devel] [PATCH 3/3] configure: add '--disable-cocoa' switch Pavel Borzenkov
  2 siblings, 1 reply; 13+ messages in thread
From: Pavel Borzenkov @ 2011-11-10 18:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: andreas.faerber

It was commented out since the initial import from svn.

Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
---
 block/raw-posix.c |   18 ------------------
 1 files changed, 0 insertions(+), 18 deletions(-)

diff --git a/block/raw-posix.c b/block/raw-posix.c
index a3de373..17e1c6f 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -37,7 +37,6 @@
 #include <IOKit/storage/IOMediaBSDClient.h>
 #include <IOKit/storage/IOMedia.h>
 #include <IOKit/storage/IOCDMedia.h>
-//#include <IOKit/storage/IOCDTypes.h>
 #include <CoreFoundation/CoreFoundation.h>
 #endif
 
@@ -279,23 +278,6 @@ static int raw_open(BlockDriverState *bs, const char *filename, int flags)
     return raw_open_common(bs, filename, flags, 0);
 }
 
-/* XXX: use host sector size if necessary with:
-#ifdef DIOCGSECTORSIZE
-        {
-            unsigned int sectorsize = 512;
-            if (!ioctl(fd, DIOCGSECTORSIZE, &sectorsize) &&
-                sectorsize > bufsize)
-                bufsize = sectorsize;
-        }
-#endif
-#ifdef CONFIG_COCOA
-        uint32_t blockSize = 512;
-        if ( !ioctl( fd, DKIOCGETBLOCKSIZE, &blockSize ) && blockSize > bufsize) {
-            bufsize = blockSize;
-        }
-#endif
-*/
-
 /*
  * Check if all memory in this vector is sector aligned.
  */
-- 
1.7.5.4

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

* [Qemu-devel] [PATCH 2/3] raw-posix: Do not use CONFIG_COCOA macro
  2011-11-10 18:40 [Qemu-devel] [PATCH 0/3] Make GUI frontends optional on Mac OS X Pavel Borzenkov
  2011-11-10 18:40 ` [Qemu-devel] [PATCH 1/3] raw-posix: Remove dead code Pavel Borzenkov
@ 2011-11-10 18:40 ` Pavel Borzenkov
  2011-11-30  0:38   ` Andreas Färber
  2011-11-10 18:40 ` [Qemu-devel] [PATCH 3/3] configure: add '--disable-cocoa' switch Pavel Borzenkov
  2 siblings, 1 reply; 13+ messages in thread
From: Pavel Borzenkov @ 2011-11-10 18:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: andreas.faerber

Use __APPLE__ and __MACH__ macros instead of CONFIG_COCOA to detect Mac
OS X host. The patch is based on the Ben Leslie's patch:
http://patchwork.ozlabs.org/patch/97859/

Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
---
 block/raw-posix.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/block/raw-posix.c b/block/raw-posix.c
index 17e1c6f..ee08f80 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -29,7 +29,7 @@
 #include "module.h"
 #include "block/raw-posix-aio.h"
 
-#ifdef CONFIG_COCOA
+#if defined(__APPLE__) && (__MACH__)
 #include <paths.h>
 #include <sys/param.h>
 #include <IOKit/IOKitLib.h>
@@ -487,7 +487,7 @@ again:
         }
         if (size == 0)
 #endif
-#ifdef CONFIG_COCOA
+#if defined(__APPLE__) && defined(__MACH__)
         size = LONG_LONG_MAX;
 #else
         size = lseek(fd, 0LL, SEEK_END);
@@ -632,7 +632,7 @@ static BlockDriver bdrv_file = {
 /***********************************************/
 /* host device */
 
-#ifdef CONFIG_COCOA
+#if defined(__APPLE__) && defined(__MACH__)
 static kern_return_t FindEjectableCDMedia( io_iterator_t *mediaIterator );
 static kern_return_t GetBSDPath( io_iterator_t mediaIterator, char *bsdPath, CFIndex maxPathSize );
 
@@ -710,7 +710,7 @@ static int hdev_open(BlockDriverState *bs, const char *filename, int flags)
 {
     BDRVRawState *s = bs->opaque;
 
-#ifdef CONFIG_COCOA
+#if defined(__APPLE__) && defined(__MACH__)
     if (strstart(filename, "/dev/cdrom", NULL)) {
         kern_return_t kernResult;
         io_iterator_t mediaIterator;
-- 
1.7.5.4

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

* [Qemu-devel] [PATCH 3/3] configure: add '--disable-cocoa' switch
  2011-11-10 18:40 [Qemu-devel] [PATCH 0/3] Make GUI frontends optional on Mac OS X Pavel Borzenkov
  2011-11-10 18:40 ` [Qemu-devel] [PATCH 1/3] raw-posix: Remove dead code Pavel Borzenkov
  2011-11-10 18:40 ` [Qemu-devel] [PATCH 2/3] raw-posix: Do not use CONFIG_COCOA macro Pavel Borzenkov
@ 2011-11-10 18:40 ` Pavel Borzenkov
  2011-12-08  0:41   ` Andreas Färber
  2 siblings, 1 reply; 13+ messages in thread
From: Pavel Borzenkov @ 2011-11-10 18:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: andreas.faerber

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.

Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
---
 configure |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/configure b/configure
index 401d9a6..4720bb2 100755
--- a/configure
+++ b/configure
@@ -670,6 +670,8 @@ for opt do
   ;;
   --enable-profiler) profiler="yes"
   ;;
+  --disable-cocoa) cocoa="no"
+  ;;
   --enable-cocoa)
       cocoa="yes" ;
       sdl="no" ;
@@ -980,7 +982,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 (default)"
+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]"
-- 
1.7.5.4

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

* Re: [Qemu-devel] [PATCH 2/3] raw-posix: Do not use CONFIG_COCOA macro
  2011-11-10 18:40 ` [Qemu-devel] [PATCH 2/3] raw-posix: Do not use CONFIG_COCOA macro Pavel Borzenkov
@ 2011-11-30  0:38   ` Andreas Färber
  2011-12-08  0:12     ` Andreas Färber
  0 siblings, 1 reply; 13+ messages in thread
From: Andreas Färber @ 2011-11-30  0:38 UTC (permalink / raw)
  To: Pavel Borzenkov; +Cc: Kevin Wolf, qemu-devel

Am 10.11.2011 19:40, schrieb Pavel Borzenkov:
> Use __APPLE__ and __MACH__ macros instead of CONFIG_COCOA to detect Mac
> OS X host. The patch is based on the Ben Leslie's patch:
> http://patchwork.ozlabs.org/patch/97859/
> 
> Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>

Reviewed-by: Andreas Färber <andreas.faerber@web.de>

Still in my queue for testing on a Mac though.

Andreas

> ---
>  block/raw-posix.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/block/raw-posix.c b/block/raw-posix.c
> index 17e1c6f..ee08f80 100644
> --- a/block/raw-posix.c
> +++ b/block/raw-posix.c
> @@ -29,7 +29,7 @@
>  #include "module.h"
>  #include "block/raw-posix-aio.h"
>  
> -#ifdef CONFIG_COCOA
> +#if defined(__APPLE__) && (__MACH__)
>  #include <paths.h>
>  #include <sys/param.h>
>  #include <IOKit/IOKitLib.h>
> @@ -487,7 +487,7 @@ again:
>          }
>          if (size == 0)
>  #endif
> -#ifdef CONFIG_COCOA
> +#if defined(__APPLE__) && defined(__MACH__)
>          size = LONG_LONG_MAX;
>  #else
>          size = lseek(fd, 0LL, SEEK_END);
> @@ -632,7 +632,7 @@ static BlockDriver bdrv_file = {
>  /***********************************************/
>  /* host device */
>  
> -#ifdef CONFIG_COCOA
> +#if defined(__APPLE__) && defined(__MACH__)
>  static kern_return_t FindEjectableCDMedia( io_iterator_t *mediaIterator );
>  static kern_return_t GetBSDPath( io_iterator_t mediaIterator, char *bsdPath, CFIndex maxPathSize );
>  
> @@ -710,7 +710,7 @@ static int hdev_open(BlockDriverState *bs, const char *filename, int flags)
>  {
>      BDRVRawState *s = bs->opaque;
>  
> -#ifdef CONFIG_COCOA
> +#if defined(__APPLE__) && defined(__MACH__)
>      if (strstart(filename, "/dev/cdrom", NULL)) {
>          kern_return_t kernResult;
>          io_iterator_t mediaIterator;

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

* Re: [Qemu-devel] [PATCH 2/3] raw-posix: Do not use CONFIG_COCOA macro
  2011-11-30  0:38   ` Andreas Färber
@ 2011-12-08  0:12     ` Andreas Färber
  0 siblings, 0 replies; 13+ messages in thread
From: Andreas Färber @ 2011-12-08  0:12 UTC (permalink / raw)
  To: Pavel Borzenkov; +Cc: Kevin Wolf, Andrzej Zaborowski, qemu-devel, Ben Leslie

Am 30.11.2011 01:38, schrieb Andreas Färber:
> Am 10.11.2011 19:40, schrieb Pavel Borzenkov:
>> Use __APPLE__ and __MACH__ macros instead of CONFIG_COCOA to detect Mac
>> OS X host. The patch is based on the Ben Leslie's patch:
>> http://patchwork.ozlabs.org/patch/97859/
>>
>> Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
> 
> Reviewed-by: Andreas Färber <andreas.faerber@web.de>

Thanks, applied to the cocoa branch with a minor edit (s/the//).

http://repo.or.cz/w/qemu/afaerber.git/shortlog/refs/heads/cocoa-for-upstream

Andreas

>> ---
>>  block/raw-posix.c |    8 ++++----
>>  1 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/block/raw-posix.c b/block/raw-posix.c
>> index 17e1c6f..ee08f80 100644
>> --- a/block/raw-posix.c
>> +++ b/block/raw-posix.c
>> @@ -29,7 +29,7 @@
>>  #include "module.h"
>>  #include "block/raw-posix-aio.h"
>>  
>> -#ifdef CONFIG_COCOA
>> +#if defined(__APPLE__) && (__MACH__)
>>  #include <paths.h>
>>  #include <sys/param.h>
>>  #include <IOKit/IOKitLib.h>
>> @@ -487,7 +487,7 @@ again:
>>          }
>>          if (size == 0)
>>  #endif
>> -#ifdef CONFIG_COCOA
>> +#if defined(__APPLE__) && defined(__MACH__)
>>          size = LONG_LONG_MAX;
>>  #else
>>          size = lseek(fd, 0LL, SEEK_END);
>> @@ -632,7 +632,7 @@ static BlockDriver bdrv_file = {
>>  /***********************************************/
>>  /* host device */
>>  
>> -#ifdef CONFIG_COCOA
>> +#if defined(__APPLE__) && defined(__MACH__)
>>  static kern_return_t FindEjectableCDMedia( io_iterator_t *mediaIterator );
>>  static kern_return_t GetBSDPath( io_iterator_t mediaIterator, char *bsdPath, CFIndex maxPathSize );
>>  
>> @@ -710,7 +710,7 @@ static int hdev_open(BlockDriverState *bs, const char *filename, int flags)
>>  {
>>      BDRVRawState *s = bs->opaque;
>>  
>> -#ifdef CONFIG_COCOA
>> +#if defined(__APPLE__) && defined(__MACH__)
>>      if (strstart(filename, "/dev/cdrom", NULL)) {
>>          kern_return_t kernResult;
>>          io_iterator_t mediaIterator;

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

* Re: [Qemu-devel] [PATCH 3/3] configure: add '--disable-cocoa' switch
  2011-11-10 18:40 ` [Qemu-devel] [PATCH 3/3] configure: add '--disable-cocoa' switch Pavel Borzenkov
@ 2011-12-08  0:41   ` Andreas Färber
  2012-01-14  0:42     ` Andreas Färber
  0 siblings, 1 reply; 13+ messages in thread
From: Andreas Färber @ 2011-12-08  0:41 UTC (permalink / raw)
  To: Pavel Borzenkov; +Cc: Andrzej Zaborowski, qemu-devel, Ben Leslie

Am 10.11.2011 19:40, schrieb 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.
> 
> Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
> ---
>  configure |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
> 
> diff --git a/configure b/configure
> index 401d9a6..4720bb2 100755
> --- a/configure
> +++ b/configure
> @@ -670,6 +670,8 @@ for opt do
>    ;;
>    --enable-profiler) profiler="yes"
>    ;;
> +  --disable-cocoa) cocoa="no"
> +  ;;
>    --enable-cocoa)
>        cocoa="yes" ;
>        sdl="no" ;

Tested-by: Andreas Färber <andreas.faerber@web.de>

> @@ -980,7 +982,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 (default)"
> +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]"

I see no prior art of any conditional help output in configure. Anthony?
Andrzej?

Andreas

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

* Re: [Qemu-devel] [PATCH 1/3] raw-posix: Remove dead code
  2011-11-10 18:40 ` [Qemu-devel] [PATCH 1/3] raw-posix: Remove dead code Pavel Borzenkov
@ 2011-12-14 12:03   ` Andreas Färber
  0 siblings, 0 replies; 13+ messages in thread
From: Andreas Färber @ 2011-12-14 12:03 UTC (permalink / raw)
  To: Pavel Borzenkov; +Cc: Kevin Wolf, Paolo Bonzini, qemu-devel

Am 10.11.2011 19:40, schrieb Pavel Borzenkov:
> It was commented out since the initial import from svn.
> 
> Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>

This dead code has just been picked up by Paolo for his "Support
mismatched host and guest logical block sizes" series (10/17).

Feel invited to test whether it works as expected on your Mac OS X.

Andreas

> ---
>  block/raw-posix.c |   18 ------------------
>  1 files changed, 0 insertions(+), 18 deletions(-)
> 
> diff --git a/block/raw-posix.c b/block/raw-posix.c
> index a3de373..17e1c6f 100644
> --- a/block/raw-posix.c
> +++ b/block/raw-posix.c
> @@ -37,7 +37,6 @@
>  #include <IOKit/storage/IOMediaBSDClient.h>
>  #include <IOKit/storage/IOMedia.h>
>  #include <IOKit/storage/IOCDMedia.h>
> -//#include <IOKit/storage/IOCDTypes.h>
>  #include <CoreFoundation/CoreFoundation.h>
>  #endif
>  
> @@ -279,23 +278,6 @@ static int raw_open(BlockDriverState *bs, const char *filename, int flags)
>      return raw_open_common(bs, filename, flags, 0);
>  }
>  
> -/* XXX: use host sector size if necessary with:
> -#ifdef DIOCGSECTORSIZE
> -        {
> -            unsigned int sectorsize = 512;
> -            if (!ioctl(fd, DIOCGSECTORSIZE, &sectorsize) &&
> -                sectorsize > bufsize)
> -                bufsize = sectorsize;
> -        }
> -#endif
> -#ifdef CONFIG_COCOA
> -        uint32_t blockSize = 512;
> -        if ( !ioctl( fd, DKIOCGETBLOCKSIZE, &blockSize ) && blockSize > bufsize) {
> -            bufsize = blockSize;
> -        }
> -#endif
> -*/
> -
>  /*
>   * Check if all memory in this vector is sector aligned.
>   */

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

* Re: [Qemu-devel] [PATCH 3/3] configure: add '--disable-cocoa' switch
  2011-12-08  0:41   ` Andreas Färber
@ 2012-01-14  0:42     ` Andreas Färber
  2012-01-16 23:46       ` Andrzej Zaborowski
  0 siblings, 1 reply; 13+ messages in thread
From: Andreas Färber @ 2012-01-14  0:42 UTC (permalink / raw)
  To: Andrzej Zaborowski, Anthony Liguori
  Cc: Rui Carmo, Ben Leslie, qemu-devel, Pavel Borzenkov

Am 08.12.2011 01:41, schrieb Andreas Färber:
> Am 10.11.2011 19:40, schrieb 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.
>>
>> Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
>> ---
>>  configure |    7 ++++++-
>>  1 files changed, 6 insertions(+), 1 deletions(-)
>>
>> diff --git a/configure b/configure
>> index 401d9a6..4720bb2 100755
>> --- a/configure
>> +++ b/configure
>> @@ -670,6 +670,8 @@ for opt do
>>    ;;
>>    --enable-profiler) profiler="yes"
>>    ;;
>> +  --disable-cocoa) cocoa="no"
>> +  ;;
>>    --enable-cocoa)
>>        cocoa="yes" ;
>>        sdl="no" ;
> 
> Tested-by: Andreas Färber <andreas.faerber@web.de>
> 
>> @@ -980,7 +982,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 (default)"
>> +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]"
> 
> I see no prior art of any conditional help output in configure. Anthony?
> Andrzej?

Ping? Should we keep command line options a flat list with comments on
applicability or start introducing tests like above?

Me, I'd prefer not doing this since the switch cases above don't check.

Andreas

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

* Re: [Qemu-devel] [PATCH 3/3] configure: add '--disable-cocoa' switch
  2012-01-14  0:42     ` Andreas Färber
@ 2012-01-16 23:46       ` Andrzej Zaborowski
  2012-01-17 11:06         ` Andreas Färber
  2012-01-17 14:46         ` Peter Maydell
  0 siblings, 2 replies; 13+ messages in thread
From: Andrzej Zaborowski @ 2012-01-16 23:46 UTC (permalink / raw)
  To: Andreas Färber; +Cc: Rui Carmo, Pavel Borzenkov, Ben Leslie, qemu-devel

On 14 January 2012 01:42, Andreas Färber <andreas.faerber@web.de> wrote:
> Am 08.12.2011 01:41, schrieb Andreas Färber:
>> Am 10.11.2011 19:40, schrieb 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.
>>>
>>> Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
>>> ---
>>>  configure |    7 ++++++-
>>>  1 files changed, 6 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/configure b/configure
>>> index 401d9a6..4720bb2 100755
>>> --- a/configure
>>> +++ b/configure
>>> @@ -670,6 +670,8 @@ for opt do
>>>    ;;
>>>    --enable-profiler) profiler="yes"
>>>    ;;
>>> +  --disable-cocoa) cocoa="no"
>>> +  ;;
>>>    --enable-cocoa)
>>>        cocoa="yes" ;
>>>        sdl="no" ;
>>
>> Tested-by: Andreas Färber <andreas.faerber@web.de>
>>
>>> @@ -980,7 +982,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 (default)"
>>> +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]"
>>
>> I see no prior art of any conditional help output in configure. Anthony?
>> Andrzej?
>
> Ping? Should we keep command line options a flat list with comments on
> applicability or start introducing tests like above?
>
> Me, I'd prefer not doing this since the switch cases above don't check.

Perhaps --diable-cocoa should be allowed on any platform.  You're
right we don't have such checks now, but then it's hard to see
downsides of doing them, so I'm quite ambivalent.

I still don't see the purpose of the following test in configure though:
      if test "$cocoa" = "no" ; then
        sdl=yes
      fi
With it in place and no --disable-cocoa there's no way to compile SDL.
 --enable-cocoa is also broken as fas as I can tell.

Cheers

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

* Re: [Qemu-devel] [PATCH 3/3] configure: add '--disable-cocoa' switch
  2012-01-16 23:46       ` Andrzej Zaborowski
@ 2012-01-17 11:06         ` Andreas Färber
  2012-01-17 14:23           ` Andrzej Zaborowski
  2012-01-17 14:46         ` Peter Maydell
  1 sibling, 1 reply; 13+ messages in thread
From: Andreas Färber @ 2012-01-17 11:06 UTC (permalink / raw)
  To: Andrzej Zaborowski; +Cc: Rui Carmo, Pavel Borzenkov, Ben Leslie, qemu-devel

Am 17.01.2012 00:46, schrieb Andrzej Zaborowski:
> On 14 January 2012 01:42, Andreas Färber <andreas.faerber@web.de> wrote:
>> Am 08.12.2011 01:41, schrieb Andreas Färber:
>>> Am 10.11.2011 19:40, schrieb 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.
>>>>
>>>> Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
>>>> ---
>>>>  configure |    7 ++++++-
>>>>  1 files changed, 6 insertions(+), 1 deletions(-)
>>>>
>>>> diff --git a/configure b/configure
>>>> index 401d9a6..4720bb2 100755
>>>> --- a/configure
>>>> +++ b/configure
>>>> @@ -670,6 +670,8 @@ for opt do
>>>>    ;;
>>>>    --enable-profiler) profiler="yes"
>>>>    ;;
>>>> +  --disable-cocoa) cocoa="no"
>>>> +  ;;
>>>>    --enable-cocoa)
>>>>        cocoa="yes" ;
>>>>        sdl="no" ;
>>>
>>> Tested-by: Andreas Färber <andreas.faerber@web.de>
>>>
>>>> @@ -980,7 +982,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 (default)"
>>>> +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]"
>>>
>>> I see no prior art of any conditional help output in configure. Anthony?
>>> Andrzej?
>>
>> Ping? Should we keep command line options a flat list with comments on
>> applicability or start introducing tests like above?
>>
>> Me, I'd prefer not doing this since the switch cases above don't check.
> 
> Perhaps --diable-cocoa should be allowed on any platform.  You're
> right we don't have such checks now, but then it's hard to see
> downsides of doing them, so I'm quite ambivalent.
> 
> I still don't see the purpose of the following test in configure though:
>       if test "$cocoa" = "no" ; then
>         sdl=yes
>       fi

The reason is that SDL and Cocoa must not both be detected due to the
way it is handled in vl.c. Given that Cocoa is enabled by default, SDL
must not be detected in that case. If Cocoa is disabled, then detecting
SDL is fine of course.

The alternative would be to check for SDL and, if present, disable
Cocoa. Still collides with Pavel's patch though - we need to sort out
how to merge them.

> With it in place and no --disable-cocoa there's no way to compile SDL.

>  --enable-cocoa is also broken as fas as I can tell.

I've been using it for historic reasons without noticeable problems.

Andreas

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

* Re: [Qemu-devel] [PATCH 3/3] configure: add '--disable-cocoa' switch
  2012-01-17 11:06         ` Andreas Färber
@ 2012-01-17 14:23           ` Andrzej Zaborowski
  0 siblings, 0 replies; 13+ messages in thread
From: Andrzej Zaborowski @ 2012-01-17 14:23 UTC (permalink / raw)
  To: Andreas Färber; +Cc: Rui Carmo, Ben Leslie, Pavel Borzenkov, qemu-devel

On 17 January 2012 12:06, Andreas Färber <andreas.faerber@web.de> wrote:
> Am 17.01.2012 00:46, schrieb Andrzej Zaborowski:
>> On 14 January 2012 01:42, Andreas Färber <andreas.faerber@web.de> wrote:
>>> Am 08.12.2011 01:41, schrieb Andreas Färber:
>>>> Am 10.11.2011 19:40, schrieb 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.
>>>>>
>>>>> Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
>>>>> ---
>>>>>  configure |    7 ++++++-
>>>>>  1 files changed, 6 insertions(+), 1 deletions(-)
>>>>>
>>>>> diff --git a/configure b/configure
>>>>> index 401d9a6..4720bb2 100755
>>>>> --- a/configure
>>>>> +++ b/configure
>>>>> @@ -670,6 +670,8 @@ for opt do
>>>>>    ;;
>>>>>    --enable-profiler) profiler="yes"
>>>>>    ;;
>>>>> +  --disable-cocoa) cocoa="no"
>>>>> +  ;;
>>>>>    --enable-cocoa)
>>>>>        cocoa="yes" ;
>>>>>        sdl="no" ;
>>>>
>>>> Tested-by: Andreas Färber <andreas.faerber@web.de>
>>>>
>>>>> @@ -980,7 +982,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 (default)"
>>>>> +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]"
>>>>
>>>> I see no prior art of any conditional help output in configure. Anthony?
>>>> Andrzej?
>>>
>>> Ping? Should we keep command line options a flat list with comments on
>>> applicability or start introducing tests like above?
>>>
>>> Me, I'd prefer not doing this since the switch cases above don't check.
>>
>> Perhaps --diable-cocoa should be allowed on any platform.  You're
>> right we don't have such checks now, but then it's hard to see
>> downsides of doing them, so I'm quite ambivalent.
>>
>> I still don't see the purpose of the following test in configure though:
>>       if test "$cocoa" = "no" ; then
>>         sdl=yes
>>       fi
>
> The reason is that SDL and Cocoa must not both be detected due to the
> way it is handled in vl.c. Given that Cocoa is enabled by default, SDL
> must not be detected in that case. If Cocoa is disabled, then detecting
> SDL is fine of course.
>
> The alternative would be to check for SDL and, if present, disable
> Cocoa. Still collides with Pavel's patch though - we need to sort out
> how to merge them.
>
>> With it in place and no --disable-cocoa there's no way to compile SDL.
>
>>  --enable-cocoa is also broken as fas as I can tell.
>
> I've been using it for historic reasons without noticeable problems.

The problem I see is that the handler touches the sdl variable, which
is also touched by --enable/disable-sdl.  So the order of the options
on the command line starts to matter.  I think the options should be
treated orthogonally, and then after parsing the command line the
script should bail out if two incompatible options are enabled.

Cheers

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

* Re: [Qemu-devel] [PATCH 3/3] configure: add '--disable-cocoa' switch
  2012-01-16 23:46       ` Andrzej Zaborowski
  2012-01-17 11:06         ` Andreas Färber
@ 2012-01-17 14:46         ` Peter Maydell
  1 sibling, 0 replies; 13+ messages in thread
From: Peter Maydell @ 2012-01-17 14:46 UTC (permalink / raw)
  To: Andrzej Zaborowski
  Cc: Rui Carmo, Andreas Färber, Ben Leslie, Pavel Borzenkov, qemu-devel

On 16 January 2012 23:46, Andrzej Zaborowski
<andrew.zaborowski@intel.com> wrote:
> On 14 January 2012 01:42, Andreas Färber <andreas.faerber@web.de> wrote:
>> Ping? Should we keep command line options a flat list with comments on
>> applicability or start introducing tests like above?
>>
>> Me, I'd prefer not doing this since the switch cases above don't check.
>
> Perhaps --diable-cocoa should be allowed on any platform.  You're
> right we don't have such checks now, but then it's hard to see
> downsides of doing them, so I'm quite ambivalent.

I'm vaguely negative about it because heading down that path increases
the number of tests and checks we end up performing before we do the
relatively straightforward thing of printing out a help message. (We
already do a pile of compiler/cpu tests early, which among other things
means 'configure --help' trashes config.log.)

"allow everything as an option and complain if it's not valid on this
machine" is at least easy to keep consistent.

-- PMM

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

end of thread, other threads:[~2012-01-17 14:46 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-10 18:40 [Qemu-devel] [PATCH 0/3] Make GUI frontends optional on Mac OS X Pavel Borzenkov
2011-11-10 18:40 ` [Qemu-devel] [PATCH 1/3] raw-posix: Remove dead code Pavel Borzenkov
2011-12-14 12:03   ` Andreas Färber
2011-11-10 18:40 ` [Qemu-devel] [PATCH 2/3] raw-posix: Do not use CONFIG_COCOA macro Pavel Borzenkov
2011-11-30  0:38   ` Andreas Färber
2011-12-08  0:12     ` Andreas Färber
2011-11-10 18:40 ` [Qemu-devel] [PATCH 3/3] configure: add '--disable-cocoa' switch Pavel Borzenkov
2011-12-08  0:41   ` Andreas Färber
2012-01-14  0:42     ` Andreas Färber
2012-01-16 23:46       ` Andrzej Zaborowski
2012-01-17 11:06         ` Andreas Färber
2012-01-17 14:23           ` Andrzej Zaborowski
2012-01-17 14:46         ` 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.