]>
Commit | Line | Data |
---|---|---|
f7deaa1a | 1 | dnl |
1a18c85c | 2 | dnl "$Id: cups-dnssd.m4 11324 2013-10-04 03:11:42Z msweet $" |
f7deaa1a | 3 | dnl |
321d8d57 | 4 | dnl DNS Service Discovery (aka Bonjour) stuff for CUPS. |
f7deaa1a | 5 | dnl |
3e7fe0ca | 6 | dnl Copyright 2007-2012 by Apple Inc. |
f7deaa1a | 7 | dnl |
bc44d920 | 8 | dnl These coded instructions, statements, and computer programs are the |
9 | dnl property of Apple Inc. and are protected by Federal copyright | |
10 | dnl law. Distribution and use rights are outlined in the file "LICENSE.txt" | |
11 | dnl which should have been included with this file. If this file is | |
12 | dnl file is missing or damaged, see the license at "http://www.cups.org/". | |
f7deaa1a | 13 | dnl |
14 | ||
3e7fe0ca MS |
15 | AC_ARG_ENABLE(avahi, [ --disable-avahi disable DNS Service Discovery support using Avahi]) |
16 | AC_ARG_ENABLE(dnssd, [ --disable-dnssd disable DNS Service Discovery support using mDNSResponder]) | |
09a101d6 | 17 | AC_ARG_WITH(dnssd-libs, [ --with-dnssd-libs set directory for DNS Service Discovery library], |
f7deaa1a | 18 | LDFLAGS="-L$withval $LDFLAGS" |
19 | DSOFLAGS="-L$withval $DSOFLAGS",) | |
09a101d6 | 20 | AC_ARG_WITH(dnssd-includes, [ --with-dnssd-includes set directory for DNS Service Discovery includes], |
f7deaa1a | 21 | CFLAGS="-I$withval $CFLAGS" |
f7deaa1a | 22 | CPPFLAGS="-I$withval $CPPFLAGS",) |
23 | ||
24 | DNSSDLIBS="" | |
c5571a1d | 25 | DNSSD_BACKEND="" |
766a8229 MS |
26 | IPPFIND_BIN="" |
27 | IPPFIND_MAN="" | |
f7deaa1a | 28 | |
3e7fe0ca MS |
29 | if test "x$PKGCONFIG" != x -a x$enable_avahi != xno; then |
30 | AC_MSG_CHECKING(for Avahi) | |
31 | if $PKGCONFIG --exists avahi-client; then | |
32 | AC_MSG_RESULT(yes) | |
33 | CFLAGS="$CFLAGS `$PKGCONFIG --cflags avahi-client`" | |
34 | DNSSDLIBS="`$PKGCONFIG --libs avahi-client`" | |
35 | DNSSD_BACKEND="dnssd" | |
766a8229 MS |
36 | IPPFIND_BIN="ippfind" |
37 | IPPFIND_MAN="ippfind.\$(MAN1EXT)" | |
3e7fe0ca MS |
38 | AC_DEFINE(HAVE_AVAHI) |
39 | else | |
40 | AC_MSG_RESULT(no) | |
41 | fi | |
42 | fi | |
43 | ||
44 | if test "x$DNSSD_BACKEND" = x -a x$enable_dnssd != xno; then | |
f7deaa1a | 45 | AC_CHECK_HEADER(dns_sd.h, [ |
f7deaa1a | 46 | case "$uname" in |
47 | Darwin*) | |
48 | # Darwin and MacOS X... | |
cc0d019f | 49 | AC_DEFINE(HAVE_DNSSD) |
d1c13e16 | 50 | DNSSDLIBS="-framework CoreFoundation -framework SystemConfiguration" |
c5571a1d | 51 | DNSSD_BACKEND="dnssd" |
766a8229 MS |
52 | IPPFIND_BIN="ippfind" |
53 | IPPFIND_MAN="ippfind.\$(MAN1EXT)" | |
f7deaa1a | 54 | ;; |
55 | *) | |
56 | # All others... | |
d1c13e16 MS |
57 | AC_MSG_CHECKING(for current version of dns_sd library) |
58 | SAVELIBS="$LIBS" | |
59 | LIBS="$LIBS -ldns_sd" | |
7a0cbd5e | 60 | AC_TRY_COMPILE([#include <dns_sd.h>], |
d1c13e16 MS |
61 | [int constant = kDNSServiceFlagsShareConnection; |
62 | unsigned char txtRecord[100]; | |
63 | uint8_t valueLen; | |
64 | TXTRecordGetValuePtr(sizeof(txtRecord), | |
65 | txtRecord, "value", &valueLen);], | |
66 | AC_MSG_RESULT(yes) | |
cc0d019f | 67 | AC_DEFINE(HAVE_DNSSD) |
d1c13e16 MS |
68 | DNSSDLIBS="-ldns_sd" |
69 | DNSSD_BACKEND="dnssd", | |
766a8229 MS |
70 | IPPFIND_BIN="ippfind" |
71 | IPPFIND_MAN="ippfind.\$(MAN1EXT)" | |
d1c13e16 MS |
72 | AC_MSG_RESULT(no)) |
73 | LIBS="$SAVELIBS" | |
f7deaa1a | 74 | ;; |
75 | esac | |
76 | ]) | |
77 | fi | |
78 | ||
79 | AC_SUBST(DNSSDLIBS) | |
c5571a1d | 80 | AC_SUBST(DNSSD_BACKEND) |
766a8229 MS |
81 | AC_SUBST(IPPFIND_BIN) |
82 | AC_SUBST(IPPFIND_MAN) | |
f7deaa1a | 83 | |
84 | dnl | |
1a18c85c | 85 | dnl End of "$Id: cups-dnssd.m4 11324 2013-10-04 03:11:42Z msweet $". |
f7deaa1a | 86 | dnl |