From 588ee77e4b6a36b884f68b1ab5e0b911288c6531 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Sat, 26 Sep 2009 07:11:23 +0200 Subject: [PATCH] configure.ac: make libsamplerate optional --- configure.ac | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index c8c00af6..8182afaa 100644 --- a/configure.ac +++ b/configure.ac @@ -142,11 +142,21 @@ fi dnl Check for pkg-config AC_PATH_PROG(PKG_CONFIG,pkg-config,no) -PKG_CHECK_MODULES(SNDLIB, sndfile >= 1.0.4, HAVE_SNDLIB=1) -PKG_CHECK_MODULES(SAMPLERATE, samplerate >= 0.0.15, HAVE_SAMPLERATE=1) +PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.4, HAVE_SNDFILE=1) +if test "${HAVE_SNDFILE}" = "1"; then + AC_DEFINE(HAVE_SNDFILE,1,[Define to enable libsndfile support]) +fi -if test "${HAVE_SNDLIB}" = "1"; then - AC_DEFINE(HAVE_SNDLIB,1,[Define to enable libsndfile support]) +dnl Enable samplerate support (auto) +AC_ARG_ENABLE(samplerate, + AC_HELP_STRING([--enable-samplerate],[compile with samplerate [[default=auto]]]), + [with_samplerate=$enableval], + with_samplerate="yes") +if test "$with_samplerate" = "yes"; then + PKG_CHECK_MODULES(SAMPLERATE, samplerate >= 0.0.15, HAVE_SAMPLERATE=1) + if test "${HAVE_SAMPLERATE}" = "1"; then + AC_DEFINE(HAVE_SAMPLERATE,1,[Define to enable libsamplerate support]) + fi fi dnl Check for fftw3 (required) @@ -260,7 +270,7 @@ else echo "Fftw3: no (that should not happen)" fi fi -if test "${HAVE_SNDLIB}" = "1"; then +if test "${HAVE_SNDFILE}" = "1"; then echo "Libsndfile: yes" else echo "Libsndfile: no" -- 2.26.2