Commit c2de5c91a25eb3dcc73b63f1ce515b8e44d1d011
1 parent
e5178e8d
Document usage of new options remove stray variables, check for ALSA/FMOD/ESD
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4797 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
66 additions
and
35 deletions
configure
| ... | ... | @@ -117,15 +117,18 @@ OS_CFLAGS="-mno-cygwin" |
| 117 | 117 | if [ "$cpu" = "i386" ] ; then |
| 118 | 118 | kqemu="yes" |
| 119 | 119 | fi |
| 120 | +audio_possible_drivers="sdl" | |
| 120 | 121 | ;; |
| 121 | 122 | MINGW32*) |
| 122 | 123 | mingw32="yes" |
| 123 | 124 | if [ "$cpu" = "i386" ] ; then |
| 124 | 125 | kqemu="yes" |
| 125 | 126 | fi |
| 127 | +audio_possible_drivers="dsound sdl fmod" | |
| 126 | 128 | ;; |
| 127 | 129 | GNU/kFreeBSD) |
| 128 | 130 | audio_drv_list="oss" |
| 131 | +audio_possible_drivers="oss sdl esd" | |
| 129 | 132 | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
| 130 | 133 | kqemu="yes" |
| 131 | 134 | fi |
| ... | ... | @@ -133,6 +136,7 @@ fi |
| 133 | 136 | FreeBSD) |
| 134 | 137 | bsd="yes" |
| 135 | 138 | audio_drv_list="oss" |
| 139 | +audio_possible_drivers="oss sdl esd" | |
| 136 | 140 | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
| 137 | 141 | kqemu="yes" |
| 138 | 142 | fi |
| ... | ... | @@ -140,10 +144,12 @@ fi |
| 140 | 144 | NetBSD) |
| 141 | 145 | bsd="yes" |
| 142 | 146 | audio_drv_list="oss" |
| 147 | +audio_possible_drivers="oss sdl esd" | |
| 143 | 148 | ;; |
| 144 | 149 | OpenBSD) |
| 145 | 150 | bsd="yes" |
| 146 | 151 | audio_drv_list="oss" |
| 152 | +audio_possible_drivers="oss sdl esd" | |
| 147 | 153 | ;; |
| 148 | 154 | Darwin) |
| 149 | 155 | bsd="yes" |
| ... | ... | @@ -151,6 +157,7 @@ darwin="yes" |
| 151 | 157 | darwin_user="yes" |
| 152 | 158 | cocoa="yes" |
| 153 | 159 | audio_drv_list="coreaudio" |
| 160 | +audio_possible_drivers="coreaudio sdl fmod" | |
| 154 | 161 | OS_CFLAGS="-mdynamic-no-pic" |
| 155 | 162 | OS_LDFLAGS="-framework CoreFoundation -framework IOKit" |
| 156 | 163 | ;; |
| ... | ... | @@ -185,13 +192,16 @@ SunOS) |
| 185 | 192 | if test -f /usr/include/sys/soundcard.h ; then |
| 186 | 193 | audio_drv_list="oss" |
| 187 | 194 | fi |
| 195 | + audio_possible_drivers="oss sdl" | |
| 188 | 196 | ;; |
| 189 | 197 | *) |
| 190 | 198 | audio_drv_list="oss" |
| 199 | +audio_possible_drivers="oss alsa sdl esd" | |
| 191 | 200 | linux="yes" |
| 192 | 201 | linux_user="yes" |
| 193 | 202 | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
| 194 | 203 | kqemu="yes" |
| 204 | + audio_possible_drivers="$audio_possible_drivers fmod" | |
| 195 | 205 | fi |
| 196 | 206 | ;; |
| 197 | 207 | esac |
| ... | ... | @@ -258,12 +268,12 @@ for opt do |
| 258 | 268 | ;; |
| 259 | 269 | --fmod-lib=*) fmod_lib="$optarg" |
| 260 | 270 | ;; |
| 271 | + --fmod-inc=*) fmod_inc="$optarg" | |
| 272 | + ;; | |
| 261 | 273 | --audio-card-list=*) audio_card_list="$optarg" |
| 262 | 274 | ;; |
| 263 | 275 | --audio-drv-list=*) audio_drv_list="$optarg" |
| 264 | 276 | ;; |
| 265 | - --fmod-inc=*) fmod_inc="$optarg" | |
| 266 | - ;; | |
| 267 | 277 | --disable-vnc-tls) vnc_tls="no" |
| 268 | 278 | ;; |
| 269 | 279 | --enable-mingw32) mingw32="yes" ; cross_prefix="i386-mingw32-" ; linux_user="no" |
| ... | ... | @@ -276,7 +286,10 @@ for opt do |
| 276 | 286 | ;; |
| 277 | 287 | --enable-profiler) profiler="yes" |
| 278 | 288 | ;; |
| 279 | - --enable-cocoa) cocoa="yes" ; sdl="no" ; | |
| 289 | + --enable-cocoa) | |
| 290 | + cocoa="yes" ; | |
| 291 | + sdl="no" ; | |
| 292 | + audio_drv_list="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`" | |
| 280 | 293 | ;; |
| 281 | 294 | --disable-gfx-check) check_gfx="no" |
| 282 | 295 | ;; |
| ... | ... | @@ -400,8 +413,10 @@ echo " --disable-werror disable compilation abort on warning" |
| 400 | 413 | echo " --disable-sdl disable SDL" |
| 401 | 414 | echo " --enable-cocoa enable COCOA (Mac OS X only)" |
| 402 | 415 | echo " --enable-mingw32 enable Win32 cross compilation with mingw32" |
| 403 | -echo " --audio-drv-list set audio drivers list" | |
| 404 | -echo " --audio-card-list set list of additional emulated audio cards" | |
| 416 | +echo " --audio-drv-list=LIST set audio drivers list:" | |
| 417 | +echo " Available drivers: $audio_possible_drivers" | |
| 418 | +echo " --audio-card-list=LIST set list of additional emulated audio cards" | |
| 419 | +echo " Available cards: ac97 adlib cs4231a gus" | |
| 405 | 420 | echo " --enable-mixemu enable mixer emulation" |
| 406 | 421 | echo " --disable-brlapi disable BrlAPI" |
| 407 | 422 | echo " --disable-vnc-tls disable TLS encryption for VNC server" |
| ... | ... | @@ -692,7 +707,7 @@ else |
| 692 | 707 | # Make sure to disable cocoa if sdl was set |
| 693 | 708 | if test "$sdl" = "yes" ; then |
| 694 | 709 | cocoa="no" |
| 695 | - audio_drv_list="echo $audio_drv_list | sed s,coreaudio,,g" | |
| 710 | + audio_drv_list="`echo $audio_drv_list | sed s,coreaudio,,g`" | |
| 696 | 711 | fi |
| 697 | 712 | fi # -z $sdl |
| 698 | 713 | |
| ... | ... | @@ -707,23 +722,53 @@ if test "$vnc_tls" = "yes" ; then |
| 707 | 722 | fi |
| 708 | 723 | |
| 709 | 724 | ########################################## |
| 710 | -# alsa sound support libraries | |
| 725 | +# Sound support libraries probe | |
| 711 | 726 | |
| 712 | -if test "$alsa" = "yes" ; then | |
| 713 | - cat > $TMPC << EOF | |
| 714 | -#include <alsa/asoundlib.h> | |
| 715 | -int main(void) { snd_pcm_t **handle; return snd_pcm_close(*handle); } | |
| 727 | +audio_drv_probe() | |
| 728 | +{ | |
| 729 | + drv=$1 | |
| 730 | + hdr=$2 | |
| 731 | + lib=$3 | |
| 732 | + exp=$4 | |
| 733 | + cfl=$5 | |
| 734 | + cat > $TMPC << EOF | |
| 735 | +#include <$hdr> | |
| 736 | +int main(void) { $exp } | |
| 716 | 737 | EOF |
| 717 | - if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lasound 2> /dev/null ; then | |
| 718 | - : | |
| 719 | - else | |
| 720 | - echo | |
| 721 | - echo "Error: Could not find alsa" | |
| 722 | - echo "Make sure to have the alsa libs and headers installed." | |
| 723 | - echo | |
| 724 | - exit 1 | |
| 725 | - fi | |
| 726 | -fi | |
| 738 | + if $cc $ARCH_CFLAGS $cfl -o $TMPE $TMPC $lib 2> /dev/null ; then | |
| 739 | + : | |
| 740 | + else | |
| 741 | + echo | |
| 742 | + echo "Error: $drv check failed" | |
| 743 | + echo "Make sure to have the $drv libs and headers installed." | |
| 744 | + echo | |
| 745 | + exit 1 | |
| 746 | + fi | |
| 747 | +} | |
| 748 | + | |
| 749 | +for drv in $audio_drv_list; do | |
| 750 | + case $drv in | |
| 751 | + alsa) | |
| 752 | + audio_drv_probe $drv alsa/asoundlib.h -lasound \ | |
| 753 | + "snd_pcm_t **handle; return snd_pcm_close(*handle);" | |
| 754 | + ;; | |
| 755 | + | |
| 756 | + fmod) | |
| 757 | + if test -z $fmod_lib || test -z $fmod_inc; then | |
| 758 | + echo | |
| 759 | + echo "Error: You must specify path to FMOD library and headers" | |
| 760 | + echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so" | |
| 761 | + echo | |
| 762 | + exit 1 | |
| 763 | + fi | |
| 764 | + audio_drv_probe $drv fmod.h $fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc" | |
| 765 | + ;; | |
| 766 | + | |
| 767 | + esd) | |
| 768 | + audio_drv_probe $drv esd.h -lesd 'return esd_play_stream(0, 0, "", 0);' | |
| 769 | + ;; | |
| 770 | + esac | |
| 771 | +done | |
| 727 | 772 | |
| 728 | 773 | ########################################## |
| 729 | 774 | # BrlAPI probe |
| ... | ... | @@ -809,20 +854,6 @@ echo "mingw32 support $mingw32" |
| 809 | 854 | echo "Audio drivers $audio_drv_list" |
| 810 | 855 | echo "Extra audio cards $audio_card_list" |
| 811 | 856 | echo "Mixer emulation $mixemu" |
| 812 | -if test "$fmod" = "yes"; then | |
| 813 | - if test -z $fmod_lib || test -z $fmod_inc; then | |
| 814 | - echo | |
| 815 | - echo "Error: You must specify path to FMOD library and headers" | |
| 816 | - echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so" | |
| 817 | - echo | |
| 818 | - exit 1 | |
| 819 | - fi | |
| 820 | - fmod_support=" (lib='$fmod_lib' include='$fmod_inc')" | |
| 821 | -else | |
| 822 | - fmod_support="" | |
| 823 | -fi | |
| 824 | -echo "FMOD support $fmod $fmod_support" | |
| 825 | -echo "OSS support $oss" | |
| 826 | 857 | echo "VNC TLS support $vnc_tls" |
| 827 | 858 | if test "$vnc_tls" = "yes" ; then |
| 828 | 859 | echo " TLS CFLAGS $vnc_tls_cflags" | ... | ... |