1 dnl Check for optional server location protocol support (used by MacOS X)
3 AC_DEFUN([AC_NETATALK_SRVLOC], [
11 [ --enable-srvloc[[=DIR]] enable Server Location Protocol (SLP) support],
16 dnl make sure atalk_libname is defined beforehand
17 [[ -n "$atalk_libname" ]] || AC_MSG_ERROR([internal error, atalk_libname undefined])
19 if test "x$srvloc" != "xno"; then
21 savedcppflags="$CPPFLAGS"
22 savedldflags="$LDFLAGS"
23 if test "x$srvloc" = "xyes" ; then
28 CPPFLAGS="$CPPFLAGS -I$srvlocdir/include"
29 LDFLAGS="$LDFLAGS -L$srvlocdir/$atalk_libname"
31 AC_MSG_CHECKING([for slp.h])
32 AC_TRY_CPP([#include <slp.h>],
42 if test "x$found_slp" = "xyes"; then
43 AC_CHECK_LIB(slp, SLPOpen, [
44 SLP_LIBS="-L$srvlocdir/$atalk_libname -lslp"
45 SLP_CFLAGS="-I$srvlocdir/include"
52 CPPFLAGS="$savedcppflags"
53 LDFLAGS="$savedldflags"
57 AC_MSG_CHECKING([whether to enable srvloc (SLP) support])
58 if test "x$found_slp" = "xyes"; then
60 AC_DEFINE(USE_SRVLOC, 1, [Define to enable SLP support])
61 netatalk_cv_srvloc=yes
64 if test "x$srvloc" != "xno" -a "x$srvloc" != "xyes"; then
65 AC_MSG_ERROR([SLP installation not found])
71 LIB_REMOVE_USR_LIB(SLP_LIBS)
72 CFLAGS_REMOVE_USR_INCLUDE(SLP_CFLAGS)