summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-10-25 11:06:39 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-10-25 11:06:39 +0000
commit582a5f9cca7f8ae1f41076c8c3bc9c3bae851b09 (patch)
tree51ff2d26d58b7e1d4082bcb84d4a3dccc1db3cfe
parenta6b3daeb44d9b6f0d47fbe0cbfc6612c061352cd (diff)
Add build magic around sbctester program
-rw-r--r--acinclude.m48
-rw-r--r--configure.in1
-rw-r--r--sbc/Makefile.am14
-rw-r--r--sbc/sbctester.c10
4 files changed, 24 insertions, 9 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 320f8946..671ba99a 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -157,10 +157,17 @@ AC_DEFUN([AC_PATH_INOTIFY], [
AC_CHECK_HEADERS(sys/inotify.h, dummy=yes, inotify_found=no)
])
+AC_DEFUN([AC_PATH_SNDFILE], [
+ PKG_CHECK_MODULES(SNDFILE, sndfile, sndfile_found=yes, sndfile_found=no)
+ AC_SUBST(SNDFILE_CFLAGS)
+ AC_SUBST(SNDFILE_LIBS)
+])
+
AC_DEFUN([AC_ARG_BLUEZ], [
fortify_enable=yes
debug_enable=no
pie_enable=no
+ sndfile_enable=${sndfile_found}
inotify_enable=${inotify_found}
expat_enable=${expat_found}
hal_enable=${hal_found}
@@ -375,6 +382,7 @@ AC_DEFUN([AC_ARG_BLUEZ], [
AC_SUBST([SBC_CFLAGS], ['-I$(top_srcdir)/sbc'])
AC_SUBST([SBC_LIBS], ['$(top_builddir)/sbc/libsbc.la'])
+ AM_CONDITIONAL(SNDFILE, test "${sndfile_enable}" = "yes" && test "${sndfile_found}" = "yes")
AM_CONDITIONAL(INOTIFY, test "${inotify_enable}" = "yes" && test "${inotify_found}" = "yes")
AM_CONDITIONAL(HAL, test "${hal_enable}" = "yes" && test "${hal_found}" = "yes")
AM_CONDITIONAL(USB, test "${usb_enable}" = "yes" && test "${usb_found}" = "yes")
diff --git a/configure.in b/configure.in
index 199a5864..e23ea839 100644
--- a/configure.in
+++ b/configure.in
@@ -35,6 +35,7 @@ AC_PATH_HAL
AC_PATH_USB
AC_PATH_EXPAT
AC_PATH_INOTIFY
+AC_PATH_SNDFILE
AC_ARG_BLUEZ
diff --git a/sbc/Makefile.am b/sbc/Makefile.am
index 46cb30be..840fbfef 100644
--- a/sbc/Makefile.am
+++ b/sbc/Makefile.am
@@ -1,14 +1,26 @@
+if SNDFILE
+sndfile_programs = sbctester
+else
+sndfile_programs =
+endif
+
if SBC
noinst_LTLIBRARIES = libsbc.la
libsbc_la_SOURCES = sbc.h sbc.c sbc_math.h sbc_tables.h
-noinst_PROGRAMS = sbcinfo sbcdec sbcenc
+noinst_PROGRAMS = sbcinfo sbcdec sbcenc $(sndfile_programs)
sbcdec_LDADD = libsbc.la
sbcenc_LDADD = libsbc.la
+
+if SNDFILE
+sbctester_LDADD = @SNDFILE_LIBS@
endif
+endif
+
+AM_CFLAGS = @SNDFILE_CFLAGS@
MAINTAINERCLEANFILES = Makefile.in
diff --git a/sbc/sbctester.c b/sbc/sbctester.c
index 0b35a335..9d719e2e 100644
--- a/sbc/sbctester.c
+++ b/sbc/sbctester.c
@@ -98,7 +98,6 @@ static int calculate_rms_level(SNDFILE * sndref, SF_INFO * infosref,
int i, j, err = 0, verdict = 0;
short refsample[MAXCHANNELS], tstsample[MAXCHANNELS];
double refbits, tstbits;
- double rms;
double rms_accu[MAXCHANNELS];
double rms_level[MAXCHANNELS];
double rms_limit = 1.0 / (pow(2.0, accuracy - 1) * pow(12.0, 0.5));
@@ -183,16 +182,11 @@ error:
return (err < 0) ? err : verdict;
}
-static int check_sample()
-{
- return 0;
-}
-
static int check_absolute_diff(SNDFILE * sndref, SF_INFO * infosref,
SNDFILE * sndtst, SF_INFO * infostst, int accuracy)
{
int i, j, err = 0, verdict = 0;
- short refsample[MAXCHANNELS], tstsample[MAXCHANNELS],
+ short refsample[MAXCHANNELS], tstsample[MAXCHANNELS];
short refmax[MAXCHANNELS], tstmax[MAXCHANNELS];
double refbits, tstbits;
double rms_absolute = 1.0 / (pow(2, accuracy - 2));
@@ -263,7 +257,7 @@ error:
int main(int argc, char *argv[])
{
int err = 0;
- int rms_absolute, pass_rms, pass_absolute, pass, accuracy;
+ int pass_rms, pass_absolute, pass, accuracy;
char *ref;
char *tst;
SNDFILE *sndref = NULL;