]> Git Repo - qemu.git/blobdiff - configure
Enable VDE by default if library is present.
[qemu.git] / configure
index 05ee62c2ae4e3a10ae43279f0f35864ebe2c8001..b00df86f2b36c89ea9cf88c313961596d8e74d96 100755 (executable)
--- a/configure
+++ b/configure
@@ -89,6 +89,7 @@ mingw32="no"
 EXESUF=""
 gdbstub="yes"
 slirp="yes"
+vde="yes"
 fmod_lib=""
 fmod_inc=""
 vnc_tls="yes"
@@ -117,15 +118,18 @@ 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)
 audio_drv_list="oss"
+audio_possible_drivers="oss sdl esd"
 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
     kqemu="yes"
 fi
@@ -133,6 +137,7 @@ fi
 FreeBSD)
 bsd="yes"
 audio_drv_list="oss"
+audio_possible_drivers="oss sdl esd"
 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
     kqemu="yes"
 fi
@@ -140,10 +145,12 @@ fi
 NetBSD)
 bsd="yes"
 audio_drv_list="oss"
+audio_possible_drivers="oss sdl esd"
 ;;
 OpenBSD)
 bsd="yes"
 audio_drv_list="oss"
+audio_possible_drivers="oss sdl esd"
 ;;
 Darwin)
 bsd="yes"
@@ -151,6 +158,7 @@ darwin="yes"
 darwin_user="yes"
 cocoa="yes"
 audio_drv_list="coreaudio"
+audio_possible_drivers="coreaudio sdl fmod"
 OS_CFLAGS="-mdynamic-no-pic"
 OS_LDFLAGS="-framework CoreFoundation -framework IOKit"
 ;;
@@ -185,13 +193,16 @@ SunOS)
     if test -f /usr/include/sys/soundcard.h ; then
         audio_drv_list="oss"
     fi
+    audio_possible_drivers="oss sdl"
 ;;
 *)
 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"
 fi
 ;;
 esac
@@ -258,25 +269,30 @@ for opt do
   ;;
   --fmod-lib=*) fmod_lib="$optarg"
   ;;
+  --fmod-inc=*) fmod_inc="$optarg"
+  ;;
   --audio-card-list=*) audio_card_list="$optarg"
   ;;
   --audio-drv-list=*) audio_drv_list="$optarg"
   ;;
-  --fmod-inc=*) fmod_inc="$optarg"
-  ;;
   --disable-vnc-tls) vnc_tls="no"
   ;;
   --enable-mingw32) mingw32="yes" ; cross_prefix="i386-mingw32-" ; linux_user="no"
   ;;
   --disable-slirp) slirp="no"
   ;;
+  --disable-vde) vde="no"
+  ;;
   --disable-kqemu) kqemu="no"
   ;;
   --disable-brlapi) brlapi="no"
   ;;
   --enable-profiler) profiler="yes"
   ;;
-  --enable-cocoa) cocoa="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"
   ;;
@@ -400,8 +416,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 "  --audio-drv-list         set audio drivers list"
-echo "  --audio-card-list        set list of additional emulated audio cards"
+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"
@@ -417,6 +435,7 @@ echo "  --fmod-lib               path to FMOD library"
 echo "  --fmod-inc               path to FMOD includes"
 echo "  --enable-uname-release=R Return R for uname -r in usermode emulation"
 echo "  --sparc_cpu=V            Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
+echo "  --disable-vde            disable support for vde network"
 echo ""
 echo "NOTE: The object files are built at the place where configure is launched"
 exit 1
@@ -692,7 +711,7 @@ else
     # Make sure to disable cocoa if sdl was set
     if test "$sdl" = "yes" ; then
        cocoa="no"
-       audio_drv_list="echo $audio_drv_list | sed s,coreaudio,,g"
+       audio_drv_list="`echo $audio_drv_list | sed s,coreaudio,,g`"
     fi
 fi # -z $sdl
 
@@ -707,24 +726,84 @@ if test "$vnc_tls" = "yes" ; then
 fi
 
 ##########################################
-# alsa sound support libraries
-
-if test "$alsa" = "yes" ; then
+# vde libraries probe
+if test "$vde" = "yes" ; then
   cat > $TMPC << EOF
-#include <alsa/asoundlib.h>
-int main(void) { snd_pcm_t **handle; return snd_pcm_close(*handle); }
+#include <libvdeplug.h>
+int main(void) { struct vde_open_args a = {0, 0, 0} ; return 0;}
 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
+    if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
+        :
+    else
+        vde="no"
+    fi
 fi
 
+##########################################
+# Sound support libraries probe
+
+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 $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;"
+    ;;
+
+    *)
+    echo "$audio_possible_drivers" | grep -q "\<$drv\>" || {
+        echo
+        echo "Error: Unknown driver '$drv' selected"
+        echo "Possible drivers are: $audio_possible_drivers"
+        echo
+        exit 1
+    }
+    ;;
+
+    esac
+done
+
 ##########################################
 # BrlAPI probe
 
@@ -809,20 +888,6 @@ echo "mingw32 support   $mingw32"
 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"
@@ -837,6 +902,7 @@ echo "Documentation     $build_docs"
 [ ! -z "$uname_release" ] && \
 echo "uname -r          $uname_release"
 echo "NPTL support      $nptl"
+echo "vde support       $vde"
 
 if test $sdl_too_old = "yes"; then
 echo "-> Your SDL version is too old - please upgrade to have SDL support"
@@ -1001,17 +1067,22 @@ if test "$slirp" = "yes" ; then
   echo "CONFIG_SLIRP=yes" >> $config_mak
   echo "#define CONFIG_SLIRP 1" >> $config_h
 fi
+if test "$vde" = "yes" ; then
+  echo "CONFIG_VDE=yes" >> $config_mak
+  echo "#define CONFIG_VDE 1" >> $config_h
+  echo "VDE_LIBS=-lvdeplug" >> $config_mak
+fi
 for card in $audio_card_list; do
-    def=CONFIG_`echo $card | tr [:lower:] [:upper:]`
+    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:]`
+    def=CONFIG_`echo $drv | tr '[:lower:]' '[:upper:]'`
     echo "$def=yes" >> $config_mak
-    if test "$drv" == "fmod"; then
+    if test "$drv" = "fmod"; then
         echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
         echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
     fi
This page took 0.031688 seconds and 4 git commands to generate.