From b2316f4f6420aeac28db7427cd9622608009a389 Mon Sep 17 00:00:00 2001
From: Stan Seibert <volsung@xiph.org>
Date: Sat, 4 Oct 2003 15:34:10 +0000
Subject: [PATCH] Fix bad autoconf mojo and disable mmap io on the alsa09
 driver by default. The dmix software mixer and some chipsets don't like mmap
 io.  Long term need to make this a runtime decision.

git-svn-id: http://svn.xiph.org/trunk/ao@5403 0101bb08-14d6-0310-b084-bc0e0c8e3800
---
 configure.in | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/configure.in b/configure.in
index d36cf01..a6767ef 100644
--- a/configure.in
+++ b/configure.in
@@ -193,7 +193,6 @@ AC_ARG_ENABLE(alsa, [  --enable-alsa           include alsa 0.5 output plugin ],
 if test "$BUILD_ALSA" = "yes"; then
    AC_CHECK_LIB(asound, snd_pcm_channel_params, have_alsa=yes, have_alsa=no)
    AC_CHECK_HEADER(sys/asoundlib.h, , have_alsa=no)
-   AM_CONDITIONAL(HAVE_ALSA,test "x$have_alsa" = xyes)
 fi
 
 if test "x$have_alsa" = xyes; then
@@ -201,6 +200,7 @@ if test "x$have_alsa" = xyes; then
 else
 	ALSA_LIBS=""
 fi
+AM_CONDITIONAL(HAVE_ALSA,test "x$have_alsa" = xyes)
 AC_SUBST(ALSA_LIBS)
 
 
@@ -208,19 +208,15 @@ dnl Check for ALSA 0.9.x
 
 AC_ARG_ENABLE(alsa09, [  --enable-alsa09         include alsa 0.9 output plugin ],
 [ BUILD_ALSA09="$enableval" ],[ BUILD_ALSA09="yes" ])
+AC_ARG_ENABLE(alsa09-mmap,
+   [  --enable-alsa09-mmap          use mmio with alsa 0.9 (experimental!) ],
+   [ BUILD_ALSA09MMIO="$enableval" ],[ BUILD_ALSA09MMIO="no" ])
 
 if test "$BUILD_ALSA09" = "yes"; then
-
-   AC_ARG_ENABLE(alsa09-mmap, [  --enable-alsa09-mmap          use mmio with alsa 0.9 ],
-   [ BUILD_ALSA09MMIO="$enableval" ],[ BUILD_ALSA09MMIO="yes" ])
-
    AC_CHECK_LIB(asound, snd_pcm_open, have_alsa09=yes, have_alsa09=no)
    AC_CHECK_HEADER(alsa/asoundlib.h, , have_alsa09=no)
-   AM_CONDITIONAL(HAVE_ALSA09,test "x$have_alsa09" = xyes)
-
    if test "$BUILD_ALSA09MMIO" = "yes" ; then
       AC_CHECK_HEADER(sys/mman.h, have_alsa09mmio=yes, have_alsa09mmio=no)
-      AM_CONDITIONAL(HAVE_ALSA09MMIO,test "x$have_alsa09mmio" = xyes)
    fi
 
 fi
@@ -233,6 +229,7 @@ if test "x$have_alsa09" = xyes; then
 else
 	ALSA09_LIBS=""
 fi
+AM_CONDITIONAL(HAVE_ALSA09,test "x$have_alsa09" = xyes)
 AC_SUBST(ALSA09_LIBS)
 
 dnl Decide whether we need to enable the workaround for broken OSS APIs
-- 
GitLab