Commit 7a24e496 authored by Max Kellermann's avatar Max Kellermann

configure.ac: new libwrap autoconf test

Use MPD_AUTO_RESULT(). Don't force libwrap by default.
parent 7a62818f
...@@ -205,7 +205,20 @@ dnl ## ...@@ -205,7 +205,20 @@ dnl ##
dnl misc libraries dnl misc libraries
dnl ## dnl ##
AC_CHECK_LIBWRAP AC_ARG_ENABLE([libwrap],
AS_HELP_STRING([--enable-libwrap], [use libwrap]),,
[enable_libwrap=auto])
if test x$enable_libwrap != xno; then
AC_CHECK_LIBWRAP(found_libwrap=yes, found_libwrap=no)
MPD_AUTO_RESULT(libwrap, libwrap, [libwrap not found])
fi
if test x$enable_libwrap = xyes; then
AC_SUBST(LIBWRAP_CFLAGS)
AC_SUBST(LIBWRAP_LDFLAGS)
AC_DEFINE(HAVE_LIBWRAP, 1, [define to enable libwrap library])
fi
AC_ARG_ENABLE(cue, AC_ARG_ENABLE(cue,
AS_HELP_STRING([--enable-cue], AS_HELP_STRING([--enable-cue],
......
...@@ -3,35 +3,12 @@ dnl Usage: ...@@ -3,35 +3,12 @@ dnl Usage:
dnl AC_CHECK_LIBWRAP([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl AC_CHECK_LIBWRAP([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl dnl
AC_DEFUN([AC_CHECK_LIBWRAP], AC_DEFUN([AC_CHECK_LIBWRAP],[
[dnl start AC_CHECK_HEADERS([tcpd.h],
AC_CHECK_LIB([wrap], [request_init],
AC_ARG_ENABLE([libwrap], [LIBWRAP_CFLAGS=""
[AS_HELP_STRING([--disable-libwrap], LIBWRAP_LDFLAGS="-lwrap"
[use libwrap (default enabled)])], , $1],
[ $2),
AC_CHECK_HEADERS([tcpd.h], $2)
[], ])
[AC_MSG_ERROR([tpcd.h libwrap header not found])]
$3)
AC_CHECK_LIB([wrap],
[request_init],
[],
[AC_MSG_ERROR([libwrap not found !])]
$3)
AC_DEFINE(HAVE_LIBWRAP, 1, [define to enable libwrap library])
LIBWRAP_CFLAGS=""
LIBWRAP_LDFLAGS="-lwrap"
AC_SUBST([LIBWRAP_CFLAGS])
AC_SUBST([LIBWRAP_LDFLAGS])
dnl ACTION-IF-FOUND
$2
]) dnl AC_ARG_ENABLE
]) dnl AC_DEFUN
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment