shithub: sox

Download patch

ref: 15e26a81a420c709767daebc0373ca0137f6fcd5
parent: b59fb8e698ff572cae533a6569ef53f43777c820
author: cbagwell <cbagwell>
date: Wed Jan 3 21:17:44 EST 2007

Use a macro to find libsamplerate that doesn't require PKG_CHECK_MODULES

--- a/configure.ac
+++ b/configure.ac
@@ -62,9 +62,6 @@
 AC_SYS_LARGEFILE
 AC_FUNC_FSEEKO
 
-dnl Test for pkg-config; some library tests rely on this
-AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
-
 dnl Check for ALSA audio
 AC_CHECK_HEADERS(alsa/asoundlib.h,
     [with_alsa=yes
@@ -133,21 +130,14 @@
 
 dnl Test for libsamplerate.
 with_samplerate=yes
-if test x$PKG_CONFIG != xno ; then
-  AC_ARG_WITH(samplerate,
-      AC_HELP_STRING([--with-samplerate],
-          [Use libsamplerate (aka Secret Rabbit Code) if present (default is YES)]))
-  if test "$with_samplerate" = yes; then
-      PKG_CHECK_MODULES(SAMPLERATE, samplerate >= 0.0.15,
-          AC_DEFINE(HAVE_SAMPLERATE, 1, [Set to 1 if you have libsamplerate.]),
-          with_samplerate=no)
-  fi
-else
-  with_samplerate=no
+AC_ARG_WITH(samplerate,
+    AC_HELP_STRING([--with-samplerate],
+        [Use libsamplerate (aka Rabbit Code) if present (default is YES)]))
+if test "$with_samplerate" = yes; then
+  SOX_PATH_SAMPLERATE(, [AC_MSG_ERROR([Could not find a usable libsamplerate])])
 fi
 AC_SUBST(SAMPLERATE_CFLAGS)
 AC_SUBST(SAMPLERATE_LIBS)
-
 
 dnl LUA, LUA_INCLUDES, LUA_LIBS