File: srvloc.m4

package info (click to toggle)
netatalk 2.0.3-11%2Blenny1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 9,428 kB
  • ctags: 6,161
  • sloc: ansic: 67,633; sh: 8,393; perl: 1,187; makefile: 1,060
file content (77 lines) | stat: -rw-r--r-- 1,774 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
dnl Check for optional server location protocol support (used by MacOS X)

dnl $Id: srvloc.m4,v 1.8.6.2 2004/04/21 00:56:59 bfernhomberg Exp $

AC_DEFUN([NETATALK_SRVLOC], [

	SLP_LIBS=""
	SLP_CFLAGS=""
	found_slp=no
	srvlocdir=""

	AC_ARG_ENABLE(srvloc,
		[  --enable-srvloc[[=DIR]]   enable Server Location Protocol (SLP) support [[auto]]],
		[srvloc=$enableval],
		[srvloc=try]
	)

    dnl make sure atalk_libname is defined beforehand
    [[ -n "$atalk_libname" ]] || AC_MSG_ERROR([internal error, atalk_libname undefined])

	if test "x$srvloc" != "xno"; then

		savedcppflags="$CPPFLAGS"
		savedldflags="$LDFLAGS"
		if test "x$srvloc" = "xyes" -o "x$srvloc" = "xtry"; then
			srvlocdir="/usr"
		else
			srvlocdir="$srvloc"
		fi
		CPPFLAGS="$CPPFLAGS -I$srvlocdir/include"
		LDFLAGS="$LDFLAGS -L$srvlocdir/$atalk_libname"

		AC_MSG_CHECKING([for slp.h])
		AC_TRY_CPP([#include <slp.h>],
			[
				AC_MSG_RESULT([yes])
				found_slp=yes
			],
			[
				AC_MSG_RESULT([no])
			]
		)
		
		if test "x$found_slp" = "xyes"; then
			AC_CHECK_LIB(slp, SLPOpen, [
		    	   SLP_LIBS="-L$srvlocdir/$atalk_libname -lslp"
		    	   SLP_CFLAGS="-I$srvlocdir/include"
			],[ 
		    	   AC_MSG_RESULT([no])
			   found_slp=no
			])
		fi

		CPPFLAGS="$savedcppflags"
		LDFLAGS="$savedldflags"
	fi
	
	netatalk_cv_srvloc=no
	AC_MSG_CHECKING([whether to enable srvloc (SLP) support])
	if test "x$found_slp" = "xyes"; then
		AC_MSG_RESULT([yes])
		AC_DEFINE(USE_SRVLOC, 1, [Define to enable SLP support])
		netatalk_cv_srvloc=yes
	else
		AC_MSG_RESULT([no])
		if test "x$srvloc" != "xno" -a "x$srvloc" != "xtry"; then
			AC_MSG_ERROR([SLP installation not found])
		fi
	fi
		


	LIB_REMOVE_USR_LIB(SLP_LIBS)
	CFLAGS_REMOVE_USR_INCLUDE(SLP_CFLAGS)
	AC_SUBST(SLP_LIBS)
	AC_SUBST(SLP_CFLAGS)
])