From 4f78562642a8a45b3035a83f5e7bb371a0ed5762 Mon Sep 17 00:00:00 2001 From: gbeauche <> Date: Mon, 19 Jul 2004 19:42:21 +0000 Subject: [PATCH] SDL audio support --- SheepShaver/src/Unix/configure.ac | 17 ++++++++++++++--- SheepShaver/src/Unix/main_unix.cpp | 3 +++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/SheepShaver/src/Unix/configure.ac b/SheepShaver/src/Unix/configure.ac index ebabca69..f6d933ae 100644 --- a/SheepShaver/src/Unix/configure.ac +++ b/SheepShaver/src/Unix/configure.ac @@ -28,6 +28,7 @@ AC_ARG_WITH(dgcc, [ --with-dgcc=COMPILER use C++ COMPILER to compi dnl SDL options. AC_ARG_ENABLE(sdl-static, [ --enable-sdl-static use SDL static libraries for linking [default=no]], [WANT_SDL_STATIC=$enableval], [WANT_SDL_STATIC=no]) AC_ARG_ENABLE(sdl-video, [ --enable-sdl-video use SDL for video graphics [default=no]], [WANT_SDL_VIDEO=$enableval], [WANT_SDL_VIDEO=no]) +AC_ARG_ENABLE(sdl-audio, [ --enable-sdl-audio use SDL for audio [default=no]], [WANT_SDL_AUDIO=$enableval], [WANT_SDL_AUDIO=no]) dnl Checks for programs. AC_PROG_CC @@ -98,13 +99,16 @@ AC_CHECK_LIB(posix4, sem_init) dnl Do we need SDL? WANT_SDL=no -SDL_SUPPORT="none" if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then WANT_SDL=yes WANT_XF86_DGA=no WANT_XF86_VIDMODE=no WANT_FBDEV_DGA=no - SDL_SUPPORT="video" + SDL_SUPPORT="$SDL_SUPPORT video" +fi +if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then + WANT_SDL=yes + SDL_SUPPORT="$SDL_SUPPORT audio" fi if [[ "x$WANT_SDL" = "xyes" ]]; then AC_PATH_PROG(sdl_config, "sdl-config") @@ -121,6 +125,9 @@ if [[ "x$WANT_SDL" = "xyes" ]]; then else WANT_SDL=no fi + SDL_SUPPORT=`echo "$SDL_SUPPORT" | sed -e "s/^ //"` +else + SDL_SUPPORT="none" fi dnl We need X11, if not using SDL. @@ -343,8 +350,8 @@ if [[ "x$WANT_SDL" = "xyes" ]]; then AC_DEFINE(USE_SDL, 1, [Define to enble SDL support.]) fi if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then - VIDEOSRCS="../SDL/video_sdl.cpp" AC_DEFINE(USE_SDL_VIDEO, 1, [Define to enable SDL video graphics support.]) + VIDEOSRCS="../SDL/video_sdl.cpp" KEYCODES="../SDL/keycodes" if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp" @@ -356,6 +363,10 @@ else KEYCODES="keycodes" EXTRASYSSRCS="$EXTRASYSSRCS clip_unix.cpp" fi +if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then + AC_DEFINE(USE_SDL_AUDIO, 1, [Define to enable SDL audio support]) + AUDIOSRC="../SDL/audio_sdl.cpp" +fi SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS" diff --git a/SheepShaver/src/Unix/main_unix.cpp b/SheepShaver/src/Unix/main_unix.cpp index 471d605a..ab644090 100644 --- a/SheepShaver/src/Unix/main_unix.cpp +++ b/SheepShaver/src/Unix/main_unix.cpp @@ -483,6 +483,9 @@ int main(int argc, char **argv) int sdl_flags = 0; #ifdef USE_SDL_VIDEO sdl_flags |= SDL_INIT_VIDEO; +#endif +#ifdef USE_SDL_AUDIO + sdl_flags |= SDL_INIT_AUDIO; #endif assert(sdl_flags != 0); if (SDL_Init(sdl_flags) == -1) {