From c643b6ff167fbd0b6fead4bee38a2b498ee611a7 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 22 Nov 2014 23:18:07 +0100 Subject: configure.ac: add macro MPD_ENABLE_AUTO_PKG_LIB --- m4/mpd_auto.m4 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'm4') diff --git a/m4/mpd_auto.m4 b/m4/mpd_auto.m4 index 041affc65..00e98f7f3 100644 --- a/m4/mpd_auto.m4 +++ b/m4/mpd_auto.m4 @@ -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 -- cgit v1.2.3