shithub: sox

Download patch

ref: 0cb1d63a2c8324e534e6fa1f68090c84986bc29f
parent: 9f09e6711b5866545f06f0745475ee01f552fc41
author: rrt <rrt>
date: Wed Dec 6 15:13:14 EST 2006

Streamline configuration, putting config tests for each optional bit
together (i.e. whether user wants them and whether they can be found
on the system).

Make some parts non-optional if they're found, namely, those that
don't change the license of libst.a.

--- a/Makefile.in
+++ b/Makefile.in
@@ -71,8 +71,6 @@
 distuninstallcheck_listfiles = find . -type f -print
 distcleancheck_listfiles = find . -type f -print
 ACLOCAL = @ACLOCAL@
-ALSA_FALSE = @ALSA_FALSE@
-ALSA_TRUE = @ALSA_TRUE@
 AMDEP_FALSE = @AMDEP_FALSE@
 AMDEP_TRUE = @AMDEP_TRUE@
 AMTAR = @AMTAR@
@@ -107,8 +105,6 @@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
 OBJEXT = @OBJEXT@
-OSS_FALSE = @OSS_FALSE@
-OSS_TRUE = @OSS_TRUE@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -117,7 +113,6 @@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
-PLAY_SUPPORT = @PLAY_SUPPORT@
 RANLIB = @RANLIB@
 SAMPLERATE_CFLAGS = @SAMPLERATE_CFLAGS@
 SAMPLERATE_LIBS = @SAMPLERATE_LIBS@
@@ -124,8 +119,6 @@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
-SUNAU_FALSE = @SUNAU_FALSE@
-SUNAU_TRUE = @SUNAU_TRUE@
 VERSION = @VERSION@
 ac_ct_CC = @ac_ct_CC@
 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
--- a/configure
+++ b/configure
@@ -685,13 +685,6 @@
 PKG_CONFIG
 SAMPLERATE_CFLAGS
 SAMPLERATE_LIBS
-ALSA_TRUE
-ALSA_FALSE
-OSS_TRUE
-OSS_FALSE
-SUNAU_TRUE
-SUNAU_FALSE
-PLAY_SUPPORT
 LTLIBOBJS'
 ac_subst_files=''
       ac_precious_vars='build_alias
@@ -1280,19 +1273,21 @@
 Optional Features:
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --disable-external-gsm  Disable detection of external GSM library
-  --disable-alsa-dsp      Disable detection of ALSA
-  --disable-oss-dsp       Disable detection of OSS
-  --disable-sun-audio     Disable detection of SUN-style audio
-  --disable-ogg-vorbis    Disable detection of Ogg Vorbis
-  --disable-flac          Disable detection of FLAC
-  --disable-mad           Disable detection of MAD (MP3 Audio Decoder)
-  --disable-lame          Disable detection of LAME (LAME Ain't an MP3 Encoder)
-  --disable-samplerate    Detection of libsamplerate (aka Secret Rabbit Code)
   --disable-dependency-tracking  speeds up one-time build
   --enable-dependency-tracking   do not reject slow dependency extractors
   --disable-largefile     omit support for large files
 
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-flac             Use FLAC if present (default is YES)
+  --with-mad              Use MAD (MP3 Audio Decoder) if present (default is
+                          YES)
+  --with-lame             Use LAME (LAME Ain't an MP3 Encoder) if present
+                          (default is YES)
+  --with-samplerate       Use libsamplerate (aka Secret Rabbit Code) if
+                          present (default is YES)
+
 Some influential environment variables:
   CC          C compiler command
   CFLAGS      C compiler flags
@@ -2207,79 +2202,6 @@
 
 
 
-
-# Check whether --enable-gsm was given.
-if test "${enable_gsm+set}" = set; then
-  enableval=$enable_gsm; enable_external_gsm=$enableval
-else
-  enable_external_gsm=yes
-fi
-
-
-# Check whether --enable-alsa_dsp was given.
-if test "${enable_alsa_dsp+set}" = set; then
-  enableval=$enable_alsa_dsp; enable_alsa_dsp=$enableval
-else
-  enable_alsa_dsp=yes
-fi
-
-
-# Check whether --enable-oss_dsp was given.
-if test "${enable_oss_dsp+set}" = set; then
-  enableval=$enable_oss_dsp; enable_oss_dsp=$enableval
-else
-  enable_oss_dsp=yes
-fi
-
-
-# Check whether --enable-sun_audio was given.
-if test "${enable_sun_audio+set}" = set; then
-  enableval=$enable_sun_audio; enable_sun_audio=$enableval
-else
-  enable_sun_audio=yes
-fi
-
-
-# Check whether --enable-ogg_vorbis was given.
-if test "${enable_ogg_vorbis+set}" = set; then
-  enableval=$enable_ogg_vorbis; enable_ogg_vorbis=$enableval
-else
-  enable_ogg_vorbis=yes
-fi
-
-
-# Check whether --enable-flac was given.
-if test "${enable_flac+set}" = set; then
-  enableval=$enable_flac; enable_flac=$enableval
-else
-  enable_flac=yes
-fi
-
-
-# Check whether --enable-mad was given.
-if test "${enable_mad+set}" = set; then
-  enableval=$enable_mad; enable_mad=$enableval
-else
-  enable_mad=yes
-fi
-
-
-# Check whether --enable-lame was given.
-if test "${enable_lame+set}" = set; then
-  enableval=$enable_lame; enable_lame=$enableval
-else
-  enable_lame=yes
-fi
-
-
-# Check whether --enable-samplerate was given.
-if test "${enable_samplerate+set}" = set; then
-  enableval=$enable_samplerate; enable_samplerate=$enableval
-else
-  enable_samplerate=yes
-fi
-
-
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -5088,7 +5010,6 @@
 
 
 
-
 for ac_func in strcasecmp strdup
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
@@ -5327,198 +5248,6 @@
 fi
 
 
-
-{ echo "$as_me:$LINENO: checking if math library is required during link..." >&5
-echo "$as_me: checking if math library is required during link..." >&6;}
-{ echo "$as_me:$LINENO: checking for pow" >&5
-echo $ECHO_N "checking for pow... $ECHO_C" >&6; }
-if test "${ac_cv_func_pow+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define pow to an innocuous variant, in case <limits.h> declares pow.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define pow innocuous_pow
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char pow (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef pow
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pow ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_pow || defined __stub___pow
-choke me
-#endif
-
-int
-main ()
-{
-return pow ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_pow=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_func_pow=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_pow" >&5
-echo "${ECHO_T}$ac_cv_func_pow" >&6; }
-
-if test "$ac_cv_func_pow" = no
-then
-
-{ echo "$as_me:$LINENO: checking for pow in -lm" >&5
-echo $ECHO_N "checking for pow in -lm... $ECHO_C" >&6; }
-if test "${ac_cv_lib_m_pow+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pow ();
-int
-main ()
-{
-return pow ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_m_pow=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_m_pow=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_m_pow" >&5
-echo "${ECHO_T}$ac_cv_lib_m_pow" >&6; }
-if test $ac_cv_lib_m_pow = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBM 1
-_ACEOF
-
-  LIBS="-lm $LIBS"
-
-fi
-
-fi
-
 # Check whether --enable-largefile was given.
 if test "${enable_largefile+set}" = set; then
   enableval=$enable_largefile;
@@ -6185,23 +5914,22 @@
 
 
 
-PLAY_SUPPORT=0
-
-
-if test "$enable_ogg_vorbis" = yes
-then
-    if test "${ac_cv_header_vorbis_codec_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for vorbis/codec.h" >&5
-echo $ECHO_N "checking for vorbis/codec.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_vorbis_codec_h+set}" = set; then
+for ac_header in alsa/asoundlib.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_vorbis_codec_h" >&5
-echo "${ECHO_T}$ac_cv_header_vorbis_codec_h" >&6; }
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking vorbis/codec.h usability" >&5
-echo $ECHO_N "checking vorbis/codec.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -6209,7 +5937,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <vorbis/codec.h>
+#include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -6258,8 +5986,8 @@
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking vorbis/codec.h presence" >&5
-echo $ECHO_N "checking vorbis/codec.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -6266,7 +5994,7 @@
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <vorbis/codec.h>
+#include <$ac_header>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -6306,25 +6034,25 @@
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: vorbis/codec.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: vorbis/codec.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: vorbis/codec.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: vorbis/codec.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: vorbis/codec.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: vorbis/codec.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: vorbis/codec.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: vorbis/codec.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: vorbis/codec.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: vorbis/codec.h: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
     ( cat <<\_ASBOX
 ## --------------------------------------------- ##
 ## Report this to cbagwell@users.sourceforge.net ##
@@ -6333,33 +6061,29 @@
      ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for vorbis/codec.h" >&5
-echo $ECHO_N "checking for vorbis/codec.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_vorbis_codec_h+set}" = set; then
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_header_vorbis_codec_h=$ac_header_preproc
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_vorbis_codec_h" >&5
-echo "${ECHO_T}$ac_cv_header_vorbis_codec_h" >&6; }
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
-if test $ac_cv_header_vorbis_codec_h = yes; then
-  found_ogg_vorbis=yes
-else
-  enable_ogg_vorbis=no
-fi
-
-
-    if test "$found_ogg_vorbis" = yes
-    then
-        { echo "$as_me:$LINENO: checking for vorbis_analysis_init in -lvorbis" >&5
-echo $ECHO_N "checking for vorbis_analysis_init in -lvorbis... $ECHO_C" >&6; }
-if test "${ac_cv_lib_vorbis_vorbis_analysis_init+set}" = set; then
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ { echo "$as_me:$LINENO: checking for snd_pcm_open in -lasound" >&5
+echo $ECHO_N "checking for snd_pcm_open in -lasound... $ECHO_C" >&6; }
+if test "${ac_cv_lib_asound_snd_pcm_open+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lvorbis -logg $LIBS"
+LIBS="-lasound  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -6373,11 +6097,11 @@
 #ifdef __cplusplus
 extern "C"
 #endif
-char vorbis_analysis_init ();
+char snd_pcm_open ();
 int
 main ()
 {
-return vorbis_analysis_init ();
+return snd_pcm_open ();
   ;
   return 0;
 }
@@ -6416,12 +6140,12 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_vorbis_vorbis_analysis_init=yes
+  ac_cv_lib_asound_snd_pcm_open=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_vorbis_vorbis_analysis_init=no
+	ac_cv_lib_asound_snd_pcm_open=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
@@ -6428,37 +6152,39 @@
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_vorbis_vorbis_analysis_init" >&5
-echo "${ECHO_T}$ac_cv_lib_vorbis_vorbis_analysis_init" >&6; }
-if test $ac_cv_lib_vorbis_vorbis_analysis_init = yes; then
-  LIBS="-lvorbisfile -lvorbisenc -lvorbis -logg $LIBS"
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBVORBIS 1
-_ACEOF
-
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_asound_snd_pcm_open" >&5
+echo "${ECHO_T}$ac_cv_lib_asound_snd_pcm_open" >&6; }
+if test $ac_cv_lib_asound_snd_pcm_open = yes; then
+  with_alsa=yes
 else
