aboutsummaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-16 23:57:05 +0200
committerMax Kellermann <max@duempel.org>2013-10-17 00:09:08 +0200
commita0105b45aee3471b71f9fca5db1eb72636c2733c (patch)
treea1e4be3d03e5c9e7bd3fc44232aa5f3dc8bc8fb3 /m4
parent551b7768fc36e0a40d568e828aab966261fcf5b0 (diff)
downloadmpd-a0105b45aee3471b71f9fca5db1eb72636c2733c.tar.gz
mpd-a0105b45aee3471b71f9fca5db1eb72636c2733c.tar.xz
mpd-a0105b45aee3471b71f9fca5db1eb72636c2733c.zip
configure.ac: add function MPD_AUTO_LIB and use it
Diffstat (limited to '')
-rw-r--r--m4/mpd_auto.m417
1 files changed, 17 insertions, 0 deletions
diff --git a/m4/mpd_auto.m4 b/m4/mpd_auto.m4
index 122c2588d..ff922fadc 100644
--- a/m4/mpd_auto.m4
+++ b/m4/mpd_auto.m4
@@ -79,3 +79,20 @@ AC_DEFUN([MPD_AUTO_PKG_LIB], [
MPD_AUTO_RESULT([$1], [$8], [$9])
])
+
+dnl Wrapper for AC_CHECK_LIB.
+dnl
+dnl Parameters: varname1, varname2, libname, symname, libs, cflags, description, errmsg
+AC_DEFUN([MPD_AUTO_LIB], [
+ AC_SUBST([$2_LIBS], [])
+ AC_SUBST([$2_CFLAGS], [])
+
+ if eval "test x`echo '$'enable_$1` != xno"; then
+ AC_CHECK_LIB($3, $4,
+ [eval "found_$1=yes $2_LIBS='$5' $2_CFLAGS='$6'"],
+ [eval "found_$1=no"],
+ [$5])
+ fi
+
+ MPD_AUTO_RESULT([$1], [$7], [$8])
+])