1 dnl Check for optional Zeroconf support
3 AC_DEFUN([NETATALK_ZEROCONF], [
9 AC_ARG_ENABLE(zeroconf,
10 [ --enable-zeroconf[[=DIR]] enable Zeroconf support [[auto]]],
11 [zeroconf=$enableval],
15 dnl make sure atalk_libname is defined beforehand
16 [[ -n "$atalk_libname" ]] || AC_MSG_ERROR([internal error, atalk_libname undefined])
18 if test "x$zeroconf" != "xno"; then
19 savedcppflags="$CPPFLAGS"
20 savedldflags="$LDFLAGS"
22 if test "x$zeroconf" = "xyes" -o "x$zeroconf" = "xtry"; then
25 zeroconf_dir="$zeroconf"
28 # mDNS support using Avahi
30 avahi-client/client.h,
34 AC_DEFINE(USE_ZEROCONF, 1, [Use DNS-SD registration]))
37 case "$ac_cv_lib_avahi_client_avahi_client_new" in
39 PKG_CHECK_MODULES(AVAHI, [ avahi-client >= 0.6 ])
40 PKG_CHECK_MODULES(AVAHI_TPOLL, [ avahi-client >= 0.6.4 ],
41 [AC_DEFINE(HAVE_AVAHI_THREADED_POLL, 1, [Uses Avahis threaded poll implementation])],
42 [AC_MSG_WARN(This Avahi implementation is not supporting threaded poll objects. Maybe this is not what you want.)])
43 ZEROCONF_LIBS="$AVAHI_LIBS"
44 ZEROCONF_CFLAGS="$AVAHI_CFLAGS"
45 AC_DEFINE(HAVE_AVAHI, 1, [Use Avahi/DNS-SD registration])
50 CPPFLAGS="$savedcppflags"
51 LDFLAGS="$savedldflags"
54 netatalk_cv_zeroconf=no
55 AC_MSG_CHECKING([whether to enable Zerconf support])
56 if test "x$found_zeroconf" = "xyes"; then
58 AC_DEFINE(USE_ZEROCONF, 1, [Define to enable Zeroconf support])
59 netatalk_cv_zeroconf=yes
62 if test "x$zeroconf" != "xno" -a "x$zeroconf" != "xtry"; then
63 AC_MSG_ERROR([Zeroconf installation not found])
67 LIB_REMOVE_USR_LIB(ZEROCONF_LIBS)
68 CFLAGS_REMOVE_USR_INCLUDE(ZEROCONF_CFLAGS)
69 AC_SUBST(ZEROCONF_LIBS)
70 AC_SUBST(ZEROCONF_CFLAGS)