On 17 January 2012 12:06, Andreas Färber <andreas.faer...@web.de> wrote: > Am 17.01.2012 00:46, schrieb Andrzej Zaborowski: >> On 14 January 2012 01:42, Andreas Färber <andreas.faer...@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.borzen...@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.faer...@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