2 dnl DNS Service Discovery (aka Bonjour) stuff for CUPS.
4 dnl Copyright 2007-2017 by Apple Inc.
6 dnl Licensed under Apache License v2.0. See the file "LICENSE" for more information.
9 AC_ARG_ENABLE(avahi, [ --disable-avahi disable DNS Service Discovery support using Avahi])
10 AC_ARG_ENABLE(dnssd, [ --disable-dnssd disable DNS Service Discovery support using mDNSResponder])
11 AC_ARG_WITH(dnssd-libs, [ --with-dnssd-libs set directory for DNS Service Discovery library],
12 LDFLAGS="-L$withval $LDFLAGS"
13 DSOFLAGS="-L$withval $DSOFLAGS",)
14 AC_ARG_WITH(dnssd-includes, [ --with-dnssd-includes set directory for DNS Service Discovery includes],
15 CFLAGS="-I$withval $CFLAGS"
16 CPPFLAGS="-I$withval $CPPFLAGS",)
23 if test "x$PKGCONFIG" != x -a x$enable_avahi != xno -a x$host_os_name != xdarwin; then
24 AC_MSG_CHECKING(for Avahi)
25 if $PKGCONFIG --exists avahi-client; then
27 CFLAGS="$CFLAGS `$PKGCONFIG --cflags avahi-client`"
28 DNSSDLIBS="`$PKGCONFIG --libs avahi-client`"
31 IPPFIND_MAN="ippfind.\$(MAN1EXT)"
38 if test "x$DNSSD_BACKEND" = x -a x$enable_dnssd != xno; then
39 AC_CHECK_HEADER(dns_sd.h, [
40 case "$host_os_name" in
44 DNSSDLIBS="-framework CoreFoundation -framework SystemConfiguration"
47 IPPFIND_MAN="ippfind.\$(MAN1EXT)"
51 AC_MSG_CHECKING(for current version of dns_sd library)
54 AC_TRY_COMPILE([#include <dns_sd.h>],
55 [int constant = kDNSServiceFlagsShareConnection;
56 unsigned char txtRecord[100];
58 TXTRecordGetValuePtr(sizeof(txtRecord),
59 txtRecord, "value", &valueLen);],
63 DNSSD_BACKEND="dnssd",
65 IPPFIND_MAN="ippfind.\$(MAN1EXT)"
74 AC_SUBST(DNSSD_BACKEND)