aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2008-11-03 10:20:51 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2008-11-03 10:20:51 +0000
commitba49f3d781ddda444783b1c99ca65f2148e70a33 (patch)
treee7914bb93cf98072c9dfda7fa65f7e9a43db843c
parentf19687f2bd42e6a147f813407db44c145e7bf7b5 (diff)
added checks for sndfile to configure; properly use this in mtx_sndfileread
svn path=/trunk/externals/iem/iemmatrix/; revision=10356
-rw-r--r--src/config.h.in3
-rw-r--r--src/configure.ac7
-rw-r--r--src/mtx_sndfileread.c7
3 files changed, 10 insertions, 7 deletions
diff --git a/src/config.h.in b/src/config.h.in
index 1f8be77..f4a52f9 100644
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -1,10 +1,11 @@
#ifndef CONFIG_H_
#define CONFIG_H_
-
/* do we have fftw3 installed? */
#undef HAVE_FFTW3_H
+/* do we have libsndfile installed? */
+#undef HAVE_SNDFILE_H
#endif /* CONFIG_H_ */
diff --git a/src/configure.ac b/src/configure.ac
index c36746e..ca98ab4 100644
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -66,9 +66,12 @@ dnl Replace `main' with a function in -lm:
AC_CHECK_LIB(m, main)
dnl Replace `main' with a function in -lpthread:
dnl AC_CHECK_LIB(pthread, main)
-dnl Replace `main' with a function in -lstk:
+dnl Replace `main' with a function in -lfftw3:
AC_CHECK_LIB(fftw3, fftw_destroy_plan)
+dnl for soundfile reading (and writing, if we do that...)
+AC_CHECK_LIB(sndfile, sf_close)
+
if test "x$with_pd" != "x"; then
if test -d "${with_pd}/src"; then
@@ -96,7 +99,7 @@ AC_CHECK_LIB(pd, nullfn)
dnl Checks for header files.
AC_HEADER_STDC
-AC_CHECK_HEADERS(stdlib.h stdio.h string.h math.h time.h sys/time.h fftw3.h)
+AC_CHECK_HEADERS(stdlib.h stdio.h string.h math.h time.h sys/time.h fftw3.h sndfile.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_TIME
diff --git a/src/mtx_sndfileread.c b/src/mtx_sndfileread.c
index 041e2bd..da77506 100644
--- a/src/mtx_sndfileread.c
+++ b/src/mtx_sndfileread.c
@@ -1,7 +1,9 @@
+
+#include "iemmatrix.h"
+
#ifdef HAVE_SNDFILE_H
# include <sndfile.h>
#endif
-#include "iemmatrix.h"
#ifdef __WIN32__
# include <io.h>
@@ -289,9 +291,6 @@ void mtx_sndfileread_setup(void)
class_addmethod(mtx_sndfileread_class, (t_method)mtx_sndfileread_close, gensym("close"), A_NULL, 0);
class_addbang(mtx_sndfileread_class, (t_method)mtx_sndfileread_frame);
class_addfloat(mtx_sndfileread_class, (t_method)mtx_sndfileread_frames);
-#ifndef HAVE_SNDFILE_H
- post("mtx_sndfileread won't work: compiled without libsndfile!");
-#endif
}
void iemtx_sndfileread_setup (void)