X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=macros%2Ftcp-wrappers.m4;h=76b75a09cd05a85d633c1bdfd20645d83cb86f82;hb=793ceb303ae22266e55f8b681ab21f00aebd35e9;hp=f3d463e8a613efe19b2032e1a804d06281caaede;hpb=ecfc96169ab669b578e53fa8e13592934fe37788;p=netatalk.git diff --git a/macros/tcp-wrappers.m4 b/macros/tcp-wrappers.m4 index f3d463e8..76b75a09 100644 --- a/macros/tcp-wrappers.m4 +++ b/macros/tcp-wrappers.m4 @@ -1,6 +1,5 @@ -dnl $Id: tcp-wrappers.m4,v 1.3 2005-04-28 20:50:05 bfernhomberg Exp $ -AC_DEFUN([NETATALK_TCP_WRAPPERS], [ +AC_DEFUN([AC_NETATALK_TCP_WRAPPERS], [ check=maybe AC_ARG_ENABLE(tcp-wrappers, [ --disable-tcp-wrappers disable TCP wrappers support], @@ -17,14 +16,20 @@ AC_DEFUN([NETATALK_TCP_WRAPPERS], [ netatalk_cv_tcpwrap=no if test "x$wrapcheck" != "xno"; then saved_LIBS=$LIBS - LIBS="$LIBS -lwrap" - AC_TRY_LINK([ -#include -int allow_severity = 0; -int deny_severity = 0; -],[ - tcpd_warn ("link test"); -], netatalk_cv_tcpwrap=yes, netatalk_cv_tcpwrap=no, netatalk_cv_tcpwrap=cross) + W_LIBS="-lwrap" + LIBS="$LIBS $W_LIBS" + AC_TRY_LINK([ int allow_severity = 0; int deny_severity = 0;] + ,[hosts_access();] + , netatalk_cv_tcpwrap=yes , + [ + LIBS=$saved_LIBS + W_LIBS="-lwrap -lnsl" + LIBS="$LIBS $W_LIBS" + AC_TRY_LINK([ int allow_severity = 0; int deny_severity = 0;] + ,[hosts_access();] + , netatalk_cv_tcpwrap=yes , netatalk_cv_tcpwrap=no) + ] + , netatalk_cv_tcpwrap=cross) LIBS=$saved_LIBS fi @@ -32,7 +37,7 @@ int deny_severity = 0; AC_MSG_CHECKING([whether to enable the TCP wrappers]) if test "x$netatalk_cv_tcpwrap" = "xyes"; then AC_DEFINE(TCPWRAP, 1, [Define if TCP wrappers should be used]) - WRAP_LIBS="-lwrap" + WRAP_LIBS=$W_LIBS AC_MSG_RESULT([yes]) else if test "x$wrapcheck" = "xyes"; then