From fa8966690bc2c5ab968b10e12fac113d0da1f641 Mon Sep 17 00:00:00 2001 From: James Peach Date: Fri, 12 Oct 2007 22:16:22 -0700 Subject: Autoconf support for detecting DNS Service Discovery support. Patch from Rishi Srivatsavai , with some adaptations. (This used to be commit 2dfe9525b9e6e7dcbac191c1fb6288e166d171e5) --- source3/configure.in | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'source3/configure.in') diff --git a/source3/configure.in b/source3/configure.in index 4c72ad3dd3..06a6a458b0 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -6161,6 +6161,40 @@ AC_SUBST(BUILD_POPT) AC_SUBST(POPTLIBS) AC_SUBST(FLAGS1) +################################################# +# Check if user wants DNS service discovery support + +AC_ARG_ENABLE(dnssd, +[ --enable-dnssd Enable DNS service discovery support (default=auto)]) + +if test x"$enable_dnssd" != x"no"; then + have_dnssd_support=yes + + AC_CHECK_HEADERS(dns_sd.h) + if test x"$ac_cv_header_dns_sd_h" != x"yes"; then + have_dnssd_support=no + fi + + # On Darwin the DNSSD API is in libc, but on other platforms it's + # probably in -ldns_sd + AC_CHECK_FUNCS(DNSServiceRegister) + AC_CHECK_LIB_EXT(dns_sd, DNSSD_LIBS, DNSServiceRegister) + if test x"$ac_cv_func_DNSServiceRegister" != x"yes" -a \ + x"$ac_cv_lib_ext_DNSServiceRegister" != x"yes"; then + have_dnssd_support=no + fi + + if test x"$have_dnssd_support" = x"yes"; then + AC_DEFINE(WTH_DNSSD_SUPPORT, 1, + [Whether to enable DNS service discovery support]) + else + if test x"$enable_dnssd" = x"yes"; then + AC_MSG_ERROR(DNS service discovery support not available) + fi + fi + +fi + ################################################# # Check to see if we should use the included iniparser @@ -6467,6 +6501,9 @@ fi if test x"$with_dnsupdate_support" != x"no"; then AC_MSG_RESULT([ UUID_LIBS = $UUID_LIBS]) fi +if test x"$have_dnssd_support" != x"no"; then + AC_MSG_RESULT([ DNSSD_LIBS = $DNSSD_LIBS]) +fi AC_MSG_RESULT([ AUTH_LIBS = $AUTH_LIBS]) ################################################# -- cgit