dnl ProFTPD - mod_wrap2
dnl Copyright (c) 2012-2015 TJ Saunders <tj@castaglia.org>
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
dnl
dnl Process this file with autoconf to produce a configure script.

AC_INIT(./mod_wrap2.c)

ac_wrap2_libs=""

dnl Auto-detection of shadow passwords.
AC_ARG_ENABLE(nis,
  [  --enable-nis            enable use of NIS/netgroups (default=no)
  ],
  [
    if test "$enableval" != "no" ; then
      AC_DEFINE(WRAP2_USE_NIS)

      dnl Hack to make sure that the correct libraries are linked on the right
      dnl platforms: FreeBSD's libc itself defines the NIS/YP functions, rather
      dnl than defining those functions in a separate libnsl library.  Same
      dnl for Mac OSX as well, apparently.

      ac_os=`uname`
      if test x"$ac_os" != xFreeBSD -a x"$ac_os" != xDarwin; then
        ac_wrap2_libs="$ac_wrap2_libs -lnsl"
      fi
    fi ])

AC_ARG_ENABLE(wrapper-options,
  [  --enable-wrapper-options
                          enable use of tcpwrapper options (default=no)
                          see hosts_options(5) man page for details
  ],
  [
    if test "$enableval" != "no" ; then
      AC_DEFINE(WRAP2_USE_OPTIONS)
    fi
  ])

MODULE_LIBS="$ac_wrap2_libs"

AC_SUBST(LDFLAGS)
AC_SUBST(MODULE_LIBS)
AC_CONFIG_HEADER(mod_wrap2.h)
AC_OUTPUT(Makefile)
