]> git.ipfire.org Git - thirdparty/cups.git/blame - config-scripts/cups-dnssd.m4
Sync up with CUPS 1.6svn-r10269 (changes from Zin TOT merged into cups.org TOT)
[thirdparty/cups.git] / config-scripts / cups-dnssd.m4
CommitLineData
f7deaa1a 1dnl
b19ccc9e 2dnl "$Id: cups-dnssd.m4 7890 2008-08-29 22:19:39Z mike $"
f7deaa1a 3dnl
321d8d57 4dnl DNS Service Discovery (aka Bonjour) stuff for CUPS.
f7deaa1a 5dnl
321d8d57 6dnl Copyright 2007-2011 by Apple Inc.
f7deaa1a 7dnl
bc44d920 8dnl These coded instructions, statements, and computer programs are the
9dnl property of Apple Inc. and are protected by Federal copyright
10dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
11dnl which should have been included with this file. If this file is
12dnl file is missing or damaged, see the license at "http://www.cups.org/".
f7deaa1a 13dnl
14
bf3816c7 15AC_ARG_ENABLE(dnssd, [ --disable-dnssd disable DNS Service Discovery support])
09a101d6 16AC_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 19AC_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
23DNSSDLIBS=""
c5571a1d 24DNSSD_BACKEND=""
f7deaa1a 25
26if 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 ])
57fi
58
59AC_SUBST(DNSSDLIBS)
c5571a1d 60AC_SUBST(DNSSD_BACKEND)
f7deaa1a 61
62dnl
b19ccc9e 63dnl End of "$Id: cups-dnssd.m4 7890 2008-08-29 22:19:39Z mike $".
f7deaa1a 64dnl