qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [4792] Change the way audio is configured
@ 2008-06-25 21:04 malc
  2008-06-27 15:34 ` [Qemu-devel] " consul
  0 siblings, 1 reply; 5+ messages in thread
From: malc @ 2008-06-25 21:04 UTC (permalink / raw)
  To: qemu-devel

Revision: 4792
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4792
Author:   malc
Date:     2008-06-25 21:04:05 +0000 (Wed, 25 Jun 2008)

Log Message:
-----------
Change the way audio is configured

Instead of having separate option for each card and driver use
--audio-drv-list and --audio-card-list options.

Under Linux it allows to set the default(first probed) driver
to something other than OSS.

Modified Paths:
--------------
    trunk/audio/audio.c
    trunk/configure
    trunk/qemu-doc.texi

Modified: trunk/audio/audio.c
===================================================================
--- trunk/audio/audio.c	2008-06-25 19:59:53 UTC (rev 4791)
+++ trunk/audio/audio.c	2008-06-25 21:04:05 UTC (rev 4792)
@@ -38,27 +38,7 @@
 #define SW_NAME(sw) (sw)->name ? (sw)->name : "unknown"
 
 static struct audio_driver *drvtab[] = {
-#ifdef CONFIG_OSS
-    &oss_audio_driver,
-#endif
-#ifdef CONFIG_ALSA
-    &alsa_audio_driver,
-#endif
-#ifdef CONFIG_COREAUDIO
-    &coreaudio_audio_driver,
-#endif
-#ifdef CONFIG_DSOUND
-    &dsound_audio_driver,
-#endif
-#ifdef CONFIG_FMOD
-    &fmod_audio_driver,
-#endif
-#ifdef CONFIG_SDL
-    &sdl_audio_driver,
-#endif
-#ifdef CONFIG_ESD
-    &esd_audio_driver,
-#endif
+    AUDIO_DRIVERS
     &no_audio_driver,
     &wav_audio_driver
 };

Modified: trunk/configure
===================================================================
--- trunk/configure	2008-06-25 19:59:53 UTC (rev 4791)
+++ trunk/configure	2008-06-25 21:04:05 UTC (rev 4792)
@@ -24,6 +24,8 @@
 cc="gcc"
 gcc3_search="yes"
 gcc3_list="gcc-3.4.6 gcc-3.4 gcc34 gcc-3.3.6 gcc-3.3 gcc33 gcc-3.2 gcc32"
+audio_drv_list=""
+audio_card_list=""
 host_cc="gcc"
 ar="ar"
 make="make"
@@ -87,16 +89,6 @@
 EXESUF=""
 gdbstub="yes"
 slirp="yes"
-adlib="no"
-ac97="no"
-gus="no"
-cs4231a="no"
-oss="no"
-dsound="no"
-coreaudio="no"
-alsa="no"
-esd="no"
-fmod="no"
 fmod_lib=""
 fmod_inc=""
 vnc_tls="yes"
@@ -133,32 +125,32 @@
 fi
 ;;
 GNU/kFreeBSD)
-oss="yes"
+audio_drv_list="oss"
 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
     kqemu="yes"
 fi
 ;;
 FreeBSD)
 bsd="yes"
-oss="yes"
+audio_drv_list="oss"
 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
     kqemu="yes"
 fi
 ;;
 NetBSD)
 bsd="yes"
-oss="yes"
+audio_drv_list="oss"
 ;;
 OpenBSD)
 bsd="yes"
-oss="yes"
+audio_drv_list="oss"
 ;;
 Darwin)
 bsd="yes"
 darwin="yes"
 darwin_user="yes"
 cocoa="yes"
-coreaudio="yes"
+audio_drv_list="coreaudio"
 OS_CFLAGS="-mdynamic-no-pic"
 OS_LDFLAGS="-framework CoreFoundation -framework IOKit"
 ;;
@@ -191,11 +183,11 @@
         fi
     fi
     if test -f /usr/include/sys/soundcard.h ; then
-        oss=yes
+        audio_drv_list="oss"
     fi
 ;;
 *)
-oss="yes"
+audio_drv_list="oss"
 linux="yes"
 linux_user="yes"
 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
@@ -264,18 +256,12 @@
   ;;
   --disable-sdl) sdl="no"
   ;;
-  --enable-coreaudio) coreaudio="yes"
+  --fmod-lib=*) fmod_lib="$optarg"
   ;;
-  --enable-alsa) alsa="yes"
+  --audio-card-list=*) audio_card_list="$optarg"
   ;;
-  --enable-esd) esd="yes"
+  --audio-drv-list=*) audio_drv_list="$optarg"
   ;;
-  --enable-dsound) dsound="yes"
-  ;;
-  --enable-fmod) fmod="yes"
-  ;;
-  --fmod-lib=*) fmod_lib="$optarg"
-  ;;
   --fmod-inc=*) fmod_inc="$optarg"
   ;;
   --disable-vnc-tls) vnc_tls="no"
@@ -284,21 +270,13 @@
   ;;
   --disable-slirp) slirp="no"
   ;;
-  --enable-adlib) adlib="yes"
-  ;;
-  --enable-ac97) ac97="yes"
-  ;;
-  --enable-gus) gus="yes"
-  ;;
-  --enable-cs4231a) cs4231a="yes"
-  ;;
   --disable-kqemu) kqemu="no"
   ;;
   --disable-brlapi) brlapi="no"
   ;;
   --enable-profiler) profiler="yes"
   ;;
-  --enable-cocoa) cocoa="yes" ; coreaudio="yes" ; sdl="no"
+  --enable-cocoa) cocoa="yes" ; sdl="no" ;
   ;;
   --disable-gfx-check) check_gfx="no"
   ;;
@@ -422,15 +400,8 @@
 echo "  --disable-sdl            disable SDL"
 echo "  --enable-cocoa           enable COCOA (Mac OS X only)"
 echo "  --enable-mingw32         enable Win32 cross compilation with mingw32"
-echo "  --enable-adlib           enable Adlib emulation"
-echo "  --enable-ac97            enable AC97 emulation"
-echo "  --enable-gus             enable Gravis Ultrasound emulation"
-echo "  --enable-cs4231a         enable CS4231A emulation"
-echo "  --enable-coreaudio       enable Coreaudio audio driver"
-echo "  --enable-alsa            enable ALSA audio driver"
-echo "  --enable-esd             enable EsoundD audio driver"
-echo "  --enable-fmod            enable FMOD audio driver"
-echo "  --enable-dsound          enable DirectSound audio driver"
+echo "  --audio-drv-list         set audio drivers list"
+echo "  --audio-card-list        set list of additional emulated audio cards"
 echo "  --enable-mixemu          enable mixer emulation"
 echo "  --disable-brlapi         disable BrlAPI"
 echo "  --disable-vnc-tls        disable TLS encryption for VNC server"
@@ -721,7 +692,7 @@
     # Make sure to disable cocoa if sdl was set
     if test "$sdl" = "yes" ; then
        cocoa="no"
-       coreaudio="no"
+       audio_drv_list="echo $audio_drv_list | sed s,coreaudio,,g"
     fi
 fi # -z $sdl
 
@@ -835,14 +806,8 @@
 fi
 echo "curses support    $curses"
 echo "mingw32 support   $mingw32"
-echo "Adlib support     $adlib"
-echo "AC97 support      $ac97"
-echo "GUS support       $gus"
-echo "CS4231A support   $cs4231a"
-echo "CoreAudio support $coreaudio"
-echo "ALSA support      $alsa"
-echo "EsounD support    $esd"
-echo "DSound support    $dsound"
+echo "Audio drivers     $audio_drv_list"
+echo "Extra audio cards $audio_card_list"
 echo "Mixer emulation   $mixemu"
 if test "$fmod" = "yes"; then
     if test -z $fmod_lib || test -z $fmod_inc; then
@@ -1036,52 +1001,26 @@
   echo "CONFIG_SLIRP=yes" >> $config_mak
   echo "#define CONFIG_SLIRP 1" >> $config_h
 fi
-if test "$adlib" = "yes" ; then
-  echo "CONFIG_ADLIB=yes" >> $config_mak
-  echo "#define CONFIG_ADLIB 1" >> $config_h
-fi
-if test "$ac97" = "yes" ; then
-  echo "CONFIG_AC97=yes" >> $config_mak
-  echo "#define CONFIG_AC97 1" >> $config_h
-fi
-if test "$gus" = "yes" ; then
-  echo "CONFIG_GUS=yes" >> $config_mak
-  echo "#define CONFIG_GUS 1" >> $config_h
-fi
-if test "$cs4231a" = "yes" ; then
-  echo "CONFIG_CS4231A=yes" >> $config_mak
-  echo "#define CONFIG_CS4231A 1" >> $config_h
-fi
-if test "$oss" = "yes" ; then
-  echo "CONFIG_OSS=yes" >> $config_mak
-  echo "#define CONFIG_OSS 1" >> $config_h
-fi
-if test "$coreaudio" = "yes" ; then
-  echo "CONFIG_COREAUDIO=yes" >> $config_mak
-  echo "#define CONFIG_COREAUDIO 1" >> $config_h
-fi
-if test "$alsa" = "yes" ; then
-  echo "CONFIG_ALSA=yes" >> $config_mak
-  echo "#define CONFIG_ALSA 1" >> $config_h
-fi
-if test "$esd" = "yes" ; then
-  echo "CONFIG_ESD=yes" >> $config_mak
-  echo "#define CONFIG_ESD 1" >> $config_h
-fi
-if test "$dsound" = "yes" ; then
-  echo "CONFIG_DSOUND=yes" >> $config_mak
-  echo "#define CONFIG_DSOUND 1" >> $config_h
-fi
+for card in $audio_card_list; do
+    def=CONFIG_`echo $card | tr [:lower:] [:upper:]`
+    echo "$def=yes" >> $config_mak
+    echo "#define $def 1" >> $config_h
+done
+echo "#define AUDIO_DRIVERS \\" >> $config_h
+for drv in $audio_drv_list; do
+    echo "    &${drv}_audio_driver, \\" >>$config_h
+    def=CONFIG_`echo $drv | tr [:lower:] [:upper:]`
+    echo "$def=yes" >> $config_mak
+    if test "$drv" == "fmod"; then
+        echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
+        echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
+    fi
+done
+echo "" >>$config_h
 if test "$mixemu" = "yes" ; then
   echo "CONFIG_MIXEMU=yes" >> $config_mak
   echo "#define CONFIG_MIXEMU 1" >> $config_h
 fi
-if test "$fmod" = "yes" ; then
-  echo "CONFIG_FMOD=yes" >> $config_mak
-  echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
-  echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
-  echo "#define CONFIG_FMOD 1" >> $config_h
-fi
 if test "$vnc_tls" = "yes" ; then
   echo "CONFIG_VNC_TLS=yes" >> $config_mak
   echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak

Modified: trunk/qemu-doc.texi
===================================================================
--- trunk/qemu-doc.texi	2008-06-25 19:59:53 UTC (rev 4791)
+++ trunk/qemu-doc.texi	2008-06-25 21:04:05 UTC (rev 4792)
@@ -183,8 +183,8 @@
 SMP is supported with up to 255 CPUs.
 
 Note that adlib, ac97, gus and cs4231a are only available when QEMU
-was configured with --enable-adlib, --enable-ac97, --enable-gus or
---enable-cs4231a respectively.
+was configured with --audio-card-list option containing the name(s) of
+required cards.
 
 QEMU uses the PC BIOS from the Bochs project and the Plex86/Bochs LGPL
 VGA BIOS.

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

* [Qemu-devel] Re: [4792] Change the way audio is configured
  2008-06-25 21:04 [Qemu-devel] [4792] Change the way audio is configured malc
@ 2008-06-27 15:34 ` consul
  2008-06-27 15:46   ` Laurent Vivier
  0 siblings, 1 reply; 5+ messages in thread
From: consul @ 2008-06-27 15:34 UTC (permalink / raw)
  To: qemu-devel

audio/audio.c:42: error: `AUDIO_DRIVERS' undeclared here (not in a function)
audio/audio.c:42: error: initializer element is not constant
audio/audio.c:42: error: (near initialization for `drvtab[0]')

Paste error?

-#endif
+    AUDIO_DRIVERS
     &no_audio_driver,
     &wav_audio_driver
 };

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

* Re: [Qemu-devel] Re: [4792] Change the way audio is configured
  2008-06-27 15:34 ` [Qemu-devel] " consul
@ 2008-06-27 15:46   ` Laurent Vivier
  2008-06-27 16:00     ` [Qemu-devel] " consul
  2008-06-27 20:03     ` [Qemu-devel][PATCH] " Stefan Weil
  0 siblings, 2 replies; 5+ messages in thread
From: Laurent Vivier @ 2008-06-27 15:46 UTC (permalink / raw)
  To: qemu-devel


Le 27 juin 08 à 17:34, consul a écrit :

> audio/audio.c:42: error: `AUDIO_DRIVERS' undeclared here (not in a  
> function)
> audio/audio.c:42: error: initializer element is not constant
> audio/audio.c:42: error: (near initialization for `drvtab[0]')
>
> Paste error?

No you have to re-run "./configure".

> -#endif
> +    AUDIO_DRIVERS
>     &no_audio_driver,
>     &wav_audio_driver
> };
>
>
>
>
>

----------------------- Laurent Vivier ----------------------
"The best way to predict the future is to invent it."
- Alan Kay

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

* [Qemu-devel] Re: Re: [4792] Change the way audio is configured
  2008-06-27 15:46   ` Laurent Vivier
@ 2008-06-27 16:00     ` consul
  2008-06-27 20:03     ` [Qemu-devel][PATCH] " Stefan Weil
  1 sibling, 0 replies; 5+ messages in thread
From: consul @ 2008-06-27 16:00 UTC (permalink / raw)
  To: qemu-devel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 679 bytes --]

