1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(include/includes.h)
3 AC_CONFIG_HEADER(include/config.h)
5 dnl Checks for programs.
13 *linux*) AC_DEFINE(LINUX);;
14 *solaris*) AC_DEFINE(SUNOS5);;
15 *sunos*) AC_DEFINE(SUNOS4);;
16 *irix*) AC_DEFINE(IRIX);;
17 *aix*) AC_DEFINE(AIX);;
18 *hpux*) AC_DEFINE(HPUX);;
19 *qnx*) AC_DEFINE(QNX);;
20 *osf1*) AC_DEFINE(OSF1);;
21 *sco*) AC_DEFINE(SCO);;
22 *next2*) AC_DEFINE(NEXT2);;
25 AC_VALIDATE_CACHE_SYSTEM_TYPE
33 AC_CHECK_HEADERS(sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h)
34 AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h net/if.h)
35 AC_CHECK_HEADERS(compat.h rpc/types.h rpc/xdr.h rpc/auth.h rpc/clnt.h)
36 AC_CHECK_HEADERS(rpcsvc/yp_prot.h rpcsvc/ypclnt.h sys/param.h ctype.h )
37 AC_CHECK_HEADERS(sys/wait.h sys/resource.h sys/ioctl.h sys/mode.h)
38 AC_CHECK_HEADERS(sys/filio.h string.h strings.h stdlib.h sys/socket.h)
39 AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h)
40 AC_CHECK_HEADERS(sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h)
41 AC_CHECK_HEADERS(shadow.h netinet/tcp.h sys/security.h security/pam_appl.h)
42 AC_CHECK_HEADERS(stropts.h poll.h readline.h history.h readline/readline.h)
43 AC_CHECK_HEADERS(readline/history.h sys/capability.h)
45 AC_CHECK_SIZEOF(int,cross)
46 AC_CHECK_SIZEOF(long,cross)
47 AC_CHECK_SIZEOF(short,cross)
61 AC_CHECK_TYPE(ino_t,unsigned)
62 AC_CHECK_TYPE(ssize_t, int)
64 AC_CACHE_CHECK([for errno in errno.h],samba_cv_errno, [
65 AC_TRY_COMPILE([#include <errno.h>],[int i = errno],
66 samba_cv_errno=yes,samba_cv_have_errno_decl=no)])
67 if test x"$samba_cv_errno" = x"yes"; then
68 AC_DEFINE(HAVE_ERRNO_DECL)
71 # stupid glibc has the functions but no declaration. grrrr.
72 AC_CACHE_CHECK([for setresuid declaration],samba_cv_have_setresuid_decl,[
73 AC_TRY_COMPILE([#include <unistd.h>],[int i = setresuid],
74 samba_cv_have_setresuid_decl=yes,samba_cv_have_setresuid_decl=no)])
75 if test x"$samba_cv_have_setresuid_decl" = x"yes"; then
76 AC_DEFINE(HAVE_SETRESUID_DECL)
79 # and glibc has setresuid under linux but the function does
80 # nothing until kernel 2.1.44! very dumb.
81 AC_CACHE_CHECK([for real setresuid],samba_cv_have_setresuid,[
82 AC_TRY_RUN([#include <errno.h>
83 main() { setresuid(1,1,1); setresuid(2,2,2); exit(errno==EPERM?0:1);}],
84 samba_cv_have_setresuid=yes,samba_cv_have_setresuid=no,samba_cv_have_setresuid=cross)])
85 if test x"$samba_cv_have_setresuid" = x"yes"; then
86 AC_DEFINE(HAVE_SETRESUID)
91 ###############################################
92 # test for where we get crypt() from
94 if test x"$ac_cv_func_crypt" = x"no"; then
95 AC_CHECK_LIB(crypt, crypt, [LIBS="$LIBS -lcrypt";
96 AC_DEFINE(HAVE_CRYPT)])
100 ###############################################
101 # test for where we get pam_authenticate() from
102 # might need libdl for this to work
103 if test "$ac_cv_header_security_pam_appl_h" = "yes"; then
104 AC_CHECK_LIB(dl,main)
106 AC_CHECK_FUNCS(pam_authenticate)
107 if test x"$ac_cv_func_pam_authenticate" = x"no"; then
108 AC_CHECK_LIB(pam, pam_authenticate, [LIBS="$LIBS -lpam"
109 AC_DEFINE(HAVE_PAM_AUTHENTICATE)])
113 ###############################################
114 # test for where we get readline() from
115 if test "$ac_cv_header_readline_h" = "yes" ||
116 test "$ac_cv_header_readline_readline_h" = "yes"; then
117 AC_CHECK_LIB(readline,readline)
121 # The following test taken from the cvs sources
122 # If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
123 # The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
124 # libsocket.so which has a bad implementation of gethostbyname (it
125 # only looks in /etc/hosts), so we only look for -lsocket if we need
127 AC_CHECK_FUNCS(connect)
128 if test x"$ac_cv_func_connect" = x"no"; then
131 *) AC_CHECK_LIB(nsl_s, printf) ;;
135 *) AC_CHECK_LIB(nsl, printf) ;;
139 *) AC_CHECK_LIB(socket, connect) ;;
143 *) AC_CHECK_LIB(inet, connect) ;;
145 dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value
147 if test x"$ac_cv_lib_socket_connect" = x"yes" ||
148 test x"$ac_cv_lib_inet_connect" = x"yes"; then
149 # ac_cv_func_connect=yes
150 # don't! it would cause AC_CHECK_FUNC to succeed next time configure is run
151 AC_DEFINE(HAVE_CONNECT)
156 AC_CHECK_FUNCS(waitpid getcwd strdup strerror chown chmod chroot)
157 AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync execl bzero memset)
158 AC_CHECK_FUNCS(memmove vsnprintf setsid glob strpbrk pipe crypt16 getauthuid)
159 AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction innetgr)
160 AC_CHECK_FUNCS(initgroups select rdchk getgrnam pathconf putprpwnam)
161 AC_CHECK_FUNCS(setuidx setgroups mktime rename ftruncate stat64 fstat64 lstat64)
162 AC_CHECK_FUNCS(set_auth_parameters atexit grantpt getspnam dup2 lseek64 ftruncate64)
163 AC_CHECK_FUNCS(fseek64 ftell64 bigcrypt getprpwnam setluid yp_get_default_domain getpwanam)
164 AC_CHECK_FUNCS(srandom random srand rand)
166 AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[
167 AC_TRY_RUN([#include <stdio.h>
168 main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
169 samba_cv_have_longlong=yes,samba_cv_have_longlong=no,samba_cv_have_longlong=cross)])
170 if test x"$samba_cv_have_longlong" = x"yes"; then
171 AC_DEFINE(HAVE_LONGLONG)
174 AC_CACHE_CHECK([for 64 bit off_t],samba_cv_SIZEOF_OFF_T,[
175 AC_TRY_RUN([#include <stdio.h>
176 #include <sys/stat.h>
177 main() { exit((sizeof(off_t) == 8) ? 0 : 1); }],
178 samba_cv_SIZEOF_OFF_T=yes,samba_cv_SIZEOF_OFF_T=no,samba_cv_SIZEOF_OFF_T=cross)])
179 if test x"$samba_cv_SIZEOF_OFF_T" = x"yes"; then
180 AC_DEFINE(SIZEOF_OFF_T,8)
183 AC_CACHE_CHECK([for off64_t],samba_cv_HAVE_OFF64_T,[
184 AC_TRY_RUN([#include <stdio.h>
185 #include <sys/stat.h>
186 main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
187 samba_cv_HAVE_OFF64_T=yes,samba_cv_HAVE_OFF64_T=no,samba_cv_HAVE_OFF64_T=cross)])
188 if test x"$samba_cv_HAVE_OFF64_T" = x"yes"; then
189 AC_DEFINE(HAVE_OFF64_T)
192 AC_CACHE_CHECK([for 64 bit ino_t],samba_cv_SIZEOF_INO_T,[
193 AC_TRY_RUN([#include <stdio.h>
194 #include <sys/stat.h>
195 main() { exit((sizeof(ino_t) == 8) ? 0 : 1); }],
196 samba_cv_SIZEOF_INO_T=yes,samba_cv_SIZEOF_INO_T=no,samba_cv_SIZEOF_INO_T=cross)])
197 if test x"$samba_cv_SIZEOF_INO_T" = x"yes"; then
198 AC_DEFINE(SIZEOF_INO_T,8)
201 AC_CACHE_CHECK([for ino64_t],samba_cv_HAVE_INO64_T,[
202 AC_TRY_RUN([#include <stdio.h>
203 #include <sys/stat.h>
204 main() { struct stat64 st; ino64_t s; if (sizeof(ino_t) == sizeof(ino64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
205 samba_cv_HAVE_INO64_T=yes,samba_cv_HAVE_INO64_T=no,samba_cv_HAVE_INO64_T=cross)])
206 if test x"$samba_cv_HAVE_INO64_T" = x"yes"; then
207 AC_DEFINE(HAVE_INO64_T)
210 AC_CACHE_CHECK([for union semun],samba_cv_HAVE_UNION_SEMUN,[
212 #include <sys/types.h>
215 main() { union semun ss; exit(0); }],
216 samba_cv_HAVE_UNION_SEMUN=yes,samba_cv_HAVE_UNION_SEMUN=no,samba_cv_HAVE_UNION_SEMUN=cross)])
217 if test x"$samba_cv_HAVE_UNION_SEMUN" = x"yes"; then
218 AC_DEFINE(HAVE_UNION_SEMUN)
221 AC_CACHE_CHECK([for unsigned char],samba_cv_HAVE_UNSIGNED_CHAR,[
222 AC_TRY_RUN([#include <stdio.h>
223 main() { char c; c=250; exit((c > 0)?0:1); }],
224 samba_cv_HAVE_UNSIGNED_CHAR=yes,samba_cv_HAVE_UNSIGNED_CHAR=no,samba_cv_HAVE_UNSIGNED_CHAR=cross)])
225 if test x"$samba_cv_HAVE_UNSIGNED_CHAR" = x"yes"; then
226 AC_DEFINE(HAVE_UNSIGNED_CHAR)
229 AC_CACHE_CHECK([for sin_len in sock],samba_cv_HAVE_SOCK_SIN_LEN,[
230 AC_TRY_COMPILE([#include <sys/types.h>
231 #include <sys/socket.h>
232 #include <netinet/in.h>],
233 [struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
234 samba_cv_HAVE_SOCK_SIN_LEN=yes,samba_cv_HAVE_SOCK_SIN_LEN=no)])
235 if test x"$samba_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
236 AC_DEFINE(HAVE_SOCK_SIN_LEN)
239 AC_CACHE_CHECK([for __FILE__ macro],samba_cv_HAVE_FILE_MACRO,[
240 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FILE__);],
241 samba_cv_HAVE_FILE_MACRO=yes,samba_cv_HAVE_FILE_MACRO=no)])
242 if test x"$samba_cv_HAVE_FILE_MACRO" = x"yes"; then
243 AC_DEFINE(HAVE_FILE_MACRO)
246 AC_CACHE_CHECK([for __FUNCTION__ macro],samba_cv_HAVE_FUNCTION_MACRO,[
247 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FUNCTION__);],
248 samba_cv_HAVE_FUNCTION_MACRO=yes,samba_cv_HAVE_FUNCTION_MACRO=no)])
249 if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then
250 AC_DEFINE(HAVE_FUNCTION_MACRO)
253 AC_CACHE_CHECK([if gettimeofday takes tz argument],samba_cv_HAVE_GETTIMEOFDAY_TZ,[
255 #include <sys/time.h>
257 main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}],
258 samba_cv_HAVE_GETTIMEOFDAY_TZ=yes,samba_cv_HAVE_GETTIMEOFDAY_TZ=no,samba_cv_HAVE_GETTIMEOFDAY_TZ=cross)])
259 if test x"$samba_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then
260 AC_DEFINE(HAVE_GETTIMEOFDAY_TZ)
264 AC_CACHE_CHECK([for broken readdir],samba_cv_HAVE_BROKEN_READDIR,[
265 AC_TRY_RUN([#include <sys/types.h>
267 main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
268 if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
269 di->d_name[0] == 0) exit(0); exit(1);} ],
270 samba_cv_HAVE_BROKEN_READDIR=yes,samba_cv_HAVE_BROKEN_READDIR=no,samba_cv_HAVE_BROKEN_READDIR=cross)])
271 if test x"$samba_cv_HAVE_BROKEN_READDIR" = x"yes"; then
272 AC_DEFINE(HAVE_BROKEN_READDIR)
275 AC_CACHE_CHECK([for utimbuf],samba_cv_HAVE_UTIMBUF,[
276 AC_TRY_COMPILE([#include <sys/types.h>
278 [struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf));],
279 samba_cv_HAVE_UTIMBUF=yes,samba_cv_HAVE_UTIMBUF=no,samba_cv_HAVE_UTIMBUF=cross)])
280 if test x"$samba_cv_HAVE_UTIMBUF" = x"yes"; then
281 AC_DEFINE(HAVE_UTIMBUF)
284 AC_CACHE_CHECK([for kernel oplock type definitions],samba_cv_HAVE_KERNEL_OPLOCKS,[
285 AC_TRY_COMPILE([#include <sys/types.h>
287 [oplock_stat_t t; t.os_state = OP_REVOKE; t.os_dev = 1; t.os_ino = 1;],
288 samba_cv_HAVE_KERNEL_OPLOCKS=yes,samba_cv_HAVE_KERNEL_OPLOCKS=no)])
289 if test x"$samba_cv_HAVE_KERNEL_OPLOCKS" = x"yes"; then
290 AC_DEFINE(HAVE_KERNEL_OPLOCKS)
293 AC_CACHE_CHECK([for irix specific capabilities],samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES,[
294 AC_TRY_COMPILE([#include <sys/types.h>
295 #include <sys/capability.h>],
298 if ((cap = cap_get_proc()) == NULL)
300 cap->cap_effective |= CAP_NETWORK_MGT;
301 cap->cap_inheritable |= CAP_NETWORK_MGT;
302 if (cap_set_proc(cap) == -1)
305 samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=yes,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no)])
306 if test x"$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" = x"yes"; then
307 AC_DEFINE(HAVE_IRIX_SPECIFIC_CAPABILITIES)
310 AC_MSG_CHECKING([for test routines])
311 AC_TRY_RUN([#include "${srcdir-.}/tests/trivial.c"],
313 AC_MSG_ERROR([cant find test code. Aborting config]),
314 AC_MSG_WARN([cannot run when cross-compiling]))
316 AC_CACHE_CHECK([for ftruncate extend],samba_cv_HAVE_FTRUNCATE_EXTEND,[
317 AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncate.c"],
318 samba_cv_HAVE_FTRUNCATE_EXTEND=yes,samba_cv_HAVE_FTRUNCATE_EXTEND=no,samba_cv_HAVE_FTRUNCATE_EXTEND=cross)])
319 if test x"$samba_cv_HAVE_FTRUNCATE_EXTEND" = x"yes"; then
320 AC_DEFINE(HAVE_FTRUNCATE_EXTEND)
323 AC_CACHE_CHECK([for broken getgroups],samba_cv_HAVE_BROKEN_GETGROUPS,[
324 AC_TRY_RUN([#include "${srcdir-.}/tests/getgroups.c"],
325 samba_cv_HAVE_BROKEN_GETGROUPS=yes,samba_cv_HAVE_BROKEN_GETGROUPS=no,samba_cv_HAVE_BROKEN_GETGROUPS=cross)])
326 if test x"$samba_cv_HAVE_BROKEN_GETGROUPS" = x"yes"; then
327 AC_DEFINE(HAVE_BROKEN_GETGROUPS)
330 AC_CACHE_CHECK([whether getpass should be replaced],samba_cv_REPLACE_GETPASS,[
331 SAVE_CPPFLAGS="$CPPFLAGS"
332 CPPFLAGS="$CPPFLAGS -I${srcdir-.}/include -I${srcdir-.}/ubiqx"
334 #define REPLACE_GETPASS 1
335 #define NO_CONFIG_H 1
336 #define main dont_declare_main
337 #include "${srcdir-.}/lib/getsmbpass.c"
339 ],[],samba_cv_REPLACE_GETPASS=yes,samba_cv_REPLACE_GETPASS=no)
340 CPPFLAGS="$SAVE_CPPFLAGS"
342 if test x"$samba_cv_REPLACE_GETPASS" = x"yes"; then
343 AC_DEFINE(REPLACE_GETPASS)
346 AC_CACHE_CHECK([for broken inet_ntoa],samba_cv_REPLACE_INET_NTOA,[
349 #include <sys/types.h>
350 #include <netinet/in.h>
351 #include <arpa/inet.h>
352 main() { struct in_addr ip; ip.s_addr = 0x12345678;
353 if (strcmp(inet_ntoa(ip),"18.52.86.120") &&
354 strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); }
356 samba_cv_REPLACE_INET_NTOA=yes,samba_cv_REPLACE_INET_NTOA=no,samba_cv_REPLACE_INET_NTOA=cross)])
357 if test x"$samba_cv_REPLACE_INET_NTOA" = x"yes"; then
358 AC_DEFINE(REPLACE_INET_NTOA)
361 AC_CACHE_CHECK([for root],samba_cv_HAVE_ROOT,[
362 AC_TRY_RUN([main() { exit(getuid() != 0); }],
363 samba_cv_HAVE_ROOT=yes,samba_cv_HAVE_ROOT=no,samba_cv_HAVE_ROOT=cross)])
364 if test x"$samba_cv_HAVE_ROOT" = x"yes"; then
367 AC_MSG_WARN(running as non-root will disable some tests)
371 AC_CACHE_CHECK([for netmask ifconf],samba_cv_HAVE_NETMASK_IFCONF,[
373 #define HAVE_NETMASK_IFCONF 1
375 #include "${srcdir-.}/lib/netmask.c"],
376 samba_cv_HAVE_NETMASK_IFCONF=yes,samba_cv_HAVE_NETMASK_IFCONF=no,samba_cv_HAVE_NETMASK_IFCONF=cross)])
377 if test x"$samba_cv_HAVE_NETMASK_IFCONF" = x"yes"; then
378 netmask=yes;AC_DEFINE(HAVE_NETMASK_IFCONF)
381 if test $netmask = no; then
382 AC_CACHE_CHECK([for netmask ifreq],samba_cv_HAVE_NETMASK_IFREQ,[
384 #define HAVE_NETMASK_IFREQ 1
386 #include "${srcdir-.}/lib/netmask.c"],
387 samba_cv_HAVE_NETMASK_IFREQ=yes,samba_cv_HAVE_NETMASK_IFREQ=no,samba_cv_HAVE_NETMASK_IFREQ=cross)])
388 if test x"$samba_cv_HAVE_NETMASK_IFREQ" = x"yes"; then
389 netmask=yes;AC_DEFINE(HAVE_NETMASK_IFREQ)
393 if test $netmask = no; then
394 AC_CACHE_CHECK([for netmask AIX],samba_cv_HAVE_NETMASK_AIX,[
396 #define HAVE_NETMASK_AIX 1
398 #include "${srcdir-.}/lib/netmask.c"],
399 samba_cv_HAVE_NETMASK_AIX=yes,samba_cv_HAVE_NETMASK_AIX=no,samba_cv_HAVE_NETMASK_AIX=cross)])
400 if test x"$samba_cv_HAVE_NETMASK_AIX" = x"yes"; then
401 netmask=yes;AC_DEFINE(HAVE_NETMASK_AIX)
405 AC_CACHE_CHECK([for trapdoor seteuid],samba_cv_HAVE_TRAPDOOR_UID,[
406 AC_TRY_RUN([#include "${srcdir-.}/tests/trapdoor.c"],
407 samba_cv_HAVE_TRAPDOOR_UID=no,samba_cv_HAVE_TRAPDOOR_UID=yes,:)])
408 if test x"$samba_cv_HAVE_TRAPDOOR_UID" = x"yes"; then
409 AC_DEFINE(HAVE_TRAPDOOR_UID)
412 AC_CACHE_CHECK([for shared mmap],samba_cv_HAVE_SHARED_MMAP,[
413 AC_TRY_RUN([#include "${srcdir-.}/tests/shared_mmap.c"],
414 samba_cv_HAVE_SHARED_MMAP=yes,samba_cv_HAVE_SHARED_MMAP=no,samba_cv_HAVE_SHARED_MMAP=cross)])
415 if test x"$samba_cv_HAVE_SHARED_MMAP" = x"yes"; then
416 AC_DEFINE(HAVE_SHARED_MMAP)
419 AC_CACHE_CHECK([for fcntl locking],samba_cv_HAVE_FCNTL_LOCK,[
420 AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock.c"],
421 samba_cv_HAVE_FCNTL_LOCK=yes,samba_cv_HAVE_FCNTL_LOCK=no,samba_cv_HAVE_FCNTL_LOCK=cross)])
422 if test x"$samba_cv_HAVE_FCNTL_LOCK" = x"yes"; then
423 AC_DEFINE(HAVE_FCNTL_LOCK)
426 AC_CACHE_CHECK([for 64 bit fcntl locking],samba_cv_HAVE_STRUCT_FLOCK64,[
435 #ifdef HAVE_SYS_FCNTL_H
436 #include <sys/fcntl.h>
438 main() { struct flock64 fl64;
439 #if defined(F_SETLKW64) && defined(F_SETLK64) && defined(F_GETLK64)
445 samba_cv_HAVE_STRUCT_FLOCK64=yes,samba_cv_HAVE_STRUCT_FLOCK64=no,samba_cv_HAVE_STRUCT_FLOCK64=cross)])
446 if test x"$samba_cv_HAVE_STRUCT_FLOCK64" = x"yes"; then
447 AC_DEFINE(HAVE_STRUCT_FLOCK64)
450 AC_CACHE_CHECK([for sysv ipc],samba_cv_HAVE_SYSV_IPC,[
451 AC_TRY_RUN([#include "${srcdir-.}/tests/sysv_ipc.c"],
452 samba_cv_HAVE_SYSV_IPC=yes,samba_cv_HAVE_SYSV_IPC=no,samba_cv_HAVE_SYSV_IPC=cross)])
453 if test x"$samba_cv_HAVE_SYSV_IPC" = x"yes"; then
454 AC_DEFINE(HAVE_SYSV_IPC)
457 #################################################
458 # check for the AFS filesystem
459 AC_MSG_CHECKING(whether to use AFS)
461 [ --with-afs Include AFS support
462 --without-afs Don't include AFS support (default)],
476 #################################################
477 # check for the DFS auth system
478 AC_MSG_CHECKING(whether to use DFS auth)
480 [ --with-dfs Include DFS support
481 --without-dfs Don't include DFS support (default)],
494 #################################################
495 # check for automount support
496 AC_MSG_CHECKING(whether to use AUTOMOUNT)
497 AC_ARG_WITH(automount,
498 [ --with-automount Include AUTOMOUNT support
499 --without-automount Don't include AUTOMOUNT support (default)],
503 AC_DEFINE(WITH_AUTOMOUNT)
512 #################################################
513 # check for a LDAP password database
514 AC_MSG_CHECKING(whether to use LDAP password database)
516 [ --with-ldap Include LDAP support
517 --without-ldap Don't include LDAP support (default)],
530 #################################################
531 # check for a NISPLUS password database
532 AC_MSG_CHECKING(whether to use NISPLUS password database)
534 [ --with-nisplus Include NISPLUS password database support
535 --without-nisplus Don't include NISPLUS password database support (default)],
539 AC_DEFINE(WITH_NISPLUS)
548 #################################################
549 # check for a NISPLUS_HOME support
550 AC_MSG_CHECKING(whether to use NISPLUS_HOME)
551 AC_ARG_WITH(nisplus-home,
552 [ --with-nisplus-home Include NISPLUS_HOME support
553 --without-nisplus-home Don't include NISPLUS_HOME support (default)],
557 AC_DEFINE(WITH_NISPLUS_HOME)
566 #################################################
567 # check for the secure socket layer
568 AC_MSG_CHECKING(whether to use SSL)
570 [ --with-ssl Include SSL support
571 --without-ssl Don't include SSL support (default)],
584 #################################################
585 # check for experimental mmap support
586 AC_MSG_CHECKING(whether to use MMAP)
588 [ --with-mmap Include experimental MMAP support
589 --without-mmap Don't include MMAP support (default)],
602 #################################################
603 # check for syslog logging
604 AC_MSG_CHECKING(whether to use syslog logging)
606 [ --with-syslog Include experimental SYSLOG support
607 --without-syslog Don't include SYSLOG support (default)],
611 AC_DEFINE(WITH_SYSLOG)
620 #################################################
621 # check for experimental netatalk resource fork support
622 AC_MSG_CHECKING(whether to support netatalk)
623 AC_ARG_WITH(netatalk,
624 [ --with-netatalk Include experimental Netatalk support
625 --without-netatalk Don't include experimental Netatalk support (default)],
629 AC_DEFINE(WITH_NETATALK)
639 #################################################
640 # these tests are taken from the GNU fileutils package
641 AC_CHECKING(how to get filesystem space usage)
644 # Test for statvfs64.
645 if test $space = no; then
647 AC_CACHE_CHECK([statvfs64 function (SVR4)], fu_cv_sys_stat_statvfs64,
649 #include <sys/types.h>
650 #include <sys/statvfs.h>
653 struct statvfs64 fsd;
654 exit (statfs64 (".", &fsd));
656 fu_cv_sys_stat_statvfs64=yes,
657 fu_cv_sys_stat_statvfs64=no,
658 fu_cv_sys_stat_statvfs64=cross)])
659 if test $fu_cv_sys_stat_statvfs64 = yes; then
661 AC_DEFINE(STAT_STATVFS64)
665 # Perform only the link test since it seems there are no variants of the
666 # statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
667 # because that got a false positive on SCO OSR5. Adding the declaration
668 # of a `struct statvfs' causes this test to fail (as it should) on such
669 # systems. That system is reported to work fine with STAT_STATFS4 which
670 # is what it gets when this test fails.
671 if test $space = no; then
673 AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
674 [AC_TRY_LINK([#include <sys/types.h>
675 #include <sys/statvfs.h>],
676 [struct statvfs fsd; statvfs (0, &fsd);],
677 fu_cv_sys_stat_statvfs=yes,
678 fu_cv_sys_stat_statvfs=no)])
679 if test $fu_cv_sys_stat_statvfs = yes; then
681 AC_DEFINE(STAT_STATVFS)
685 if test $space = no; then
686 # DEC Alpha running OSF/1
687 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
688 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
690 #include <sys/param.h>
691 #include <sys/types.h>
692 #include <sys/mount.h>
697 exit (statfs (".", &fsd, sizeof (struct statfs)));
699 fu_cv_sys_stat_statfs3_osf1=yes,
700 fu_cv_sys_stat_statfs3_osf1=no,
701 fu_cv_sys_stat_statfs3_osf1=no)])
702 AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
703 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
705 AC_DEFINE(STAT_STATFS3_OSF1)
709 if test $space = no; then
711 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
712 member (AIX, 4.3BSD)])
713 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
715 #ifdef HAVE_SYS_PARAM_H
716 #include <sys/param.h>
718 #ifdef HAVE_SYS_MOUNT_H
719 #include <sys/mount.h>
721 #ifdef HAVE_SYS_VFS_H
728 exit (statfs (".", &fsd));
730 fu_cv_sys_stat_statfs2_bsize=yes,
731 fu_cv_sys_stat_statfs2_bsize=no,
732 fu_cv_sys_stat_statfs2_bsize=no)])
733 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
734 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
736 AC_DEFINE(STAT_STATFS2_BSIZE)
740 if test $space = no; then
742 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
743 AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
744 [AC_TRY_RUN([#include <sys/types.h>
745 #include <sys/statfs.h>
749 exit (statfs (".", &fsd, sizeof fsd, 0));
751 fu_cv_sys_stat_statfs4=yes,
752 fu_cv_sys_stat_statfs4=no,
753 fu_cv_sys_stat_statfs4=no)])
754 AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
755 if test $fu_cv_sys_stat_statfs4 = yes; then
757 AC_DEFINE(STAT_STATFS4)
761 if test $space = no; then
763 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
764 member (4.4BSD and NetBSD)])
765 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
766 [AC_TRY_RUN([#include <sys/types.h>
767 #ifdef HAVE_SYS_PARAM_H
768 #include <sys/param.h>
770 #ifdef HAVE_SYS_MOUNT_H
771 #include <sys/mount.h>
777 exit (statfs (".", &fsd));
779 fu_cv_sys_stat_statfs2_fsize=yes,
780 fu_cv_sys_stat_statfs2_fsize=no,
781 fu_cv_sys_stat_statfs2_fsize=no)])
782 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
783 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
785 AC_DEFINE(STAT_STATFS2_FSIZE)
789 if test $space = no; then
791 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
792 AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
793 [AC_TRY_RUN([#include <sys/types.h>
794 #ifdef HAVE_SYS_PARAM_H
795 #include <sys/param.h>
797 #ifdef HAVE_SYS_MOUNT_H
798 #include <sys/mount.h>
800 #ifdef HAVE_SYS_FS_TYPES_H
801 #include <sys/fs_types.h>
806 /* Ultrix's statfs returns 1 for success,
807 0 for not mounted, -1 for failure. */
808 exit (statfs (".", &fsd) != 1);
810 fu_cv_sys_stat_fs_data=yes,
811 fu_cv_sys_stat_fs_data=no,
812 fu_cv_sys_stat_fs_data=no)])
813 AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
814 if test $fu_cv_sys_stat_fs_data = yes; then
816 AC_DEFINE(STAT_STATFS2_FS_DATA)
820 echo "checking configure summary"
821 AC_TRY_RUN([#include "${srcdir-.}/tests/summary.c"],
822 echo "configure OK";,
823 AC_MSG_ERROR([summary failure. Aborting config]),:)
825 AC_OUTPUT(Makefile tests/dummy client/dummy lib/dummy ubiqx/dummy
826 web/dummy param/dummy nmbd/dummy smbd/dummy rpc_server/dummy
827 rpc_client/dummy rpc_parse/dummy locking/dummy passdb/dummy
828 script/dummy include/dummy codepages/dummy libsmb/dummy bin/dummy
829 utils/dummy printing/dummy include/stamp-h)