summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-06-16 15:41:29 +0200
committerLennart Poettering <lennart@poettering.net>2010-06-16 15:41:29 +0200
commit0213c3f8102bdc934c629d11a44ca0b408762287 (patch)
tree743fcd1210de5bf35a271b64d5103487fc5f7ad4 /m4
parent18c78fb1af5415bb6f87d9c7cae1f9c60e14ae24 (diff)
socket: add optional libwrap support
Diffstat (limited to 'm4')
-rw-r--r--m4/acx_libwrap.m419
1 files changed, 19 insertions, 0 deletions
diff --git a/m4/acx_libwrap.m4 b/m4/acx_libwrap.m4
new file mode 100644
index 000000000..e1602144b
--- /dev/null
+++ b/m4/acx_libwrap.m4
@@ -0,0 +1,19 @@
+AC_DEFUN([ACX_LIBWRAP], [
+LIBWRAP_LIBS=
+saved_LIBS="$LIBS"
+LIBS="$LIBS -lwrap"
+AC_MSG_CHECKING([for tcpwrap library and headers])
+AC_LINK_IFELSE(
+AC_LANG_PROGRAM(
+[#include <tcpd.h>
+#include <syslog.h>
+int allow_severity = LOG_INFO;
+int deny_severity = LOG_WARNING;],
+[struct request_info *req;
+return hosts_access (req);]),
+[AC_DEFINE(HAVE_LIBWRAP, [], [Have tcpwrap?])
+LIBWRAP_LIBS="-lwrap"
+AC_MSG_RESULT(yes)],
+[AC_MSG_RESULT(no)])
+LIBS="$saved_LIBS"
+])