aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac8
-rw-r--r--m4/mpd_auto.m410
2 files changed, 12 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index 3d6ec62af..d34855955 100644
--- a/configure.ac
+++ b/configure.ac
@@ -682,12 +682,8 @@ fi
AM_CONDITIONAL(HAVE_MVP, test x$enable_mvp = xyes)
-if test x$enable_alsa != xno; then
- PKG_CHECK_MODULES(ALSA, [alsa >= 0.9.0],
- found_alsa=yes, found_alsa=no)
-fi
-
-MPD_AUTO_RESULT([alsa], [ALSA output plugin], [libasound not found])
+MPD_AUTO_PKG(alsa, ALSA, [alsa >= 0.9.0],
+ [ALSA output plugin], [libasound not found])
if test x$enable_alsa = xyes; then
AC_DEFINE(HAVE_ALSA, 1, [Define to enable ALSA support])
diff --git a/m4/mpd_auto.m4 b/m4/mpd_auto.m4
index 635f41560..58ea63796 100644
--- a/m4/mpd_auto.m4
+++ b/m4/mpd_auto.m4
@@ -38,3 +38,13 @@ AC_DEFUN([MPD_AUTO_RESULT], [
MPD_AUTO_DISABLED([$name], [$feature], [$msg])
fi
])
+
+AC_DEFUN([MPD_AUTO_PKG], [
+ if eval "test x`echo '$'enable_$1` != xno"; then
+ PKG_CHECK_MODULES([$2], [$3],
+ [eval "found_$1=yes"],
+ [eval "found_$1=no"])
+ fi
+
+ MPD_AUTO_RESULT([$1], [$4], [$5])
+])