2 dnl DNS Service Discovery (aka Bonjour) stuff for CUPS.
4 dnl Copyright © 2007-2019 by Apple Inc.
6 dnl Licensed under Apache License v2.0. See the file "LICENSE" for more
10 AC_ARG_ENABLE(avahi, [ --disable-avahi disable DNS Service Discovery support using Avahi])
11 AC_ARG_ENABLE(dnssd, [ --disable-dnssd disable DNS Service Discovery support using mDNSResponder])
12 AC_ARG_WITH(dnssd-libs, [ --with-dnssd-libs set directory for DNS Service Discovery library],
13 LDFLAGS="-L$withval $LDFLAGS"
14 DSOFLAGS="-L$withval $DSOFLAGS",)
15 AC_ARG_WITH(dnssd-includes, [ --with-dnssd-includes set directory for DNS Service Discovery includes],
16 CFLAGS="-I$withval $CFLAGS"
17 CPPFLAGS="-I$withval $CPPFLAGS",)
24 if test "x$PKGCONFIG" != x -a x$enable_avahi != xno -a x$host_os_name != xdarwin; then
25 AC_MSG_CHECKING(for Avahi)
26 if $PKGCONFIG --exists avahi-client; then
28 CFLAGS="$CFLAGS `$PKGCONFIG --cflags avahi-client`"
29 DNSSDLIBS="`$PKGCONFIG --libs avahi-client`"
32 IPPFIND_MAN="ippfind.\$(MAN1EXT)"
39 if test "x$DNSSD_BACKEND" = x -a x$enable_dnssd != xno; then
40 AC_CHECK_HEADER(dns_sd.h, [
41 case "$host_os_name" in
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)