unix: Support OSS audio on systems other than Linux.

This commit is contained in:
nia 2023-11-20 11:16:08 +01:00
parent 666761c95a
commit 62501a2218
2 changed files with 71 additions and 27 deletions

64
unix/configure vendored
View File

@ -7264,18 +7264,60 @@ fi
if test "x$enable_sound" = "xyes"; then if test "x$enable_sound" = "xyes"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether sound is supported on this platform" >&5 ac_fn_cxx_check_header_compile "$LINENO" "sys/soundcard.h" "ac_cv_header_sys_soundcard_h" "$ac_includes_default"
printf %s "checking whether sound is supported on this platform... " >&6; } if test "x$ac_cv_header_sys_soundcard_h" = xyes
if test "x$snes9x_cv_linux_os" = "xyes"; then then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _oss_ioctl in -lossaudio" >&5
else printf %s "checking for _oss_ioctl in -lossaudio... " >&6; }
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 if test ${ac_cv_lib_ossaudio__oss_ioctl+y}
printf "%s\n" "no" >&6; } then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Your OS is not Linux. Build without sound support." >&5 printf %s "(cached) " >&6
printf "%s\n" "$as_me: WARNING: Your OS is not Linux. Build without sound support." >&2;} else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-lossaudio $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
namespace conftest {
extern "C" int _oss_ioctl ();
}
int
main (void)
{
return conftest::_oss_ioctl ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"
then :
ac_cv_lib_ossaudio__oss_ioctl=yes
else $as_nop
ac_cv_lib_ossaudio__oss_ioctl=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ossaudio__oss_ioctl" >&5
printf "%s\n" "$ac_cv_lib_ossaudio__oss_ioctl" >&6; }
if test "x$ac_cv_lib_ossaudio__oss_ioctl" = xyes
then :
S9XLIBS="$S9XLIBS -lossaudio"
fi
else $as_nop
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Your OS does not have OSS. Build without sound support." >&5
printf "%s\n" "$as_me: WARNING: Your OS does not have OSS. Build without sound support." >&2;}
enable_sound="no" enable_sound="no"
fi
fi
fi fi
if test "x$enable_sound" = "xyes"; then if test "x$enable_sound" = "xyes"; then

View File

@ -479,14 +479,16 @@ AC_ARG_ENABLE([sound],
[], [enable_sound="yes"]) [], [enable_sound="yes"])
if test "x$enable_sound" = "xyes"; then if test "x$enable_sound" = "xyes"; then
AC_MSG_CHECKING([whether sound is supported on this platform]) AC_CHECK_HEADER([sys/soundcard.h],
if test "x$snes9x_cv_linux_os" = "xyes"; then [
AC_MSG_RESULT([yes]) AC_CHECK_LIB([ossaudio], [_oss_ioctl], [
else S9XLIBS="$S9XLIBS -lossaudio"
AC_MSG_RESULT([no]) ], [], [])
AC_MSG_WARN([Your OS is not Linux. Build without sound support.]) ],
[
AC_MSG_WARN([Your OS does not have OSS. Build without sound support.])
enable_sound="no" enable_sound="no"
fi ])
fi fi
if test "x$enable_sound" = "xyes"; then if test "x$enable_sound" = "xyes"; then