From a1b880642244b9f732d327e1d93162652838bb06 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 1 Sep 2011 09:18:16 +0200 Subject: configure.ac: fail if libid3tag was enabled explicitly, but not found Add M4 function MPD_AUTO_PKG_LIB for pkg-config with AC_CHECK_LIB fallback. --- m4/mpd_auto.m4 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'm4') diff --git a/m4/mpd_auto.m4 b/m4/mpd_auto.m4 index 3f233938f..23713d5b7 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]) +]) -- cgit v1.2.3