1 # Check whether user wants TCP wrappers support
2 AC_DEFUN([AC_TCP_WRAPPERS],[
4 AC_ARG_WITH(tcp-wrappers,
5 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
7 with_tcpw=$withval, with_tcpw=yes)
8 if test "x$with_tcpw" != "xno" ; then
10 saved_LDFLAGS="$LDFLAGS"
11 saved_CPPFLAGS="$CPPFLAGS"
12 if test -n "${with_tcpw}" -a "${with_tcpw}" != "yes"; then
13 if test -d "${with_tcpw}/lib"; then
14 if test -n "${need_dash_r}"; then
15 LDFLAGS="-L${with_tcpw}/lib -R${with_tcpw}/lib ${LDFLAGS}"
17 LDFLAGS="-L${with_tcpw}/lib ${LDFLAGS}"
20 if test -n "${need_dash_r}"; then
21 LDFLAGS="-L${with_tcpw} -R${with_tcpw} ${LDFLAGS}"
23 LDFLAGS="-L${with_tcpw} ${LDFLAGS}"
26 if test -d "${with_tcpw}/include"; then
27 CPPFLAGS="-I${with_tcpw}/include ${CPPFLAGS}"
29 CPPFLAGS="-I${with_tcpw} ${CPPFLAGS}"
34 AC_MSG_CHECKING(for libwrap)
35 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
37 int deny_severity = 0, allow_severity = 0;
38 ]], [[hosts_access(0);]])],[
41 AC_DEFINE([LIBWRAP], [1], [tcp-wrapper])
42 AC_DEFINE([HAVE_LIBWRAP], [1], [tcp-wrapper])
43 AC_DEFINE([HAVE_TCP_WRAPPER], [1], [tcp-wrapper])
46 AC_MSG_ERROR([*** libwrap missing])
52 AC_SUBST(HAVE_LIBWRAP)
53 AC_SUBST(HAVE_TCP_WRAPPER)