$OpenBSD: patch-configure_ac,v 1.2 2009/10/15 15:44:50 jakemsr Exp $
--- configure.ac.orig	Sat Apr 11 22:06:55 2009
+++ configure.ac	Tue Oct 13 20:59:08 2009
@@ -50,7 +50,8 @@ AM_PROG_LIBTOOL
 AC_PROG_MAKE_SET
 
 dnl Check for libraries
-AC_CHECK_LIB(pthread, pthread_create)
+dnl AC_CHECK_LIB(pthread, pthread_create)
+LIBS="$LIBS -pthread"
 
 dnl Check for header files
 AC_HEADER_STDC
@@ -87,7 +88,7 @@ AC_SUBST(LIBFLUID_CPPFLAGS)
 AC_SUBST(LIBFLUID_LDFLAGS)
 AC_SUBST(FLUID_CPPFLAGS)
 
-AM_CONDITIONAL(MINGW32_SUPPORT, test "$mingw32_support" == "yes")
+AM_CONDITIONAL(MINGW32_SUPPORT, test "$mingw32_support" = "yes")
 
 AC_ARG_ENABLE(double, AS_HELP_STRING([--enable-double],
 	[double floating point for dsp (default=float)]),
@@ -141,7 +142,7 @@ if test "$ENABLE_DEBUG" = "yes"; then
   CFLAGS="${CFLAGS} ${FCCFLAGS} -g -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wstrict-prototypes -Wno-unused"
   AC_DEFINE(DEBUG, 1, [Define to activate debugging message]) 
 else
-  CFLAGS="${CFLAGS} ${FCCFLAGS} -O2 -fomit-frame-pointer -funroll-all-loops -finline-functions -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wstrict-prototypes -Wno-unused -Winline"
+  CFLAGS="${CFLAGS} ${FCCFLAGS} -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wstrict-prototypes -Wno-unused -Winline"
   AC_DEFINE(DEBUG, 0, [Define to activate debugging message])
 fi
 
@@ -228,7 +229,27 @@ dnl - Check support for OSS audio
 AC_OSS_AUDIO
 AM_CONDITIONAL(OSS_SUPPORT, test "$OSS_SUPPORT" = "1")
 
+dnl - Check for sndio support
+AC_ARG_ENABLE(sndio-support, AS_HELP_STRING([--disable-sndio-support],
+	[disable sndio support (default=auto)]),
+  enable_sndio=$enableval, enable_sndio="yes")
 
+if test "x$enable_sndio" != "xno"; then
+  AC_CHECK_HEADER(sndio.h, SNDIO_SUPPORT=1, SNDIO_SUPPORT=0)
+else
+  SNDIO_SUPPORT=0
+fi
+
+if test "$SNDIO_SUPPORT" = "1"; then
+  AC_DEFINE(SNDIO_SUPPORT, 1, [Define to enable sndio driver])
+fi
+AM_CONDITIONAL(SNDIO_SUPPORT, test "$SNDIO_SUPPORT" = "1")
+SNDIO_CFLAGS=""
+AC_SUBST(SNDIO_CFLAGS)
+SNDIO_LIBS="-lsndio"
+AC_SUBST(SNDIO_LIBS)
+
+
 dnl - Check support for MidiShare
 AC_MIDISHARE
 
@@ -440,6 +461,12 @@ if test "${OSS_SUPPORT}" = "1"; then
   echo "OSS:                   yes"
 else 
   echo "OSS:                   no"
+fi
+
+if test "${SNDIO_SUPPORT}" = "1"; then
+  echo "sndio:                 yes"
+else 
+  echo "sndio:                 no"
 fi
 
 if test "${MIDISHARE_SUPPORT}" = "1"; then
