From 025c17af90a7f907822ef2f044ec143972d670e8 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 20 Mar 2009 14:53:10 +0100 Subject: [PATCH] Add avahi detection to configure (cherry picked from commit dcf1df139f02d54f040e0e649f6b9bf388fdfb00) --- source/Makefile.in | 1 + source/configure.in | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/source/Makefile.in b/source/Makefile.in index ee22703d745..b8d5567e901 100644 --- a/source/Makefile.in +++ b/source/Makefile.in @@ -69,6 +69,7 @@ WINBIND_NSS_EXTRA_LIBS=@WINBIND_NSS_EXTRA_LIBS@ WINBIND_NSS_PTHREAD=@WINBIND_NSS_PTHREAD@ PAM_WINBIND_EXTRA_LIBS=@PAM_WINBIND_EXTRA_LIBS@ DNSSD_LIBS=@DNSSD_LIBS@ +AVAHI_LIBS=@AVAHI_LIBS@ POPT_LIBS=@POPTLIBS@ LIBTALLOC_LIBS=@LIBTALLOC_LIBS@ LIBTDB_LIBS=@LIBTDB_LIBS@ diff --git a/source/configure.in b/source/configure.in index ff96b907fc0..86fd40dc92c 100644 --- a/source/configure.in +++ b/source/configure.in @@ -6200,6 +6200,42 @@ if test x"$enable_dnssd" == x"yes"; then fi ################################################# +# Check if user wants avahi support + +AC_ARG_ENABLE(avahi, +[AS_HELP_STRING([--enable-avahi], [Enable Avahi support (default=auto)])]) + +AC_SUBST(AVAHI_LIBS) +if test x"$enable_avahi" != x"no"; then + have_avahi_support=yes + + AC_CHECK_HEADERS(avahi-common/watch.h) + if test x"$ac_cv_header_avahi_common_watch_h" != x"yes"; then + have_avahi_support=no + fi + + AC_CHECK_HEADERS(avahi-client/client.h) + if test x"$ac_cv_header_avahi_common_watch_h" != x"yes"; then + have_avahi_support=no + fi + + AC_CHECK_LIB_EXT(avahi-client, AVAHI_LIBS, avahi_client_new) + if test x"$ac_cv_lib_ext_avahi_client_avahi_client_new" != x"yes"; then + have_avahi_support=no + fi + + if test x"$have_avahi_support" = x"yes"; then + AC_DEFINE(WITH_AVAHI_SUPPORT, 1, + [Whether to enable avahi support]) + else + if test x"$enable_avahi" = x"yes"; then + AC_MSG_ERROR(avahi support not available) + fi + fi + +fi + +################################################# # Check to see if we should use the included iniparser AC_ARG_WITH(included-iniparser, -- 2.11.4.GIT