]> git.ipfire.org Git - thirdparty/cups.git/blob - config-scripts/cups-dnssd.m4
Update all references to OS X to macOS.
[thirdparty/cups.git] / config-scripts / cups-dnssd.m4
1 dnl
2 dnl DNS Service Discovery (aka Bonjour) stuff for CUPS.
3 dnl
4 dnl Copyright 2007-2015 by Apple Inc.
5 dnl
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/".
11 dnl
12
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",)
21
22 DNSSDLIBS=""
23 DNSSD_BACKEND=""
24 IPPFIND_BIN=""
25 IPPFIND_MAN=""
26
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
30 AC_MSG_RESULT(yes)
31 CFLAGS="$CFLAGS `$PKGCONFIG --cflags avahi-client`"
32 DNSSDLIBS="`$PKGCONFIG --libs avahi-client`"
33 DNSSD_BACKEND="dnssd"
34 IPPFIND_BIN="ippfind"
35 IPPFIND_MAN="ippfind.\$(MAN1EXT)"
36 AC_DEFINE(HAVE_AVAHI)
37 else
38 AC_MSG_RESULT(no)
39 fi
40 fi
41
42 if test "x$DNSSD_BACKEND" = x -a x$enable_dnssd != xno; then
43 AC_CHECK_HEADER(dns_sd.h, [
44 case "$uname" in
45 Darwin*)
46 # Darwin and MacmacOS...
47 AC_DEFINE(HAVE_DNSSD)
48 DNSSDLIBS="-framework CoreFoundation -framework SystemConfiguration"
49 DNSSD_BACKEND="dnssd"
50 IPPFIND_BIN="ippfind"
51 IPPFIND_MAN="ippfind.\$(MAN1EXT)"
52 ;;
53 *)
54 # All others...
55 AC_MSG_CHECKING(for current version of dns_sd library)
56 SAVELIBS="$LIBS"
57 LIBS="$LIBS -ldns_sd"
58 AC_TRY_COMPILE([#include <dns_sd.h>],
59 [int constant = kDNSServiceFlagsShareConnection;
60 unsigned char txtRecord[100];
61 uint8_t valueLen;
62 TXTRecordGetValuePtr(sizeof(txtRecord),
63 txtRecord, "value", &valueLen);],
64 AC_MSG_RESULT(yes)
65 AC_DEFINE(HAVE_DNSSD)
66 DNSSDLIBS="-ldns_sd"
67 DNSSD_BACKEND="dnssd",
68 IPPFIND_BIN="ippfind"
69 IPPFIND_MAN="ippfind.\$(MAN1EXT)"
70 AC_MSG_RESULT(no))
71 LIBS="$SAVELIBS"
72 ;;
73 esac
74 ])
75 fi
76
77 AC_SUBST(DNSSDLIBS)
78 AC_SUBST(DNSSD_BACKEND)
79 AC_SUBST(IPPFIND_BIN)
80 AC_SUBST(IPPFIND_MAN)