aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure226
1 files changed, 101 insertions, 125 deletions
diff --git a/configure b/configure
index d047a6445..60e849391 100755
--- a/configure
+++ b/configure
@@ -24,6 +24,8 @@ cross_prefix=""
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 @@ mingw32="no"
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"
@@ -130,22 +122,26 @@ OS_CFLAGS="-mno-cygwin"
if [ "$cpu" = "i386" ] ; then
kqemu="yes"
fi
+audio_possible_drivers="sdl"
;;
MINGW32*)
mingw32="yes"
if [ "$cpu" = "i386" ] ; then
kqemu="yes"
fi
+audio_possible_drivers="dsound sdl fmod"
;;
GNU/kFreeBSD)
-oss="yes"
+audio_drv_list="oss"
+audio_possible_drivers="oss sdl esd"
if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
kqemu="yes"
fi
;;
FreeBSD)
bsd="yes"
-oss="yes"
+audio_drv_list="oss"
+audio_possible_drivers="oss sdl esd"
if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
kqemu="yes"
kvm="yes"
@@ -153,18 +149,21 @@ fi
;;
NetBSD)
bsd="yes"
-oss="yes"
+audio_drv_list="oss"
+audio_possible_drivers="oss sdl esd"
;;
OpenBSD)
bsd="yes"
-oss="yes"
+audio_drv_list="oss"
+audio_possible_drivers="oss sdl esd"
;;
Darwin)
bsd="yes"
darwin="yes"
darwin_user="yes"
cocoa="yes"
-coreaudio="yes"
+audio_drv_list="coreaudio"
+audio_possible_drivers="coreaudio sdl fmod"
OS_CFLAGS="-mdynamic-no-pic"
OS_LDFLAGS="-framework CoreFoundation -framework IOKit"
;;
@@ -197,15 +196,18 @@ SunOS)
fi
fi
if test -f /usr/include/sys/soundcard.h ; then
- oss=yes
+ audio_drv_list="oss"
fi
+ audio_possible_drivers="oss sdl"
;;
*)
-oss="yes"
+audio_drv_list="oss"
+audio_possible_drivers="oss alsa sdl esd pa"
linux="yes"
linux_user="yes"
if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
kqemu="yes"
+ audio_possible_drivers="$audio_possible_drivers fmod"
kvm="yes"
fi
if [ "$cpu" = "ia64" ] ; then
@@ -280,34 +282,20 @@ for opt do
;;
--disable-sdl) sdl="no"
;;
- --enable-coreaudio) coreaudio="yes"
- ;;
- --enable-alsa) alsa="yes"
- ;;
- --enable-esd) esd="yes"
- ;;
- --enable-dsound) dsound="yes"
- ;;
- --enable-fmod) fmod="yes"
- ;;
--fmod-lib=*) fmod_lib="$optarg"
;;
--fmod-inc=*) fmod_inc="$optarg"
;;
+ --audio-card-list=*) audio_card_list="$optarg"
+ ;;
+ --audio-drv-list=*) audio_drv_list="$optarg"
+ ;;
--disable-vnc-tls) vnc_tls="no"
;;
--enable-mingw32) mingw32="yes" ; cross_prefix="i386-mingw32-" ; linux_user="no"
;;
--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-kvm) kvm="no"
@@ -318,7 +306,10 @@ for opt do
;;
--kernel-path=*) kernel_path="$optarg"
;;
- --enable-cocoa) cocoa="yes" ; coreaudio="yes" ; sdl="no"
+ --enable-cocoa)
+ cocoa="yes" ;
+ sdl="no" ;
+ audio_drv_list="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
;;
--disable-gfx-check) check_gfx="no"
;;
@@ -448,15 +439,10 @@ echo " --disable-werror disable compilation abort on warning"
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=LIST set audio drivers list:"
+echo " Available drivers: $audio_possible_drivers"
+echo " --audio-card-list=LIST set list of additional emulated audio cards"
+echo " Available cards: ac97 adlib cs4231a gus"
echo " --enable-mixemu enable mixer emulation"
echo " --disable-brlapi disable BrlAPI"
echo " --disable-vnc-tls disable TLS encryption for VNC server"
@@ -765,7 +751,7 @@ else
# 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
@@ -780,23 +766,59 @@ if test "$vnc_tls" = "yes" ; then
fi
##########################################
-# alsa sound support libraries
+# Sound support libraries probe
-if test "$alsa" = "yes" ; then
- cat > $TMPC << EOF
-#include <alsa/asoundlib.h>
-int main(void) { snd_pcm_t **handle; return snd_pcm_close(*handle); }
+audio_drv_probe()
+{
+ drv=$1
+ hdr=$2
+ lib=$3
+ exp=$4
+ cfl=$5
+ cat > $TMPC << EOF
+#include <$hdr>
+int main(void) { $exp }
EOF
- if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lasound 2> /dev/null ; then
- :
- else
- echo
- echo "Error: Could not find alsa"
- echo "Make sure to have the alsa libs and headers installed."
- echo
- exit 1
- fi
-fi
+ if $cc $ARCH_CFLAGS $cfl -o $TMPE $TMPC $lib 2> /dev/null ; then
+ :
+ else
+ echo
+ echo "Error: $drv check failed"
+ echo "Make sure to have the $drv libs and headers installed."
+ echo
+ exit 1
+ fi
+}
+
+for drv in $audio_drv_list; do
+ case $drv in
+ alsa)
+ audio_drv_probe $drv alsa/asoundlib.h -lasound \
+ "snd_pcm_t **handle; return snd_pcm_close(*handle);"
+ ;;
+
+ fmod)
+ if test -z $fmod_lib || test -z $fmod_inc; then
+ echo
+ echo "Error: You must specify path to FMOD library and headers"
+ echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
+ echo
+ exit 1
+ fi
+ audio_drv_probe $drv fmod.h $fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc"
+ ;;
+
+ esd)
+ audio_drv_probe $drv esd.h -lesd 'return esd_play_stream(0, 0, "", 0);'
+ ;;
+
+ pa)
+ audio_drv_probe $drv pulse/simple.h -lpulse-simple \
+ "pa_simple *s = NULL; pa_simple_free(s); return 0;"
+ ;;
+
+ esac
+done
##########################################
# BrlAPI probe
@@ -904,29 +926,9 @@ if test "$sdl" != "no" ; then
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
- echo
- echo "Error: You must specify path to FMOD library and headers"
- echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
- echo
- exit 1
- fi
- fmod_support=" (lib='$fmod_lib' include='$fmod_inc')"
-else
- fmod_support=""
-fi
-echo "FMOD support $fmod $fmod_support"
-echo "OSS support $oss"
echo "VNC TLS support $vnc_tls"
if test "$vnc_tls" = "yes" ; then
echo " TLS CFLAGS $vnc_tls_cflags"
@@ -1110,52 +1112,26 @@ if test "$slirp" = "yes" ; then
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