$OpenBSD: patch-configure,v 1.10 2012/04/19 07:43:47 ratchov Exp $
--- configure.orig	Sun Jan 15 10:08:27 2012
+++ configure	Wed Apr 11 19:02:04 2012
@@ -134,6 +134,7 @@ _flac=auto
 _mad=auto
 _alsa=auto
 _seq_midi=auto
+_sndio=auto
 _timidity=auto
 _zlib=auto
 _sparkle=auto
@@ -879,6 +880,8 @@ for ac_option in $@; do
 	--disable-alsa)           _alsa=no        ;;
 	--enable-seq-midi)        _seq_midi=yes   ;;
 	--disable-seq-midi)       _seq_midi=no    ;;
+	--enable-sndio)           _sndio=yes      ;;
+	--disable-sndio)          _sndio=no       ;;
 	--enable-timidity)        _timidity=yes   ;;
 	--disable-timidity)       _timidity=no    ;;
 	--enable-vorbis)          _vorbis=yes     ;;
@@ -937,6 +940,11 @@ for ac_option in $@; do
 		ALSA_CFLAGS="-I$arg/include"
 		ALSA_LIBS="-L$arg/lib"
 		;;
+	--with-sndio-prefix=*)
+		arg=`echo $ac_option | cut -d '=' -f 2`
+		SNDIO_CFLAGS="-I$arg/include"
+		SNDIO_LIBS="-L$arg/lib"
+		;;
 	--with-ogg-prefix=*)
 		arg=`echo $ac_option | cut -d '=' -f 2`
 		OGG_CFLAGS="-I$arg/include"
@@ -1613,21 +1621,6 @@ elif test "$have_icc" = yes ; then
 	add_line_to_config_mk 'CXX_UPDATE_DEP_FLAG = -MMD -MF "$(*D)/$(DEPDIR)/$(*F).d" -MQ "$@" -MP'
 fi;
 
-# By default, we add -pedantic to the CXXFLAGS to catch some potentially
-# non-portable constructs, like use of GNU extensions.
-# However, some platforms use GNU extensions in system header files, so
-# for these we must not use -pedantic.
-case $_host_os in
-android | gamecube | psp | wii)
-	;;
-*)
-	# ICC does not support pedantic, while GCC and clang do.
-	if test "$have_icc" = no ; then
-		CXXFLAGS="$CXXFLAGS -pedantic"
-	fi
-	;;
-esac
-
 # If possible, we want to use -Wglobal-constructors
 # However, not all compilers support that, so check whether the active one does.
 echocheck "whether -Wglobal-constructors work"
@@ -3076,9 +3069,11 @@ EOF
 fi
 if test "$_flac" = yes ; then
 	if test "$_vorbis" = yes ; then
-		LIBS="$LIBS $FLAC_LIBS $OGG_LIBS -lFLAC -logg"
+		# LIBS="$LIBS $FLAC_LIBS $OGG_LIBS -lFLAC -logg"
+		LIBS="$LIBS `pkg-config --libs flac` -logg"
 	else
-		LIBS="$LIBS $FLAC_LIBS -lFLAC"
+		# LIBS="$LIBS $FLAC_LIBS -lFLAC"
+		LIBS="$LIBS `pkg-config --libs flac`"
 	fi
 	INCLUDES="$INCLUDES $FLAC_CFLAGS"
 fi
@@ -3205,6 +3200,24 @@ if test "$_seq_midi" = auto ; then
 fi
 define_in_config_h_if_yes "$_seq_midi" 'USE_SEQ_MIDI'
 echo "$_seq_midi"
+
+#
+# Check for sndio
+#
+echocheck "sndio"
+if test "$_sndio" = auto ; then
+	cat > $TMPC << EOF
+#include <sndio.h>
+int main(void) { struct sio_par par; sio_init(&par); return 0; }
+EOF
+	cc_check $SNDIO_CFLAGS $SNDIO_LIBS -lsndio && _sndio=yes
+fi
+if test "$_sndio" = yes ; then
+	LIBS="$LIBS $SNDIO_LIBS -lsndio"
+	INCLUDES="$INCLUDES $SNDIO_CFLAGS"
+fi
+define_in_config_h_if_yes "$_sndio" 'USE_SNDIO'
+echo "$_sndio"
 
 #
 # Check for TiMidity(++)