-  enable_ogg_vorbis=no
+  with_alsa=no
 fi
 
-    fi
+else
+  with_alsa=no
 fi
 
+done
 
-if test "$enable_flac" = yes
-then
-    if test "${ac_cv_header_FLAC_file_encoder_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for FLAC/file_encoder.h" >&5
-echo $ECHO_N "checking for FLAC/file_encoder.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_FLAC_file_encoder_h+set}" = set; then
+
+with_oss=no
+
+for ac_header in sys/soundcard.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_FLAC_file_encoder_h" >&5
-echo "${ECHO_T}$ac_cv_header_FLAC_file_encoder_h" >&6; }
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking FLAC/file_encoder.h usability" >&5
-echo $ECHO_N "checking FLAC/file_encoder.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -6466,7 +6192,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <FLAC/file_encoder.h>
+#include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -6515,8 +6241,8 @@
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking FLAC/file_encoder.h presence" >&5
-echo $ECHO_N "checking FLAC/file_encoder.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -6523,7 +6249,7 @@
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <FLAC/file_encoder.h>
+#include <$ac_header>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -6563,25 +6289,25 @@
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: FLAC/file_encoder.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: FLAC/file_encoder.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: FLAC/file_encoder.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: FLAC/file_encoder.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: FLAC/file_encoder.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: FLAC/file_encoder.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: FLAC/file_encoder.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: FLAC/file_encoder.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: FLAC/file_encoder.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: FLAC/file_encoder.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: FLAC/file_encoder.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: FLAC/file_encoder.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: FLAC/file_encoder.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: FLAC/file_encoder.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: FLAC/file_encoder.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: FLAC/file_encoder.h: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
     ( cat <<\_ASBOX
 ## --------------------------------------------- ##
 ## Report this to cbagwell@users.sourceforge.net ##
@@ -6590,33 +6316,44 @@
      ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for FLAC/file_encoder.h" >&5
-echo $ECHO_N "checking for FLAC/file_encoder.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_FLAC_file_encoder_h+set}" = set; then
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_header_FLAC_file_encoder_h=$ac_header_preproc
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_FLAC_file_encoder_h" >&5
-echo "${ECHO_T}$ac_cv_header_FLAC_file_encoder_h" >&6; }
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
-if test $ac_cv_header_FLAC_file_encoder_h = yes; then
-  found_flac=yes
-else
-  enable_flac=no
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ with_oss=yes
 fi
 
+done
 
-    if test "$found_flac" = yes
-    then
-        { echo "$as_me:$LINENO: checking for FLAC__file_encoder_new in -lFLAC" >&5
-echo $ECHO_N "checking for FLAC__file_encoder_new in -lFLAC... $ECHO_C" >&6; }
-if test "${ac_cv_lib_FLAC_FLAC__file_encoder_new+set}" = set; then
+
+for ac_header in machine/soundcard.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lFLAC  $LIBS"
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -6623,30 +6360,17 @@
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char FLAC__file_encoder_new ();
-int
-main ()
-{
-return FLAC__file_encoder_new ();
-  ;
-  return 0;
-}
+$ac_includes_default
+#include <$ac_header>
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -6663,7 +6387,7 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -s conftest.$ac_objext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
@@ -6673,49 +6397,134 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_FLAC_FLAC__file_encoder_new=yes
+  ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_FLAC_FLAC__file_encoder_new=no
+	ac_header_compiler=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_FLAC_FLAC__file_encoder_new" >&5
-echo "${ECHO_T}$ac_cv_lib_FLAC_FLAC__file_encoder_new" >&6; }
-if test $ac_cv_lib_FLAC_FLAC__file_encoder_new = yes; then
-  LIBS="-lFLAC $LIBS"
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBFLAC 1
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## --------------------------------------------- ##
+## Report this to cbagwell@users.sourceforge.net ##
+## --------------------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  enable_flac=no
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
-    fi
 fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ with_oss=yes
+fi
 
+done
 
-if test "$enable_mad" = yes
-then
-    if test "${ac_cv_header_mad_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for mad.h" >&5
-echo $ECHO_N "checking for mad.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_mad_h+set}" = set; then
+
+with_sun_audio=no
+
+for ac_header in sys/audioio.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_mad_h" >&5
-echo "${ECHO_T}$ac_cv_header_mad_h" >&6; }
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking mad.h usability" >&5
-echo $ECHO_N "checking mad.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -6723,7 +6532,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <mad.h>
+#include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -6772,8 +6581,8 @@
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking mad.h presence" >&5
-echo $ECHO_N "checking mad.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -6780,7 +6589,7 @@
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <mad.h>
+#include <$ac_header>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -6820,25 +6629,25 @@
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: mad.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: mad.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: mad.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: mad.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: mad.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: mad.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: mad.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: mad.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: mad.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: mad.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: mad.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: mad.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: mad.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: mad.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: mad.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: mad.h: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
     ( cat <<\_ASBOX
 ## --------------------------------------------- ##
 ## Report this to cbagwell@users.sourceforge.net ##
@@ -6847,33 +6656,44 @@
      ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for mad.h" >&5
-echo $ECHO_N "checking for mad.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_mad_h+set}" = set; then
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_header_mad_h=$ac_header_preproc
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_mad_h" >&5
-echo "${ECHO_T}$ac_cv_header_mad_h" >&6; }
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
-if test $ac_cv_header_mad_h = yes; then
-  found_mad=yes
-else
-  enable_mad=no
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ with_sun_audio=yes
 fi
 
+done
 
-    if test "$found_mad" = yes
-    then
-        { echo "$as_me:$LINENO: checking for mad_stream_buffer in -lmad" >&5
-echo $ECHO_N "checking for mad_stream_buffer in -lmad... $ECHO_C" >&6; }
-if test "${ac_cv_lib_mad_mad_stream_buffer+set}" = set; then
+
+for ac_header in sun/audioio.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lmad  $LIBS"
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -6880,30 +6700,17 @@
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char mad_stream_buffer ();
-int
-main ()
-{
-return mad_stream_buffer ();
-  ;
-  return 0;
-}
+$ac_includes_default
+#include <$ac_header>
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -6920,7 +6727,7 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
+	 { ac_try='test -s conftest.$ac_objext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
@@ -6930,49 +6737,128 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_mad_mad_stream_buffer=yes
+  ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_mad_mad_stream_buffer=no
+	ac_header_compiler=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_mad_mad_stream_buffer" >&5
-echo "${ECHO_T}$ac_cv_lib_mad_mad_stream_buffer" >&6; }
-if test $ac_cv_lib_mad_mad_stream_buffer = yes; then
-  LIBS="$LIBS -lmad"
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBMAD 1
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## --------------------------------------------- ##
+## Report this to cbagwell@users.sourceforge.net ##
+## --------------------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  enable_mad=no
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
-     fi
 fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ with_sun_audio=yes
+fi
 
+done
 
