]> arthur.barton.de Git - netatalk.git/blob - macros/tcp-wrappers.m4
fix LFS test for cross compilation, from Bolke de Bruin
[netatalk.git] / macros / tcp-wrappers.m4
1 dnl $Id: tcp-wrappers.m4,v 1.1.4.4 2004-08-11 03:05:45 bfernhomberg Exp $
2
3 AC_DEFUN([NETATALK_TCP_WRAPPERS], [
4         check=maybe
5         AC_ARG_ENABLE(tcp-wrappers,
6                 [  --disable-tcp-wrappers  disable TCP wrappers support],
7                 [
8                         if test "x$enableval" = "xno"; then
9                                 wrapcheck=no
10                         else
11                                 wrapcheck=yes
12                         fi
13                 ]
14         )
15
16         enable=no
17         netatalk_cv_tcpwrap=no
18         if test "x$wrapcheck" != "xno"; then
19                 saved_LIBS=$LIBS
20                 LIBS="$LIBS -lwrap"
21                 AC_TRY_LINK([
22 #include <tcpd.h>
23 int allow_severity = 0;
24 int deny_severity = 0;
25 ],[
26         tcpd_warn ("link test");
27 ], netatalk_cv_tcpwrap=yes, netatalk_cv_tcpwrap=no, netatalk_cv_tcpwrap=cross)
28
29                 LIBS=$saved_LIBS
30         fi
31
32         AC_MSG_CHECKING([whether to enable the TCP wrappers])
33         if test "x$netatalk_cv_tcpwrap" = "xyes"; then
34                 AC_DEFINE(TCPWRAP, 1, [Define if TCP wrappers should be used])
35                 WRAP_LIBS="-lwrap"
36                 AC_MSG_RESULT([yes])
37         else
38                 if test "x$wrapcheck" = "xyes"; then
39                         AC_MSG_ERROR([libwrap not found])
40                 else
41                         AC_MSG_RESULT([no])
42                 fi
43         fi
44
45         AC_SUBST(WRAP_LIBS)
46 ])