aboutsummaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4')
-rw-r--r--m4/mpd_auto.m415
1 files changed, 15 insertions, 0 deletions
diff --git a/m4/mpd_auto.m4 b/m4/mpd_auto.m4
index 3f233938..23713d5b 100644
--- a/m4/mpd_auto.m4
+++ b/m4/mpd_auto.m4
@@ -63,3 +63,18 @@ AC_DEFUN([MPD_AUTO_PKG], [
MPD_AUTO_RESULT([$1], [$4], [$5])
])
+
+dnl Check with pkg-config first, fall back to AC_CHECK_LIB.
+dnl
+dnl Parameters: varname1, varname2, pkgname, libname, symname, libs, cflags, description, errmsg
+AC_DEFUN([MPD_AUTO_PKG_LIB], [
+ if eval "test x`echo '$'enable_$1` != xno"; then
+ PKG_CHECK_MODULES([$2], [$3],
+ [eval "found_$1=yes"],
+ AC_CHECK_LIB($4, $5,
+ [eval "found_$1=yes $2_LIBS='$6' $2_CFLAGS='$7'"],
+ [eval "found_$1=no"]))
+ fi
+
+ MPD_AUTO_RESULT([$1], [$8], [$9])
+])