aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-27 21:34:43 +0100
committerMax Kellermann <max@duempel.org>2013-01-27 21:43:04 +0100
commit44725e485db84c834782ade925dd31ae4341fecd (patch)
tree73526a1881d7d5ec43fb6ab19b355eee5fe7aa8a /configure.ac
parente98e2a0b07363132707146f571d3411e3e1b8076 (diff)
downloadmpd-44725e485db84c834782ade925dd31ae4341fecd.tar.gz
mpd-44725e485db84c834782ade925dd31ae4341fecd.tar.xz
mpd-44725e485db84c834782ade925dd31ae4341fecd.zip
configure.ac: disable libwrap if not compatible with C++
The libwrap version on Mac OS X is broken, it will not work with C++ due to broken function prototypes.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac21
1 files changed, 21 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 1dd2126b1..a15733f19 100644
--- a/configure.ac
+++ b/configure.ac
@@ -577,6 +577,27 @@ AM_CONDITIONAL(ENABLE_INOTIFY, test x$enable_inotify = xyes)
dnl --------------------------------- libwrap ---------------------------------
if test x$enable_libwrap != xno; then
AC_CHECK_LIBWRAP(found_libwrap=yes, found_libwrap=no)
+
+ if test x$found_libwrap = xyes; then
+ dnl See if libwrap is compatible with C++; it is
+ dnl broken on many systems
+ AC_MSG_CHECKING(whether libwrap is compatible with C++)
+ AC_LANG_PUSH([C++])
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+ #include <tcpd.h>
+ bool CheckLibWrap(int fd, const char &progname) {
+ struct request_info req;
+ request_init(&req, RQ_FILE, fd, RQ_DAEMON, progname, 0);
+ fromhost(&req);
+ return hosts_access(&req);
+ }
+ ])],
+ AC_MSG_RESULT([yes]),
+ [found_libwrap=no; AC_MSG_RESULT([no]);
+ AC_MSG_WARN([Your version of libwrap is broken with C++])])
+ AC_LANG_POP
+ fi
+
MPD_AUTO_RESULT(libwrap, libwrap, [libwrap not found])
fi