shithub: aubio

Download patch

ref: e43464c66947865b712be4e8a8c96de2498e4860
parent: 8b3a7e791f7bd185b73ea9f2d599a9b9d3a4d049
parent: 9430dfde990f595505468fdbe20b82b9c42f225e
author: Paul Brossier <piem@piem.org>
date: Fri Jan 6 15:53:32 EST 2012

Merge branch 'master' of piem.org:/git/aubio/aubio

--- a/configure.ac
+++ b/configure.ac
@@ -153,9 +153,15 @@
             [Defined when c99 style varargs macros are supported])
 fi
 
-PKG_CHECK_MODULES(SNDFILE,     sndfile >= 1.0.4,       HAVE_SNDFILE=1)
-if test "${HAVE_SNDFILE}" = "1"; then
-  AC_DEFINE(HAVE_SNDFILE,1,[Define to enable libsndfile support])
+AC_ARG_ENABLE(sndfile,
+  AC_HELP_STRING([--enable-sndfile],[compile with sndfile [[default=auto]]]),
+  [with_sndfile=$enableval],
+  with_sndfile="yes")
+if test "$with_sndfile" = "yes"; then
+  PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.4, HAVE_SNDFILE=1, HAVE_SNDFILE=0)
+  if test "${HAVE_SNDFILE}" = "1"; then
+    AC_DEFINE(HAVE_SNDFILE,1,[Define to enable libsndfile support])
+  fi
 fi
 
 dnl Enable samplerate support (auto)
--- a/examples/sndfileio.c
+++ b/examples/sndfileio.c
@@ -18,6 +18,8 @@
 
 */
 
+#ifdef HAVE_SNDFILE
+
 #include <string.h>
 
 #include <sndfile.h>
@@ -247,3 +249,4 @@
         AUBIO_DBG("format   : %d\n", f->format);
 }
 
+#endif /* HAVE_SNDFILE */
--- a/examples/utils.c
+++ b/examples/utils.c
@@ -18,7 +18,7 @@
 
 */
 
-/** 
+/**
 
   This file includes some tools common to all examples. Code specific to the
   algorithm performed by each program should go in the source file of that
@@ -63,8 +63,13 @@
 uint_t samplerate = 44100;
 
 
+#ifdef HAVE_SNDFILE
 aubio_sndfile_t *file = NULL;
 aubio_sndfile_t *fileout = NULL;
+#else
+void *file = NULL;
+void *fileout = NULL;
+#endif
 
 fvec_t *ibuf;
 fvec_t *obuf;
@@ -196,6 +201,8 @@
   return 0;
 }
 
+#ifdef HAVE_SNDFILE
+
 void
 examples_common_init (int argc, char **argv)
 {
@@ -258,8 +265,19 @@
 
 }
 
+#else /* HAVE_SNDFILE */
 
 void
+examples_common_init (int argc, char **argv)
+{
+  outmsg ("Error, compiled without sndfile, nothing to do for now!\n");
+}
+
+
+#endif /* HAVE_SNDFILE */
+
+
+void
 examples_common_del (void)
 {
   uint_t i;
@@ -273,6 +291,8 @@
 aubio_jack_t *jack_setup;
 #endif
 
+#if HAVE_SNDFILE
+
 void
 examples_common_process (aubio_process_func_t process_func,
     aubio_print_func_t print)
@@ -319,6 +339,16 @@
 
   }
 }
+
+#else /* HAVE_SNDFILE */
+
+void
+examples_common_process (aubio_process_func_t process_func,
+    aubio_print_func_t print)
+{
+}
+
+#endif /* HAVE_SNDFILE */
 
 void
 flush_process (aubio_process_func_t process_func, aubio_print_func_t print)
--- a/tests/src/Makefile.am
+++ b/tests/src/Makefile.am
@@ -5,7 +5,6 @@
 test_phasevoc_jack_LDADD  = $(AM_LDFLAGS) @JACK_LIBS@ 
 
 bin_PROGRAMS = \
-	test-fft \
 	test-hist \
 	test-scale \
 	test-cvec \
@@ -27,9 +26,7 @@
 	test-pitchfcomb \
 	test-pitchmcomb \
 	test-pitch \
-	test-beattracking \
 	test-onset \
-	test-tempo \
 	test-mathutils \
 	test-tss