-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfigure.in
61 lines (53 loc) · 2.1 KB
/
configure.in
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
dnl Process this file with autoconf to produce a configure script.
AC_INIT(libauthSamba.h)
AC_CONFIG_HEADERS(config.h)
dnl Checks for library functions.
AC_FUNC_ALLOCA
# Force use of a samba directory
AC_ARG_WITH(samba-prefix,
[ --with-samba-prefix=ARG
Use specified curses libraries instead of
those automatically found by configure.],
[
CFLAGS="$CFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib -lsmbclient"
],
[ with_samba=no ]
)
dnl Check for library existence
AC_CHECK_LIB(smbclient, smbc_mkdir, ,
[ AC_MSG_ERROR([I can't find your libsmbclient.so or symbol smbc_mkdir.
Check config.log for details.]) ])
AC_CHECK_LIB(smbclient, smbc_open, ,
[ AC_MSG_ERROR([I can't find your libsmbclient.so or symbol smbc_open.
Check config.log for details.]) ])
AC_CHECK_LIB(smbclient, smbc_fstat, ,
[ AC_MSG_ERROR([I can't find your libsmbclient.so or symbol smbc_fstat.
Check config.log for details.]) ])
dnl Check for context
AC_CHECK_LIB(smbclient,
smbc_init_context, ,
[ AC_MSG_ERROR([Your libsmbclient.so is too old. Please update to samba 3.]) ])
dnl Did we have SMBCTXX->flags ?
AC_TRY_COMPILE([#include <libsmbclient.h>],
[SMBCCTX *c; c->flags=0;],
smbctxFlags_ok=yes, smbctxFlags_ok=no)
if test "$smbctxFlags_ok" = yes; then
AC_DEFINE(HAVE_SMBCTXX_FLAG,,[define if SMBCTXX->flags flag exist.])
AC_MSG_RESULT([Good you have SMBCTXX->flags ])
CFLAGS="$CFLAGS -DHAVE_SMBCTXX_FLAG"
else
AC_MSG_RESULT([You don't define SMBCTXX->flags. Samba older than 3.0.11. Filesys::SmbClient::set_flag will not work])
fi
dnl This is context->close_fn or context close ?
AC_TRY_COMPILE([#include <libsmbclient.h>],
[SMBCCTX *c; c->close_fn(c,0);],
smbctxclosefn=yes, smbctxclosefn=no)
if test "$smbctxclosefn" = yes; then
AC_DEFINE(HAVE_CLOSEFN,, [define if SMBCTXX->close_fn exist.])
AC_MSG_RESULT([You use SMBCTXX->close_fn (release >= 3.0.20). ])
CFLAGS="$CFLAGS -DHAVE_CLOSEFN"
else
AC_MSG_RESULT([You use SMBCTXX->close (release < 3.0.20). ])
fi
AC_OUTPUT