1 dnl Check for optional server location protocol support (used by MacOS X)
3 dnl $Id: srvloc.m4,v 1.10 2009-12-13 11:58:30 franklahm Exp $
5 AC_DEFUN([NETATALK_SRVLOC], [
13 [ --enable-srvloc[[=DIR]] enable Server Location Protocol (SLP) support],
18 dnl make sure atalk_libname is defined beforehand
19 [[ -n "$atalk_libname" ]] || AC_MSG_ERROR([internal error, atalk_libname undefined])
21 if test "x$srvloc" != "xno"; then
23 savedcppflags="$CPPFLAGS"
24 savedldflags="$LDFLAGS"
25 if test "x$srvloc" = "xyes" ; then
30 CPPFLAGS="$CPPFLAGS -I$srvlocdir/include"
31 LDFLAGS="$LDFLAGS -L$srvlocdir/$atalk_libname"
33 AC_MSG_CHECKING([for slp.h])
34 AC_TRY_CPP([#include <slp.h>],
44 if test "x$found_slp" = "xyes"; then
45 AC_CHECK_LIB(slp, SLPOpen, [
46 SLP_LIBS="-L$srvlocdir/$atalk_libname -lslp"
47 SLP_CFLAGS="-I$srvlocdir/include"
54 CPPFLAGS="$savedcppflags"
55 LDFLAGS="$savedldflags"
59 AC_MSG_CHECKING([whether to enable srvloc (SLP) support])
60 if test "x$found_slp" = "xyes"; then
62 AC_DEFINE(USE_SRVLOC, 1, [Define to enable SLP support])
63 netatalk_cv_srvloc=yes
66 if test "x$srvloc" != "xno" -a "x$srvloc" != "xyes"; then
67 AC_MSG_ERROR([SLP installation not found])
73 LIB_REMOVE_USR_LIB(SLP_LIBS)
74 CFLAGS_REMOVE_USR_INCLUDE(SLP_CFLAGS)