summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Makefile.am8
-rw-r--r--configure.ac10
3 files changed, 18 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 4ed264c..26f5ed9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,3 +26,4 @@ autom4te.cache
src/sbcdec
src/sbcenc
src/sbcinfo
+src/sbctester
diff --git a/Makefile.am b/Makefile.am
index eb5d0f6..730fb5a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -24,7 +24,13 @@ src_sbcdec_LDADD = sbc/libsbc-private.la
src_sbcenc_SOURCES = src/sbcenc.c src/formats.h
src_sbcenc_LDADD = sbc/libsbc-private.la
-AM_CFLAGS = -finline-functions -fgcse-after-reload \
+if SBCTESTER
+noinst_PROGRAMS = src/sbctester
+
+src_sbctester_LDADD = @SNDFILE_LIBS@ -lm
+endif
+
+AM_CFLAGS = @SNDFILE_CFLAGS@ -finline-functions -fgcse-after-reload \
-funswitch-loops -funroll-loops
MAINTAINERCLEANFILES = Makefile.in \
diff --git a/configure.ac b/configure.ac
index b10ca7e..eea066a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,4 +44,14 @@ AC_ARG_ENABLE(pie, AC_HELP_STRING([--enable-pie],
fi
])
+AC_ARG_ENABLE(sbctester, AC_HELP_STRING([--disable-sbctester],
+ [disable SBC tester]), [enable_sbctester=${enableval}])
+if (test "${enable_sbctester}" != "no"); then
+ PKG_CHECK_MODULES(SNDFILE, sndfile, dummy=yes,
+ AC_MSG_ERROR(sndfile library is required))
+ AC_SUBST(SNDFILE_CFLAGS)
+ AC_SUBST(SNDFILE_LIBS)
+fi
+AM_CONDITIONAL(SBCTESTER, test "${enable_sbctester}" != "no")
+
AC_OUTPUT(Makefile)