Added an SDL2 OpenBSD sndio(7) audio target.

--HG--
extra : rebase_source : 5ad387265cff73c1635ca4f2c3635848ba722614
This commit is contained in:
Ryan C. Gordon 2013-07-07 02:03:07 -04:00
parent fdca15860f
commit bbe065f50f
8 changed files with 460 additions and 0 deletions

View file

@ -910,6 +910,52 @@ AC_HELP_STRING([--enable-nas-shared], [dynamically load NAS audio support [[defa
fi
}
dnl See if the sndio audio interface is supported
CheckSNDIO()
{
AC_ARG_ENABLE(sndio,
AC_HELP_STRING([--enable-sndio], [support the sndio audio API [[default=yes]]]),
, enable_sndio=yes)
if test x$enable_audio = xyes -a x$enable_sndio = xyes; then
AC_CHECK_HEADER(sndio.h, have_sndio_hdr=yes)
AC_CHECK_LIB(sndio, sio_open, have_sndio_lib=yes)
AC_MSG_CHECKING(for sndio audio support)
have_sndio=no
if test x$have_sndio_hdr = xyes -a x$have_sndio_lib = xyes; then
have_sndio=yes
SNDIO_LIBS="-lsndio"
fi
AC_MSG_RESULT($have_sndio)
if test x$have_sndio = xyes; then
AC_ARG_ENABLE(sndio-shared,
AC_HELP_STRING([--enable-sndio-shared], [dynamically load sndio audio support [[default=yes]]]),
, enable_sndio_shared=yes)
sndio_lib=[`find_lib "libsndio.so.*" "$SNDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
if test x$have_loadso != xyes && \
test x$enable_sndio_shared = xyes; then
AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic sndio loading])
fi
if test x$have_loadso = xyes && \
test x$enable_sndio_shared = xyes && test x$sndio_lib != x; then
echo "-- dynamic libsndio -> $sndio_lib"
AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_SNDIO_DYNAMIC, "$sndio_lib", [ ])
else
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SNDIO_LIBS"
fi
AC_DEFINE(SDL_AUDIO_DRIVER_SNDIO, 1, [ ])
SOURCES="$SOURCES $srcdir/src/audio/sndio/*.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS $SNDIO_CFLAGS"
have_audio=yes
fi
fi
}
dnl rcg07142001 See if the user wants the disk writer audio driver...
CheckDiskAudio()
{
@ -2262,6 +2308,7 @@ case "$host" in
CheckARTSC
CheckESD
CheckNAS
CheckSNDIO
CheckX11
CheckDirectFB
CheckFusionSound