You're right.  Sorry for noice.

"Laurent Vivier" <laurent@lvivier.info> wrote in message 
news:0D57F194-2B76-460D-936E-B9E7ED70ADBE@lvivier.info...

Le 27 juin 08 à 17:34, consul a écrit :

> audio/audio.c:42: error: `AUDIO_DRIVERS' undeclared here (not in a 
> function)
> audio/audio.c:42: error: initializer element is not constant
> audio/audio.c:42: error: (near initialization for `drvtab[0]')
>
> Paste error?

No you have to re-run "./configure".

> -#endif
> +    AUDIO_DRIVERS
>     &no_audio_driver,
>     &wav_audio_driver
> };
>
>
>
>
>

----------------------- Laurent Vivier ----------------------
"The best way to predict the future is to invent it."
- Alan Kay

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

* Re: [Qemu-devel][PATCH] Re: [4792] Change the way audio is configured
  2008-06-27 15:46   ` Laurent Vivier
  2008-06-27 16:00     ` [Qemu-devel] " consul
@ 2008-06-27 20:03     ` Stefan Weil
  1 sibling, 0 replies; 5+ messages in thread
From: Stefan Weil @ 2008-06-27 20:03 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 696 bytes --]

Laurent Vivier schrieb:
>
> Le 27 juin 08 à 17:34, consul a écrit :
>
>> audio/audio.c:42: error: `AUDIO_DRIVERS' undeclared here (not in a 
>> function)
>> audio/audio.c:42: error: initializer element is not constant
>> audio/audio.c:42: error: (near initialization for `drvtab[0]')
>>
>> Paste error?
>
> No you have to re-run "./configure".

Here is a small patch which automatically calls configure when the file 
changes.
It also tells users to run configure when they call make without a 
configuration.

The patch is not perfect: it tries to call configure with the last 
options, but
it will fail at options containing white space. These are rarely used, 
so it is
still useful.

Stefan


[-- Attachment #2: Makefile.patch --]
[-- Type: text/x-diff, Size: 856 bytes --]

Index: Makefile
===================================================================
--- Makefile	(revision 4795)
+++ Makefile	(working copy)
@@ -1,6 +1,6 @@
 # Makefile for QEMU.
 
-include config-host.mak
+-include config-host.mak
 
 .PHONY: all clean distclean dvi info install install-doc tar tarbin \
 	speed test html dvi info
@@ -180,6 +180,15 @@
 dyngen$(EXESUF): dyngen.c
 	$(HOST_CC) $(CFLAGS) $(CPPFLAGS) -o $@ $^
 
+config-host.mak: configure
+ifneq ($(wildcard config-host.mak),)
+	@echo $@ is out-of-date, running configure
+	@fgrep "Configured with:" $@ | sed s/.*Configured.with:.// | sh
+else
+	@echo "Please call configure before running make!"
+	@exit 1
+endif
+
 clean:
 # avoid old build problems by removing potentially incorrect old files
 	rm -f config.mak config.h op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h

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

end of thread, other threads:[~2008-06-27 20:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-25 21:04 [Qemu-devel] [4792] Change the way audio is configured malc
2008-06-27 15:34 ` [Qemu-devel] " consul
2008-06-27 15:46   ` Laurent Vivier
2008-06-27 16:00     ` [Qemu-devel] " consul
2008-06-27 20:03     ` [Qemu-devel][PATCH] " Stefan Weil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).