]> arthur.barton.de Git - netatalk.git/blob - macros/srvloc.m4
unblock signals in children (cf previous commit for RH9 )
[netatalk.git] / macros / srvloc.m4
1 dnl Check for optional server location protocol support (used by MacOS X)
2
3 dnl $Id: srvloc.m4,v 1.8.6.1 2003-10-29 23:53:24 bfernhomberg Exp $
4
5 AC_DEFUN([NETATALK_SRVLOC], [
6
7         SLP_LIBS=""
8         SLP_CFLAGS=""
9         found_slp=no
10         srvlocdir=""
11
12         AC_ARG_ENABLE(srvloc,
13                 [  --enable-srvloc[[=DIR]]   enable Server Location Protocol (SLP) support [[auto]]],
14                 [srvloc=$enableval],
15                 [srvloc=try]
16         )
17
18         if test "x$srvloc" != "xno"; then
19
20                 savedcppflags="$CPPFLAGS"
21                 savedldflags="$LDFLAGS"
22                 if test "x$srvloc" = "xyes" -o "x$srvloc" = "xtry"; then
23                         srvlocdir="/usr"
24                 else
25                         srvlocdir="$srvloc"
26                 fi
27                 CPPFLAGS="$CPPFLAGS -I$srvlocdir/include"
28                 LDFLAGS="$LDFLAGS -L$srvlocdir/lib"
29
30                 AC_MSG_CHECKING([for slp.h])
31                 AC_TRY_CPP([#include <slp.h>],
32                         [
33                                 AC_MSG_RESULT([yes])
34                                 found_slp=yes
35                         ],
36                         [
37                                 AC_MSG_RESULT([no])
38                         ]
39                 )
40                 
41                 if test "x$found_slp" = "xyes"; then
42                         AC_CHECK_LIB(slp, SLPOpen, [
43                            SLP_LIBS="-L$srvlocdir/lib -lslp"
44                            SLP_CFLAGS="-I$srvlocdir/include"
45                         ],[ 
46                            AC_MSG_RESULT([no])
47                            found_slp=no
48                         ])
49                 fi
50
51                 CPPFLAGS="$savedcppflags"
52                 LDFLAGS="$savedldflags"
53         fi
54         
55         netatalk_cv_srvloc=no
56         AC_MSG_CHECKING([whether to enable srvloc (SLP) support])
57         if test "x$found_slp" = "xyes"; then
58                 AC_MSG_RESULT([yes])
59                 AC_DEFINE(USE_SRVLOC, 1, [Define to enable SLP support])
60                 netatalk_cv_srvloc=yes
61         else
62                 AC_MSG_RESULT([no])
63                 if test "x$srvloc" != "xno" -a "x$srvloc" != "xtry"; then
64                         AC_MSG_ERROR([SLP installation not found])
65                 fi
66         fi
67                 
68
69
70         LIB_REMOVE_USR_LIB(SLP_LIBS)
71         CFLAGS_REMOVE_USR_INCLUDE(SLP_CFLAGS)
72         AC_SUBST(SLP_LIBS)
73         AC_SUBST(SLP_CFLAGS)
74 ])