]> git.ipfire.org Git - thirdparty/cups.git/blame - config-scripts/cups-dnssd.m4
Merge changes from CUPS 1.6svn-r10510.
[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
3e7fe0ca 6dnl Copyright 2007-2012 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
3e7fe0ca
MS
15AC_ARG_ENABLE(avahi, [ --disable-avahi disable DNS Service Discovery support using Avahi])
16AC_ARG_ENABLE(dnssd, [ --disable-dnssd disable DNS Service Discovery support using mDNSResponder])
09a101d6 17AC_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 20AC_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
24DNSSDLIBS=""
c5571a1d 25DNSSD_BACKEND=""
f7deaa1a 26
3e7fe0ca
MS
27if test "x$PKGCONFIG" != x -a x$enable_avahi != xno; then
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"
34 AC_DEFINE(HAVE_AVAHI)
35 else
36 AC_MSG_RESULT(no)
37 fi
38fi
39
40if test "x$DNSSD_BACKEND" = x -a x$enable_dnssd != xno; then
f7deaa1a 41 AC_CHECK_HEADER(dns_sd.h, [
f7deaa1a 42 case "$uname" in
43 Darwin*)
44 # Darwin and MacOS X...
cc0d019f 45 AC_DEFINE(HAVE_DNSSD)
d1c13e16 46 DNSSDLIBS="-framework CoreFoundation -framework SystemConfiguration"
c5571a1d 47 DNSSD_BACKEND="dnssd"
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",
64 AC_MSG_RESULT(no))
65 LIBS="$SAVELIBS"
f7deaa1a 66 ;;
67 esac
68 ])
69fi
70
71AC_SUBST(DNSSDLIBS)
c5571a1d 72AC_SUBST(DNSSD_BACKEND)
f7deaa1a 73
74dnl
b19ccc9e 75dnl End of "$Id: cups-dnssd.m4 7890 2008-08-29 22:19:39Z mike $".
f7deaa1a 76dnl