diff options
author | Eric Wong <normalperson@yhbt.net> | 2008-06-16 02:48:07 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-06-16 02:48:07 +0000 |
commit | 2444f5d41a3ccefdf14f5336430ef46baf976626 (patch) | |
tree | ee147c111fea3c7f808fd2f27a4dc55500d7d013 /configure.ac | |
parent | ac74ef1fde5859aabcffe6ec6c57100cb680d89f (diff) | |
download | mpd-2444f5d41a3ccefdf14f5336430ef46baf976626.tar.gz mpd-2444f5d41a3ccefdf14f5336430ef46baf976626.tar.xz mpd-2444f5d41a3ccefdf14f5336430ef46baf976626.zip |
Backport Bonjour support from trunk
Thanks to Qball, pat, and jat :)
------------------------------------------------------------------------
r6477 | jat | 2007-06-04 19:41:18 +0200 (Mo, 04 Jun 2007) | 4 lines
Don't initialize zeroconf until after we've daemonized and log output has
been redirected. This prevents zeroconf from blocking daemonization, and
makes sure any errors get sent to the logs and not stdout.
------------------------------------------------------------------------
r6474 | jat | 2007-06-03 22:09:12 +0200 (So, 03 Jun 2007) | 3 lines
Adding ChangeLog entry for zeroconf_enabled, adding Zeroconf section to
mpdconf.example, and updating the zeroconf_* docs.
------------------------------------------------------------------------
r6471 | jat | 2007-06-03 21:44:19 +0200 (So, 03 Jun 2007) | 4 lines
Define HAVE_ZEROCONF if Avahi or Bonjour support is enabled, so that we can
silence a warning about an unused variable without using stupid checks for
HAVE_AVAHI || HAVE_BONJOUR.
------------------------------------------------------------------------
r6467 | pat | 2007-06-03 20:08:51 +0200 (So, 03 Jun 2007) | 2 lines
allow zeroconf to be disabled.
------------------------------------------------------------------------
r6464 | jat | 2007-06-03 02:03:20 +0200 (So, 03 Jun 2007) | 2 lines
Cleaning up zeroconf configure magic.
------------------------------------------------------------------------
r6463 | jat | 2007-06-03 00:58:51 +0200 (So, 03 Jun 2007) | 2 lines
Check if we need -ldns_sd for Bonjour.
------------------------------------------------------------------------
r6462 | jat | 2007-06-03 00:52:53 +0200 (So, 03 Jun 2007) | 2 lines
Adding a missing include.
------------------------------------------------------------------------
r6453 | pat | 2007-06-02 19:06:08 +0200 (Sa, 02 Jun 2007) | 3 lines
Added Bonjour zeroconf support. This works now natively on
MacOS X. I couldn't test mDNSResponder support on Linux, as
Debian doesn't include it - but should work as well.
git-svn-id: https://svn.musicpd.org/mpd/branches/branch-0.13.0-fixes@7381 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac index 1206b296f..562264362 100644 --- a/configure.ac +++ b/configure.ac @@ -583,26 +583,38 @@ no|avahi|bonjour) esac if test x$with_zeroconf != xno; then - if test x$with_zeroconf = xauto; then + if test x$with_zeroconf = xavahi || test x$with_zeroconf = xauto; then PKG_CHECK_MODULES([AVAHI], [avahi-client], - [with_zeroconf=avahi;AC_DEFINE([HAVE_AVAHI], 1, [Define to enable Avahi Zeroconf support])] MPD_LIBS="$MPD_LIBS $AVAHI_LIBS" MPD_CFLAGS="$MPD_CFLAGS $AVAHI_CFLAGS", - [with_zeroconf=auto]) + [found_avahi=1;AC_DEFINE([HAVE_AVAHI], 1, [Define to enable Avahi Zeroconf support])] + MPD_LIBS="$MPD_LIBS $AVAHI_LIBS" MPD_CFLAGS="$MPD_CFLAGS $AVAHI_CFLAGS", + [found_avahi=0]) + fi + + if test x$found_avahi = x1; then + with_zeroconf=avahi elif test x$with_zeroconf = xavahi; then - PKG_CHECK_MODULES([AVAHI], [avahi-client], - [with_zeroconf=avahi;AC_DEFINE([HAVE_AVAHI], 1, [Define to enable Avahi Zeroconf support])] MPD_LIBS="$MPD_LIBS $AVAHI_LIBS" MPD_CFLAGS="$MPD_CFLAGS $AVAHI_CFLAGS") + with_zeroconf=no fi - # In the future, should add bonjour support (for OSX) and check at autodetect - # time - #if test x$with_zeroconf = xbonjour -o x$with_zeroconf = xauto; then - if test x$with_zeroconf = xbonjour; then - AC_MSG_WARN([Bonjour support has not been implemented yet, disabling Zeroconf]) + if test x$with_zeroconf = xbonjour || test x$with_zeroconf = xauto; then + AC_CHECK_HEADER(dns_sd.h, + [found_bonjour=1;AC_DEFINE([HAVE_BONJOUR], 1, [Define to enable Bonjour Zeroconf support])], + [found_bonjour=0]) + AC_CHECK_LIB(dns_sd, DNSServiceRegister, + MPD_LIBS="$MPD_LIBS -ldns_sd") + fi + + if test x$found_bonjour = x1; then + with_zeroconf=bonjour + elif test x$with_zeroconf = xbonjour; then with_zeroconf=no fi - if test x$with_zeroconf = xauto; then + if test x$with_zeroconf = xauto || test x$with_zeroconf = xno; then AC_MSG_WARN([No supported Zeroconf backend found, disabling Zeroconf]) with_zeroconf=no + else + AC_DEFINE([HAVE_ZEROCONF], 1, [Define to enable Zeroconf support]) fi fi |