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