$OpenBSD: patch-configure_ac,v 1.5 2021/06/25 21:48:40 sthen Exp $

Index: configure.ac
--- configure.ac.orig
+++ configure.ac
@@ -94,7 +94,7 @@ dnl Check for GNU LD
 AC_LIB_PROG_LD_GNU
 AM_CONDITIONAL(GNU_LD_SUPPORT, test "x$with_gnu_ld" = "xyes")
 
-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)]),
@@ -150,7 +150,7 @@ if test "$GCC" = yes; then
     CFLAGS="${CFLAGS} ${FCCFLAGS} -g -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wstrict-prototypes -Wno-unused-parameter -Wno-cast-qual"
     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 -Winline -Wno-unused-parameter -Wno-cast-qual"
+    CFLAGS="${CFLAGS} ${FCCFLAGS} -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wstrict-prototypes -Winline -Wno-unused-parameter -Wno-cast-qual"
     AC_DEFINE(DEBUG, 0, [Define to activate debugging message])
   fi
 fi
@@ -291,7 +291,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
 
@@ -547,6 +567,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
