diff --git a/configure.in b/configure.in index ca99b66..7dcf6bb 100644 --- a/configure.in +++ b/configure.in @@ -476,6 +476,10 @@ dnl ================================================================== dnl Checks for sound dnl ================================================================== +AC_ARG_ENABLE(alsa, +[ --disable-alsa disable alsa support], +) + dnl MME AC_CHECK_LIB(mme,waveOutOpen,HAVE_LIBMME=yes) if test -z "$SNDTYPE" -a "x$ac_cv_header_mme_mmsystem_h" = "xyes" -a \ @@ -489,6 +493,21 @@ QF_maGiC_VALUE SOUND_LIBS="-lmme") fi +SNDTYPE="" +AC_MSG_CHECKING(for sound support) +if test "x$enable_alsa" != "xno"; then + if test -z "$SNDTYPE" -a "x$ac_cv_header_sys_asoundlib_h" = "xyes"; then + AC_EGREP_CPP([QF_maGiC_VALUE],[ +#include +#if defined(SND_LIB_MAJOR) && defined(SND_LIB_MINOR) +#if SND_LIB_MAJOR>0 || (SND_LIB_MAJOR==0 && SND_LIB_MINOR>=5) +QF_maGiC_VALUE +#endif +#endif + ],[ SNDTYPE="ALSA" SOUND_LIBS="-lasound"]) + fi +fi + dnl OSS if test -z "$SNDTYPE" -a "x$ac_cv_header_sys_soundcard_h" = "xyes"; then AC_EGREP_CPP([QF_maGiC_VALUE],[ @@ -533,6 +552,7 @@ fi AC_SUBST(SOUND_LIBS) AM_CONDITIONAL(SNDTYPE_MME, test "$SNDTYPE" = "MME") AM_CONDITIONAL(SNDTYPE_OSS, test "$SNDTYPE" = "OSS") +AM_CONDITIONAL(SNDTYPE_ALSA, test "$SNDTYPE" = "ALSA") AM_CONDITIONAL(SNDTYPE_WIN32, test "$SNDTYPE" = "WIN32") diff --git a/include/sound.h b/include/sound.h index 368c558..98c358b 100644 --- a/include/sound.h +++ b/include/sound.h @@ -155,6 +155,7 @@ extern int total_channels; extern qboolean fakedma; extern int fakedma_updates; extern int paintedtime; +extern int soundtime; extern vec3_t listener_origin; extern vec3_t listener_forward; extern vec3_t listener_right; diff --git a/source/Makefile.am b/source/Makefile.am index 02e014e..f2e61a8 100644 --- a/source/Makefile.am +++ b/source/Makefile.am @@ -25,9 +25,13 @@ libqfsnd_a_SOURCES = snd_win.c else if SNDTYPE_OSS libqfsnd_a_SOURCES = snd_oss.c +else +if SNDTYPE_ALSA +libqfsnd_a_SOURCES = snd_alsa.c endif endif -EXTRA_libqfsnd_a_SOURCES = snd_win.c snd_oss.c +endif +EXTRA_libqfsnd_a_SOURCES = snd_win.c snd_oss.c snd_alsa.c if CDTYPE_WIN32 libqfcd_a_SOURCES = cd_win.c