configure.in
changeset 2947 fec0db6c44b7
parent 2857 5e04bdd79479
child 2998 d364ee9b9c15
--- a/configure.in	Thu Jan 01 19:42:48 2009 +0000
+++ b/configure.in	Thu Jan 01 21:34:22 2009 +0000
@@ -1349,6 +1349,56 @@
     fi
 }
 
+dnl Find FusionSound
+CheckFusionSound()
+{
+    AC_ARG_ENABLE(fusionsound,
+AC_HELP_STRING([--enable-fusionsound], [use FusionSound audio driver [[default=no]]]),
+                  , enable_fusionsound=no)
+    if test x$enable_audio = xyes -a x$enable_fusionsound = xyes; then
+        fusionsound=no
+
+        FUSIONSOUND_REQUIRED_VERSION=1.1.1
+
+        AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+        AC_MSG_CHECKING(for FusionSound $FUSIONSOUND_REQUIRED_VERSION support)
+        if test x$PKG_CONFIG != xno; then
+            if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $FUSIONSOUND_REQUIRED_VERSION fusionsound; then
+                FUSIONSOUND_CFLAGS=`$PKG_CONFIG --cflags fusionsound`
+                FUSIONSOUND_LIBS=`$PKG_CONFIG --libs fusionsound`
+                fusionsound=yes
+            fi
+        fi
+        AC_MSG_RESULT($fusionsound)
+
+        if test x$fusionsound = xyes; then
+            AC_DEFINE(SDL_AUDIO_DRIVER_FUSIONSOUND)
+            SOURCES="$SOURCES $srcdir/src/audio/fusionsound/*.c"
+            EXTRA_CFLAGS="$EXTRA_CFLAGS $FUSIONSOUND_CFLAGS"
+            
+            AC_ARG_ENABLE(fusionsound-shared,
+AC_HELP_STRING([--enable-fusionsound-shared], [dynamically load fusionsound audio support [[default=yes]]]),
+                          , enable_fusionsound_shared=yes)
+            fusionsound_shared=no
+	        AC_MSG_CHECKING(for FusionSound dynamic loading support)
+            if test x$have_loadso != xyes && \
+               test x$enable_fusionsound_shared = xyes; then
+                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic fusionsound loading])
+            fi
+            if test x$have_loadso = xyes && \
+               test x$enable_fusionsound_shared = xyes; then
+                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC, "libfusionsound.so")
+            	fusionsound_shared=yes
+            else
+	            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $FUSIONSOUND_LIBS"
+            fi
+	        AC_MSG_RESULT($fusionsound_shared)
+            
+            have_audio=yes
+        fi
+    fi
+}
+
 dnl See if we're running on PlayStation 2 hardware
 CheckPS2GS()
 {
@@ -2207,6 +2257,7 @@
         CheckNANOX
         CheckFBCON
         CheckDirectFB
+        CheckFusionSound
         CheckPS2GS
         CheckSVGA
         CheckVGL