]>
Commit | Line | Data |
---|---|---|
f7deaa1a | 1 | dnl |
503b54c9 | 2 | dnl DNS Service Discovery (aka Bonjour) stuff for CUPS. |
f7deaa1a | 3 | dnl |
3c2cb822 | 4 | dnl Copyright © 2007-2019 by Apple Inc. |
f7deaa1a | 5 | dnl |
3c2cb822 MS |
6 | dnl Licensed under Apache License v2.0. See the file "LICENSE" for more |
7 | dnl information. | |
f7deaa1a | 8 | dnl |
9 | ||
3e7fe0ca MS |
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]) | |
09a101d6 | 12 | AC_ARG_WITH(dnssd-libs, [ --with-dnssd-libs set directory for DNS Service Discovery library], |
f7deaa1a | 13 | LDFLAGS="-L$withval $LDFLAGS" |
14 | DSOFLAGS="-L$withval $DSOFLAGS",) | |
09a101d6 | 15 | AC_ARG_WITH(dnssd-includes, [ --with-dnssd-includes set directory for DNS Service Discovery includes], |
f7deaa1a | 16 | CFLAGS="-I$withval $CFLAGS" |
f7deaa1a | 17 | CPPFLAGS="-I$withval $CPPFLAGS",) |
18 | ||
19 | DNSSDLIBS="" | |
c5571a1d | 20 | DNSSD_BACKEND="" |
766a8229 MS |
21 | IPPFIND_BIN="" |
22 | IPPFIND_MAN="" | |
f7deaa1a | 23 | |
105922ec | 24 | if test "x$PKGCONFIG" != x -a x$enable_avahi != xno -a x$host_os_name != xdarwin; then |
3e7fe0ca MS |
25 | AC_MSG_CHECKING(for Avahi) |
26 | if $PKGCONFIG --exists avahi-client; then | |
27 | AC_MSG_RESULT(yes) | |
28 | CFLAGS="$CFLAGS `$PKGCONFIG --cflags avahi-client`" | |
29 | DNSSDLIBS="`$PKGCONFIG --libs avahi-client`" | |
30 | DNSSD_BACKEND="dnssd" | |
766a8229 | 31 | IPPFIND_BIN="ippfind" |
8dabd144 | 32 | IPPFIND_MAN="ippfind.1" |
3e7fe0ca MS |
33 | AC_DEFINE(HAVE_AVAHI) |
34 | else | |
35 | AC_MSG_RESULT(no) | |
36 | fi | |
37 | fi | |
38 | ||
39 | if test "x$DNSSD_BACKEND" = x -a x$enable_dnssd != xno; then | |
f7deaa1a | 40 | AC_CHECK_HEADER(dns_sd.h, [ |
105922ec MS |
41 | case "$host_os_name" in |
42 | darwin*) | |
d4874933 | 43 | # Darwin and macOS... |
cc0d019f | 44 | AC_DEFINE(HAVE_DNSSD) |
c5571a1d | 45 | DNSSD_BACKEND="dnssd" |
766a8229 | 46 | IPPFIND_BIN="ippfind" |
87030afb | 47 | IPPFIND_MAN="ippfind.1" |
f7deaa1a | 48 | ;; |
49 | *) | |
50 | # All others... | |
d1c13e16 MS |
51 | AC_MSG_CHECKING(for current version of dns_sd library) |
52 | SAVELIBS="$LIBS" | |
53 | LIBS="$LIBS -ldns_sd" | |
7a0cbd5e | 54 | AC_TRY_COMPILE([#include <dns_sd.h>], |
d1c13e16 MS |
55 | [int constant = kDNSServiceFlagsShareConnection; |
56 | unsigned char txtRecord[100]; | |
57 | uint8_t valueLen; | |
58 | TXTRecordGetValuePtr(sizeof(txtRecord), | |
59 | txtRecord, "value", &valueLen);], | |
60 | AC_MSG_RESULT(yes) | |
cc0d019f | 61 | AC_DEFINE(HAVE_DNSSD) |
d1c13e16 MS |
62 | DNSSDLIBS="-ldns_sd" |
63 | DNSSD_BACKEND="dnssd", | |
766a8229 | 64 | IPPFIND_BIN="ippfind" |
87030afb | 65 | IPPFIND_MAN="ippfind.1" |
d1c13e16 MS |
66 | AC_MSG_RESULT(no)) |
67 | LIBS="$SAVELIBS" | |
f7deaa1a | 68 | ;; |
69 | esac | |
70 | ]) | |
71 | fi | |
72 | ||
73 | AC_SUBST(DNSSDLIBS) | |
c5571a1d | 74 | AC_SUBST(DNSSD_BACKEND) |
766a8229 MS |
75 | AC_SUBST(IPPFIND_BIN) |
76 | AC_SUBST(IPPFIND_MAN) |