]> arthur.barton.de Git - netatalk.git/commitdiff
Put TCP wrappers check into a separate file. Changed --with-tcp-wrappers to
authorsrittau <srittau>
Thu, 12 Jun 2003 23:15:06 +0000 (23:15 +0000)
committersrittau <srittau>
Thu, 12 Jun 2003 23:15:06 +0000 (23:15 +0000)
--disable-tcp-wrappers, changed default.

configure.in
macros/tcp-wrappers.m4 [new file with mode: 0644]

index 291ba2bd91ae4b9e62ee2fe4b7335bd45c7008e5..ded997c02a05b802a7eb26908b85d0437f8f5992 100644 (file)
@@ -1,4 +1,4 @@
-dnl $Id: configure.in,v 1.189 2003-06-11 21:45:43 srittau Exp $
+dnl $Id: configure.in,v 1.190 2003-06-12 23:15:06 srittau Exp $
 dnl configure.in for netatalk
 
 AC_INIT(etc/afpd/main.c)
@@ -342,15 +342,7 @@ AC_ARG_ENABLE(shell-check,
        fi
 )
 
-AC_ARG_WITH(tcp-wrappers,
-       [  --with-tcp-wrappers     enable TCP wrappers support],
-       AC_CHECK_LIB(wrap, tcpd_warn,
-               AC_DEFINE(TCPWRAP, 1, [Define if TCP wrappers should be used])
-               WRAP_LIBS="-lwrap"
-               AC_MSG_RESULT([enabling TCP wrappers support])
-       )
-)
-AC_SUBST(WRAP_LIBS)
+NETATALK_TCP_WRAPPERS
 
 AC_ARG_ENABLE(redhat,
        [  --enable-redhat         use redhat-style sysv configuration ],
diff --git a/macros/tcp-wrappers.m4 b/macros/tcp-wrappers.m4
new file mode 100644 (file)
index 0000000..3274d1d
--- /dev/null
@@ -0,0 +1,35 @@
+dnl $Id: tcp-wrappers.m4,v 1.1 2003-06-12 23:15:07 srittau Exp $
+
+AC_DEFUN([NETATALK_TCP_WRAPPERS], [
+       check=maybe
+       AC_ARG_ENABLE(tcp-wrappers,
+               [  --disable-tcp-wrappers  disable TCP wrappers support],
+               [
+                       if test "x$enableval" == "xno"; then
+                               check=no
+                       else
+                               check=yes
+                       fi
+               ]
+       )
+
+       enable=no
+       if test "x$check" != "xno"; then
+               AC_CHECK_LIB(wrap, tcpd_warn, enable=yes)
+       fi
+
+       AC_MSG_CHECKING([whether to enable the TCP wrappers])
+       if test "x$enable" == "xyes"; then
+               AC_DEFINE(TCPWRAP, 1, [Define if TCP wrappers should be used])
+               WRAP_LIBS="-lwrap"
+               AC_MSG_RESULT([yes])
+       else
+               if test "x$check" == "xyes"; then
+                       AC_MSG_ERROR([libwrap not found])
+               else
+                       AC_MSG_RESULT([no])
+               fi
+       fi
+
+       AC_SUBST(WRAP_LIBS)
+])