-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)
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 ],
--- /dev/null
+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)
+])