Added support for Avahi mDNS advertisement

This commit is contained in:
Daniel P. Berrange
2007-09-19 01:56:55 +00:00
parent c79514fda0
commit 8f4e48edff
10 changed files with 777 additions and 13 deletions

View File

@@ -21,6 +21,8 @@ AC_SUBST(LIBVIRT_VERSION)
AC_SUBST(LIBVIRT_VERSION_INFO)
AC_SUBST(LIBVIRT_VERSION_NUMBER)
AVAHI_REQUIRED="0.6.0"
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
@@ -232,6 +234,9 @@ if test "$with_qemu" = "yes" ; then
AC_MSG_ERROR([You must install kernel-headers in order to compile libvirt]))
fi
dnl Need to test if pkg-config exists
PKG_PROG_PKG_CONFIG
dnl ==========================================================================
dnl find libxml2 library, borrowed from xmlsec
dnl ==========================================================================
@@ -300,6 +305,27 @@ AC_CHECK_TYPE(gnutls_session,
[enable GnuTLS 1.0 compatibility macros]),,
[#include <gnutls/gnutls.h>])
dnl Avahi library
AC_ARG_WITH(avahi,
[ --with-avahi use avahi to advertise remote daemon],
[],
[with_avahi=check])
if test "$with_avahi" = "check" -a "x$PKG_CONFIG" != "x" ; then
PKG_CHECK_EXISTS(avahi-client >= $AVAHI_REQUIRED, [with_avahi=yes], [with_avahi=no])
fi
AVAHI_CFLAGS=
AVAHI_LIBS=
if test "$with_avahi" = "yes"; then
PKG_CHECK_MODULES(AVAHI, avahi-client >= $AVAHI_REQUIRED)
AC_DEFINE_UNQUOTED(HAVE_AVAHI, 1, [whether Avahi is used to broadcast server presense])
fi
AM_CONDITIONAL(HAVE_AVAHI, [test "$with_avahi" = "yes"])
AC_SUBST(AVAHI_CFLAGS)
AC_SUBST(AVAHI_LIBS)
dnl virsh libraries
AC_CHECK_LIB(curses, initscr,
[VIRSH_LIBS="$VIRSH_LIBS -lcurses"],
@@ -485,6 +511,11 @@ AC_MSG_NOTICE([])
AC_MSG_NOTICE([Libraries])
AC_MSG_NOTICE([])
AC_MSG_NOTICE([ libxml: $LIBXML_CFLAGS $LIBXML_LIBS])
if test "$with_avahi" = "yes" ; then
AC_MSG_NOTICE([ avahi: $AVAHI_CFLAGS $AVAHI_LIBS])
else
AC_MSG_NOTICE([ avahi: no])
fi
AC_MSG_NOTICE([])
AC_MSG_NOTICE([Miscellaneous])
AC_MSG_NOTICE([])