e6c38fe
diff -up cups-1.4.7/config.h.in.avahi-1-config cups-1.4.7/config.h.in
e6c38fe
--- cups-1.4.7/config.h.in.avahi-1-config	2011-01-10 07:39:37.000000000 +0000
e6c38fe
+++ cups-1.4.7/config.h.in	2011-06-28 12:53:16.860630055 +0100
e6c38fe
@@ -345,6 +345,13 @@
e6c38fe
 
e6c38fe
 
e6c38fe
 /*
e6c38fe
+ * Do we have Avahi for DNS Service Discovery?
e6c38fe
+ */
e6c38fe
+
e6c38fe
+#undef HAVE_AVAHI
e6c38fe
+
e6c38fe
+
e6c38fe
+/*
e6c38fe
  * Do we have <sys/ioctl.h>?
e6c38fe
  */
e6c38fe
 
e6c38fe
diff -up cups-1.4.7/config-scripts/cups-dnssd.m4.avahi-1-config cups-1.4.7/config-scripts/cups-dnssd.m4
e6c38fe
--- cups-1.4.7/config-scripts/cups-dnssd.m4.avahi-1-config	2009-08-28 23:54:34.000000000 +0100
e6c38fe
+++ cups-1.4.7/config-scripts/cups-dnssd.m4	2011-06-28 12:53:16.860630055 +0100
e6c38fe
@@ -27,6 +27,21 @@ AC_ARG_WITH(dnssd-includes, [  --with-dn
e6c38fe
 DNSSDLIBS=""
e6c38fe
 DNSSD_BACKEND=""
e6c38fe
 
e6c38fe
+AC_ARG_ENABLE(avahi, [  --enable-avahi          turn on DNS Service Discovery support, default=no],
e6c38fe
+	      [if test x$enable_avahi = xyes; then
e6c38fe
+		       AC_MSG_CHECKING(for Avahi)
e6c38fe
+		       if $PKGCONFIG --exists avahi-client; then
e6c38fe
+			       AC_MSG_RESULT(yes)
e6c38fe
+			       CFLAGS="$CFLAGS `$PKGCONFIG --cflags avahi-client`"
e6c38fe
+			       DNSSDLIBS="`$PKGCONFIG --libs avahi-client`"
e6c38fe
+			       DNSSD_BACKEND="dnssd"
e6c38fe
+			       AC_DEFINE(HAVE_AVAHI)
e6c38fe
+			       enable_dnssd=no
e6c38fe
+		       else
e6c38fe
+			       AC_MSG_RESULT(no)
e6c38fe
+		       fi
e6c38fe
+	       fi])
e6c38fe
+
e6c38fe
 if test x$enable_dnssd != xno; then
e6c38fe
 	AC_CHECK_HEADER(dns_sd.h, [
e6c38fe
 		case "$uname" in