diff options
author | Max Kellermann <max@duempel.org> | 2011-09-01 09:18:16 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2011-09-01 10:58:36 +0200 |
commit | a1b880642244b9f732d327e1d93162652838bb06 (patch) | |
tree | b12e5ad1e83091cbf2605ba5468ec61a5ffade83 /m4/mpd_auto.m4 | |
parent | e635d479129fe3a6ea4cff13b682be6cc97db81c (diff) |
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.
Diffstat (limited to 'm4/mpd_auto.m4')
-rw-r--r-- | m4/mpd_auto.m4 | 15 |
1 files changed, 15 insertions, 0 deletions
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]) +]) |