From 3a144b131de045795dad1de4cb873bd6744690ab Mon Sep 17 00:00:00 2001 From: srittau Date: Thu, 12 Jun 2003 23:15:06 +0000 Subject: [PATCH] Put TCP wrappers check into a separate file. Changed --with-tcp-wrappers to --disable-tcp-wrappers, changed default. --- configure.in | 12 ++---------- macros/tcp-wrappers.m4 | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 10 deletions(-) create mode 100644 macros/tcp-wrappers.m4 diff --git a/configure.in b/configure.in index 291ba2bd..ded997c0 100644 --- a/configure.in +++ b/configure.in @@ -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 index 00000000..3274d1d7 --- /dev/null +++ b/macros/tcp-wrappers.m4 @@ -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) +]) -- 2.39.2