Index: configure.ac
--- configure.ac.orig
+++ configure.ac
@@ -27,13 +27,6 @@ if test x"$GCC" = x"yes"; then
     TRY_CFLAGS="$OPT_CFLAGS -Wall"
     AC_TRY_CFLAGS([$TRY_CFLAGS $CFLAGS],[OPT_CFLAGS=$TRY_CFLAGS])
 
-    dnl -O3
-    changequote(<<,>>)
-    TRY_CFLAGS=`echo "$OPT_CFLAGS $CFLAGS"|sed "s/-O[0-9]*//g"`
-    changequote([,])
-    TRY_CFLAGS="$TRY_CFLAGS -O3"
-    AC_TRY_CFLAGS([$TRY_CFLAGS],[OPT_CFLAGS=$TRY_CFLAGS; CFLAGS=""])
-
     AC_ARG_ENABLE([debug],
 	[  --enable-debug          debug mode configuration])
     if test x"$enable_debug" = x"yes"; then
@@ -145,6 +138,15 @@ if test x"$enable_oss" != x"no"; then
         AC_CHECK_LIB([ossaudio],[_oss_ioctl],
             [LIBAO_LIBS="$LIBAO_LIBS -lossaudio"]);;
     esac
+fi
+
+dnl check for sndio
+AC_ARG_ENABLE([sndio],
+    [  --disable-sndio make a version not using sndio])
+if test x"$enable_sndio" != x"no"; then
+    AC_DEFINE([LIBAO_SNDIO],,[libao sndio support])
+    AC_CHECK_LIB([sndio],[sio_initpar],
+       [LIBAO_LIBS="$LIBAO_LIBS -lsndio"])
 fi
 
 dnl check for solaris
