- if test "x$check" != "xno"; then
- AC_CHECK_LIB(wrap, tcpd_warn, enable=yes)
+ netatalk_cv_tcpwrap=no
+ if test "x$wrapcheck" != "xno"; then
+ saved_LIBS=$LIBS
+ 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