Autoconf support for detecting DNS Service Discovery support.
authorJames Peach <jpeach@samba.org>
Sat, 13 Oct 2007 05:16:22 +0000 (22:16 -0700)
committerJames Peach <jpeach@samba.org>
Thu, 13 Dec 2007 03:55:20 +0000 (19:55 -0800)
Patch from Rishi Srivatsavai <rishisv@gmail.com>, with some
adaptations.
(This used to be commit 2dfe9525b9e6e7dcbac191c1fb6288e166d171e5)

source3/Makefile.in
source3/configure.in

index 285255e7f74bd9fe5b3910ce93a40e2be8756cf9..d26f688f8073f5fa56b1107156ef7d1deac06499 100644 (file)
@@ -63,6 +63,7 @@ KRB5LIBS=@KRB5_LIBS@
 LDAP_LIBS=@LDAP_LIBS@
 NSCD_LIBS=@NSCD_LIBS@
 UUID_LIBS=@UUID_LIBS@
+DNSSD_LIBS=@DNSSD_LIBS@
 
 INSTALLCMD=@INSTALL@
 INSTALLLIBCMD_SH=@INSTALLLIBCMD_SH@
index 4c72ad3dd3a24397a9c01ea20a134af59cea3236..06a6a458b0b7eb503d9da9bed421eab3bff893a1 100644 (file)
@@ -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])
 
 #################################################