X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fcups.git;a=blobdiff_plain;f=config-scripts%2Fcups-dnssd.m4;h=19832dc1609aa418717764225349a1b57c103c20;hp=d35eb316c11844e6996c37388f86922dc47745ce;hb=87030afb3aa8735848c66a0526d06af69d7010c6;hpb=d1c13e168660dfc384ead2efe29eb20a7abc5950 diff --git a/config-scripts/cups-dnssd.m4 b/config-scripts/cups-dnssd.m4 index d35eb316c..19832dc16 100644 --- a/config-scripts/cups-dnssd.m4 +++ b/config-scripts/cups-dnssd.m4 @@ -1,22 +1,14 @@ dnl -dnl "$Id: cups-dnssd.m4 7890 2008-08-29 22:19:39Z mike $" +dnl DNS Service Discovery (aka Bonjour) stuff for CUPS. dnl -dnl DNS Service Discovery (aka Bonjour) stuff for the Common UNIX Printing System (CUPS). +dnl Copyright © 2007-2019 by Apple Inc. dnl -dnl http://www.dns-sd.org -dnl http://www.multicastdns.org/ -dnl http://developer.apple.com/networking/bonjour/ -dnl -dnl Copyright 2007-2008 by Apple Inc. -dnl -dnl These coded instructions, statements, and computer programs are the -dnl property of Apple Inc. and are protected by Federal copyright -dnl law. Distribution and use rights are outlined in the file "LICENSE.txt" -dnl which should have been included with this file. If this file is -dnl file is missing or damaged, see the license at "http://www.cups.org/". +dnl Licensed under Apache License v2.0. See the file "LICENSE" for more +dnl information. dnl -AC_ARG_ENABLE(dnssd, [ --enable-dnssd turn on DNS Service Discovery support, default=yes]) +AC_ARG_ENABLE(avahi, [ --disable-avahi disable DNS Service Discovery support using Avahi]) +AC_ARG_ENABLE(dnssd, [ --disable-dnssd disable DNS Service Discovery support using mDNSResponder]) AC_ARG_WITH(dnssd-libs, [ --with-dnssd-libs set directory for DNS Service Discovery library], LDFLAGS="-L$withval $LDFLAGS" DSOFLAGS="-L$withval $DSOFLAGS",) @@ -26,24 +18,40 @@ AC_ARG_WITH(dnssd-includes, [ --with-dnssd-includes set directory for DNS Ser DNSSDLIBS="" DNSSD_BACKEND="" +IPPFIND_BIN="" +IPPFIND_MAN="" + +if test "x$PKGCONFIG" != x -a x$enable_avahi != xno -a x$host_os_name != xdarwin; then + AC_MSG_CHECKING(for Avahi) + if $PKGCONFIG --exists avahi-client; then + AC_MSG_RESULT(yes) + CFLAGS="$CFLAGS `$PKGCONFIG --cflags avahi-client`" + DNSSDLIBS="`$PKGCONFIG --libs avahi-client`" + DNSSD_BACKEND="dnssd" + IPPFIND_BIN="ippfind" + IPPFIND_MAN="ippfind.1)" + AC_DEFINE(HAVE_AVAHI) + else + AC_MSG_RESULT(no) + fi +fi -if test x$enable_dnssd != xno; then +if test "x$DNSSD_BACKEND" = x -a x$enable_dnssd != xno; then AC_CHECK_HEADER(dns_sd.h, [ - case "$uname" in - Darwin*) - # Darwin and MacOS X... + case "$host_os_name" in + darwin*) + # Darwin and macOS... AC_DEFINE(HAVE_DNSSD) - AC_DEFINE(HAVE_COREFOUNDATION) - AC_DEFINE(HAVE_SYSTEMCONFIGURATION) - DNSSDLIBS="-framework CoreFoundation -framework SystemConfiguration" DNSSD_BACKEND="dnssd" + IPPFIND_BIN="ippfind" + IPPFIND_MAN="ippfind.1" ;; *) # All others... AC_MSG_CHECKING(for current version of dns_sd library) SAVELIBS="$LIBS" LIBS="$LIBS -ldns_sd" - AC_TRY_COMPILE([#include ], [int constant = kDNSServiceFlagsShareConnection; unsigned char txtRecord[100]; uint8_t valueLen; @@ -53,6 +61,8 @@ if test x$enable_dnssd != xno; then AC_DEFINE(HAVE_DNSSD) DNSSDLIBS="-ldns_sd" DNSSD_BACKEND="dnssd", + IPPFIND_BIN="ippfind" + IPPFIND_MAN="ippfind.1" AC_MSG_RESULT(no)) LIBS="$SAVELIBS" ;; @@ -62,7 +72,5 @@ fi AC_SUBST(DNSSDLIBS) AC_SUBST(DNSSD_BACKEND) - -dnl -dnl End of "$Id: cups-dnssd.m4 7890 2008-08-29 22:19:39Z mike $". -dnl +AC_SUBST(IPPFIND_BIN) +AC_SUBST(IPPFIND_MAN)