- Changed -lpthread to -pthread in quake2_LDFLAGS. Should

probably be a configure test
- Added configure test for AFMT_S16_NE (FreeBSD doesn't have
  _NE, only _LE or _BE)
- Wrapped the use of AFMT_S16_NE in ifdef HAVE_AFMT_S16_NE
This commit is contained in:
Jamie Wilkinson 2002-04-11 00:38:25 +00:00
parent 740faf6966
commit 404101bc00
3 changed files with 28 additions and 2 deletions

View file

@ -81,6 +81,23 @@ AC_TRY_LINK(
AC_MSG_RESULT(no)
)
if test "x$ac_cv_header_sys_soundcard_h" = "xyes"; then
AC_MSG_CHECKING(for AFMT_S16_NE in sys/soundcard.h)
AC_EGREP_CPP([QF_maGiC_VALUE],
[
#include <sys/soundcard.h>
#ifdef AFMT_S16_NE
QF_maGiC_VALUE
#endif
],
HAVE_AFMT_S16_NE=yes
AC_MSG_RESULT(yes)
,
AC_MSG_RESULT(no)
)
fi
AC_SUBST(HAVE_AFMT_S16_NE)
dnl -----------------------------
dnl Checks for library functions.
dnl -----------------------------

View file

@ -107,7 +107,7 @@ ref_softsdl_so_SOURCES = $(REF_SOFT_COMMON) $(REF_SOFT_ASM) rw_sdl.c
AM_CFLAGS = -Wall -Werror -pipe -I/usr/X11R6/include $(shell sdl-config --cflags) -DOPENGL -fPIC
quake2_LDFLAGS = -lm -lpthread @DL_LIBS@
quake2_LDFLAGS = -lm -pthread @DL_LIBS@
ref_glx_so_LDFLAGS = -shared
ref_glx_so_LDADD = -L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm -lGL

View file

@ -292,7 +292,12 @@ qboolean SNDDMA_Init(void) {
dma.samplebits = (int)sndbits->value;
if (dma.samplebits != 16 && dma.samplebits != 8) {
ioctl(audio_fd, SNDCTL_DSP_GETFMTS, &fmt);
if (fmt & AFMT_S16_NE) dma.samplebits = 16;
#ifdef HAVE_AFMT_S16_NE
if (fmt & AFMT_S16_NE)
#else
if (fmt & AFMT_S16_LE)
#endif
dma.samplebits = 16;
else if (fmt & AFMT_U8) dma.samplebits = 8;
}
/* in relnev 0.9, from here until the next RELNEV 0.9 comment has been moved
@ -348,7 +353,11 @@ qboolean SNDDMA_Init(void) {
if (dma.samplebits == 16)
{
#ifdef HAVE_AFMT_S16_NE
rc = AFMT_S16_NE;
#else
rc = AFMT_S16_LE;
#endif
rc = ioctl(audio_fd, SNDCTL_DSP_SETFMT, &rc);
if (rc < 0)
{