aboutsummaryrefslogtreecommitdiffstats
path: root/m4/mpd_auto.m4
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--m4/mpd_auto.m440
1 files changed, 40 insertions, 0 deletions
diff --git a/m4/mpd_auto.m4 b/m4/mpd_auto.m4
new file mode 100644
index 000000000..635f41560
--- /dev/null
+++ b/m4/mpd_auto.m4
@@ -0,0 +1,40 @@
+AC_DEFUN([MPD_AUTO_ENABLED], [
+ var="enable_$1"
+ feature="$2"
+
+ if eval "test x`echo '$'$var` = xauto"; then
+ AC_MSG_NOTICE([auto-detected $feature])
+ eval "$var=yes"
+ fi
+])
+
+AC_DEFUN([MPD_AUTO_DISABLED], [
+ var="enable_$1"
+ feature="$2"
+ msg="$3"
+
+ if eval "test x`echo '$'$var` = xauto"; then
+ AC_MSG_WARN([$msg -- disabling $feature])
+ eval "$var=no"
+ else
+ AC_MSG_ERROR([$msg])
+ fi
+])
+
+AC_DEFUN([MPD_AUTO_RESULT], [
+ name="$1"
+ var="enable_$1"
+ found="found_$name"
+ feature="$2"
+ msg="$3"
+
+ if eval "test x`echo '$'$var` = xno"; then
+ eval "$found=no"
+ fi
+
+ if eval "test x`echo '$'$found` = xyes"; then
+ MPD_AUTO_ENABLED([$name], [$feature])
+ else
+ MPD_AUTO_DISABLED([$name], [$feature], [$msg])
+ fi
+])