From ba49f3d781ddda444783b1c99ca65f2148e70a33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 3 Nov 2008 10:20:51 +0000 Subject: added checks for sndfile to configure; properly use this in mtx_sndfileread svn path=/trunk/externals/iem/iemmatrix/; revision=10356 --- src/config.h.in | 3 ++- src/configure.ac | 7 +++++-- src/mtx_sndfileread.c | 7 +++---- 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 #endif -#include "iemmatrix.h" #ifdef __WIN32__ # include @@ -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) -- cgit v1.2.1