import from HEAD
[freeradius.git] / src / modules / rlm_smb / configure.in
1 AC_INIT(rlm_smb.c)
2 AC_CONFIG_HEADER(config.h)
3 AC_REVISION($Revision$)
4 AC_DEFUN(modname,[rlm_smb])
5
6 if test x$with_[]modname != xno; then
7
8         AC_PROG_CC
9         AC_PROG_CPP
10
11         dnl extra argument: --with-rlm-smb-lib-dir
12         rlm_smb_lib_dir=
13         AC_ARG_WITH(rlm-smb-lib-dir,
14         [  --with-rlm-smb-lib-dir=DIR       Directory for samba library files []],
15         [ case "$withval" in
16             no)
17                 AC_MSG_ERROR(Need rlm-smb-lib-dir)
18                 ;;
19             yes)
20                 ;;
21             *)
22                 rlm_smb_lib_dir="$withval"
23                 ;;
24           esac ]
25         )
26
27         dnl extra argument: --with-rlm-smb-include-dir
28         rlm_smb_inc_dir=
29         AC_ARG_WITH(rlm-smb-include-dir,
30         [  --with-rlm-smb-include-dir=DIR   Directory for samba include files []],
31         [ case "$withval" in
32             no)
33                 AC_MSG_ERROR(Need rlm-smb-include-dir)
34                 ;;
35             yes)
36                 ;;
37             *)
38                 rlm_smb_include_dir="$withval"
39                 ;;
40           esac ]
41         )
42
43         AC_CHECK_HEADERS(arpa/inet.h \
44                         dirent.h \
45                         sys/vfs.h \
46                         netinet/in.h \
47                         netinet/tcp.h \
48                         sys/uio.h \
49                         sys/signal.h \
50                         sys/socket.h \
51                         unistd.h \
52                         ctype.h \
53                         netdb.h \
54                         signal.h \
55                         )
56
57         targetname=modname
58         smb_cflags="-I."
59 else
60         targetname=
61         echo \*\*\* module modname is disabled.
62 fi
63
64 if test x"$fail" != x""; then
65         if test x"${enable_strict_dependencies}" = x"yes"; then
66                 AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
67         else
68                 AC_MSG_WARN([silently not building ]modname[.])
69                 AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]); 
70                 targetname=""
71         fi
72 fi
73
74 AC_SUBST(smb_cflags)
75 AC_SUBST(smb_ldflags)
76 AC_SUBST(targetname)
77 AC_OUTPUT(Makefile)