]>
Commit | Line | Data |
---|---|---|
f7deaa1a | 1 | dnl |
b19ccc9e | 2 | dnl "$Id: cups-dnssd.m4 7890 2008-08-29 22:19:39Z mike $" |
f7deaa1a | 3 | dnl |
321d8d57 | 4 | dnl DNS Service Discovery (aka Bonjour) stuff for CUPS. |
f7deaa1a | 5 | dnl |
321d8d57 | 6 | dnl Copyright 2007-2011 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 | ||
bf3816c7 | 15 | AC_ARG_ENABLE(dnssd, [ --disable-dnssd disable DNS Service Discovery support]) |
09a101d6 | 16 | AC_ARG_WITH(dnssd-libs, [ --with-dnssd-libs set directory for DNS Service Discovery library], |
f7deaa1a | 17 | LDFLAGS="-L$withval $LDFLAGS" |
18 | DSOFLAGS="-L$withval $DSOFLAGS",) | |
09a101d6 | 19 | AC_ARG_WITH(dnssd-includes, [ --with-dnssd-includes set directory for DNS Service Discovery includes], |
f7deaa1a | 20 | CFLAGS="-I$withval $CFLAGS" |
f7deaa1a | 21 | CPPFLAGS="-I$withval $CPPFLAGS",) |
22 | ||
23 | DNSSDLIBS="" | |
c5571a1d | 24 | DNSSD_BACKEND="" |
f7deaa1a | 25 | |
26 | if test x$enable_dnssd != xno; then | |
27 | AC_CHECK_HEADER(dns_sd.h, [ | |
f7deaa1a | 28 | case "$uname" in |
29 | Darwin*) | |
30 | # Darwin and MacOS X... | |
cc0d019f | 31 | AC_DEFINE(HAVE_DNSSD) |
f7deaa1a | 32 | AC_DEFINE(HAVE_COREFOUNDATION) |
33 | AC_DEFINE(HAVE_SYSTEMCONFIGURATION) | |
d1c13e16 | 34 | DNSSDLIBS="-framework CoreFoundation -framework SystemConfiguration" |
c5571a1d | 35 | DNSSD_BACKEND="dnssd" |
f7deaa1a | 36 | ;; |
37 | *) | |
38 | # All others... | |
d1c13e16 MS |
39 | AC_MSG_CHECKING(for current version of dns_sd library) |
40 | SAVELIBS="$LIBS" | |
41 | LIBS="$LIBS -ldns_sd" | |
7a0cbd5e | 42 | AC_TRY_COMPILE([#include <dns_sd.h>], |
d1c13e16 MS |
43 | [int constant = kDNSServiceFlagsShareConnection; |
44 | unsigned char txtRecord[100]; | |
45 | uint8_t valueLen; | |
46 | TXTRecordGetValuePtr(sizeof(txtRecord), | |
47 | txtRecord, "value", &valueLen);], | |
48 | AC_MSG_RESULT(yes) | |
cc0d019f | 49 | AC_DEFINE(HAVE_DNSSD) |
d1c13e16 MS |
50 | DNSSDLIBS="-ldns_sd" |
51 | DNSSD_BACKEND="dnssd", | |
52 | AC_MSG_RESULT(no)) | |
53 | LIBS="$SAVELIBS" | |
f7deaa1a | 54 | ;; |
55 | esac | |
56 | ]) | |
57 | fi | |
58 | ||
59 | AC_SUBST(DNSSDLIBS) | |
c5571a1d | 60 | AC_SUBST(DNSSD_BACKEND) |
f7deaa1a | 61 | |
62 | dnl | |
b19ccc9e | 63 | dnl End of "$Id: cups-dnssd.m4 7890 2008-08-29 22:19:39Z mike $". |
f7deaa1a | 64 | dnl |