GSS_S_PROMPTING_NEEDED is a bit
[cyrus-sasl.git] / cmulocal / libwrap.m4
1 dnl libwrap.m4 --- do we have libwrap, the access control library?
2 dnl $Id: libwrap.m4,v 1.10 2005/04/26 19:14:08 shadow Exp $
3
4 AC_DEFUN([CMU_LIBWRAP], [
5 AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
6   AC_REQUIRE([CMU_SOCKETS])
7   AC_ARG_WITH(libwrap, 
8               [  --with-libwrap=DIR      use libwrap (rooted in DIR) [yes] ],
9               with_libwrap=$withval, with_libwrap=yes)
10   if test "$with_libwrap" != no; then
11     if test -d "$with_libwrap"; then
12       CPPFLAGS="$CPPFLAGS -I${with_libwrap}/include"
13       LDFLAGS="$LDFLAGS -L${with_libwrap}/$CMU_LIB_SUBDIR"
14     fi
15     cmu_save_LIBS="$LIBS"
16     AC_CHECK_LIB(wrap, request_init, [
17                  AC_CHECK_HEADER(tcpd.h,, with_libwrap=no)],
18                  with_libwrap=no, ${LIB_SOCKET})
19     LIBS="$cmu_save_LIBS"
20   fi
21   AC_MSG_CHECKING(libwrap support)
22   AC_MSG_RESULT($with_libwrap)
23   LIB_WRAP=""
24   if test "$with_libwrap" != no; then
25     AC_DEFINE(HAVE_LIBWRAP,[],[Do we have TCP wrappers?])
26     LIB_WRAP="-lwrap"
27     AC_CHECK_LIB(nsl, yp_get_default_domain, LIB_WRAP="${LIB_WRAP} -lnsl")
28   fi
29   AC_SUBST(LIB_WRAP)
30 ])