aboutsummaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-08-06 23:25:57 +0200
committerMax Kellermann <max@duempel.org>2013-08-06 23:32:21 +0200
commit47e16dbee3d43a8fac8e2337df442814ec6d036b (patch)
tree011c45b1d151425adaef1168fcf6ba7238d6e82a /m4
parent66f678023f6e18dde9679d0a69565d6a50d09ed4 (diff)
downloadmpd-47e16dbee3d43a8fac8e2337df442814ec6d036b.tar.gz
mpd-47e16dbee3d43a8fac8e2337df442814ec6d036b.tar.xz
mpd-47e16dbee3d43a8fac8e2337df442814ec6d036b.zip
configure.ac: add option --enable-eventfd
Remove the runtime check for eventfd(), hard-code the feature once it's been selected at compile time. The class WakeFD is splitted into EventFD and EventPipe, using WakeFD as a macro diversion.
Diffstat (limited to 'm4')
-rw-r--r--m4/mpd_func.m412
1 files changed, 12 insertions, 0 deletions
diff --git a/m4/mpd_func.m4 b/m4/mpd_func.m4
new file mode 100644
index 000000000..c4650336b
--- /dev/null
+++ b/m4/mpd_func.m4
@@ -0,0 +1,12 @@
+dnl MPD_OPTIONAL_FUNC(func, macro)
+dnl
+dnl Allow the user to enable or disable the use of a function. If the
+dnl option is not specified, the function is auto-detected.
+AC_DEFUN([MPD_OPTIONAL_FUNC], [
+ AC_ARG_ENABLE([$1],
+ AS_HELP_STRING([--enable-$1],
+ [use the function "$1()" (default: auto)]),
+ [test xenable_$1 = xyes && AC_DEFINE([$2], 1, [Define to use $1()])],
+ [AC_CHECK_FUNC([$1],
+ [AC_DEFINE([$2], 1, [Define to use $1()])],)])
+])