aboutsummaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
authorDavide Camurri <jussx0@gmail.com>2010-01-20 21:04:07 +0100
committerMax Kellermann <max@duempel.org>2010-01-20 21:04:07 +0100
commit7a62818ffdfbdef76784acb8b2e90e7cc14333f0 (patch)
tree514a95f1bccf2c4f169b0f08f0eaaff00627f28f /m4
parentacb0ff1ea869ceb5d7561cf840f3252ae9fd02cb (diff)
downloadmpd-7a62818ffdfbdef76784acb8b2e90e7cc14333f0.tar.gz
mpd-7a62818ffdfbdef76784acb8b2e90e7cc14333f0.tar.xz
mpd-7a62818ffdfbdef76784acb8b2e90e7cc14333f0.zip
client: optionally use libwrap
Diffstat (limited to 'm4')
-rw-r--r--m4/libwrap.m437
1 files changed, 37 insertions, 0 deletions
diff --git a/m4/libwrap.m4 b/m4/libwrap.m4
new file mode 100644
index 000000000..000b0bab2
--- /dev/null
+++ b/m4/libwrap.m4
@@ -0,0 +1,37 @@
+dnl
+dnl Usage:
+dnl AC_CHECK_LIBWRAP([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl
+
+AC_DEFUN([AC_CHECK_LIBWRAP],
+ [dnl start
+
+ AC_ARG_ENABLE([libwrap],
+ [AS_HELP_STRING([--disable-libwrap],
+ [use libwrap (default enabled)])], ,
+ [
+ AC_CHECK_HEADERS([tcpd.h],
+ [],
+ [AC_MSG_ERROR([tpcd.h libwrap header not found])]
+ $3)
+
+ AC_CHECK_LIB([wrap],
+ [request_init],
+ [],
+ [AC_MSG_ERROR([libwrap not found !])]
+ $3)
+
+ AC_DEFINE(HAVE_LIBWRAP, 1, [define to enable libwrap library])
+
+ LIBWRAP_CFLAGS=""
+ LIBWRAP_LDFLAGS="-lwrap"
+
+ AC_SUBST([LIBWRAP_CFLAGS])
+ AC_SUBST([LIBWRAP_LDFLAGS])
+
+ dnl ACTION-IF-FOUND
+ $2
+
+ ]) dnl AC_ARG_ENABLE
+
+]) dnl AC_DEFUN