configure.ac: add macro MPD_ENABLE_AUTO_PKG_LIB

This commit is contained in:
Max Kellermann
2014-11-22 23:18:07 +01:00
parent b3f5b4932c
commit c643b6ff16
9 changed files with 45 additions and 53 deletions

View File

@@ -97,6 +97,25 @@ AC_DEFUN([MPD_ENABLE_AUTO_PKG], [
AM_CONDITIONAL(ENABLE_$2, test x$[]enable_$1 = xyes)
])
dnl Wrapper for AC_ARG_ENABLE and MPD_AUTO_PKG_LIB
dnl
dnl Parameters: varname1, varname2, pkg, libname, symname, libs, cflags, description, errmsg, default, pre
AC_DEFUN([MPD_ENABLE_AUTO_PKG_LIB], [
AC_ARG_ENABLE(translit([$1], [_], [-]),
AS_HELP_STRING([--enable-]translit([$1], [_], [-]),
[enable $4 (default: auto)]),,
[enable_$1=]ifelse([$10], [], [auto], [$10]))
$11
MPD_AUTO_PKG_LIB($1, $2, $3, $4, $5, $6, $7, $8, $9)
if test x$[]enable_$1 = xyes; then
AC_DEFINE(ENABLE_$2, 1,
[Define to enable $4])
fi
AM_CONDITIONAL(ENABLE_$2, test x$[]enable_$1 = xyes)
])
dnl Wrapper for MPD_ENABLE_AUTO_PKG and MPD_DEPENDS
dnl
dnl Parameters: varname1, varname2, pkg, description, errmsg, default, dep_variable, dep_errmsg