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 Kerberos IV auth system
496 AC_MSG_CHECKING(whether to use Kerberos IV)
498 [ --with-krb4=base-dir Include Kerberos IV support
499 --whithout-krb4 Don't include Kerbers IV support (default)],
502 AC_CHECK_LIB(resolv, dn_expand)
503 LIBS="$LIBS -lkrb -ldes"
504 CFLAGS="$CFLAGS -I$withval/include"
505 LDFLAGS="$LDFLAGS -L$withval/lib"],
509 #################################################
510 # check for automount support
511 AC_MSG_CHECKING(whether to use AUTOMOUNT)
512 AC_ARG_WITH(automount,
513 [ --with-automount Include AUTOMOUNT support
514 --without-automount Don't include AUTOMOUNT support (default)],
518 AC_DEFINE(WITH_AUTOMOUNT)
527 #################################################
528 # check for a LDAP password database
529 AC_MSG_CHECKING(whether to use LDAP password database)
531 [ --with-ldap Include LDAP support
532 --without-ldap Don't include LDAP support (default)],
545 #################################################
546 # check for a NISPLUS password database
547 AC_MSG_CHECKING(whether to use NISPLUS password database)
549 [ --with-nisplus Include NISPLUS password database support
550 --without-nisplus Don't include NISPLUS password database support (default)],
554 AC_DEFINE(WITH_NISPLUS)
563 #################################################
564 # check for a NISPLUS_HOME support
565 AC_MSG_CHECKING(whether to use NISPLUS_HOME)
566 AC_ARG_WITH(nisplus-home,
567 [ --with-nisplus-home Include NISPLUS_HOME support
568 --without-nisplus-home Don't include NISPLUS_HOME support (default)],
572 AC_DEFINE(WITH_NISPLUS_HOME)
581 #################################################
582 # check for the secure socket layer
583 AC_MSG_CHECKING(whether to use SSL)
585 [ --with-ssl Include SSL support
586 --without-ssl Don't include SSL support (default)],
599 #################################################
600 # check for experimental mmap support
601 AC_MSG_CHECKING(whether to use MMAP)
603 [ --with-mmap Include experimental MMAP support
604 --without-mmap Don't include MMAP support (default)],
617 #################################################
618 # check for syslog logging
619 AC_MSG_CHECKING(whether to use syslog logging)
621 [ --with-syslog Include experimental SYSLOG support
622 --without-syslog Don't include SYSLOG support (default)],
626 AC_DEFINE(WITH_SYSLOG)
635 #################################################
636 # check for experimental netatalk resource fork support
637 AC_MSG_CHECKING(whether to support netatalk)
638 AC_ARG_WITH(netatalk,
639 [ --with-netatalk Include experimental Netatalk support
640 --without-netatalk Don't include experimental Netatalk support (default)],
644 AC_DEFINE(WITH_NETATALK)
654 #################################################
655 # these tests are taken from the GNU fileutils package
656 AC_CHECKING(how to get filesystem space usage)
659 # Test for statvfs64.
660 if test $space = no; then
662 AC_CACHE_CHECK([statvfs64 function (SVR4)], fu_cv_sys_stat_statvfs64,
664 #include <sys/types.h>
665 #include <sys/statvfs.h>
668 struct statvfs64 fsd;
669 exit (statfs64 (".", &fsd));
671 fu_cv_sys_stat_statvfs64=yes,
672 fu_cv_sys_stat_statvfs64=no,
673 fu_cv_sys_stat_statvfs64=cross)])
674 if test $fu_cv_sys_stat_statvfs64 = yes; then
676 AC_DEFINE(STAT_STATVFS64)
680 # Perform only the link test since it seems there are no variants of the
681 # statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
682 # because that got a false positive on SCO OSR5. Adding the declaration
683 # of a `struct statvfs' causes this test to fail (as it should) on such
684 # systems. That system is reported to work fine with STAT_STATFS4 which
685 # is what it gets when this test fails.
686 if test $space = no; then
688 AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
689 [AC_TRY_LINK([#include <sys/types.h>
690 #include <sys/statvfs.h>],
691 [struct statvfs fsd; statvfs (0, &fsd);],
692 fu_cv_sys_stat_statvfs=yes,
693 fu_cv_sys_stat_statvfs=no)])
694 if test $fu_cv_sys_stat_statvfs = yes; then
696 AC_DEFINE(STAT_STATVFS)
700 if test $space = no; then
701 # DEC Alpha running OSF/1
702 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
703 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
705 #include <sys/param.h>
706 #include <sys/types.h>
707 #include <sys/mount.h>
712 exit (statfs (".", &fsd, sizeof (struct statfs)));
714 fu_cv_sys_stat_statfs3_osf1=yes,
715 fu_cv_sys_stat_statfs3_osf1=no,
716 fu_cv_sys_stat_statfs3_osf1=no)])
717 AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
718 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
720 AC_DEFINE(STAT_STATFS3_OSF1)
724 if test $space = no; then
726 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
727 member (AIX, 4.3BSD)])
728 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
730 #ifdef HAVE_SYS_PARAM_H
731 #include <sys/param.h>
733 #ifdef HAVE_SYS_MOUNT_H
734 #include <sys/mount.h>
736 #ifdef HAVE_SYS_VFS_H
743 exit (statfs (".", &fsd));
745 fu_cv_sys_stat_statfs2_bsize=yes,
746 fu_cv_sys_stat_statfs2_bsize=no,
747 fu_cv_sys_stat_statfs2_bsize=no)])
748 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
749 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
751 AC_DEFINE(STAT_STATFS2_BSIZE)
755 if test $space = no; then
757 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
758 AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
759 [AC_TRY_RUN([#include <sys/types.h>
760 #include <sys/statfs.h>
764 exit (statfs (".", &fsd, sizeof fsd, 0));
766 fu_cv_sys_stat_statfs4=yes,
767 fu_cv_sys_stat_statfs4=no,
768 fu_cv_sys_stat_statfs4=no)])
769 AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
770 if test $fu_cv_sys_stat_statfs4 = yes; then
772 AC_DEFINE(STAT_STATFS4)
776 if test $space = no; then
778 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
779 member (4.4BSD and NetBSD)])
780 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
781 [AC_TRY_RUN([#include <sys/types.h>
782 #ifdef HAVE_SYS_PARAM_H
783 #include <sys/param.h>
785 #ifdef HAVE_SYS_MOUNT_H
786 #include <sys/mount.h>
792 exit (statfs (".", &fsd));
794 fu_cv_sys_stat_statfs2_fsize=yes,
795 fu_cv_sys_stat_statfs2_fsize=no,
796 fu_cv_sys_stat_statfs2_fsize=no)])
797 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
798 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
800 AC_DEFINE(STAT_STATFS2_FSIZE)
804 if test $space = no; then
806 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
807 AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
808 [AC_TRY_RUN([#include <sys/types.h>
809 #ifdef HAVE_SYS_PARAM_H
810 #include <sys/param.h>
812 #ifdef HAVE_SYS_MOUNT_H
813 #include <sys/mount.h>
815 #ifdef HAVE_SYS_FS_TYPES_H
816 #include <sys/fs_types.h>
821 /* Ultrix's statfs returns 1 for success,
822 0 for not mounted, -1 for failure. */
823 exit (statfs (".", &fsd) != 1);
825 fu_cv_sys_stat_fs_data=yes,
826 fu_cv_sys_stat_fs_data=no,
827 fu_cv_sys_stat_fs_data=no)])
828 AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
829 if test $fu_cv_sys_stat_fs_data = yes; then
831 AC_DEFINE(STAT_STATFS2_FS_DATA)
835 echo "checking configure summary"
836 AC_TRY_RUN([#include "${srcdir-.}/tests/summary.c"],
837 echo "configure OK";,
838 AC_MSG_ERROR([summary failure. Aborting config]),:)
840 DUMMY_FILES=`cd ${srcdir-.} >/dev/null &&
841 echo */. | sed 's, ,dummy ,g;s,$,dummy,'`
842 AC_SUBST(DUMMY_FILES)
843 DUMMY_BASE=:include/stamp-h.in
846 DUMMY_GEN=`echo "$DUMMY_FILES" | sed "s, ,$DUMMY_BASE ,g;s,\$,$DUMMY_BASE,"`
847 AC_OUTPUT($DUMMY_GEN Makefile include/stamp-h)