]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - config-scripts/cups-dnssd.m4
Merge changes from CUPS 1.4.0 (r8750)
[thirdparty/cups.git] / config-scripts / cups-dnssd.m4
index 46b7f39a69ff04beb7aa11e26db40a9e312532b5..fcc4e0040896395dd835ad98d0831c6b544aab53 100644 (file)
@@ -1,5 +1,5 @@
 dnl
-dnl "$Id: cups-dnssd.m4 7585 2008-05-16 23:13:47Z mike $"
+dnl "$Id: cups-dnssd.m4 7890 2008-08-29 22:19:39Z mike $"
 dnl
 dnl   DNS Service Discovery (aka Bonjour) stuff for the Common UNIX Printing System (CUPS).
 dnl
@@ -7,7 +7,7 @@ dnl   http://www.dns-sd.org
 dnl   http://www.multicastdns.org/
 dnl   http://developer.apple.com/networking/bonjour/
 dnl
-dnl   Copyright 2007-2008 by Apple Inc.
+dnl   Copyright 2007-2009 by Apple Inc.
 dnl
 dnl   These coded instructions, statements, and computer programs are the
 dnl   property of Apple Inc. and are protected by Federal copyright
@@ -16,7 +16,7 @@ dnl   which should have been included with this file.  If this file is
 dnl   file is missing or damaged, see the license at "http://www.cups.org/".
 dnl
 
-AC_ARG_ENABLE(dnssd, [  --enable-dnssd          turn on DNS Service Discovery support, default=yes])
+AC_ARG_ENABLE(dnssd, [  --disable-dnssd         disable DNS Service Discovery support])
 AC_ARG_WITH(dnssd-libs, [  --with-dnssd-libs       set directory for DNS Service Discovery library],
        LDFLAGS="-L$withval $LDFLAGS"
        DSOFLAGS="-L$withval $DSOFLAGS",)
@@ -32,17 +32,29 @@ if test x$enable_dnssd != xno; then
                case "$uname" in
                        Darwin*)
                                # Darwin and MacOS X...
-                               DNSSDLIBS="-framework CoreFoundation -framework SystemConfiguration"
                                AC_DEFINE(HAVE_DNSSD)
                                AC_DEFINE(HAVE_COREFOUNDATION)
                                AC_DEFINE(HAVE_SYSTEMCONFIGURATION)
+                               DNSSDLIBS="-framework CoreFoundation -framework SystemConfiguration"
                                DNSSD_BACKEND="dnssd"
                                ;;
                        *)
                                # All others...
-                               AC_CHECK_LIB(dns_sd,TXTRecordGetValuePtr,
+                               AC_MSG_CHECKING(for current version of dns_sd library)
+                               SAVELIBS="$LIBS"
+                               LIBS="$LIBS -ldns_sd"
+                               AC_TRY_COMPILE([#include <dns_sd.h],
+                                       [int constant = kDNSServiceFlagsShareConnection;
+                                       unsigned char txtRecord[100];
+                                       uint8_t valueLen;
+                                       TXTRecordGetValuePtr(sizeof(txtRecord),
+                                           txtRecord, "value", &valueLen);],
+                                       AC_MSG_RESULT(yes)
                                        AC_DEFINE(HAVE_DNSSD)
-                                       DNSSDLIBS="-ldns_sd")
+                                       DNSSDLIBS="-ldns_sd"
+                                       DNSSD_BACKEND="dnssd",
+                                       AC_MSG_RESULT(no))
+                               LIBS="$SAVELIBS"
                                ;;
                esac
        ])
@@ -52,5 +64,5 @@ AC_SUBST(DNSSDLIBS)
 AC_SUBST(DNSSD_BACKEND)
 
 dnl
-dnl End of "$Id: cups-dnssd.m4 7585 2008-05-16 23:13:47Z mike $".
+dnl End of "$Id: cups-dnssd.m4 7890 2008-08-29 22:19:39Z mike $".
 dnl