2 dnl DNS Service Discovery (aka Bonjour) stuff for CUPS.
4 dnl Copyright 2007-2015 by Apple Inc.
6 dnl These coded instructions, statements, and computer programs are the
7 dnl property of Apple Inc. and are protected by Federal copyright
8 dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
9 dnl which should have been included with this file. If this file is
10 dnl file is missing or damaged, see the license at "http://www.cups.org/".
13 AC_ARG_ENABLE(avahi, [ --disable-avahi disable DNS Service Discovery support using Avahi])
14 AC_ARG_ENABLE(dnssd, [ --disable-dnssd disable DNS Service Discovery support using mDNSResponder])
15 AC_ARG_WITH(dnssd-libs, [ --with-dnssd-libs set directory for DNS Service Discovery library],
16 LDFLAGS="-L$withval $LDFLAGS"
17 DSOFLAGS="-L$withval $DSOFLAGS",)
18 AC_ARG_WITH(dnssd-includes, [ --with-dnssd-includes set directory for DNS Service Discovery includes],
19 CFLAGS="-I$withval $CFLAGS"
20 CPPFLAGS="-I$withval $CPPFLAGS",)
27 if test "x$PKGCONFIG" != x -a x$enable_avahi != xno -a x$uname != xDarwin; then
28 AC_MSG_CHECKING(for Avahi)
29 if $PKGCONFIG --exists avahi-client; then
31 CFLAGS="$CFLAGS `$PKGCONFIG --cflags avahi-client`"
32 DNSSDLIBS="`$PKGCONFIG --libs avahi-client`"
35 IPPFIND_MAN="ippfind.\$(MAN1EXT)"
42 if test "x$DNSSD_BACKEND" = x -a x$enable_dnssd != xno; then
43 AC_CHECK_HEADER(dns_sd.h, [
46 # Darwin and MacOS X...
48 DNSSDLIBS="-framework CoreFoundation -framework SystemConfiguration"
51 IPPFIND_MAN="ippfind.\$(MAN1EXT)"
55 AC_MSG_CHECKING(for current version of dns_sd library)
58 AC_TRY_COMPILE([#include <dns_sd.h>],
59 [int constant = kDNSServiceFlagsShareConnection;
60 unsigned char txtRecord[100];
62 TXTRecordGetValuePtr(sizeof(txtRecord),
63 txtRecord, "value", &valueLen);],
67 DNSSD_BACKEND="dnssd",
69 IPPFIND_MAN="ippfind.\$(MAN1EXT)"
78 AC_SUBST(DNSSD_BACKEND)