shithub: libsamplerate

Download patch

ref: 57bb4de0f1d8279ffa115f9ff1c5d4d38d531f5c
parent: a7df0e7fbfe7cec2a87f2a90db76e51602de26e5
author: Erik de Castro Lopo <erikd@mega-nerd.com>
date: Wed Nov 2 17:06:45 EDT 2011

Detect and use ALSA for varispeed-play.

--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-11-02  Erik de Castro Lopo  <erikd AT mega-nerd DOT com>
+
+    * configure.ac examples/Makefile.am
+    Detect ALSA and use it in varispeed-play.
+
 2011-08-15  Erik de Castro Lopo  <erikd AT mega-nerd DOT com>
 
     * configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -185,6 +185,19 @@
 	fi
 
 #====================================================================================
+# Check for ALSA.
+
+ALSA_LIBS=""
+
+if test x$enable_alsa != xno ; then
+	AC_CHECK_HEADERS(alsa/asoundlib.h)
+	if test x$ac_cv_header_alsa_asoundlib_h = xyes ; then
+		ALSA_LIBS="-lasound"
+		enable_alsa=yes
+		fi
+	fi
+
+#====================================================================================
 # Check for libfftw3 which is required for the test and example programs.
 
 if test $ac_arg_fftw = "Y" ; then
@@ -293,6 +306,8 @@
 AC_SUBST(SNDFILE_CFLAGS)
 AC_SUBST(SNDFILE_LIBS)
 
+AC_SUBST(ALSA_LIBS)
+
 AC_CONFIG_FILES([Makefile M4/Makefile src/Version_script \
 			Win32/Makefile Win32/Makefile.mingw \
 			src/Makefile examples/Makefile tests/Makefile doc/Makefile \
@@ -322,9 +337,10 @@
 AC_MSG_RESULT([
   Extra tools required for testing and examples :
 
-    Use FFTW : .................... ${ac_cv_fftw3}])
+    Have FFTW : ................... ${ac_cv_fftw3}])
 
-AC_MSG_RESULT([    Have libsndfile : ............. ${ac_cv_sndfile}
+AC_MSG_RESULT([    Have libsndfile : ............. ${ac_cv_sndfile}])
+AC_MSG_RESULT([    Have ALSA : ................... ${ac_cv_header_alsa_asoundlib_h}
 ])
 
 AC_MSG_RESULT([  Installation directories :
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -10,7 +10,7 @@
 
 OS_SPECIFIC_LINKS = @OS_SPECIFIC_LINKS@
 
-SNDFILE_LIBS = @SNDFILE_LIBS@
+SNDFILE_LIBS = @SNDFILE_LIBS@ @ALSA_LIBS@
 AM_CFLAGS = @SNDFILE_CFLAGS@
 
 #===============================================================================