]>
Commit | Line | Data |
---|---|---|
f7deaa1a | 1 | dnl |
503b54c9 | 2 | dnl DNS Service Discovery (aka Bonjour) stuff for CUPS. |
f7deaa1a | 3 | dnl |
d4874933 | 4 | dnl Copyright 2007-2016 by Apple Inc. |
f7deaa1a | 5 | dnl |
503b54c9 MS |
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 | |
57b7b66b | 10 | dnl missing or damaged, see the license at "http://www.cups.org/". |
f7deaa1a | 11 | dnl |
12 | ||
3e7fe0ca MS |
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]) | |
09a101d6 | 15 | AC_ARG_WITH(dnssd-libs, [ --with-dnssd-libs set directory for DNS Service Discovery library], |
f7deaa1a | 16 | LDFLAGS="-L$withval $LDFLAGS" |
17 | DSOFLAGS="-L$withval $DSOFLAGS",) | |
09a101d6 | 18 | AC_ARG_WITH(dnssd-includes, [ --with-dnssd-includes set directory for DNS Service Discovery includes], |
f7deaa1a | 19 | CFLAGS="-I$withval $CFLAGS" |
f7deaa1a | 20 | CPPFLAGS="-I$withval $CPPFLAGS",) |
21 | ||
22 | DNSSDLIBS="" | |
c5571a1d | 23 | DNSSD_BACKEND="" |
766a8229 MS |
24 | IPPFIND_BIN="" |
25 | IPPFIND_MAN="" | |
f7deaa1a | 26 | |
7470f0c7 | 27 | if test "x$PKGCONFIG" != x -a x$enable_avahi != xno -a x$uname != xDarwin; then |
3e7fe0ca MS |
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" | |
766a8229 MS |
34 | IPPFIND_BIN="ippfind" |
35 | IPPFIND_MAN="ippfind.\$(MAN1EXT)" | |
3e7fe0ca MS |
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 | |
f7deaa1a | 43 | AC_CHECK_HEADER(dns_sd.h, [ |
f7deaa1a | 44 | case "$uname" in |
45 | Darwin*) | |
d4874933 | 46 | # Darwin and macOS... |
cc0d019f | 47 | AC_DEFINE(HAVE_DNSSD) |
d1c13e16 | 48 | DNSSDLIBS="-framework CoreFoundation -framework SystemConfiguration" |
c5571a1d | 49 | DNSSD_BACKEND="dnssd" |
766a8229 MS |
50 | IPPFIND_BIN="ippfind" |
51 | IPPFIND_MAN="ippfind.\$(MAN1EXT)" | |
f7deaa1a | 52 | ;; |
53 | *) | |
54 | # All others... | |
d1c13e16 MS |
55 | AC_MSG_CHECKING(for current version of dns_sd library) |
56 | SAVELIBS="$LIBS" | |
57 | LIBS="$LIBS -ldns_sd" | |
7a0cbd5e | 58 | AC_TRY_COMPILE([#include <dns_sd.h>], |
d1c13e16 MS |
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) | |
cc0d019f | 65 | AC_DEFINE(HAVE_DNSSD) |
d1c13e16 MS |
66 | DNSSDLIBS="-ldns_sd" |
67 | DNSSD_BACKEND="dnssd", | |
766a8229 MS |
68 | IPPFIND_BIN="ippfind" |
69 | IPPFIND_MAN="ippfind.\$(MAN1EXT)" | |
d1c13e16 MS |
70 | AC_MSG_RESULT(no)) |
71 | LIBS="$SAVELIBS" | |
f7deaa1a | 72 | ;; |
73 | esac | |
74 | ]) | |
75 | fi | |
76 | ||
77 | AC_SUBST(DNSSDLIBS) | |
c5571a1d | 78 | AC_SUBST(DNSSD_BACKEND) |
766a8229 MS |
79 | AC_SUBST(IPPFIND_BIN) |
80 | AC_SUBST(IPPFIND_MAN) |