]> arthur.barton.de Git - netatalk.git/commitdiff
Rework tcp wrappers detection, should work on OpenBSD as well now.
authorbfernhomberg <bfernhomberg>
Wed, 11 Aug 2004 03:05:45 +0000 (03:05 +0000)
committerbfernhomberg <bfernhomberg>
Wed, 11 Aug 2004 03:05:45 +0000 (03:05 +0000)
macros/tcp-wrappers.m4

index 57c56d6e254fb7230040431f50c22485e9016414..c663d2dd59f49d8852d76017b8083c76e0c169c4 100644 (file)
@@ -1,4 +1,4 @@
-dnl $Id: tcp-wrappers.m4,v 1.1.4.3 2004-01-03 01:49:54 bfernhomberg Exp $
+dnl $Id: tcp-wrappers.m4,v 1.1.4.4 2004-08-11 03:05:45 bfernhomberg Exp $
 
 AC_DEFUN([NETATALK_TCP_WRAPPERS], [
        check=maybe
@@ -6,33 +6,36 @@ AC_DEFUN([NETATALK_TCP_WRAPPERS], [
                [  --disable-tcp-wrappers  disable TCP wrappers support],
                [
                        if test "x$enableval" = "xno"; then
-                               check=no
+                               wrapcheck=no
                        else
-                               check=yes
+                               wrapcheck=yes
                        fi
                ]
        )
 
        enable=no
-       if test "x$check" != "xno"; then
-               AC_CHECK_LIB(wrap, tcpd_warn, enable=yes)
-       fi
-       if test "x$enable" = "xyes"; then
-               AC_CHECK_HEADERS(tcpd.h)
-               if test "x$ac_cv_header_tcpd_h" != "xyes"; then
-                       enable=no
-               fi
+       netatalk_cv_tcpwrap=no
+       if test "x$wrapcheck" != "xno"; then
+               saved_LIBS=$LIBS
+               LIBS="$LIBS -lwrap"
+               AC_TRY_LINK([
+#include <tcpd.h>
+int allow_severity = 0;
+int deny_severity = 0;
+],[
+       tcpd_warn ("link test");
+], netatalk_cv_tcpwrap=yes, netatalk_cv_tcpwrap=no, netatalk_cv_tcpwrap=cross)
+
+               LIBS=$saved_LIBS
        fi
 
-       netatalk_cv_tcpwrap=no
        AC_MSG_CHECKING([whether to enable the TCP wrappers])
-       if test "x$enable" = "xyes"; then
+       if test "x$netatalk_cv_tcpwrap" = "xyes"; then
                AC_DEFINE(TCPWRAP, 1, [Define if TCP wrappers should be used])
                WRAP_LIBS="-lwrap"
-               netatalk_cv_tcpwrap=yes
                AC_MSG_RESULT([yes])
        else
-               if test "x$check" = "xyes"; then
+               if test "x$wrapcheck" = "xyes"; then
                        AC_MSG_ERROR([libwrap not found])
                else
                        AC_MSG_RESULT([no])