-if test "$enable_lame" = yes
-then
-    if test "${ac_cv_header_lame_lame_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for lame/lame.h" >&5
-echo $ECHO_N "checking for lame/lame.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_lame_lame_h+set}" = set; then
+
+if test "${ac_cv_header_vorbis_codec_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for vorbis/codec.h" >&5
+echo $ECHO_N "checking for vorbis/codec.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_vorbis_codec_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_lame_lame_h" >&5
-echo "${ECHO_T}$ac_cv_header_lame_lame_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_vorbis_codec_h" >&5
+echo "${ECHO_T}$ac_cv_header_vorbis_codec_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking lame/lame.h usability" >&5
-echo $ECHO_N "checking lame/lame.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking vorbis/codec.h usability" >&5
+echo $ECHO_N "checking vorbis/codec.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -6980,7 +6866,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <lame/lame.h>
+#include <vorbis/codec.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -7029,8 +6915,8 @@
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking lame/lame.h presence" >&5
-echo $ECHO_N "checking lame/lame.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking vorbis/codec.h presence" >&5
+echo $ECHO_N "checking vorbis/codec.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -7037,7 +6923,7 @@
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <lame/lame.h>
+#include <vorbis/codec.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -7077,25 +6963,25 @@
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: lame/lame.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: lame/lame.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: lame/lame.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: lame/lame.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: vorbis/codec.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: vorbis/codec.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: lame/lame.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: lame/lame.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: lame/lame.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: lame/lame.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: lame/lame.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: lame/lame.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: lame/lame.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: lame/lame.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: lame/lame.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: lame/lame.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: lame/lame.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: lame/lame.h: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: vorbis/codec.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: vorbis/codec.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: vorbis/codec.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: vorbis/codec.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: vorbis/codec.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: vorbis/codec.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: vorbis/codec.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: vorbis/codec.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: vorbis/codec.h: in the future, the compiler will take precedence" >&2;}
     ( cat <<\_ASBOX
 ## --------------------------------------------- ##
 ## Report this to cbagwell@users.sourceforge.net ##
@@ -7104,33 +6990,25 @@
      ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for lame/lame.h" >&5
-echo $ECHO_N "checking for lame/lame.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_lame_lame_h+set}" = set; then
+{ echo "$as_me:$LINENO: checking for vorbis/codec.h" >&5
+echo $ECHO_N "checking for vorbis/codec.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_vorbis_codec_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_header_lame_lame_h=$ac_header_preproc
+  ac_cv_header_vorbis_codec_h=$ac_header_preproc
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_lame_lame_h" >&5
-echo "${ECHO_T}$ac_cv_header_lame_lame_h" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_vorbis_codec_h" >&5
+echo "${ECHO_T}$ac_cv_header_vorbis_codec_h" >&6; }
 
 fi
-if test $ac_cv_header_lame_lame_h = yes; then
-  found_lame=yes
-else
-  enable_lame=no
-fi
-
-
-    if test "$found_lame" = yes
-    then
-        { echo "$as_me:$LINENO: checking for lame_init in -lmp3lame" >&5
-echo $ECHO_N "checking for lame_init in -lmp3lame... $ECHO_C" >&6; }
-if test "${ac_cv_lib_mp3lame_lame_init+set}" = set; then
+if test $ac_cv_header_vorbis_codec_h = yes; then
+  { echo "$as_me:$LINENO: checking for vorbis_analysis_init in -lvorbis" >&5
+echo $ECHO_N "checking for vorbis_analysis_init in -lvorbis... $ECHO_C" >&6; }
+if test "${ac_cv_lib_vorbis_vorbis_analysis_init+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lmp3lame  $LIBS"
+LIBS="-lvorbis -logg $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -7144,11 +7022,11 @@
 #ifdef __cplusplus
 extern "C"
 #endif
-char lame_init ();
+char vorbis_analysis_init ();
 int
 main ()
 {
-return lame_init ();
+return vorbis_analysis_init ();
   ;
   return 0;
 }
@@ -7187,12 +7065,12 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_mp3lame_lame_init=yes
+  ac_cv_lib_vorbis_vorbis_analysis_init=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_mp3lame_lame_init=no
+	ac_cv_lib_vorbis_vorbis_analysis_init=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
@@ -7199,244 +7077,308 @@
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_mp3lame_lame_init" >&5
-echo "${ECHO_T}$ac_cv_lib_mp3lame_lame_init" >&6; }
-if test $ac_cv_lib_mp3lame_lame_init = yes; then
-  LIBS="$LIBS -lmp3lame"
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LAME 1
-_ACEOF
-
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_vorbis_vorbis_analysis_init" >&5
+echo "${ECHO_T}$ac_cv_lib_vorbis_vorbis_analysis_init" >&6; }
+if test $ac_cv_lib_vorbis_vorbis_analysis_init = yes; then
+  with_ogg_vorbis=yes
 else
-  enable_lame=no
+  with_ogg_vorbis=no
 fi
 
-    fi
-fi
 
-
-if test "$enable_samplerate" = yes
-then
-
-
-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
-	if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
-set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+{ echo "$as_me:$LINENO: checking for ogg_packet_clear in -logg" >&5
+echo $ECHO_N "checking for ogg_packet_clear in -logg... $ECHO_C" >&6; }
+if test "${ac_cv_lib_ogg_ogg_packet_clear+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $PKG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-logg  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-  ;;
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ogg_packet_clear ();
+int
+main ()
+{
+return ogg_packet_clear ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
 esac
-fi
-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-if test -n "$PKG_CONFIG"; then
-  { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
-echo "${ECHO_T}$PKG_CONFIG" >&6; }
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_ogg_ogg_packet_clear=yes
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_ogg_ogg_packet_clear=no
 fi
 
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_ogg_ogg_packet_clear" >&5
+echo "${ECHO_T}$ac_cv_lib_ogg_ogg_packet_clear" >&6; }
+if test $ac_cv_lib_ogg_ogg_packet_clear = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBOGG 1
+_ACEOF
 
+  LIBS="-logg $LIBS"
+
+else
+  with_ogg_vorbis=no
 fi
