From 0e048dee411cc20beb2a8667e5bb339f9b7fb939 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sat, 17 May 2014 21:27:52 +0200 Subject: New resample feature on output channels. --- configure.ac | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index c3fc352..d8d45d4 100644 --- a/configure.ac +++ b/configure.ac @@ -355,7 +355,36 @@ if test x$with_resample == xyes; then dnl Check for libsamplerate dnl ====================== PKG_CHECK_MODULES(SAMPLERATE, samplerate >= 0.1.7) -fi + +# dnl ====================== +# dnl Check for the zitaresampler library +# dnl ====================== +# AC_LANG_PUSH([C++]) +# tmp_CXXFLAGS="$CXXFLAGS" +# tmp_CPPFLAGS="$CPPFLAGS" +# tmp_CFLAGS="$CFLAGS" +# tmp_LDFLAGS="$LDFLAGS" +# tmp_LIBS="$LIBS" +# CXXFLAGS="" +# CPPFLAGS="$ZITA_CPPFLAGS" +# CFLAGS="" +# LDFLAGS="$ZITA_LDFLAGS" +# LIBS="" +# AC_CHECK_HEADER(zita-resampler/resampler.h, , +# AC_MSG_ERROR([*** zita-resampler header files not found! Set ZITA_CPPFLAGS to add searchpath.])) +# AC_CHECK_LIB(zita-resampler, _Z28zita_resampler_major_versionv, , +# AC_MSG_ERROR([*** zita-resampler library not found! Set ZITA_LDFLAGS to add searchpath.])) +# ZITA_CPPFLAGS="$CXXFLAGS $CPPFLAGS $CFLAGS" +# ZITA_LIBS="$LDFLAGS $LIBS" +# CXXFLAGS="$tmp_CXXFLAGS" +# CPPFLAGS="$tmp_CPPFLAGS" +# CFLAGS="$tmp_CFLAGS" +# LDFLAGS="$tmp_LDFLAGS" +# LIBS="$tmp_LIBS" +# AC_SUBST(ZITA_CPPFLAGS) +# AC_SUBST(ZITA_LIBS) +# AC_LANG_POP([C++]) +fi #dnl ====================== #dnl Check for zlib -- cgit v1.2.3 From 484eb4f976568ba058c91a36f6482a404e35d486 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sun, 12 Oct 2014 21:15:03 +0200 Subject: Add zita resampler and libsamplerate to comnfigure. --- configure.ac | 108 ++++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 73 insertions(+), 35 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index d8d45d4..68dffad 100644 --- a/configure.ac +++ b/configure.ac @@ -346,44 +346,82 @@ dnl Check for sndfile dnl ====================== PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.20) -AC_ARG_WITH(resample, [ --with-resample Build with resample support]) -if test x$with_resample == xyes; then + +AC_ARG_ENABLE([resampler], +[ --enable-resampler[=lib] Enable resampler using either 'zita' or 'src' (libsamplerate). Use 'auto' for autodetect [default=auto]],, + [enable_resampler="auto"]) +if test "x$enable_resampler" = "xyes"; then + enable_resampler="auto" +fi + +has_src=no +has_zita=no +if test x$enable_resampler != xno; then AC_MSG_WARN([*** Building resample support!]) - AC_DEFINE(WITH_RESAMPLE, [], [Use resample]) + AC_DEFINE(WITH_RESAMPLER, [], [Use resample]) - dnl ====================== - dnl Check for libsamplerate - dnl ====================== - PKG_CHECK_MODULES(SAMPLERATE, samplerate >= 0.1.7) + if test x$enable_resampler == xauto || test x$enable_resampler == xsrc; then + dnl ====================== + dnl Check for libsamplerate + dnl ====================== + PKG_CHECK_MODULES(SAMPLERATE, samplerate >= 0.1.7, has_src=yes, has_src=no) + fi -# dnl ====================== -# dnl Check for the zitaresampler library -# dnl ====================== -# AC_LANG_PUSH([C++]) -# tmp_CXXFLAGS="$CXXFLAGS" -# tmp_CPPFLAGS="$CPPFLAGS" -# tmp_CFLAGS="$CFLAGS" -# tmp_LDFLAGS="$LDFLAGS" -# tmp_LIBS="$LIBS" -# CXXFLAGS="" -# CPPFLAGS="$ZITA_CPPFLAGS" -# CFLAGS="" -# LDFLAGS="$ZITA_LDFLAGS" -# LIBS="" -# AC_CHECK_HEADER(zita-resampler/resampler.h, , -# AC_MSG_ERROR([*** zita-resampler header files not found! Set ZITA_CPPFLAGS to add searchpath.])) -# AC_CHECK_LIB(zita-resampler, _Z28zita_resampler_major_versionv, , -# AC_MSG_ERROR([*** zita-resampler library not found! Set ZITA_LDFLAGS to add searchpath.])) -# ZITA_CPPFLAGS="$CXXFLAGS $CPPFLAGS $CFLAGS" -# ZITA_LIBS="$LDFLAGS $LIBS" -# CXXFLAGS="$tmp_CXXFLAGS" -# CPPFLAGS="$tmp_CPPFLAGS" -# CFLAGS="$tmp_CFLAGS" -# LDFLAGS="$tmp_LDFLAGS" -# LIBS="$tmp_LIBS" -# AC_SUBST(ZITA_CPPFLAGS) -# AC_SUBST(ZITA_LIBS) -# AC_LANG_POP([C++]) + if test x$enable_resampler == xauto || test x$enable_resampler == xzita; then + dnl ====================== + dnl Check for the zitaresampler library + dnl ====================== + AC_LANG_PUSH([C++]) + tmp_CXXFLAGS="$CXXFLAGS" + tmp_CPPFLAGS="$CPPFLAGS" + tmp_CFLAGS="$CFLAGS" + tmp_LDFLAGS="$LDFLAGS" + tmp_LIBS="$LIBS" + CXXFLAGS="" + CPPFLAGS="$ZITA_CPPFLAGS" + CFLAGS="" + LDFLAGS="$ZITA_LDFLAGS" + LIBS="" + AC_CHECK_HEADER(zita-resampler/resampler.h, + AC_CHECK_LIB(zita-resampler, _Z28zita_resampler_major_versionv, has_zita=yes, has_zita=no), + has_zita=no) + ZITA_CPPFLAGS="$CXXFLAGS $CPPFLAGS $CFLAGS" + ZITA_LIBS="$LDFLAGS $LIBS -lzita-resampler" + CXXFLAGS="$tmp_CXXFLAGS" + CPPFLAGS="$tmp_CPPFLAGS" + CFLAGS="$tmp_CFLAGS" + LDFLAGS="$tmp_LDFLAGS" + LIBS="$tmp_LIBS" + AC_SUBST(ZITA_CPPFLAGS) + AC_SUBST(ZITA_LIBS) + AC_LANG_POP([C++]) + fi +fi + +if test x$enable_resampler == xauto; then + if test x$has_zita == xyes; then + enable_resampler=zita + elif test x$has_src == xyes; then + enable_resampler=src + else + AC_MSG_ERROR([*** No resampler library present. Either libsamplerate or zita-resampler must be installed.]) + fi +fi + +if test x$enable_resampler == xzita; then + if test x$has_zita == xyes; then + AC_DEFINE(USE_ZITA, [], [zita-resampler is present]) + else + AC_MSG_ERROR([*** zita-resampler library or headers not found. Set ZITA_LDFLAGS or ZITA_CPPFLAGS to add searchpath.]) + fi +fi + +if test x$enable_resampler == xsrc; then + if test x$has_src == xyes; then + AC_DEFINE(USE_SRC, [], [libsamplerate is present]) + else + AC_MSG_ERROR([*** Missing libsamplerate.]) + fi fi #dnl ====================== -- cgit v1.2.3 From 2e7176bc558cb03d4e7c27769bab9cd45c703332 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 5 Dec 2014 20:32:14 +0100 Subject: Change check for libzita-resampler to not depend on cpp name mangling. --- configure.ac | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 37e3013..641f2f7 100644 --- a/configure.ac +++ b/configure.ac @@ -351,13 +351,13 @@ if test x$enable_resampler != xno; then CXXFLAGS="" CPPFLAGS="$ZITA_CPPFLAGS" CFLAGS="" - LDFLAGS="$ZITA_LDFLAGS" + LDFLAGS="$ZITA_LDFLAGS -lzita-resampler -lpthread" LIBS="" - AC_CHECK_HEADER(zita-resampler/resampler.h, - AC_CHECK_LIB(zita-resampler, _Z28zita_resampler_major_versionv, has_zita=yes, has_zita=no), - has_zita=no) + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([#include ], + [Resampler r] ) ], has_zita=yes, has_zita=no) ZITA_CPPFLAGS="$CXXFLAGS $CPPFLAGS $CFLAGS" - ZITA_LIBS="$LDFLAGS $LIBS -lzita-resampler" + ZITA_LIBS="$LDFLAGS $LIBS" CXXFLAGS="$tmp_CXXFLAGS" CPPFLAGS="$tmp_CPPFLAGS" CFLAGS="$tmp_CFLAGS" -- cgit v1.2.3