summaryrefslogtreecommitdiff
path: root/aclocal/idmap.m4
blob: ada73f010e5d9f113046895e87ab3f57edc501ae (plain)
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
dnl Headers needed by wbclient.h
dnl
AC_DEFUN([AC_WBCH_COMPL],[
[
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
]
[#ifdef HAVE_STDBOOL_H
#include <stdbool.h>
#endif
]
[#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
]
[#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
]
[#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
]])

dnl Check for wbclient.h header and libwbclient.so
dnl
AC_DEFUN([AC_TEST_WBCHL],[
if test $enable_cifsidmap != "no" -o $enable_cifsacl != "no"; then
	AC_CHECK_HEADERS([wbclient.h], , [
				if test "$enable_cifsidmap" = "yes"; then
					AC_MSG_ERROR([wbclient.h not found, consider installing libwbclient-devel.])
				else
					AC_MSG_WARN([wbclient.h not found, consider installing libwbclient-devel. Disabling cifs.idmap.])
					enable_cifsidmap="no"
				fi
				if test "$enable_cifsacl" = "yes"; then
					AC_MSG_ERROR([wbclient.h not found, consider installing libwbclient-devel.])
				else
					AC_MSG_WARN([wbclient.h not found, consider installing libwbclient-devel. Disabling cifsacl.])
					enable_cifsacl="no"
				fi
			], [ AC_WBCH_COMPL ])
fi

if test $enable_cifsacl != "no"; then
	AC_CHECK_HEADERS([sys/xattr.h], , [
				if test "$enable_cifsacl" = "yes"; then
					AC_MSG_ERROR([/usr/include/sys/xattr.h not found])
				else
					AC_MSG_WARN([/usr/include/sys/xattr.h not found. Disabling cifsacl.])
					enable_cifsacl="no"
				fi
			], [ ])
fi

if test $enable_cifsidmap != "no" -o $enable_cifsacl != "no"; then
	AC_CHECK_LIB([wbclient], [wbcStringToSid],
		[ WINB_LDADD='-lwbclient' ] [ AC_DEFINE(HAVE_LIBWBCLIENT, 1, ["Define var have_libwbclient"]) ], [AC_MSG_ERROR([No functioning wbclient library found!])])
	AC_SUBST(WINB_LDADD)
fi
])