003-Make-DNS-SD-functionality-optional-at-build-time.patch (1710B)
1 From a88d6d31fc5a04be4378095e03b4aac133954026 Mon Sep 17 00:00:00 2001 2 From: Christian Beier <dontmind@freeshell.org> 3 Date: Tue, 15 Mar 2016 15:09:25 +0100 4 Subject: [PATCH] Make DNS-SD functionality optional at build time. 5 6 When building for embedded systems, for instance, we 7 want to limit dependencies to a minimum and it seems 8 that OLA is able to perform its core tasks without 9 DNS-SD perfectly fine. 10 11 Signed-off-by: Christian Beier <dontmind@freeshell.org> 12 --- 13 configure.ac | 27 +++++++++++++++------------ 14 1 file changed, 15 insertions(+), 12 deletions(-) 15 16 diff --git a/configure.ac b/configure.ac 17 index 6654354..0d1947c 100644 18 --- a/configure.ac 19 +++ b/configure.ac 20 @@ -411,23 +411,26 @@ AS_IF([test "x$use_ossp_uuid" = xyes], 21 22 # DNS-SD support 23 # We use either avahi or the Apple DNS-SD library. 24 - 25 -# dns_sd 26 -AC_CHECK_HEADER( 27 - [dns_sd.h], 28 - [AC_SEARCH_LIBS(DNSServiceRegister, [dns_sd], [have_dnssd="yes"])]) 29 +AC_ARG_WITH(dns-sd, 30 +[AS_HELP_STRING([--without-dns-sd], [disable DNS-SD support])],,) 31 +if test "x$with_dns_sd" != "xno"; then 32 + # dns_sd 33 + AC_CHECK_HEADER( 34 + [dns_sd.h], 35 + [AC_SEARCH_LIBS(DNSServiceRegister, [dns_sd], [have_dnssd="yes"])]) 36 + 37 + # avahi 38 + PKG_CHECK_MODULES( 39 + avahi, 40 + [avahi-client], 41 + [have_avahi="yes"], 42 + [true]) 43 +fi 44 45 AS_IF([test "x$have_dnssd" = xyes], 46 [AC_DEFINE([HAVE_DNSSD], [1], [Defined to use Bonjour DNS_SD])]) 47 AM_CONDITIONAL([HAVE_DNSSD], [test "x$have_dnssd" = xyes]) 48 49 -# avahi 50 -PKG_CHECK_MODULES( 51 - avahi, 52 - [avahi-client], 53 - [have_avahi="yes"], 54 - [true]) 55 - 56 AS_IF([test "x$have_avahi" = xyes], 57 [AC_DEFINE([HAVE_AVAHI], [1], [Defined to use Avahi])]) 58 AM_CONDITIONAL([HAVE_AVAHI], [test "x$have_avahi" = xyes]) 59 -- 60 2.1.4 61