-if test -z "$ac_cv_path_PKG_CONFIG"; then
-  ac_pt_PKG_CONFIG=$PKG_CONFIG
-  # Extract the first word of "pkg-config", so it can be a program name with args.
-set dummy pkg-config; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
+
+
+{ echo "$as_me:$LINENO: checking for ov_clear in -lvorbisfile" >&5
+echo $ECHO_N "checking for ov_clear in -lvorbisfile... $ECHO_C" >&6; }
+if test "${ac_cv_lib_vorbisfile_ov_clear+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $ac_pt_PKG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lvorbisfile  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-  ;;
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ov_clear ();
+int
+main ()
+{
+return ov_clear ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
 esac
-fi
-ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
-if test -n "$ac_pt_PKG_CONFIG"; then
-  { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
-echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-  if test "x$ac_pt_PKG_CONFIG" = x; then
-    PKG_CONFIG=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
 esac
-    PKG_CONFIG=$ac_pt_PKG_CONFIG
-  fi
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_vorbisfile_ov_clear=yes
 else
-  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
-fi
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+	ac_cv_lib_vorbisfile_ov_clear=no
 fi
-if test -n "$PKG_CONFIG"; then
-	_pkg_min_version=0.9.0
-	{ echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
-echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; }
-	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
-		{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-	else
-		{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-		PKG_CONFIG=""
-	fi
 
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_vorbisfile_ov_clear" >&5
+echo "${ECHO_T}$ac_cv_lib_vorbisfile_ov_clear" >&6; }
+if test $ac_cv_lib_vorbisfile_ov_clear = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBVORBISFILE 1
+_ACEOF
 
-pkg_failed=no
-{ echo "$as_me:$LINENO: checking for SAMPLERATE" >&5
-echo $ECHO_N "checking for SAMPLERATE... $ECHO_C" >&6; }
+  LIBS="-lvorbisfile $LIBS"
 
-if test -n "$PKG_CONFIG"; then
-    if test -n "$SAMPLERATE_CFLAGS"; then
-        pkg_cv_SAMPLERATE_CFLAGS="$SAMPLERATE_CFLAGS"
-    else
-        if test -n "$PKG_CONFIG" && \
-    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"samplerate >= 0.0.15\"") >&5
-  ($PKG_CONFIG --exists --print-errors "samplerate >= 0.0.15") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-  pkg_cv_SAMPLERATE_CFLAGS=`$PKG_CONFIG --cflags "samplerate >= 0.0.15" 2>/dev/null`
 else
-  pkg_failed=yes
+  with_ogg_vorbis=no
 fi
-    fi
+
+
+{ echo "$as_me:$LINENO: checking for vorbis_encode_init_vbr in -lvorbisenc" >&5
+echo $ECHO_N "checking for vorbis_encode_init_vbr in -lvorbisenc... $ECHO_C" >&6; }
+if test "${ac_cv_lib_vorbisenc_vorbis_encode_init_vbr+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-	pkg_failed=untried
-fi
-if test -n "$PKG_CONFIG"; then
-    if test -n "$SAMPLERATE_LIBS"; then
-        pkg_cv_SAMPLERATE_LIBS="$SAMPLERATE_LIBS"
-    else
-        if test -n "$PKG_CONFIG" && \
-    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"samplerate >= 0.0.15\"") >&5
-  ($PKG_CONFIG --exists --print-errors "samplerate >= 0.0.15") 2>&5
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lvorbisenc  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char vorbis_encode_init_vbr ();
+int
+main ()
+{
+return vorbis_encode_init_vbr ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-  pkg_cv_SAMPLERATE_LIBS=`$PKG_CONFIG --libs "samplerate >= 0.0.15" 2>/dev/null`
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_vorbisenc_vorbis_encode_init_vbr=yes
 else
-  pkg_failed=yes
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_vorbisenc_vorbis_encode_init_vbr=no
 fi
-    fi
-else
-	pkg_failed=untried
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_vorbisenc_vorbis_encode_init_vbr" >&5
+echo "${ECHO_T}$ac_cv_lib_vorbisenc_vorbis_encode_init_vbr" >&6; }
+if test $ac_cv_lib_vorbisenc_vorbis_encode_init_vbr = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBVORBISENC 1
+_ACEOF
 
+  LIBS="-lvorbisenc $LIBS"
 
-
-if test $pkg_failed = yes; then
-
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
-        _pkg_short_errors_supported=yes
 else
-        _pkg_short_errors_supported=no
+  with_ogg_vorbis=no
 fi
-        if test $_pkg_short_errors_supported = yes; then
-	        SAMPLERATE_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "samplerate >= 0.0.15"`
-        else
-	        SAMPLERATE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "samplerate >= 0.0.15"`
-        fi
-	# Put the nasty error message in config.log where it belongs
-	echo "$SAMPLERATE_PKG_ERRORS" >&5
 
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-                enable_samplerate=no
-elif test $pkg_failed = untried; then
-	enable_samplerate=no
 else
-	SAMPLERATE_CFLAGS=$pkg_cv_SAMPLERATE_CFLAGS
-	SAMPLERATE_LIBS=$pkg_cv_SAMPLERATE_LIBS
-        { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_SAMPLERATE 1
-_ACEOF
-
+  with_ogg_vorbis=no
 fi
-fi
 
 
 
+with_flac=yes
 
-if test "$enable_alsa_dsp" = yes
-then
+# Check whether --with-flac was given.
+if test "${with_flac+set}" = set; then
+  withval=$with_flac;
+fi
 
-for ac_header in alsa/asoundlib.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+if test "$with_flac" = yes
+then
+    if test "${ac_cv_header_FLAC_file_encoder_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for FLAC/file_encoder.h" >&5
+echo $ECHO_N "checking for FLAC/file_encoder.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_FLAC_file_encoder_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_FLAC_file_encoder_h" >&5
+echo "${ECHO_T}$ac_cv_header_FLAC_file_encoder_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking FLAC/file_encoder.h usability" >&5
+echo $ECHO_N "checking FLAC/file_encoder.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -7444,7 +7386,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <$ac_header>
+#include <FLAC/file_encoder.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -7493,8 +7435,8 @@
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking FLAC/file_encoder.h presence" >&5
+echo $ECHO_N "checking FLAC/file_encoder.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -7501,7 +7443,7 @@
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$ac_header>
+#include <FLAC/file_encoder.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -7541,25 +7483,25 @@
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: FLAC/file_encoder.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: FLAC/file_encoder.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: FLAC/file_encoder.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: FLAC/file_encoder.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: FLAC/file_encoder.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: FLAC/file_encoder.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: FLAC/file_encoder.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: FLAC/file_encoder.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: FLAC/file_encoder.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: FLAC/file_encoder.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: FLAC/file_encoder.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: FLAC/file_encoder.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: FLAC/file_encoder.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: FLAC/file_encoder.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: FLAC/file_encoder.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: FLAC/file_encoder.h: in the future, the compiler will take precedence" >&2;}
     ( cat <<\_ASBOX
 ## --------------------------------------------- ##
 ## Report this to cbagwell@users.sourceforge.net ##
@@ -7568,37 +7510,26 @@
      ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+{ echo "$as_me:$LINENO: checking for FLAC/file_encoder.h" >&5
+echo $ECHO_N "checking for FLAC/file_encoder.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_FLAC_file_encoder_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  eval "$as_ac_Header=\$ac_header_preproc"
+  ac_cv_header_FLAC_file_encoder_h=$ac_header_preproc
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_FLAC_file_encoder_h" >&5
+echo "${ECHO_T}$ac_cv_header_FLAC_file_encoder_h" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
- found_alsa_dsp=yes
-fi
+if test $ac_cv_header_FLAC_file_encoder_h = yes; then
 
-done
-
-
-    if test "$found_alsa_dsp" = yes
-    then
-        { echo "$as_me:$LINENO: checking for snd_pcm_open in -lasound" >&5
-echo $ECHO_N "checking for snd_pcm_open in -lasound... $ECHO_C" >&6; }
-if test "${ac_cv_lib_asound_snd_pcm_open+set}" = set; then
+{ echo "$as_me:$LINENO: checking for FLAC__file_encoder_new in -lFLAC" >&5
+echo $ECHO_N "checking for FLAC__file_encoder_new in -lFLAC... $ECHO_C" >&6; }
+if test "${ac_cv_lib_FLAC_FLAC__file_encoder_new+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lasound  $LIBS"
+LIBS="-lFLAC  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -7612,11 +7543,11 @@
 #ifdef __cplusplus
 extern "C"
 #endif
-char snd_pcm_open ();
+char FLAC__file_encoder_new ();
 int
 main ()
 {
-return snd_pcm_open ();
+return FLAC__file_encoder_new ();
   ;
   return 0;
 }
@@ -7655,12 +7586,12 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_asound_snd_pcm_open=yes
+  ac_cv_lib_FLAC_FLAC__file_encoder_new=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_asound_snd_pcm_open=no
+	ac_cv_lib_FLAC_FLAC__file_encoder_new=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
@@ -7667,55 +7598,47 @@
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_asound_snd_pcm_open" >&5
-echo "${ECHO_T}$ac_cv_lib_asound_snd_pcm_open" >&6; }
-if test $ac_cv_lib_asound_snd_pcm_open = yes; then
-  LIBS="$LIBS -lasound"
-                     PLAY_SUPPORT=1
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ALSA 1
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_FLAC_FLAC__file_encoder_new" >&5
+echo "${ECHO_T}$ac_cv_lib_FLAC_FLAC__file_encoder_new" >&6; }
+if test $ac_cv_lib_FLAC_FLAC__file_encoder_new = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBFLAC 1
 _ACEOF
 
+  LIBS="-lFLAC $LIBS"
+
 else
-  enable_lame=no
+  with_flac=no
 fi
 
-    else
-        enable_alsa_dsp=no
-    fi
+else
+  with_flac=no
 fi
 
 
-if test x$enable_alsa_dsp = xyes; then
-  ALSA_TRUE=
-  ALSA_FALSE='#'
-else
-  ALSA_TRUE='#'
-  ALSA_FALSE=
 fi
 
+with_mad=yes
 
-if test "$enable_oss_dsp" = yes
-then
+# Check whether --with-mad was given.
+if test "${with_mad+set}" = set; then
+  withval=$with_mad;
+fi
 
-
-for ac_header in sys/soundcard.h machine/soundcard.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+if test "$with_mad" = yes
+then
+    if test "${ac_cv_header_mad_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for mad.h" >&5
+echo $ECHO_N "checking for mad.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_mad_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_mad_h" >&5
+echo "${ECHO_T}$ac_cv_header_mad_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking mad.h usability" >&5
+echo $ECHO_N "checking mad.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -7723,7 +7646,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <$ac_header>
+#include <mad.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -7772,8 +7695,8 @@
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking mad.h presence" >&5
+echo $ECHO_N "checking mad.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -7780,7 +7703,7 @@
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$ac_header>
+#include <mad.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -7820,25 +7743,25 @@
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: mad.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: mad.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: mad.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: mad.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: mad.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: mad.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: mad.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: mad.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: mad.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: mad.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: mad.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: mad.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: mad.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: mad.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: mad.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: mad.h: in the future, the compiler will take precedence" >&2;}
     ( cat <<\_ASBOX
 ## --------------------------------------------- ##
 ## Report this to cbagwell@users.sourceforge.net ##
@@ -7847,71 +7770,26 @@
      ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+{ echo "$as_me:$LINENO: checking for mad.h" >&5
+echo $ECHO_N "checking for mad.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_mad_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  eval "$as_ac_Header=\$ac_header_preproc"
+  ac_cv_header_mad_h=$ac_header_preproc
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_mad_h" >&5
+echo "${ECHO_T}$ac_cv_header_mad_h" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
- found_oss_dsp=yes
-fi
+if test $ac_cv_header_mad_h = yes; then
 
-done
-
-
-    if test "$found_oss_dsp" = yes
-    then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_OSS 1
-_ACEOF
-
-	PLAY_SUPPORT=1
-    else
-        enable_oss_dsp=no
-    fi
-fi
-
-
-if test x$enable_oss_dsp = xyes; then
-  OSS_TRUE=
-  OSS_FALSE='#'
-else
-  OSS_TRUE='#'
-  OSS_FALSE=
-fi
-
-
-if test "$enable_sun_audio" = yes
-then
-
-
-for ac_header in sys/audioio.h sun/audioio.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+{ echo "$as_me:$LINENO: checking for mad_stream_buffer in -lmad" >&5
+echo $ECHO_N "checking for mad_stream_buffer in -lmad... $ECHO_C" >&6; }
+if test "${ac_cv_lib_mad_mad_stream_buffer+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
 else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmad  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -7918,17 +7796,30 @@
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char mad_stream_buffer ();
+int
+main ()
+{
+return mad_stream_buffer ();
+  ;
+  return 0;
+}
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -7945,7 +7836,7 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
+	 { ac_try='test -s conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
@@ -7955,158 +7846,59 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_header_compiler=yes
+  ac_cv_lib_mad_mad_stream_buffer=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_header_compiler=no
+	ac_cv_lib_mad_mad_stream_buffer=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-if test -z "$ac_cpp_err"; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_mad_mad_stream_buffer" >&5
+echo "${ECHO_T}$ac_cv_lib_mad_mad_stream_buffer" >&6; }
+if test $ac_cv_lib_mad_mad_stream_buffer = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBMAD 1
+_ACEOF
 
-  ac_header_preproc=no
-fi
+  LIBS="-lmad $LIBS"
 
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## --------------------------------------------- ##
-## Report this to cbagwell@users.sourceforge.net ##
-## --------------------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  eval "$as_ac_Header=\$ac_header_preproc"
+  with_mad=no
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
 
+else
+  with_mad=no
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
- found_sun_audio=yes
-fi
 
-done
 
-
-    if test "$found_sun_audio" = yes
-    then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SUNAUDIO 1
-_ACEOF
-
-	PLAY_SUPPORT=1
-    else
-        enable_sun_audio=no
-    fi
 fi
 
+with_lame=yes
 
-if test x$enable_sun_audio = xyes; then
-  SUNAU_TRUE=
-  SUNAU_FALSE='#'
-else
-  SUNAU_TRUE='#'
-  SUNAU_FALSE=
+# Check whether --with-lame was given.
+if test "${with_lame+set}" = set; then
+  withval=$with_lame;
 fi
 
-
-if test "$enable_external_gsm" = yes
+if test "$with_lame" = yes
 then
-
-for ac_header in gsm/gsm.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+    if test "${ac_cv_header_lame_lame_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for lame/lame.h" >&5
+echo $ECHO_N "checking for lame/lame.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_lame_lame_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_lame_lame_h" >&5
+echo "${ECHO_T}$ac_cv_header_lame_lame_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking lame/lame.h usability" >&5
+echo $ECHO_N "checking lame/lame.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -8114,7 +7906,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <$ac_header>
+#include <lame/lame.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -8163,8 +7955,8 @@
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking lame/lame.h presence" >&5
+echo $ECHO_N "checking lame/lame.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -8171,7 +7963,7 @@
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$ac_header>
+#include <lame/lame.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -8211,25 +8003,25 @@
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: lame/lame.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: lame/lame.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: lame/lame.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: lame/lame.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: lame/lame.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: lame/lame.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: lame/lame.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: lame/lame.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: lame/lame.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: lame/lame.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: lame/lame.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: lame/lame.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: lame/lame.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: lame/lame.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: lame/lame.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: lame/lame.h: in the future, the compiler will take precedence" >&2;}
     ( cat <<\_ASBOX
 ## --------------------------------------------- ##
 ## Report this to cbagwell@users.sourceforge.net ##
@@ -8238,37 +8030,26 @@
      ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+{ echo "$as_me:$LINENO: checking for lame/lame.h" >&5
+echo $ECHO_N "checking for lame/lame.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_lame_lame_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  eval "$as_ac_Header=\$ac_header_preproc"
+  ac_cv_header_lame_lame_h=$ac_header_preproc
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_lame_lame_h" >&5
+echo "${ECHO_T}$ac_cv_header_lame_lame_h" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
- found_libgsm=yes
-fi
+if test $ac_cv_header_lame_lame_h = yes; then
 
-done
-
-
-    if test "$found_libgsm" = yes
-    then
-        { echo "$as_me:$LINENO: checking for gsm_create in -lgsm" >&5
-echo $ECHO_N "checking for gsm_create in -lgsm... $ECHO_C" >&6; }
-if test "${ac_cv_lib_gsm_gsm_create+set}" = set; then
+{ echo "$as_me:$LINENO: checking for lame_init in -lmp3lame" >&5
+echo $ECHO_N "checking for lame_init in -lmp3lame... $ECHO_C" >&6; }
+if test "${ac_cv_lib_mp3lame_lame_init+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgsm  $LIBS"
+LIBS="-lmp3lame  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -8282,11 +8063,11 @@
 #ifdef __cplusplus
 extern "C"
 #endif
-char gsm_create ();
+char lame_init ();
 int
 main ()
 {
-return gsm_create ();
+return lame_init ();
   ;
   return 0;
 }
@@ -8325,12 +8106,12 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_gsm_gsm_create=yes
+  ac_cv_lib_mp3lame_lame_init=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_gsm_gsm_create=no
+	ac_cv_lib_mp3lame_lame_init=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
@@ -8337,23 +8118,235 @@
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_gsm_gsm_create" >&5
-echo "${ECHO_T}$ac_cv_lib_gsm_gsm_create" >&6; }
-if test $ac_cv_lib_gsm_gsm_create = yes; then
-  LIBS="$LIBS -lgsm"
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_mp3lame_lame_init" >&5
+echo "${ECHO_T}$ac_cv_lib_mp3lame_lame_init" >&6; }
+if test $ac_cv_lib_mp3lame_lame_init = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBMP3LAME 1
+_ACEOF
+
+  LIBS="-lmp3lame $LIBS"
+
+else
+  with_lame=no
 fi
 
+else
+  with_lame=no
+fi
 
-cat >>confdefs.h <<\_ACEOF
-#define EXTERNAL_GSM 1
-_ACEOF
 
+fi
+
+with_samplerate=yes
+
+# Check whether --with-samplerate was given.
+if test "${with_samplerate+set}" = set; then
+  withval=$with_samplerate;
+fi
+
+if test "$with_samplerate" = yes
+then
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
+echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=0.9.0
+	{ echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
+echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; }
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	else
+		{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+		PKG_CONFIG=""
+	fi
+
+fi
+
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for SAMPLERATE" >&5
+echo $ECHO_N "checking for SAMPLERATE... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$SAMPLERATE_CFLAGS"; then
+        pkg_cv_SAMPLERATE_CFLAGS="$SAMPLERATE_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"samplerate >= 0.0.15\"") >&5
+  ($PKG_CONFIG --exists --print-errors "samplerate >= 0.0.15") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_SAMPLERATE_CFLAGS=`$PKG_CONFIG --cflags "samplerate >= 0.0.15" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
     fi
+else
+	pkg_failed=untried
 fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$SAMPLERATE_LIBS"; then
+        pkg_cv_SAMPLERATE_LIBS="$SAMPLERATE_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"samplerate >= 0.0.15\"") >&5
+  ($PKG_CONFIG --exists --print-errors "samplerate >= 0.0.15") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_SAMPLERATE_LIBS=`$PKG_CONFIG --libs "samplerate >= 0.0.15" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
 
 
 
+if test $pkg_failed = yes; then
 
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        SAMPLERATE_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "samplerate >= 0.0.15"`
+        else
+	        SAMPLERATE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "samplerate >= 0.0.15"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$SAMPLERATE_PKG_ERRORS" >&5
+
+	{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+                with_samplerate=no
+elif test $pkg_failed = untried; then
+	with_samplerate=no
+else
+	SAMPLERATE_CFLAGS=$pkg_cv_SAMPLERATE_CFLAGS
+	SAMPLERATE_LIBS=$pkg_cv_SAMPLERATE_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SAMPLERATE 1
+_ACEOF
+
+fi
+fi
+
+
+
+
 ac_config_files="$ac_config_files Makefile src/libst-config src/Makefile src/libgsm/Makefile"
 
 ac_config_files="$ac_config_files src/play"
@@ -8476,27 +8469,6 @@
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
-if test -z "${ALSA_TRUE}" && test -z "${ALSA_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"ALSA\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"ALSA\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${OSS_TRUE}" && test -z "${OSS_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"OSS\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"OSS\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${SUNAU_TRUE}" && test -z "${SUNAU_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"SUNAU\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"SUNAU\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
 
 : ${CONFIG_STATUS=./config.status}
 ac_clean_files_save=$ac_clean_files
@@ -9104,17 +9076,10 @@
 PKG_CONFIG!$PKG_CONFIG$ac_delim
 SAMPLERATE_CFLAGS!$SAMPLERATE_CFLAGS$ac_delim
 SAMPLERATE_LIBS!$SAMPLERATE_LIBS$ac_delim
-ALSA_TRUE!$ALSA_TRUE$ac_delim
-ALSA_FALSE!$ALSA_FALSE$ac_delim
-OSS_TRUE!$OSS_TRUE$ac_delim
-OSS_FALSE!$OSS_FALSE$ac_delim
-SUNAU_TRUE!$SUNAU_TRUE$ac_delim
-SUNAU_FALSE!$SUNAU_FALSE$ac_delim
-PLAY_SUPPORT!$PLAY_SUPPORT$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 93; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 86; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
@@ -13272,15 +13237,14 @@
 if test ! -f src/monkey.wav; then cp ${srcdir}/src/monkey.wav src/monkey.wav; fi
 
 echo
-echo "ALSA Driver.......................   $enable_alsa_dsp"
-echo "OSS Driver........................   $enable_oss_dsp"
-echo "SUN /dev/audio....................   $enable_sun_audio"
-echo "Ogg Vorbis support................   $enable_ogg_vorbis"
-echo "FLAC support......................   $enable_flac"
-echo "MAD MP3 Decoder...................   $enable_mad"
-echo "LAME MP3 Encoder..................   $enable_lame"
-echo "Secret Rabbit Code resampling.....   $enable_samplerate"
+echo "ALSA Driver.......................   $with_alsa"
+echo "OSS Driver........................   $with_oss"
+echo "SUN /dev/audio....................   $with_sun_audio"
+echo "Ogg Vorbis support................   $with_ogg_vorbis"
+echo "FLAC support......................   $with_flac"
+echo "MAD MP3 Decoder...................   $with_mad"
+echo "LAME MP3 Encoder..................   $with_lame"
+echo "Secret Rabbit Code resampling.....   $with_samplerate"
 echo
 echo "Configure finished.  Do 'make; make install' to compile and install SoX."
 echo
-
--- a/configure.ac
+++ b/configure.ac
@@ -8,52 +8,6 @@
 
 AC_CONFIG_SRCDIR(sox.1)
 
-dnl Parameters to configure
-
-AC_ARG_ENABLE(gsm,
-	[  --disable-external-gsm  Disable detection of external GSM library],
-	enable_external_gsm=$enableval, enable_external_gsm=yes)
-
-AC_ARG_ENABLE(alsa_dsp,
-	[  --disable-alsa-dsp      Disable detection of ALSA],
-	[enable_alsa_dsp=$enableval],
-	[enable_alsa_dsp=yes])
-
-AC_ARG_ENABLE(oss_dsp,
-	[  --disable-oss-dsp       Disable detection of OSS],
-	[enable_oss_dsp=$enableval],
-	[enable_oss_dsp=yes])
-
-AC_ARG_ENABLE(sun_audio,
-	[  --disable-sun-audio     Disable detection of SUN-style audio],
-	[enable_sun_audio=$enableval],
-	[enable_sun_audio=yes])
-
-AC_ARG_ENABLE(ogg_vorbis,
-	[  --disable-ogg-vorbis    Disable detection of Ogg Vorbis],
-	[enable_ogg_vorbis=$enableval],
-	[enable_ogg_vorbis=yes])
-
-AC_ARG_ENABLE(flac,
-	[  --disable-flac          Disable detection of FLAC],
-	[enable_flac=$enableval],
-	[enable_flac=yes])
-
-AC_ARG_ENABLE(mad,
-	[  --disable-mad           Disable detection of MAD (MP3 Audio Decoder)],
-	[enable_mad=$enableval],
-	[enable_mad=yes])
-
-AC_ARG_ENABLE(lame,
-	[  --disable-lame          Disable detection of LAME (LAME Ain't an MP3 Encoder)],
-	[enable_lame=$enableval],
-	[enable_lame=yes])
-
-AC_ARG_ENABLE(samplerate,
-        [  --disable-samplerate    Detection of libsamplerate (aka Secret Rabbit Code)],
-        [enable_samplerate=$enableval],
-        [enable_samplerate=yes])
-
 dnl Checks for programs.
 AC_PROG_CC
 AC_PROG_RANLIB
@@ -74,163 +28,88 @@
 AC_CHECK_HEADERS(fcntl.h unistd.h byteswap.h)
 
 dnl Checks for library functions.
-
 AC_CHECK_FUNCS(strcasecmp strdup)
 AC_REPLACE_FUNCS(getopt_long)
 AM_CONDITIONAL(GETOPT_LONG, test x$getopt_long = xtrue)
 
-dnl Check if math library is needed.
-
-AC_CHECKING(if math library is required during link)
-AC_CHECK_FUNC(pow)
-if test "$ac_cv_func_pow" = no
-then
-  AC_CHECK_LIB(m, pow)
-fi
-
 dnl Large File Support
 AC_SYS_LARGEFILE
 AC_FUNC_FSEEKO
       
-dnl Initial values for exported symbols.
+dnl Check for ALSA audio
+AC_CHECK_HEADERS(alsa/asoundlib.h,
+    [AC_CHECK_LIB(asound, snd_pcm_open, with_alsa=yes, with_alsa=no)],
+    with_alsa=no)
 
-PLAY_SUPPORT=0
+dnl Check for OSS audio
+with_oss=no
+AC_CHECK_HEADERS(sys/soundcard.h, with_oss=yes)
+AC_CHECK_HEADERS(machine/soundcard.h, with_oss=yes)
 
-dnl Test for Ogg Vorbis libraries.
+dnl Check for Sun-style audio
+with_sun_audio=no
+AC_CHECK_HEADERS(sys/audioio.h, with_sun_audio=yes)
+AC_CHECK_HEADERS(sun/audioio.h, with_sun_audio=yes)
 
-if test "$enable_ogg_vorbis" = yes
-then
-    AC_CHECK_HEADER(vorbis/codec.h, found_ogg_vorbis=yes, enable_ogg_vorbis=no)
-    if test "$found_ogg_vorbis" = yes
-    then
-        AC_CHECK_LIB(vorbis, vorbis_analysis_init,
-                     LIBS="-lvorbisfile -lvorbisenc -lvorbis -logg $LIBS"
-                     AC_DEFINE([HAVE_LIBVORBIS], 1, 
-		               [Define if you have Ogg Vorbis Library installed]),
-	             enable_ogg_vorbis=no, -logg)
-    fi
-fi
+dnl Check for Ogg Vorbis libraries
+AC_CHECK_HEADER(vorbis/codec.h,
+    [AC_CHECK_LIB(vorbis, vorbis_analysis_init, with_ogg_vorbis=yes, with_ogg_vorbis=no, -logg)
+    AC_CHECK_LIB(ogg, ogg_packet_clear,, with_ogg_vorbis=no)
+    AC_CHECK_LIB(vorbisfile, ov_clear,, with_ogg_vorbis=no)
+    AC_CHECK_LIB(vorbisenc, vorbis_encode_init_vbr,, with_ogg_vorbis=no)],
+    with_ogg_vorbis=no)
 
-dnl Test for FLAC libraries.
-
-if test "$enable_flac" = yes
+dnl Check for FLAC libraries
+with_flac=yes
+AC_ARG_WITH(flac,
+    AS_HELP_STRING([--with-flac],
+        [Use FLAC if present (default is YES)]))
+if test "$with_flac" = yes
 then
-    AC_CHECK_HEADER(FLAC/file_encoder.h, found_flac=yes, enable_flac=no)
-    if test "$found_flac" = yes
-    then
-        AC_CHECK_LIB(FLAC, FLAC__file_encoder_new,
-                     LIBS="-lFLAC $LIBS"
-                     AC_DEFINE([HAVE_LIBFLAC], 1, 
-		               [Define if you have FLAC Library installed]),
-	             enable_flac=no)
-    fi
+    AC_CHECK_HEADER(FLAC/file_encoder.h,
+        [AC_CHECK_LIB(FLAC, FLAC__file_encoder_new,,with_flac=no)],
+        with_flac=no)
 fi
 
-dnl Test for MAD libraries.
-
-if test "$enable_mad" = yes
+dnl Check for MAD libraries
+with_mad=yes
+AC_ARG_WITH(mad,
+    AS_HELP_STRING([--with-mad],
+        [Use MAD (MP3 Audio Decoder) if present (default is YES)]))
+if test "$with_mad" = yes
 then
-    AC_CHECK_HEADER(mad.h, found_mad=yes, enable_mad=no)
-    if test "$found_mad" = yes
-    then
-        AC_CHECK_LIB(mad, mad_stream_buffer,
-                     LIBS="$LIBS -lmad" 
-		     AC_DEFINE([HAVE_LIBMAD], 1, 
-		               [Define if you have MAD (MP3 Audio Decoder) Library installed]),
-		     enable_mad=no)
-     fi
+    AC_CHECK_HEADER(mad.h,
+        [AC_CHECK_LIB(mad, mad_stream_buffer,,with_mad=no)],
+        with_mad=no)
 fi
 
 dnl Test for LAME library.
-
-if test "$enable_lame" = yes
+with_lame=yes
+AC_ARG_WITH(lame,
+    AS_HELP_STRING([--with-lame],
+        [Use LAME (LAME Ain't an MP3 Encoder) if present (default is YES)]))
+if test "$with_lame" = yes
 then
-    AC_CHECK_HEADER(lame/lame.h, found_lame=yes, enable_lame=no)
-    if test "$found_lame" = yes
-    then
-        AC_CHECK_LIB(mp3lame, lame_init,
-                     LIBS="$LIBS -lmp3lame"
-                     AC_DEFINE([HAVE_LAME], 1, 
-		               [Define if you have LAME (LAME Ain't an MP3 Encoder) library installed]),
-		     enable_lame=no)
-    fi
+    AC_CHECK_HEADER(lame/lame.h,
+        [AC_CHECK_LIB(mp3lame, lame_init,,with_lame=no)],
+        with_lame=no)
 fi
 
 dnl Test for libsamplerate.
-
-if test "$enable_samplerate" = yes
+with_samplerate=yes
+AC_ARG_WITH(samplerate,
+    AS_HELP_STRING([--with-samplerate],
+        [Use libsamplerate (aka Secret Rabbit Code) if present (default is YES)]))
+if test "$with_samplerate" = yes
 then
     PKG_CHECK_MODULES(SAMPLERATE, samplerate >= 0.0.15,
         AC_DEFINE_UNQUOTED([HAVE_SAMPLERATE],1,
             [Set to 1 if you have libsamplerate.]),
-        enable_samplerate=no)
+        with_samplerate=no)
 fi
 AC_SUBST(SAMPLERATE_CFLAGS)
 AC_SUBST(SAMPLERATE_LIBS)
 
-dnl Checks for ALSA.
-
-if test "$enable_alsa_dsp" = yes
-then
-    AC_CHECK_HEADERS(alsa/asoundlib.h, found_alsa_dsp=yes)
-
-    if test "$found_alsa_dsp" = yes
-    then
-        AC_CHECK_LIB(asound, snd_pcm_open,
-                     LIBS="$LIBS -lasound"
-                     PLAY_SUPPORT=1
-                     AC_DEFINE([HAVE_ALSA], 1, 
-		               [Define if you have ALSA library installed]),
-		     enable_lame=no)
-    else
-        enable_alsa_dsp=no
-    fi
-fi
-AM_CONDITIONAL(ALSA, test x$enable_alsa_dsp = xyes)
-
-if test "$enable_oss_dsp" = yes
-then
-    AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h, found_oss_dsp=yes)
-
-    if test "$found_oss_dsp" = yes
-    then
-        AC_DEFINE([HAVE_OSS], 1, 
-                  [Define if you have OSS installed])
-	PLAY_SUPPORT=1
-    else
-        enable_oss_dsp=no
-    fi
-fi
-AM_CONDITIONAL(OSS, test x$enable_oss_dsp = xyes)
-
-if test "$enable_sun_audio" = yes
-then
-    AC_CHECK_HEADERS(sys/audioio.h sun/audioio.h, found_sun_audio=yes)
-
-    if test "$found_sun_audio" = yes
-    then
-        AC_DEFINE([HAVE_SUNAUDIO], 1, 
-                  [Define if you have Sun /dev/audio installed])
-	PLAY_SUPPORT=1
-    else
-        enable_sun_audio=no
-    fi
-fi
-AM_CONDITIONAL(SUNAU, test x$enable_sun_audio = xyes)
-
-if test "$enable_external_gsm" = yes
-then
-    AC_CHECK_HEADERS(gsm/gsm.h, found_libgsm=yes)
-
-    if test "$found_libgsm" = yes
-    then
-        AC_CHECK_LIB(gsm, gsm_create, LIBS="$LIBS -lgsm")
-        AC_DEFINE([EXTERNAL_GSM], 1, [Define if you are using an external GSM library])
-    fi
-fi
-
-AC_SUBST(PLAY_SUPPORT)
-
 dnl Generate output files...
 
 AC_CONFIG_FILES([Makefile src/libst-config src/Makefile src/libgsm/Makefile])
@@ -246,21 +125,14 @@
 if test ! -f src/monkey.wav; then cp ${srcdir}/src/monkey.wav src/monkey.wav; fi
 
 echo
-echo "ALSA Driver.......................   $enable_alsa_dsp"
-echo "OSS Driver........................   $enable_oss_dsp"
-echo "SUN /dev/audio....................   $enable_sun_audio"
-echo "Ogg Vorbis support................   $enable_ogg_vorbis"
-echo "FLAC support......................   $enable_flac"
-echo "MAD MP3 Decoder...................   $enable_mad"
-echo "LAME MP3 Encoder..................   $enable_lame"
-echo "Secret Rabbit Code resampling.....   $enable_samplerate"
+echo "ALSA Driver.......................   $with_alsa"
+echo "OSS Driver........................   $with_oss"
+echo "SUN /dev/audio....................   $with_sun_audio"
+echo "Ogg Vorbis support................   $with_ogg_vorbis"
+echo "FLAC support......................   $with_flac"
+echo "MAD MP3 Decoder...................   $with_mad"
+echo "LAME MP3 Encoder..................   $with_lame"
+echo "Secret Rabbit Code resampling.....   $with_samplerate"
 echo
 echo "Configure finished.  Do 'make; make install' to compile and install SoX."
 echo
-
-dnl Local Variables:
-dnl comment-start: "dnl "
-dnl comment-end: ""
-dnl comment-start-skip: "\\bdnl\\b\\s *"
-dnl compile-command: "autoconf"
-dnl End:
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -19,25 +19,13 @@
 	  reverb.c reverse.c silence.c speed.c stat.c \
 	  stretch.c swap.c synth.c tone.c trim.c vibro.c vol.c
 
-PLAY_0    =
-PLAY_1    = play
+libst_a_SOURCES = $(formats) $(effects) alsa.c oss.c sunaudio.c handlers.c misc.c stio.c util.c
 
-libst_a_SOURCES = $(formats) $(effects) handlers.c misc.c stio.c util.c
-if OSS
-libst_a_SOURCES += oss.c
-endif
-if ALSA
-libst_a_SOURCES += alsa.c
-endif
-if SUNAU
-libst_a_SOURCES += sunaudio.c
-endif
-
 sox_SOURCES = sox.c
 sox_LDADD = libst.a libgsm/libgsm.a
 sox_LDFLAGS = @SAMPLERATE_LIBS@
 
-all: sox soxmix $(PLAY_$(PLAY_SUPPORT))
+all: sox soxmix play
 
 soxmix: sox
 	$(RM) soxmix
@@ -46,18 +34,12 @@
 libgsm/libgsm.a:
 	cd libgsm && $(MAKE)
 
-PLAY_INSTALL_0    =
-PLAY_INSTALL_1    = install-play
-
-install: sox $(PLAY_INSTALL_$(PLAY_SUPPORT))
+install: sox play
 	$(top_srcdir)/mkinstalldirs $(bindir)
 	$(INSTALL) -c -m 755 sox $(bindir)
 	$(RM) $(bindir)/soxmix
 	cd $(bindir) && $(LN_S) sox soxmix
-
-install-play:
 	if [ -f $(bindir)/rec ] ; then $(RM) $(bindir)/rec; fi
-	$(top_srcdir)/mkinstalldirs $(bindir)
 	$(INSTALL) -c -m 755 play $(bindir)
 	cd $(bindir) && $(LN_S) play rec
 
@@ -70,14 +52,9 @@
 	$(INSTALL) -c -m 644 $(srcdir)/st.h $(includedir)
 	$(INSTALL) -c -m 644 ststdint.h $(includedir)
 
-PLAY_UNINSTALL_0    =
-PLAY_UNINSTALL_1    = uninstall-play
-
-uninstall: $(PLAY_UNINSTALL_$(PLAY_SUPPORT))
+uninstall: 
 	$(RM) $(bindir)/sox
 	$(RM) $(bindir)/soxmix
-
-uninstall-play:
 	$(RM) $(bindir)/play
 	$(RM) $(bindir)/rec
 
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -36,9 +36,6 @@
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
 bin_PROGRAMS = sox$(EXEEXT)
-@OSS_TRUE@am__append_1 = oss.c
-@ALSA_TRUE@am__append_2 = alsa.c
-@SUNAU_TRUE@am__append_3 = sunaudio.c
 subdir = src
 DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
 	$(srcdir)/libst-config.in $(srcdir)/play.in \
@@ -64,19 +61,6 @@
 ARFLAGS = cru
 libst_a_AR = $(AR) $(ARFLAGS)
 libst_a_LIBADD =
-am__libst_a_SOURCES_DIST = 8svx.c adpcm.c aiff.c au.c auto.c avr.c \
-	cdr.c cvsd.c dat.c flac.c g711.c g721.c g723_16.c g723_24.c \
-	g723_40.c g72x.c gsm.c hcom.c ima_rw.c maud.c mp3.c nulfile.c \
-	prc.c raw.c sf.c smp.c sndrtool.c sphere.c tx16w.c voc.c \
-	vorbis.c vox.c wav.c wve.c xa.c avg.c band.c bandpass.c \
-	biquad.c breject.c btrworth.c chorus.c compand.c copy.c \
-	dcshift.c deemphas.c earwax.c echo.c echos.c equalizer.c \
-	fade.c FFT.c filter.c flanger.c highp.c highpass.c lowp.c \
-	lowpass.c mask.c mcompand.c noiseprof.c noisered.c pan.c \
-	phaser.c pitch.c polyphas.c rabbit.c rate.c repeat.c \
-	resample.c reverb.c reverse.c silence.c speed.c stat.c \
-	stretch.c swap.c synth.c tone.c trim.c vibro.c vol.c \
-	handlers.c misc.c stio.c util.c oss.c alsa.c sunaudio.c
 am__objects_1 = 8svx.$(OBJEXT) adpcm.$(OBJEXT) aiff.$(OBJEXT) \
 	au.$(OBJEXT) auto.$(OBJEXT) avr.$(OBJEXT) cdr.$(OBJEXT) \
 	cvsd.$(OBJEXT) dat.$(OBJEXT) flac.$(OBJEXT) g711.$(OBJEXT) \
@@ -103,13 +87,9 @@
 	stat.$(OBJEXT) stretch.$(OBJEXT) swap.$(OBJEXT) \
 	synth.$(OBJEXT) tone.$(OBJEXT) trim.$(OBJEXT) vibro.$(OBJEXT) \
 	vol.$(OBJEXT)
-@OSS_TRUE@am__objects_3 = oss.$(OBJEXT)
-@ALSA_TRUE@am__objects_4 = alsa.$(OBJEXT)
-@SUNAU_TRUE@am__objects_5 = sunaudio.$(OBJEXT)
-am_libst_a_OBJECTS = $(am__objects_1) $(am__objects_2) \
-	handlers.$(OBJEXT) misc.$(OBJEXT) stio.$(OBJEXT) \
-	util.$(OBJEXT) $(am__objects_3) $(am__objects_4) \
-	$(am__objects_5)
+am_libst_a_OBJECTS = $(am__objects_1) $(am__objects_2) alsa.$(OBJEXT) \
+	oss.$(OBJEXT) sunaudio.$(OBJEXT) handlers.$(OBJEXT) \
+	misc.$(OBJEXT) stio.$(OBJEXT) util.$(OBJEXT)
 libst_a_OBJECTS = $(am_libst_a_OBJECTS)
 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 PROGRAMS = $(bin_PROGRAMS)
@@ -124,7 +104,7 @@
 CCLD = $(CC)
 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
 SOURCES = $(libst_a_SOURCES) $(sox_SOURCES)
-DIST_SOURCES = $(am__libst_a_SOURCES_DIST) $(sox_SOURCES)
+DIST_SOURCES = $(libst_a_SOURCES) $(sox_SOURCES)
 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
 	html-recursive info-recursive install-data-recursive \
 	install-exec-recursive install-info-recursive \
@@ -136,8 +116,6 @@
 DIST_SUBDIRS = $(SUBDIRS)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
-ALSA_FALSE = @ALSA_FALSE@
-ALSA_TRUE = @ALSA_TRUE@
 AMDEP_FALSE = @AMDEP_FALSE@
 AMDEP_TRUE = @AMDEP_TRUE@
 AMTAR = @AMTAR@
@@ -172,8 +150,6 @@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
 OBJEXT = @OBJEXT@
-OSS_FALSE = @OSS_FALSE@
-OSS_TRUE = @OSS_TRUE@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -182,7 +158,6 @@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
-PLAY_SUPPORT = @PLAY_SUPPORT@
 RANLIB = @RANLIB@
 SAMPLERATE_CFLAGS = @SAMPLERATE_CFLAGS@
 SAMPLERATE_LIBS = @SAMPLERATE_LIBS@
@@ -189,8 +164,6 @@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
-SUNAU_FALSE = @SUNAU_FALSE@
-SUNAU_TRUE = @SUNAU_TRUE@
 VERSION = @VERSION@
 ac_ct_CC = @ac_ct_CC@
 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
@@ -243,17 +216,10 @@
 	  reverb.c reverse.c silence.c speed.c stat.c \
 	  stretch.c swap.c synth.c tone.c trim.c vibro.c vol.c
 
-PLAY_0 = 
-PLAY_1 = play
-libst_a_SOURCES = $(formats) $(effects) handlers.c misc.c stio.c \
-	util.c $(am__append_1) $(am__append_2) $(am__append_3)
+libst_a_SOURCES = $(formats) $(effects) alsa.c oss.c sunaudio.c handlers.c misc.c stio.c util.c
 sox_SOURCES = sox.c
 sox_LDADD = libst.a libgsm/libgsm.a
 sox_LDFLAGS = @SAMPLERATE_LIBS@
-PLAY_INSTALL_0 = 
-PLAY_INSTALL_1 = install-play
-PLAY_UNINSTALL_0 = 
-PLAY_UNINSTALL_1 = uninstall-play
 all: stconfig.h
 	$(MAKE) $(AM_MAKEFLAGS) all-recursive
 
@@ -753,7 +719,7 @@
 	uninstall-libLIBRARIES
 
 
-all: sox soxmix $(PLAY_$(PLAY_SUPPORT))
+all: sox soxmix play
 
 soxmix: sox
 	$(RM) soxmix
@@ -762,15 +728,12 @@
 libgsm/libgsm.a:
 	cd libgsm && $(MAKE)
 
-install: sox $(PLAY_INSTALL_$(PLAY_SUPPORT))
+install: sox play
 	$(top_srcdir)/mkinstalldirs $(bindir)
 	$(INSTALL) -c -m 755 sox $(bindir)
 	$(RM) $(bindir)/soxmix
 	cd $(bindir) && $(LN_S) sox soxmix
-
-install-play:
 	if [ -f $(bindir)/rec ] ; then $(RM) $(bindir)/rec; fi
-	$(top_srcdir)/mkinstalldirs $(bindir)
 	$(INSTALL) -c -m 755 play $(bindir)
 	cd $(bindir) && $(LN_S) play rec
 
@@ -783,11 +746,9 @@
 	$(INSTALL) -c -m 644 $(srcdir)/st.h $(includedir)
 	$(INSTALL) -c -m 644 ststdint.h $(includedir)
 
-uninstall: $(PLAY_UNINSTALL_$(PLAY_SUPPORT))
+uninstall: 
 	$(RM) $(bindir)/sox
 	$(RM) $(bindir)/soxmix
-
-uninstall-play:
 	$(RM) $(bindir)/play
 	$(RM) $(bindir)/rec
 
--- a/src/libgsm/Makefile.in
+++ b/src/libgsm/Makefile.in
@@ -68,8 +68,6 @@
 DIST_SOURCES = $(libgsm_a_SOURCES)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
-ALSA_FALSE = @ALSA_FALSE@
-ALSA_TRUE = @ALSA_TRUE@
 AMDEP_FALSE = @AMDEP_FALSE@
 AMDEP_TRUE = @AMDEP_TRUE@
 AMTAR = @AMTAR@
@@ -106,8 +104,6 @@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
 OBJEXT = @OBJEXT@
-OSS_FALSE = @OSS_FALSE@
-OSS_TRUE = @OSS_TRUE@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -122,8 +118,6 @@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
-SUNAU_FALSE = @SUNAU_FALSE@
-SUNAU_TRUE = @SUNAU_TRUE@
 VERSION = @VERSION@
 ac_ct_CC = @ac_ct_CC@
 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
--- a/src/stconfig.h.in
+++ b/src/stconfig.h.in
@@ -1,11 +1,5 @@
 /* src/stconfig.h.in.  Generated from configure.ac by autoheader.  */
 
-/* Define if you are using an external GSM library */
-#undef EXTERNAL_GSM
-
-/* Define if you have ALSA library installed */
-#undef HAVE_ALSA
-
 /* Define to 1 if you have the <alsa/asoundlib.h> header file. */
 #undef HAVE_ALSA_ASOUNDLIB_H
 
@@ -21,27 +15,27 @@
 /* Define to 1 if you have the `getopt_long' function. */
 #undef HAVE_GETOPT_LONG
 
-/* Define to 1 if you have the <gsm/gsm.h> header file. */
-#undef HAVE_GSM_GSM_H
-
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
-/* Define if you have LAME (LAME Ain't an MP3 Encoder) library installed */
-#undef HAVE_LAME
-
-/* Define if you have FLAC Library installed */
+/* Define to 1 if you have the `FLAC' library (-lFLAC). */
 #undef HAVE_LIBFLAC
 
-/* Define to 1 if you have the `m' library (-lm). */
-#undef HAVE_LIBM
-
-/* Define if you have MAD (MP3 Audio Decoder) Library installed */
+/* Define to 1 if you have the `mad' library (-lmad). */
 #undef HAVE_LIBMAD
 
-/* Define if you have Ogg Vorbis Library installed */
-#undef HAVE_LIBVORBIS
+/* Define to 1 if you have the `mp3lame' library (-lmp3lame). */
+#undef HAVE_LIBMP3LAME
 
+/* Define to 1 if you have the `ogg' library (-logg). */
+#undef HAVE_LIBOGG
+
+/* Define to 1 if you have the `vorbisenc' library (-lvorbisenc). */
+#undef HAVE_LIBVORBISENC
+
+/* Define to 1 if you have the `vorbisfile' library (-lvorbisfile). */
+#undef HAVE_LIBVORBISFILE
+
 /* Define to 1 if you have the <machine/soundcard.h> header file. */
 #undef HAVE_MACHINE_SOUNDCARD_H
 
@@ -48,9 +42,6 @@
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
 
-/* Define if you have OSS installed */
-#undef HAVE_OSS
-
 /* Set to 1 if you have libsamplerate. */
 #undef HAVE_SAMPLERATE
 
@@ -71,9 +62,6 @@
 
 /* Define to 1 if you have the <string.h> header file. */
 #undef HAVE_STRING_H
-
-/* Define if you have Sun /dev/audio installed */
-#undef HAVE_SUNAUDIO
 
 /* Define to 1 if you have the <sun/audioio.h> header file. */
 #undef HAVE_SUN_AUDIOIO_H