avahi: add option to build the libdns_sd (Bonjour) compatibility library
authorPeter Korsgaard <peter@korsgaard.com>
Mon, 22 Sep 2014 21:04:59 +0000 (23:04 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Mon, 22 Sep 2014 21:04:59 +0000 (23:04 +0200)
As requested on the list.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/avahi/Config.in
package/avahi/avahi.mk

index 483d976c776b62c4685816d7d17134c9fd345e6b..b52cc78ce510cc345ac7dc1c1096f27a2d9c3a6c 100644 (file)
@@ -35,6 +35,14 @@ config BR2_PACKAGE_AVAHI_DAEMON
          The daemon registers local IP addresses and services using
          mDNS/DNS-SD.
 
+config BR2_PACKAGE_AVAHI_LIBDNSSD_COMPATIBILITY
+       bool "libdns_sd compatibility (Bonjour)"
+       depends on BR2_PACKAGE_AVAHI_DAEMON
+       select BR2_PACKAGE_DBUS
+       help
+         Enable the libdns_sd (Bonjour) compatibility library support
+         for legacy applications.
+
 endif
 
 comment "avahi needs a toolchain w/ threads"
index 08364dfa22384e34d28fd0e0a4c57c69d0240d9f..55527dcde7e7f46d99fea140f5951a305c5157cc 100644 (file)
@@ -101,6 +101,10 @@ else
 AVAHI_CONF_OPT += --with-xml=none
 endif
 
+ifeq ($(BR2_PACKAGE_AVAHI_LIBDNSSD_COMPATIBILITY),y)
+AVAHI_CONF_OPT += --enable-compat-libdns_sd
+endif
+
 ifeq ($(BR2_PACKAGE_DBUS),y)
 AVAHI_DEPENDENCIES += dbus
 else
@@ -181,4 +185,14 @@ endef
 
 endif
 
+# applications expects to be able to #include <dns_sd.h>
+define AVAHI_STAGING_INSTALL_LIBDNSSD_LINK
+       ln -sf avahi-compat-libdns_sd/dns_sd.h \
+               $(STAGING_DIR)/usr/include/dns_sd.h
+endef
+
+ifeq ($(BR2_PACKAGE_AVAHI_LIBDNSSD_COMPATIBILITY),y)
+AVAHI_POST_INSTALL_STAGING_HOOKS += AVAHI_STAGING_INSTALL_LIBDNSSD_LINK
+endif
+
 $(eval $(autotools-package))