Commit 2aca7272 authored by Sam Lantinga's avatar Sam Lantinga

Audio subsystem no longer assumes sun audio API on UNIX systems

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40149
parent f2de3a7f
...@@ -307,6 +307,29 @@ CheckOPENBSDAUDIO() ...@@ -307,6 +307,29 @@ CheckOPENBSDAUDIO()
fi fi
} }
dnl Check whether we want to use IRIX 6.5+ native audio or not
CheckDMEDIA()
{
if test x$enable_audio = xyes; then
AC_MSG_CHECKING(for dmedia audio support)
have_dmedia=no
AC_TRY_COMPILE([
#include <dmedia/audio.h>
],[
ALport audio_port;
],[
have_dmedia=yes
])
# Set up files for the audio library
if test x$have_dmedia = xyes; then
CFLAGS="$CFLAGS -DDMEDIA_SUPPORT"
AUDIO_SUBDIRS="$AUDIO_SUBDIRS dmedia"
AUDIO_DRIVERS="$AUDIO_DRIVERS dmedia/libaudio_dmedia.la"
SYSTEM_LIBS="$SYSTEM_LIBS -laudio"
fi
fi
}
dnl Find the ESD includes and libraries dnl Find the ESD includes and libraries
CheckESD() CheckESD()
{ {
...@@ -1203,6 +1226,7 @@ case "$target" in ...@@ -1203,6 +1226,7 @@ case "$target" in
# Set up files for the audio library # Set up files for the audio library
# We use the OSS and ALSA API's, not the Sun audio API # We use the OSS and ALSA API's, not the Sun audio API
#if test x$enable_audio = xyes; then #if test x$enable_audio = xyes; then
# CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
# AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun" # AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
# AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la" # AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
#fi #fi
...@@ -1262,6 +1286,13 @@ case "$target" in ...@@ -1262,6 +1286,13 @@ case "$target" in
CheckPTHREAD CheckPTHREAD
# Set up files for the main() stub # Set up files for the main() stub
COPY_ARCH_SRC(src/main, linux, SDL_main.c) COPY_ARCH_SRC(src/main, linux, SDL_main.c)
# Set up files for the audio library
# We use the OSS and ALSA API's, not the Sun audio API
#if test x$enable_audio = xyes; then
# CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
# AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
# AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
#fi
# Set up files for the joystick library # Set up files for the joystick library
# (No joystick support yet) # (No joystick support yet)
if test x$enable_joystick = xyes; then if test x$enable_joystick = xyes; then
...@@ -1310,6 +1341,7 @@ case "$target" in ...@@ -1310,6 +1341,7 @@ case "$target" in
# Set up files for the audio library # Set up files for the audio library
# We use the OSS and ALSA API's, not the Sun audio API # We use the OSS and ALSA API's, not the Sun audio API
#if test x$enable_audio = xyes; then #if test x$enable_audio = xyes; then
# CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
# AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun" # AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
# AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la" # AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
#fi #fi
...@@ -1360,6 +1392,7 @@ case "$target" in ...@@ -1360,6 +1392,7 @@ case "$target" in
COPY_ARCH_SRC(src/main, linux, SDL_main.c) COPY_ARCH_SRC(src/main, linux, SDL_main.c)
# Set up files for the audio library # Set up files for the audio library
if test x$enable_audio = xyes; then if test x$enable_audio = xyes; then
CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun" AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la" AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
fi fi
...@@ -1414,6 +1447,7 @@ case "$target" in ...@@ -1414,6 +1447,7 @@ case "$target" in
# Set up files for the audio library # Set up files for the audio library
# We use the OSS and native API's, not the Sun audio API # We use the OSS and native API's, not the Sun audio API
#if test x$enable_audio = xyes; then #if test x$enable_audio = xyes; then
# CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
# AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun" # AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
# AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la" # AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
#fi #fi
...@@ -1471,6 +1505,7 @@ case "$target" in ...@@ -1471,6 +1505,7 @@ case "$target" in
COPY_ARCH_SRC(src/main, linux, SDL_main.c) COPY_ARCH_SRC(src/main, linux, SDL_main.c)
# Set up files for the audio library # Set up files for the audio library
if test x$enable_audio = xyes; then if test x$enable_audio = xyes; then
CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun" AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la" AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
fi fi
...@@ -1519,6 +1554,7 @@ case "$target" in ...@@ -1519,6 +1554,7 @@ case "$target" in
COPY_ARCH_SRC(src/main, linux, SDL_main.c) COPY_ARCH_SRC(src/main, linux, SDL_main.c)
# Set up files for the audio library # Set up files for the audio library
if test x$enable_audio = xyes; then if test x$enable_audio = xyes; then
CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun" AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la" AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
fi fi
...@@ -1552,6 +1588,8 @@ case "$target" in ...@@ -1552,6 +1588,8 @@ case "$target" in
ARCH=irix ARCH=irix
CheckDummyVideo CheckDummyVideo
CheckDiskAudio CheckDiskAudio
CheckDMEDIA
CheckESD
CheckNAS CheckNAS
CheckX11 CheckX11
CheckAAlib CheckAAlib
...@@ -1559,12 +1597,12 @@ case "$target" in ...@@ -1559,12 +1597,12 @@ case "$target" in
CheckPTHREAD CheckPTHREAD
# Set up files for the main() stub # Set up files for the main() stub
COPY_ARCH_SRC(src/main, linux, SDL_main.c) COPY_ARCH_SRC(src/main, linux, SDL_main.c)
# Set up files for the audio library # We use the dmedia audio API, not the Sun audio API
if test x$enable_audio = xyes; then #if test x$enable_audio = xyes; then
AUDIO_SUBDIRS="$AUDIO_SUBDIRS dmedia" # CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
AUDIO_DRIVERS="$AUDIO_DRIVERS dmedia/libaudio_dmedia.la" # AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
SYSTEM_LIBS="$SYSTEM_LIBS -laudio" # AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
fi #fi
# Set up files for the joystick library # Set up files for the joystick library
# (No joystick support yet) # (No joystick support yet)
if test x$enable_joystick = xyes; then if test x$enable_joystick = xyes; then
...@@ -1622,6 +1660,7 @@ case "$target" in ...@@ -1622,6 +1660,7 @@ case "$target" in
COPY_ARCH_SRC(src/main, linux, SDL_main.c) COPY_ARCH_SRC(src/main, linux, SDL_main.c)
# Set up files for the audio library # Set up files for the audio library
if test x$enable_audio = xyes; then if test x$enable_audio = xyes; then
CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun" AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la" AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
fi fi
...@@ -1710,6 +1749,7 @@ case "$target" in ...@@ -1710,6 +1749,7 @@ case "$target" in
COPY_ARCH_SRC(src/main, linux, SDL_main.c) COPY_ARCH_SRC(src/main, linux, SDL_main.c)
# Set up files for the audio library # Set up files for the audio library
if test x$enable_audio = xyes; then if test x$enable_audio = xyes; then
CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun" AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la" AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
fi fi
...@@ -1757,8 +1797,6 @@ case "$target" in ...@@ -1757,8 +1797,6 @@ case "$target" in
SYSTEM_LIBS="$SYSTEM_LIBS -lasound" SYSTEM_LIBS="$SYSTEM_LIBS -lasound"
AUDIO_SUBDIRS="$AUDIO_SUBDIRS nto" AUDIO_SUBDIRS="$AUDIO_SUBDIRS nto"
AUDIO_DRIVERS="$AUDIO_DRIVERS nto/libaudio_nto.la" AUDIO_DRIVERS="$AUDIO_DRIVERS nto/libaudio_nto.la"
AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
fi fi
# Set up files for the joystick library # Set up files for the joystick library
if test x$enable_joystick = xyes; then if test x$enable_joystick = xyes; then
......
...@@ -50,9 +50,11 @@ static AudioBootStrap *bootstrap[] = { ...@@ -50,9 +50,11 @@ static AudioBootStrap *bootstrap[] = {
#ifdef ALSA_SUPPORT #ifdef ALSA_SUPPORT
&ALSA_bootstrap, &ALSA_bootstrap,
#endif #endif
#if (defined(unix) && !defined(__CYGWIN32__)) && \ #ifdef SUNAUDIO_SUPPORT
!defined(OSS_SUPPORT) && !defined(ALSA_SUPPORT) &SUNAUDIO_bootstrap,
&AUDIO_bootstrap, #endif
#ifdef DMEDIA_SUPPORT
&DMEDIA_bootstrap,
#endif #endif
#ifdef ARTSC_SUPPORT #ifdef ARTSC_SUPPORT
&ARTSC_bootstrap, &ARTSC_bootstrap,
......
...@@ -109,9 +109,11 @@ extern AudioBootStrap DMA_bootstrap; ...@@ -109,9 +109,11 @@ extern AudioBootStrap DMA_bootstrap;
#ifdef ALSA_SUPPORT #ifdef ALSA_SUPPORT
extern AudioBootStrap ALSA_bootstrap; extern AudioBootStrap ALSA_bootstrap;
#endif #endif
#if (defined(unix) && !defined(__CYGWIN32__)) && \ #ifdef SUNAUDIO_SUPPORT
!defined(OSS_SUPPORT) && !defined(ALSA_SUPPORT) extern AudioBootStrap SUNAUDIO_bootstrap;
extern AudioBootStrap AUDIO_bootstrap; #endif
#ifdef DMEDIA_SUPPORT
extern AudioBootStrap DMEDIA_bootstrap;
#endif #endif
#ifdef ARTSC_SUPPORT #ifdef ARTSC_SUPPORT
extern AudioBootStrap ARTSC_bootstrap; extern AudioBootStrap ARTSC_bootstrap;
......
...@@ -91,7 +91,7 @@ static SDL_AudioDevice *Audio_CreateDevice(int devindex) ...@@ -91,7 +91,7 @@ static SDL_AudioDevice *Audio_CreateDevice(int devindex)
return this; return this;
} }
AudioBootStrap AUDIO_bootstrap = { AudioBootStrap DMEDIA_bootstrap = {
"AL", "IRIX DMedia audio", "AL", "IRIX DMedia audio",
Audio_Available, Audio_CreateDevice Audio_Available, Audio_CreateDevice
}; };
......
...@@ -117,7 +117,7 @@ static SDL_AudioDevice *Audio_CreateDevice(int devindex) ...@@ -117,7 +117,7 @@ static SDL_AudioDevice *Audio_CreateDevice(int devindex)
return this; return this;
} }
AudioBootStrap AUDIO_bootstrap = { AudioBootStrap SUNAUDIO_bootstrap = {
"audio", "UNIX /dev/audio interface", "audio", "UNIX /dev/audio interface",
Audio_Available, Audio_CreateDevice Audio_Available, Audio_CreateDevice
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment