translated tartially 'til file operations...
[midnight-commander.git] / vfs / samba / configure.in
blob14f6753a39493ffd1b249a33b074338363b10d40
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(include/includes.h)
3 AC_PREREQ(2.52)
4 AC_CONFIG_HEADER(include/config.h)
5 AC_CONFIG_AUX_DIR(../../config)
6 # we want to be compatibe with older versions of Samba
7 AC_PREFIX_DEFAULT(/usr/local/samba)
8 AC_SYS_LARGEFILE
10 dnl Unique-to-Samba variables we'll be playing with.
11 AC_SUBST(SHELL)
12 AC_SUBST(MPROGS)
13 AC_SUBST(LDSHFLAGS)
14 AC_SUBST(HOST_OS)
15 AC_SUBST(WRAP)
16 AC_SUBST(WRAP32)
18 # compile with optimisation and without debugging by default
19 CFLAGS=${CFLAGS-"-O"}
21 dnl Checks for programs.
22 AC_PROG_CC
23 AC_PROG_INSTALL
24 AC_PROG_AWK
25 AC_CHECK_TOOL(AR, ar, ar)
27 dnl Check if C compiler understands -c and -o at the same time
28 AC_PROG_CC_C_O
29 if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
30       BROKEN_CC=
31 else
32       BROKEN_CC=#
34 AC_SUBST(BROKEN_CC)
36 AC_CANONICAL_HOST
37 AC_VALIDATE_CACHE_SYSTEM_TYPE
38 SAMBA_MAINTAINER_MODE
40 AC_INLINE
41 AC_HEADER_STDC
42 AC_HEADER_DIRENT
43 AC_HEADER_TIME
44 AC_HEADER_SYS_WAIT
45 AC_CHECK_HEADERS(arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h)
46 AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h net/if.h)
47 AC_CHECK_HEADERS(compat.h rpc/rpc.h rpcsvc/nis.h rpcsvc/yp_prot.h rpcsvc/ypclnt.h)
48 AC_CHECK_HEADERS(sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/mode.h)
49 AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h string.h strings.h stdlib.h sys/socket.h)
50 AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h termio.h)
51 AC_CHECK_HEADERS(sys/termio.h sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h)
52 AC_CHECK_HEADERS(netinet/tcp.h netinet/in_systm.h netinet/in_ip.h)
53 AC_CHECK_HEADERS(sys/security.h security/pam_appl.h)
54 AC_CHECK_HEADERS(stropts.h poll.h sys/capability.h syscall.h sys/syscall.h)
55 AC_CHECK_HEADERS(sys/acl.h sys/cdefs.h glob.h)
57 AC_CHECK_SIZEOF(int)
58 AC_CHECK_SIZEOF(long)
59 AC_CHECK_SIZEOF(short)
60 AC_CHECK_SIZEOF(off_t)
61 AC_CHECK_SIZEOF(ino_t)
63 AC_C_CONST
64 AC_C_INLINE
65 AC_C_BIGENDIAN
66 AC_C_CHAR_UNSIGNED
68 AC_TYPE_SIGNAL
69 AC_TYPE_UID_T
70 AC_TYPE_MODE_T
71 AC_TYPE_OFF_T
72 AC_TYPE_SIZE_T
73 AC_TYPE_PID_T
74 AC_STRUCT_ST_RDEV
75 AC_CHECK_TYPE(ino_t,unsigned)
76 AC_CHECK_TYPE(loff_t,off_t)
77 AC_CHECK_TYPE(offset_t,off_t)
78 AC_CHECK_TYPE(ssize_t, int)
80 # we need libdl for PAM and the new VFS code
81 AC_CHECK_LIB(dl,main)
83 AC_CACHE_CHECK([for errno in errno.h],samba_cv_errno, [
84     AC_TRY_COMPILE([#include <errno.h>],[int i = errno],
85         samba_cv_errno=yes,samba_cv_have_errno=no)])
86 if test x"$samba_cv_errno" = x"yes"; then
87    AC_DEFINE(HAVE_ERRNO_DECL, 1, [Define if errno is declared])
90 # stupid glibc has the functions but no declaration. grrrr.
91 AC_CACHE_CHECK([for crypt declaration],samba_cv_have_crypt_decl,[
92     AC_TRY_COMPILE([#include <unistd.h>],[int i = (int)crypt],
93         samba_cv_have_crypt_decl=yes,samba_cv_have_crypt_decl=no)])
94 if test x"$samba_cv_have_crypt_decl" = x"yes"; then
95     AC_DEFINE(HAVE_CRYPT_DECL, 1, [Define if crypt() is declared])
98 AC_FUNC_MEMCMP
100 ###############################################
101 # test for where we get crypt() from
102 AC_CHECK_FUNCS(crypt)
103 if test x"$ac_cv_func_crypt" = x"no"; then
104     AC_CHECK_LIB(crypt, crypt, [LIBS="$LIBS -lcrypt";
105         AC_DEFINE(HAVE_CRYPT)])
109 # The following test taken from the cvs sources
110 # If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
111 # The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
112 # libsocket.so which has a bad implementation of gethostbyname (it
113 # only looks in /etc/hosts), so we only look for -lsocket if we need
114 # it.
115 AC_CHECK_FUNCS(connect)
116 if test x"$ac_cv_func_connect" = x"no"; then
117     case "$LIBS" in
118     *-lnsl*) ;;
119     *) AC_CHECK_LIB(nsl_s, printf) ;;
120     esac
121     case "$LIBS" in
122     *-lnsl*) ;;
123     *) AC_CHECK_LIB(nsl, printf) ;;
124     esac
125     case "$LIBS" in
126     *-lsocket*) ;;
127     *) AC_CHECK_LIB(socket, connect) ;;
128     esac
129     case "$LIBS" in
130     *-linet*) ;;
131     *) AC_CHECK_LIB(inet, connect) ;;
132     esac
133     dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value
134     dnl has been cached.
135     if test x"$ac_cv_lib_socket_connect" = x"yes" || 
136        test x"$ac_cv_lib_inet_connect" = x"yes"; then
137         # ac_cv_func_connect=yes
138         # don't!  it would cause AC_CHECK_FUNC to succeed next time configure is run
139         AC_DEFINE(HAVE_CONNECT)
140     fi
143 AC_CHECK_FUNCS(waitpid getcwd strdup strtoul strerror chown chmod)
144 AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync bzero memset)
145 AC_CHECK_FUNCS(memmove vsnprintf snprintf setsid glob strpbrk pipe crypt16 getauthuid)
146 AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction innetgr setnetgrent getnetgrent endnetgrent)
147 AC_CHECK_FUNCS(initgroups select rdchk getgrnam pathconf)
148 AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups mktime rename ftruncate)
149 AC_CHECK_FUNCS(grantpt dup2 yp_get_default_domain getpwanam)
150 AC_CHECK_FUNCS(srandom random srand rand setenv usleep strcasecmp)
152 AC_CHECK_FUNCS(getdents)
153 AC_CHECK_FUNCS(llseek)
156 # If no strcasecmp, check for it in some known places
157 # It is in -lresolv on ReliantUNIX and UnixWare
158 #   -lresolve *must* follow -lnsl for name resolution to work properly
161 if test x$ac_cv_func_strcasecmp = xno ; then
162         AC_CHECK_LIB(resolv,strcasecmp,[LIBS="$LIBS -lresolv"]
163                 AC_DEFINE(HAVE_STRCASECMP))
167 # Check for the functions putprpwnam, set_auth_parameters,
168 # getspnam, bigcrypt and getprpwnam in -lsec and -lsecurity
169 # Needed for OSF1 and HPUX.
172 AC_LIBTESTFUNC(security, putprpwnam)
173 AC_LIBTESTFUNC(sec, putprpwnam)
175 AC_LIBTESTFUNC(security, set_auth_parameters)
176 AC_LIBTESTFUNC(sec, set_auth_parameters)
178 AC_LIBTESTFUNC(security, getspnam)
179 AC_LIBTESTFUNC(sec, getspnam)
181 AC_LIBTESTFUNC(security, bigcrypt)
182 AC_LIBTESTFUNC(sec, bigcrypt)
184 AC_LIBTESTFUNC(security, getprpwnam)
185 AC_LIBTESTFUNC(sec, getprpwnam)
187 # this bit needs to be modified for each OS that is suported by
188 # smbwrapper. You need to specify how to created a shared library and
189 # how to compile C code to produce PIC object files
191 # these are the defaults, good for lots of systems
192 HOST_OS="$host_os"
193 LDSHFLAGS="-shared"
195 # and these are for particular systems
196 case "$host_os" in
197                 *linux*)   AC_DEFINE(LINUX, 1, [Define on Linux]);;
198                 *solaris*) AC_DEFINE(SUNOS5, 1, [Define on SunOS 5 (Solaris)])
199                                         LDSHFLAGS="-G"
200                 ;;
201                 *sunos*) AC_DEFINE(SUNOS4, 1, [Define on SunOS 4])
202                                         LDSHFLAGS=""
203                 ;;
204                 *bsd*) LDSHFLAGS="-shared -Bshareable"
205                 ;;
206                 *irix*) AC_DEFINE(IRIX, 1, [Define on IRIX])
207                         case "$host_os" in
208                         *irix6*) AC_DEFINE(IRIX6, 1, [Define on IRIX 6])
209                         ;;
210                         esac
211                         ATTEMPT_WRAP32_BUILD=yes
212                 ;;
213                 *aix*) AC_DEFINE(AIX, 1, [Define on AIX]);;
214                 *hpux*) AC_DEFINE(HPUX, 1, [Define on HP-UX]);;
215                 *qnx*) AC_DEFINE(QNX, 1, [Define on QNX]);;
216                 *osf*) AC_DEFINE(OSF1, 1, [Define on OSF1]);;
217                 *sco*) AC_DEFINE(SCO, 1, [Define on SCO]);;
218                 *next2*) AC_DEFINE(NEXT2, 1, [Define on NeXT 2]);;
219                 *dgux*) AC_CHECK_PROG( ROFF, groff, [groff -etpsR -Tascii -man]);;
220                 *sysv4*)
221                         case "$host" in
222                                 *-univel-*)     if [ test "$GCC" != yes ]; then
223                                                                         AC_DEFINE(HAVE_MEMSET)
224                                                                 fi
225                                                                 LDSHFLAGS="-G"
226                                 ;;
227                         esac
228                         ;;
229                 *sysv5*)
230                         if [ test "$GCC" != yes ]; then
231                                 AC_DEFINE(HAVE_MEMSET)
232                         fi
233                         LDSHFLAGS="-G"
234                         ;;
235 esac
237 ################
239 AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[
240 AC_TRY_RUN([#include <stdio.h>
241 main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
242 samba_cv_have_longlong=yes,samba_cv_have_longlong=no,samba_cv_have_longlong=cross)])
243 if test x"$samba_cv_have_longlong" = x"yes"; then
244     AC_DEFINE(HAVE_LONGLONG, 1, [Define if long long is usable])
247 AC_CACHE_CHECK([for sin_len in sock],samba_cv_HAVE_SOCK_SIN_LEN,[
248 AC_TRY_COMPILE([#include <sys/types.h>
249 #include <sys/socket.h>
250 #include <netinet/in.h>],
251 [struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
252 samba_cv_HAVE_SOCK_SIN_LEN=yes,samba_cv_HAVE_SOCK_SIN_LEN=no)])
253 if test x"$samba_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
254     AC_DEFINE(HAVE_SOCK_SIN_LEN, 1, [Define if struct sockaddr_in has sin_len field])
257 AC_CACHE_CHECK([for __FILE__ macro],samba_cv_HAVE_FILE_MACRO,[
258 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FILE__);],
259 samba_cv_HAVE_FILE_MACRO=yes,samba_cv_HAVE_FILE_MACRO=no)])
260 if test x"$samba_cv_HAVE_FILE_MACRO" = x"yes"; then
261     AC_DEFINE(HAVE_FILE_MACRO, 1, [Define if __FILE__ macro is supported])
264 AC_CACHE_CHECK([for __FUNCTION__ macro],samba_cv_HAVE_FUNCTION_MACRO,[
265 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FUNCTION__);],
266 samba_cv_HAVE_FUNCTION_MACRO=yes,samba_cv_HAVE_FUNCTION_MACRO=no)])
267 if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then
268     AC_DEFINE(HAVE_FUNCTION_MACRO, 1, [Define if __FUNCTION__ macro is supported])
271 AC_CACHE_CHECK([if gettimeofday takes tz argument],samba_cv_HAVE_GETTIMEOFDAY_TZ,[
272 AC_TRY_RUN([
273 #include <sys/time.h>
274 #include <unistd.h>
275 main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}],
276            samba_cv_HAVE_GETTIMEOFDAY_TZ=yes,samba_cv_HAVE_GETTIMEOFDAY_TZ=no,samba_cv_HAVE_GETTIMEOFDAY_TZ=cross)])
277 if test x"$samba_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then
278     AC_DEFINE(HAVE_GETTIMEOFDAY_TZ, 1, [Define if gettimeofday takes tz argument])
282 AC_CACHE_CHECK([for broken readdir],samba_cv_HAVE_BROKEN_READDIR,[
283 AC_TRY_RUN([#include <sys/types.h>
284 #include <dirent.h>
285 main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
286 if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
287 di->d_name[0] == 0) exit(0); exit(1);} ],
288 samba_cv_HAVE_BROKEN_READDIR=yes,samba_cv_HAVE_BROKEN_READDIR=no,samba_cv_HAVE_BROKEN_READDIR=cross)])
289 if test x"$samba_cv_HAVE_BROKEN_READDIR" = x"yes"; then
290     AC_DEFINE(HAVE_BROKEN_READDIR, 1, [Define if readdir() is broken])
293 AC_CACHE_CHECK([for kernel oplock type definitions],samba_cv_HAVE_KERNEL_OPLOCKS,[
294 AC_TRY_COMPILE([#include <sys/types.h>
295 #include <fcntl.h>],
296 [oplock_stat_t t; t.os_state = OP_REVOKE; t.os_dev = 1; t.os_ino = 1;],
297 samba_cv_HAVE_KERNEL_OPLOCKS=yes,samba_cv_HAVE_KERNEL_OPLOCKS=no)])
298 if test x"$samba_cv_HAVE_KERNEL_OPLOCKS" = x"yes"; then
299     AC_DEFINE(HAVE_KERNEL_OPLOCKS, 1, [Define to use kernel oplock capabilities])
302 AC_CACHE_CHECK([for irix specific capabilities],samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES,[
303 AC_TRY_RUN([#include <sys/types.h>
304 #include <sys/capability.h>
305 main() {
306  cap_t cap;
307  if ((cap = cap_get_proc()) == NULL)
308    exit(1);
309  cap->cap_effective |= CAP_NETWORK_MGT;
310  cap->cap_inheritable |= CAP_NETWORK_MGT;
311  cap_set_proc(cap);
312  exit(0);
315 samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=yes,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=cross)])
316 if test x"$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" = x"yes"; then
317     AC_DEFINE(HAVE_IRIX_SPECIFIC_CAPABILITIES, 1, [Define to support IRIX specific capabilities])
321 # Check for int16, uint16, int32 and uint32 in rpc/types.h included from rpc/rpc.h
322 # This is *really* broken but some systems (DEC OSF1) do this.... JRA.
325 AC_CACHE_CHECK([for int16 typedef included by rpc/rpc.h],samba_cv_HAVE_INT16_FROM_RPC_RPC_H,[
326 AC_TRY_COMPILE([#include <sys/types.h>
327 #if defined(HAVE_RPC_RPC_H)
328 #include <rpc/rpc.h>
329 #endif],
330 [int16 testvar;],
331 samba_cv_HAVE_INT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT16_FROM_RPC_RPC_H=no)])
332 if test x"$samba_cv_HAVE_INT16_FROM_RPC_RPC_H" = x"yes"; then
333     AC_DEFINE(HAVE_INT16_FROM_RPC_RPC_H, 1, [Define if rpc/rpc.h defines int16])
336 AC_CACHE_CHECK([for uint16 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT16_FROM_RPC_RPC_H,[
337 AC_TRY_COMPILE([#include <sys/types.h>
338 #if defined(HAVE_RPC_RPC_H)
339 #include <rpc/rpc.h>
340 #endif],
341 [uint16 testvar;],
342 samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=no)])
343 if test x"$samba_cv_HAVE_UINT16_FROM_RPC_RPC_H" = x"yes"; then
344     AC_DEFINE(HAVE_UINT16_FROM_RPC_RPC_H, 1, [Define if rpc/rpc.h defines uint16])
347 AC_CACHE_CHECK([for int32 typedef included by rpc/rpc.h],samba_cv_HAVE_INT32_FROM_RPC_RPC_H,[
348 AC_TRY_COMPILE([#include <sys/types.h>
349 #if defined(HAVE_RPC_RPC_H)
350 #include <rpc/rpc.h>
351 #endif],
352 [int32 testvar;],
353 samba_cv_HAVE_INT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT32_FROM_RPC_RPC_H=no)])
354 if test x"$samba_cv_HAVE_INT32_FROM_RPC_RPC_H" = x"yes"; then
355     AC_DEFINE(HAVE_INT32_FROM_RPC_RPC_H, 1, [Define if rpc/rpc.h defines int32])
358 AC_CACHE_CHECK([for uint32 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT32_FROM_RPC_RPC_H,[
359 AC_TRY_COMPILE([#include <sys/types.h>
360 #if defined(HAVE_RPC_RPC_H)
361 #include <rpc/rpc.h>
362 #endif],
363 [uint32 testvar;],
364 samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=no)])
365 if test x"$samba_cv_HAVE_UINT32_FROM_RPC_RPC_H" = x"yes"; then
366     AC_DEFINE(HAVE_UINT32_FROM_RPC_RPC_H, 1, [Define if rpc/rpc.h defines uint32])
370 dnl Some systems (SCO) have a problem including
371 dnl <prot.h> and <rpc/rpc.h> due to AUTH_ERROR being defined
372 dnl as a #define in <prot.h> and as part of an enum
373 dnl in <rpc/rpc.h>.
376 AC_CACHE_CHECK([for conflicting AUTH_ERROR define in rpc/rpc.h],samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT,[
377 AC_TRY_COMPILE([#include <sys/types.h>
378 #ifdef HAVE_SYS_SECURITY_H
379 #include <sys/security.h>
380 #include <prot.h>
381 #endif  /* HAVE_SYS_SECURITY_H */
382 #if defined(HAVE_RPC_RPC_H)
383 #include <rpc/rpc.h>
384 #endif],
385 [int testvar;],
386 samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=no,samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=yes)])
387 if test x"$samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT" = x"yes"; then
388     AC_DEFINE(HAVE_RPC_AUTH_ERROR_CONFLICT, 1, [Define if rpc/rpc.h defines AUTH_ERROR])
391 AC_MSG_CHECKING([for test routines])
392 AC_TRY_RUN([#include "${srcdir-.}/tests/trivial.c"],
393            AC_MSG_RESULT(yes),
394            AC_MSG_ERROR([cant find test code. Aborting config]),
395            AC_MSG_WARN([cannot run when cross-compiling]))
397 AC_CACHE_CHECK([for broken getgroups],samba_cv_HAVE_BROKEN_GETGROUPS,[
398 AC_TRY_RUN([#include "${srcdir-.}/tests/getgroups.c"],
399            samba_cv_HAVE_BROKEN_GETGROUPS=yes,samba_cv_HAVE_BROKEN_GETGROUPS=no,samba_cv_HAVE_BROKEN_GETGROUPS=cross)])
400 if test x"$samba_cv_HAVE_BROKEN_GETGROUPS" = x"yes"; then
401     AC_DEFINE(HAVE_BROKEN_GETGROUPS, 1, [Define if getgroups() is broken])
404 netmask=no;
405 AC_CACHE_CHECK([for netmask ifconf],samba_cv_HAVE_NETMASK_IFCONF,[
406 AC_TRY_RUN([
407 #define HAVE_NETMASK_IFCONF 1
408 #define AUTOCONF 1
409 #include "confdefs.h"
410 #include "${srcdir-.}/lib/netmask.c"],
411            samba_cv_HAVE_NETMASK_IFCONF=yes,samba_cv_HAVE_NETMASK_IFCONF=no,samba_cv_HAVE_NETMASK_IFCONF=cross)])
412 if test x"$samba_cv_HAVE_NETMASK_IFCONF" = x"yes"; then
413     netmask=yes;AC_DEFINE(HAVE_NETMASK_IFCONF, 1, [Define to use IFCONF style netmask])
416 if test $netmask = no; then
417 AC_CACHE_CHECK([for netmask ifreq],samba_cv_HAVE_NETMASK_IFREQ,[
418 AC_TRY_RUN([
419 #define HAVE_NETMASK_IFREQ 1
420 #define AUTOCONF 1
421 #include "confdefs.h"
422 #include "${srcdir-.}/lib/netmask.c"],
423            samba_cv_HAVE_NETMASK_IFREQ=yes,samba_cv_HAVE_NETMASK_IFREQ=no,samba_cv_HAVE_NETMASK_IFREQ=cross)])
424 if test x"$samba_cv_HAVE_NETMASK_IFREQ" = x"yes"; then
425     netmask=yes;AC_DEFINE(HAVE_NETMASK_IFREQ, 1, [Define to use IFREQ style netmask])
429 if test $netmask = no; then
430 AC_CACHE_CHECK([for netmask AIX],samba_cv_HAVE_NETMASK_AIX,[
431 AC_TRY_RUN([
432 #define HAVE_NETMASK_AIX 1
433 #define AUTOCONF 1
434 #include "confdefs.h"
435 #include "${srcdir-.}/lib/netmask.c"],
436            samba_cv_HAVE_NETMASK_AIX=yes,samba_cv_HAVE_NETMASK_AIX=no,samba_cv_HAVE_NETMASK_AIX=cross)])
437 if test x"$samba_cv_HAVE_NETMASK_AIX" = x"yes"; then
438     netmask=yes;AC_DEFINE(HAVE_NETMASK_AIX, 1, [Define to use AIX style netmask])
443 AC_CACHE_CHECK([for broken nisplus include files],samba_cv_BROKEN_NISPLUS_INCLUDE_FILES,[
444 AC_TRY_COMPILE([#include <sys/acl.h>
445 #if defined(HAVE_RPCSVC_NIS_H)
446 #include <rpcsvc/nis.h>
447 #endif],
448 [return 0;],
449 samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=no,samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=yes)])
450 if test x"$samba_cv_BROKEN_NISPLUS_INCLUDE_FILES" = x"yes"; then
451     AC_DEFINE(BROKEN_NISPLUS_INCLUDE_FILES, 1,
452               [Define if sys/acl.h and rpcsvc/nis.h cannot be included together])
456 #################################################
457 # check for a LDAP password database
458 AC_MSG_CHECKING([whether to use LDAP password database])
459 AC_ARG_WITH(ldap,
460 [  --with-ldap     Include LDAP support
461   --without-ldap  Don't include LDAP support (default)],
462 [ case "$withval" in
463   yes)
464     AC_MSG_RESULT(yes)
465     AC_DEFINE(WITH_LDAP, 1, [Define to enable LDAP support])
466     ;;
467   *)
468     AC_MSG_RESULT(no)
469     ;;
470   esac ],
471   AC_MSG_RESULT(no)
474 #################################################
475 # check for a NISPLUS password database
476 AC_MSG_CHECKING([whether to use NISPLUS password database])
477 AC_ARG_WITH(nisplus,
478 [  --with-nisplus     Include NISPLUS password database support
479   --without-nisplus  Don't include NISPLUS password database support (default)],
480 [ case "$withval" in
481   yes)
482     AC_MSG_RESULT(yes)
483     AC_DEFINE(WITH_NISPLUS, 1, [Define to enable NIS+ support])
484     ;;
485   *)
486     AC_MSG_RESULT(no)
487     ;;
488   esac ],
489   AC_MSG_RESULT(no)
492 #################################################
493 # check for a NISPLUS_HOME support 
494 AC_MSG_CHECKING([whether to use NISPLUS_HOME])
495 AC_ARG_WITH(nisplus-home,
496 [  --with-nisplus-home     Include NISPLUS_HOME support
497   --without-nisplus-home  Don't include NISPLUS_HOME support (default)],
498 [ case "$withval" in
499   yes)
500     AC_MSG_RESULT(yes)
501     AC_DEFINE(WITH_NISPLUS_HOME, 1, [Define to support NISPLUS_HOME variable])
502     ;;
503   *)
504     AC_MSG_RESULT(no)
505     ;;
506   esac ],
507   AC_MSG_RESULT(no)
510 #################################################
511 # check for the secure socket layer
512 AC_MSG_CHECKING([whether to use SSL])
513 AC_ARG_WITH(ssl,
514 [  --with-ssl     Include SSL support
515   --without-ssl  Don't include SSL support (default)
516   --with-sslinc=DIR Where the SSL includes are (defaults to /usr/local/ssl)],
517 [ case "$withval" in
518   yes)
519     AC_MSG_RESULT(yes)
520     AC_DEFINE(WITH_SSL, 1, [Define to enable SSL support])
521     withval="/usr/local/ssl"     # default
523     if test "${with_sslinc+set}" = set; then
525         withval="$with_sslinc"
526         case "$withval" in
527         yes|no)
528           AC_MSG_WARN([--with-sslinc called without argument - will use default])
529           CFLAGS="-I/usr/local/ssl/include $CFLAGS"
530           LIBS="-lssl -lcrypto $LIBS"
531           LDFLAGS="=L/usr/local/ssl/lib $LDFLAGS"
532         ;;
533         * )
534           CFLAGS="-I${withval}/include $CFLAGS"
535           LIBS="-lssl -l crypto $LIBS"
536           LDFLAGS="-L${withval}/lib $LDFLAGS"
537         ;;
538         esac
540     else
542         CFLAGS="-I/usr/local/ssl/include $CFLAGS"   
543         LIBS="-lssl -lcrypto $LIBS"
544         LDFLAGS="-L/usr/local/ssl/lib $LDFLAGS"
546     fi
548     if test ! -d ${withval}; then
549       AC_MSG_ERROR([called with --with-ssl, but ssl base directory ${withval} does not exist or is not a directory. Aborting config])
550     fi 
552     CFLAGS="-DHAVE_CRYPT_DECL $CFLAGS"  # Damn, SSLeay defines its own
554     ;;
555   *)
556     AC_MSG_RESULT(no)
557     ;;
558   esac ],
559   AC_MSG_RESULT(no)
563 #################################################
564 # set private directory location
565 AC_ARG_WITH(privatedir,
566 [  --with-privatedir=DIR     Where to put smbpasswd ($ac_default_prefix/private)],
567 [ case "$withval" in
568   yes|no)
569   #
570   # Just in case anybody calls it without argument
571   #
572     AC_MSG_WARN([--with-privatedir called without argument - will use default])
573     privatedir='${prefix}/private'
574   ;;
575   * )
576     privatedir="$withval"
577     ;;
578   esac
579   AC_SUBST(privatedir)],
580   [privatedir='${prefix}/private'
581    AC_SUBST(privatedir)]
584 #################################################
585 # set lock directory location
586 AC_ARG_WITH(lockdir,
587 [  --with-lockdir=DIR     Where to put lock files ($ac_default_prefix/var/locks)],
588 [ case "$withval" in
589   yes|no)
590   #
591   # Just in case anybody calls it without argument
592   #
593     AC_MSG_WARN([--with-lockdir called without argument - will use default])
594     lockdir='$(VARDIR)/locks'
595   ;;
596   * )
597     lockdir="$withval"
598     ;;
599   esac
600   AC_SUBST(lockdir)],
601   [lockdir='$(VARDIR)/locks'
602    AC_SUBST(lockdir)]
605 #################################################
606 # set configuration directory location
607 configdir="\$(LIBDIR)"
608 AC_ARG_WITH(configdir,
609 [  --with-configdir=DIR    Where to put configuration files (\$libdir)],
610 [ case "$withval" in
611   yes|no)
612   #
613   # Just in case anybody does it
614   #
615     AC_MSG_WARN([--with-configdir called without argument - will use default])
616   ;;
617   * )
618     configdir="$withval"
619     ;;
620   esac]
624 #################################################
625 # set codepage directory location
626 codepagedir="\$(LIBDIR)/codepages"
627 AC_ARG_WITH(codepagedir,
628 [  --with-codepagedir=DIR  Where to put codepage files (\$libdir/codepages)],
629 [ case "$withval" in
630   yes|no)
631   #
632   # Just in case anybody does it
633   #
634     AC_MSG_WARN([--with-codepagedir called without argument - will use default])
635   ;;
636   * )
637     codepagedir="$withval"
638     ;;
639   esac])
641 AC_MSG_CHECKING([configure summary])
642 AC_TRY_RUN([#include "${srcdir-.}/tests/summary.c"],
643            AC_MSG_RESULT(OK);,
644            AC_MSG_RESULT(failure)
645            AC_MSG_ERROR([Aborting config]),:)
647 builddir=`pwd`
648 AC_SUBST(builddir)
649 AC_SUBST(configdir)
650 AC_SUBST(codepagedir)
652 AC_OUTPUT([include/stamp-h Makefile])