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);;
30 AC_CHECK_HEADERS(sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h)
31 AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h net/if.h)
32 AC_CHECK_HEADERS(compat.h rpc/types.h rpc/xdr.h rpc/auth.h rpc/clnt.h)
33 AC_CHECK_HEADERS(rpcsvc/yp_prot.h rpcsvc/ypclnt.h sys/param.h ctype.h )
34 AC_CHECK_HEADERS(sys/wait.h sys/resource.h sys/ioctl.h sys/mode.h)
35 AC_CHECK_HEADERS(sys/filio.h string.h strings.h stdlib.h sys/socket.h)
36 AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h)
37 AC_CHECK_HEADERS(sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h)
38 AC_CHECK_HEADERS(shadow.h netinet/tcp.h sys/security.h security/pam_appl.h)
39 AC_CHECK_HEADERS(stropts.h poll.h readline.h history.h readline/readline.h)
40 AC_CHECK_HEADERS(readline/history.h)
42 AC_CHECK_SIZEOF(int,cross)
43 AC_CHECK_SIZEOF(long,cross)
44 AC_CHECK_SIZEOF(short,cross)
58 AC_CHECK_TYPE(ino_t,unsigned)
59 AC_CHECK_TYPE(ssize_t, int)
61 AC_CACHE_CHECK([for errno in errno.h],samba_cv_errno, [
62 AC_TRY_COMPILE([#include <errno.h>],[int i = errno],
63 samba_cv_errno=yes,samba_cv_have_errno_decl=no)])
64 if test x"$samba_cv_errno" = x"yes"; then
65 AC_DEFINE(HAVE_ERRNO_DECL)
68 # stupid glibc has the functions but no declaration. grrrr.
69 AC_CACHE_CHECK([for setresuid declaration],samba_cv_have_setresuid_decl,[
70 AC_TRY_COMPILE([#include <unistd.h>],[int i = setresuid],
71 samba_cv_have_setresuid_decl=yes,samba_cv_have_setresuid_decl=no)])
72 if test x"$samba_cv_have_setresuid_decl" = x"yes"; then
73 AC_DEFINE(HAVE_SETRESUID_DECL)
76 # and glibc has setresuid under linux but the function does
77 # nothing until kernel 2.1.44! very dumb.
78 AC_CACHE_CHECK([for real setresuid],samba_cv_have_setresuid,[
79 AC_TRY_RUN([#include <errno.h>
80 main() { setresuid(1,1,1); setresuid(2,2,2); exit(errno==EPERM?0:1);}],
81 samba_cv_have_setresuid=yes,samba_cv_have_setresuid=no,samba_cv_have_setresuid=cross)])
82 if test x"$samba_cv_have_setresuid" = x"yes"; then
83 AC_DEFINE(HAVE_SETRESUID)
88 ###############################################
89 # test for where we get crypt() from
91 if test x"$ac_cv_func_crypt" = x"no"; then
92 AC_CHECK_LIB(crypt, crypt, [LIBS="$LIBS -lcrypt";
93 AC_DEFINE(HAVE_CRYPT)])
97 ###############################################
98 # test for where we get pam_authenticate() from
99 # might need libdl for this to work
100 if test "$ac_cv_header_security_pam_appl_h" = "yes"; then
101 AC_CHECK_LIB(dl,main)
103 AC_CHECK_FUNCS(pam_authenticate)
104 if test x"$ac_cv_func_pam_authenticate" = x"no"; then
105 AC_CHECK_LIB(pam, pam_authenticate, [LIBS="$LIBS -lpam"
106 AC_DEFINE(HAVE_PAM_AUTHENTICATE)])
110 ###############################################
111 # test for where we get readline() from
112 if test "$ac_cv_header_readline_h" = "yes" ||
113 test "$ac_cv_header_readline_readline_h" = "yes"; then
114 AC_CHECK_LIB(readline,readline)
118 # The following test taken from the cvs sources
119 # If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
120 # The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
121 # libsocket.so which has a bad implementation of gethostbyname (it
122 # only looks in /etc/hosts), so we only look for -lsocket if we need
124 AC_CHECK_FUNCS(connect)
125 if test x"$ac_cv_func_connect" = x"no"; then
128 *) AC_CHECK_LIB(nsl_s, printf) ;;
132 *) AC_CHECK_LIB(nsl, printf) ;;
136 *) AC_CHECK_LIB(socket, connect) ;;
140 *) AC_CHECK_LIB(inet, connect) ;;
142 dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value
144 if test x"$ac_cv_lib_socket_connect" = x"yes" ||
145 test x"$ac_cv_lib_inet_connect" = x"yes"; then
146 # ac_cv_func_connect=yes
147 # don't! it would cause AC_CHECK_FUNC to succeed next time configure is run
148 AC_DEFINE(HAVE_CONNECT)
153 AC_CHECK_FUNCS(waitpid getcwd strdup strerror chown chmod chroot)
154 AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync execl bzero memset)
155 AC_CHECK_FUNCS(memmove vsnprintf setsid glob strpbrk pipe crypt16 getauthuid)
156 AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction innetgr)
157 AC_CHECK_FUNCS(initgroups select rdchk getgrnam pathconf putprpwnam)
158 AC_CHECK_FUNCS(setuidx setgroups mktime rename ftruncate stat64 fstat64 lstat64)
159 AC_CHECK_FUNCS(set_auth_parameters atexit grantpt getspnam dup2 lseek64 ftruncate64)
160 AC_CHECK_FUNCS(fseek64 ftell64 bigcrypt getprpwnam setluid yp_get_default_domain getpwanam)
162 AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[
163 AC_TRY_RUN([#include <stdio.h>
164 main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
165 samba_cv_have_longlong=yes,samba_cv_have_longlong=no,samba_cv_have_longlong=cross)])
166 if test x"$samba_cv_have_longlong" = x"yes"; then
167 AC_DEFINE(HAVE_LONGLONG)
170 AC_CACHE_CHECK([for 64 bit off_t],samba_cv_SIZEOF_OFF_T,[
171 AC_TRY_RUN([#include <stdio.h>
172 #include <sys/stat.h>
173 main() { exit((sizeof(off_t) == 8) ? 0 : 1); }],
174 samba_cv_SIZEOF_OFF_T=yes,samba_cv_SIZEOF_OFF_T=no,samba_cv_SIZEOF_OFF_T=cross)])
175 if test x"$samba_cv_SIZEOF_OFF_T" = x"yes"; then
176 AC_DEFINE(SIZEOF_OFF_T,8)
179 AC_CACHE_CHECK([for off64_t],samba_cv_HAVE_OFF64_T,[
180 AC_TRY_RUN([#include <stdio.h>
181 #include <sys/stat.h>
182 main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
183 samba_cv_HAVE_OFF64_T=yes,samba_cv_HAVE_OFF64_T=no,samba_cv_HAVE_OFF64_T=cross)])
184 if test x"$samba_cv_HAVE_OFF64_T" = x"yes"; then
185 AC_DEFINE(HAVE_OFF64_T)
188 AC_CACHE_CHECK([for 64 bit ino_t],samba_cv_SIZEOF_INO_T,[
189 AC_TRY_RUN([#include <stdio.h>
190 #include <sys/stat.h>
191 main() { exit((sizeof(ino_t) == 8) ? 0 : 1); }],
192 samba_cv_SIZEOF_INO_T=yes,samba_cv_SIZEOF_INO_T=no,samba_cv_SIZEOF_INO_T=cross)])
193 if test x"$samba_cv_SIZEOF_INO_T" = x"yes"; then
194 AC_DEFINE(SIZEOF_INO_T,8)
197 AC_CACHE_CHECK([for ino64_t],samba_cv_HAVE_INO64_T,[
198 AC_TRY_RUN([#include <stdio.h>
199 #include <sys/stat.h>
200 main() { struct stat64 st; ino64_t s; if (sizeof(ino_t) == sizeof(ino64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
201 samba_cv_HAVE_INO64_T=yes,samba_cv_HAVE_INO64_T=no,samba_cv_HAVE_INO64_T=cross)])
202 if test x"$samba_cv_HAVE_INO64_T" = x"yes"; then
203 AC_DEFINE(HAVE_INO64_T)
206 AC_CACHE_CHECK([for union semun],samba_cv_HAVE_UNION_SEMUN,[
208 #include <sys/types.h>
211 main() { union semun ss; exit(0); }],
212 samba_cv_HAVE_UNION_SEMUN=yes,samba_cv_HAVE_UNION_SEMUN=no,samba_cv_HAVE_UNION_SEMUN=cross)])
213 if test x"$samba_cv_HAVE_UNION_SEMUN" = x"yes"; then
214 AC_DEFINE(HAVE_UNION_SEMUN)
217 AC_CACHE_CHECK([for unsigned char],samba_cv_HAVE_UNSIGNED_CHAR,[
218 AC_TRY_RUN([#include <stdio.h>
219 main() { char c; c=250; exit((c > 0)?0:1); }],
220 samba_cv_HAVE_UNSIGNED_CHAR=yes,samba_cv_HAVE_UNSIGNED_CHAR=no,samba_cv_HAVE_UNSIGNED_CHAR=cross)])
221 if test x"$samba_cv_HAVE_UNSIGNED_CHAR" = x"yes"; then
222 AC_DEFINE(HAVE_UNSIGNED_CHAR)
225 AC_CACHE_CHECK([for sin_len in sock],samba_cv_HAVE_SOCK_SIN_LEN,[
226 AC_TRY_COMPILE([#include <sys/types.h>
227 #include <sys/socket.h>
228 #include <netinet/in.h>],
229 [struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
230 samba_cv_HAVE_SOCK_SIN_LEN=yes,samba_cv_HAVE_SOCK_SIN_LEN=no)])
231 if test x"$samba_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
232 AC_DEFINE(HAVE_SOCK_SIN_LEN)
235 AC_CACHE_CHECK([for __FILE__ macro],samba_cv_HAVE_FILE_MACRO,[
236 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FILE__);],
237 samba_cv_HAVE_FILE_MACRO=yes,samba_cv_HAVE_FILE_MACRO=no)])
238 if test x"$samba_cv_HAVE_FILE_MACRO" = x"yes"; then
239 AC_DEFINE(HAVE_FILE_MACRO)
242 AC_CACHE_CHECK([for __FUNCTION__ macro],samba_cv_HAVE_FUNCTION_MACRO,[
243 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FUNCTION__);],
244 samba_cv_HAVE_FUNCTION_MACRO=yes,samba_cv_HAVE_FUNCTION_MACRO=no)])
245 if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then
246 AC_DEFINE(HAVE_FUNCTION_MACRO)
249 AC_CACHE_CHECK([if gettimeofday takes tz argument],samba_cv_HAVE_GETTIMEOFDAY_TZ,[
251 #include <sys/time.h>
253 main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}],
254 samba_cv_HAVE_GETTIMEOFDAY_TZ=yes,samba_cv_HAVE_GETTIMEOFDAY_TZ=no,samba_cv_HAVE_GETTIMEOFDAY_TZ=cross)])
255 if test x"$samba_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then
256 AC_DEFINE(HAVE_GETTIMEOFDAY_TZ)
260 AC_CACHE_CHECK([for broken readdir],samba_cv_HAVE_BROKEN_READDIR,[
261 AC_TRY_RUN([#include <sys/types.h>
263 main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
264 if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
265 di->d_name[0] == 0) exit(0); exit(1);} ],
266 samba_cv_HAVE_BROKEN_READDIR=yes,samba_cv_HAVE_BROKEN_READDIR=no,samba_cv_HAVE_BROKEN_READDIR=cross)])
267 if test x"$samba_cv_HAVE_BROKEN_READDIR" = x"yes"; then
268 AC_DEFINE(HAVE_BROKEN_READDIR)
271 AC_CACHE_CHECK([for utimbuf],samba_cv_HAVE_UTIMBUF,[
272 AC_TRY_COMPILE([#include <sys/types.h>
274 [struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf));],
275 samba_cv_HAVE_UTIMBUF=yes,samba_cv_HAVE_UTIMBUF=no,samba_cv_HAVE_UTIMBUF=cross)])
276 if test x"$samba_cv_HAVE_UTIMBUF" = x"yes"; then
277 AC_DEFINE(HAVE_UTIMBUF)
281 AC_MSG_CHECKING([for test routines])
282 AC_TRY_RUN([#include "${srcdir-.}/tests/trivial.c"],
284 AC_MSG_ERROR([cant find test code. Aborting config]),
285 AC_MSG_WARN([cannot run when cross-compiling]))
287 AC_CACHE_CHECK([for ftruncate extend],samba_cv_HAVE_FTRUNCATE_EXTEND,[
288 AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncate.c"],
289 samba_cv_HAVE_FTRUNCATE_EXTEND=yes,samba_cv_HAVE_FTRUNCATE_EXTEND=no,samba_cv_HAVE_FTRUNCATE_EXTEND=cross)])
290 if test x"$samba_cv_HAVE_FTRUNCATE_EXTEND" = x"yes"; then
291 AC_DEFINE(HAVE_FTRUNCATE_EXTEND)
294 AC_CACHE_CHECK([for broken getgroups],samba_cv_HAVE_BROKEN_GETGROUPS,[
295 AC_TRY_RUN([#include "${srcdir-.}/tests/getgroups.c"],
296 samba_cv_HAVE_BROKEN_GETGROUPS=yes,samba_cv_HAVE_BROKEN_GETGROUPS=no,samba_cv_HAVE_BROKEN_GETGROUPS=cross)])
297 if test x"$samba_cv_HAVE_BROKEN_GETGROUPS" = x"yes"; then
298 AC_DEFINE(HAVE_BROKEN_GETGROUPS)
301 AC_CACHE_CHECK([whether getpass should be replaced],samba_cv_REPLACE_GETPASS,[
302 SAVE_CPPFLAGS="$CPPFLAGS"
303 CPPFLAGS="$CPPFLAGS -I${srcdir-.}/include -I${srcdir-.}/ubiqx"
305 #define REPLACE_GETPASS 1
306 #define NO_CONFIG_H 1
307 #define main dont_declare_main
308 #include "${srcdir-.}/lib/getsmbpass.c"
310 ],[],samba_cv_REPLACE_GETPASS=yes,samba_cv_REPLACE_GETPASS=no)
311 CPPFLAGS="$SAVE_CPPFLAGS"
313 if test x"$samba_cv_REPLACE_GETPASS" = x"yes"; then
314 AC_DEFINE(REPLACE_GETPASS)
317 AC_CACHE_CHECK([for broken inet_ntoa],samba_cv_REPLACE_INET_NTOA,[
320 #include <sys/types.h>
321 #include <netinet/in.h>
322 #include <arpa/inet.h>
323 main() { struct in_addr ip; ip.s_addr = 0x12345678;
324 if (strcmp(inet_ntoa(ip),"18.52.86.120") &&
325 strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); }
327 samba_cv_REPLACE_INET_NTOA=yes,samba_cv_REPLACE_INET_NTOA=no,samba_cv_REPLACE_INET_NTOA=cross)])
328 if test x"$samba_cv_REPLACE_INET_NTOA" = x"yes"; then
329 AC_DEFINE(REPLACE_INET_NTOA)
332 AC_CACHE_CHECK([for root],samba_cv_HAVE_ROOT,[
333 AC_TRY_RUN([main() { exit(getuid() != 0); }],
334 samba_cv_HAVE_ROOT=yes,samba_cv_HAVE_ROOT=no,samba_cv_HAVE_ROOT=cross)])
335 if test x"$samba_cv_HAVE_ROOT" = x"yes"; then
338 AC_MSG_WARN(running as non-root will disable some tests)
342 AC_CACHE_CHECK([for netmask ifconf],samba_cv_HAVE_NETMASK_IFCONF,[
344 #define HAVE_NETMASK_IFCONF 1
346 #include "${srcdir-.}/lib/netmask.c"],
347 samba_cv_HAVE_NETMASK_IFCONF=yes,samba_cv_HAVE_NETMASK_IFCONF=no,samba_cv_HAVE_NETMASK_IFCONF=cross)])
348 if test x"$samba_cv_HAVE_NETMASK_IFCONF" = x"yes"; then
349 netmask=yes;AC_DEFINE(HAVE_NETMASK_IFCONF)
352 if test $netmask = no; then
353 AC_CACHE_CHECK([for netmask ifreq],samba_cv_HAVE_NETMASK_IFREQ,[
355 #define HAVE_NETMASK_IFREQ 1
357 #include "${srcdir-.}/lib/netmask.c"],
358 samba_cv_HAVE_NETMASK_IFREQ=yes,samba_cv_HAVE_NETMASK_IFREQ=no,samba_cv_HAVE_NETMASK_IFREQ=cross)])
359 if test x"$samba_cv_HAVE_NETMASK_IFREQ" = x"yes"; then
360 netmask=yes;AC_DEFINE(HAVE_NETMASK_IFREQ)
364 if test $netmask = no; then
365 AC_CACHE_CHECK([for netmask AIX],samba_cv_HAVE_NETMASK_AIX,[
367 #define HAVE_NETMASK_AIX 1
369 #include "${srcdir-.}/lib/netmask.c"],
370 samba_cv_HAVE_NETMASK_AIX=yes,samba_cv_HAVE_NETMASK_AIX=no,samba_cv_HAVE_NETMASK_AIX=cross)])
371 if test x"$samba_cv_HAVE_NETMASK_AIX" = x"yes"; then
372 netmask=yes;AC_DEFINE(HAVE_NETMASK_AIX)
376 AC_CACHE_CHECK([for trapdoor seteuid],samba_cv_HAVE_TRAPDOOR_UID,[
377 AC_TRY_RUN([#include "${srcdir-.}/tests/trapdoor.c"],
378 samba_cv_HAVE_TRAPDOOR_UID=no,samba_cv_HAVE_TRAPDOOR_UID=yes,:)])
379 if test x"$samba_cv_HAVE_TRAPDOOR_UID" = x"yes"; then
380 AC_DEFINE(HAVE_TRAPDOOR_UID)
383 AC_CACHE_CHECK([for shared mmap],samba_cv_HAVE_SHARED_MMAP,[
384 AC_TRY_RUN([#include "${srcdir-.}/tests/shared_mmap.c"],
385 samba_cv_HAVE_SHARED_MMAP=yes,samba_cv_HAVE_SHARED_MMAP=no,samba_cv_HAVE_SHARED_MMAP=cross)])
386 if test x"$samba_cv_HAVE_SHARED_MMAP" = x"yes"; then
387 AC_DEFINE(HAVE_SHARED_MMAP)
390 AC_CACHE_CHECK([for fcntl locking],samba_cv_HAVE_FCNTL_LOCK,[
391 AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock.c"],
392 samba_cv_HAVE_FCNTL_LOCK=yes,samba_cv_HAVE_FCNTL_LOCK=no,samba_cv_HAVE_FCNTL_LOCK=cross)])
393 if test x"$samba_cv_HAVE_FCNTL_LOCK" = x"yes"; then
394 AC_DEFINE(HAVE_FCNTL_LOCK)
397 AC_CACHE_CHECK([for 64 bit fcntl locking],samba_cv_HAVE_STRUCT_FLOCK64,[
406 #ifdef HAVE_SYS_FCNTL_H
407 #include <sys/fcntl.h>
409 main() { struct flock64 fl64;
410 #if defined(F_SETLKW64) && defined(F_SETLK64) && defined(F_GETLK64)
416 samba_cv_HAVE_STRUCT_FLOCK64=yes,samba_cv_HAVE_STRUCT_FLOCK64=no,samba_cv_HAVE_STRUCT_FLOCK64=cross)])
417 if test x"$samba_cv_HAVE_STRUCT_FLOCK64" = x"yes"; then
418 AC_DEFINE(HAVE_STRUCT_FLOCK64)
421 AC_CACHE_CHECK([for sysv ipc],samba_cv_HAVE_SYSV_IPC,[
422 AC_TRY_RUN([#include "${srcdir-.}/tests/sysv_ipc.c"],
423 samba_cv_HAVE_SYSV_IPC=yes,samba_cv_HAVE_SYSV_IPC=no,samba_cv_HAVE_SYSV_IPC=cross)])
424 if test x"$samba_cv_HAVE_SYSV_IPC" = x"yes"; then
425 AC_DEFINE(HAVE_SYSV_IPC)
428 #################################################
429 # check for the AFS filesystem
430 AC_MSG_CHECKING(whether to use AFS)
432 [ --with-afs Include AFS support
433 --without-afs Don't include AFS support (default)],
447 #################################################
448 # check for the DFS auth system
449 AC_MSG_CHECKING(whether to use DFS auth)
451 [ --with-dfs Include DFS support
452 --without-dfs Don't include DFS support (default)],
465 #################################################
466 # check for automount support
467 AC_MSG_CHECKING(whether to use AUTOMOUNT)
468 AC_ARG_WITH(automount,
469 [ --with-automount Include AUTOMOUNT support
470 --without-automount Don't include AUTOMOUNT support (default)],
474 AC_DEFINE(WITH_AUTOMOUNT)
483 #################################################
484 # check for a LDAP password database
485 AC_MSG_CHECKING(whether to use LDAP password database)
487 [ --with-ldap Include LDAP support
488 --without-ldap Don't include LDAP support (default)],
501 #################################################
502 # check for a NISPLUS password database
503 AC_MSG_CHECKING(whether to use NISPLUS password database)
505 [ --with-nisplus Include NISPLUS password database support
506 --without-nisplus Don't include NISPLUS password database support (default)],
510 AC_DEFINE(WITH_NISPLUS)
519 #################################################
520 # check for a NISPLUS_HOME support
521 AC_MSG_CHECKING(whether to use NISPLUS_HOME)
522 AC_ARG_WITH(nisplus-home,
523 [ --with-nisplus-home Include NISPLUS_HOME support
524 --without-nisplus-home Don't include NISPLUS_HOME support (default)],
528 AC_DEFINE(WITH_NISPLUS_HOME)
537 #################################################
538 # check for the secure socket layer
539 AC_MSG_CHECKING(whether to use SSL)
541 [ --with-ssl Include SSL support
542 --without-ssl Don't include SSL support (default)],
555 #################################################
556 # check for experimental mmap support
557 AC_MSG_CHECKING(whether to use MMAP)
559 [ --with-mmap Include experimental MMAP support
560 --without-mmap Don't include MMAP support (default)],
573 #################################################
574 # check for syslog logging
575 AC_MSG_CHECKING(whether to use syslog logging)
577 [ --with-syslog Include experimental SYSLOG support
578 --without-syslog Don't include SYSLOG support (default)],
582 AC_DEFINE(WITH_SYSLOG)
591 #################################################
592 # check for experimental netatalk resource fork support
593 AC_MSG_CHECKING(whether to support netatalk)
594 AC_ARG_WITH(netatalk,
595 [ --with-netatalk Include experimental Netatalk support
596 --without-netatalk Don't include experimental Netatalk support (default)],
600 AC_DEFINE(WITH_NETATALK)
610 #################################################
611 # these tests are taken from the GNU fileutils package
612 AC_CHECKING(how to get filesystem space usage)
615 # Test for statvfs64.
616 if test $space = no; then
618 AC_CACHE_CHECK([statvfs64 function (SVR4)], fu_cv_sys_stat_statvfs64,
620 #include <sys/types.h>
621 #include <sys/statvfs.h>
624 struct statvfs64 fsd;
625 exit (statfs64 (".", &fsd));
627 fu_cv_sys_stat_statvfs64=yes,
628 fu_cv_sys_stat_statvfs64=no,
629 fu_cv_sys_stat_statvfs64=cross)])
630 if test $fu_cv_sys_stat_statvfs64 = yes; then
632 AC_DEFINE(STAT_STATVFS64)
636 # Perform only the link test since it seems there are no variants of the
637 # statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
638 # because that got a false positive on SCO OSR5. Adding the declaration
639 # of a `struct statvfs' causes this test to fail (as it should) on such
640 # systems. That system is reported to work fine with STAT_STATFS4 which
641 # is what it gets when this test fails.
642 if test $space = no; then
644 AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
645 [AC_TRY_LINK([#include <sys/types.h>
646 #include <sys/statvfs.h>],
647 [struct statvfs fsd; statvfs (0, &fsd);],
648 fu_cv_sys_stat_statvfs=yes,
649 fu_cv_sys_stat_statvfs=no)])
650 if test $fu_cv_sys_stat_statvfs = yes; then
652 AC_DEFINE(STAT_STATVFS)
656 if test $space = no; then
657 # DEC Alpha running OSF/1
658 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
659 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
661 #include <sys/param.h>
662 #include <sys/types.h>
663 #include <sys/mount.h>
668 exit (statfs (".", &fsd, sizeof (struct statfs)));
670 fu_cv_sys_stat_statfs3_osf1=yes,
671 fu_cv_sys_stat_statfs3_osf1=no,
672 fu_cv_sys_stat_statfs3_osf1=no)])
673 AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
674 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
676 AC_DEFINE(STAT_STATFS3_OSF1)
680 if test $space = no; then
682 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
683 member (AIX, 4.3BSD)])
684 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
686 #ifdef HAVE_SYS_PARAM_H
687 #include <sys/param.h>
689 #ifdef HAVE_SYS_MOUNT_H
690 #include <sys/mount.h>
692 #ifdef HAVE_SYS_VFS_H
699 exit (statfs (".", &fsd));
701 fu_cv_sys_stat_statfs2_bsize=yes,
702 fu_cv_sys_stat_statfs2_bsize=no,
703 fu_cv_sys_stat_statfs2_bsize=no)])
704 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
705 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
707 AC_DEFINE(STAT_STATFS2_BSIZE)
711 if test $space = no; then
713 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
714 AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
715 [AC_TRY_RUN([#include <sys/types.h>
716 #include <sys/statfs.h>
720 exit (statfs (".", &fsd, sizeof fsd, 0));
722 fu_cv_sys_stat_statfs4=yes,
723 fu_cv_sys_stat_statfs4=no,
724 fu_cv_sys_stat_statfs4=no)])
725 AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
726 if test $fu_cv_sys_stat_statfs4 = yes; then
728 AC_DEFINE(STAT_STATFS4)
732 if test $space = no; then
734 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
735 member (4.4BSD and NetBSD)])
736 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
737 [AC_TRY_RUN([#include <sys/types.h>
738 #ifdef HAVE_SYS_PARAM_H
739 #include <sys/param.h>
741 #ifdef HAVE_SYS_MOUNT_H
742 #include <sys/mount.h>
748 exit (statfs (".", &fsd));
750 fu_cv_sys_stat_statfs2_fsize=yes,
751 fu_cv_sys_stat_statfs2_fsize=no,
752 fu_cv_sys_stat_statfs2_fsize=no)])
753 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
754 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
756 AC_DEFINE(STAT_STATFS2_FSIZE)
760 if test $space = no; then
762 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
763 AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
764 [AC_TRY_RUN([#include <sys/types.h>
765 #ifdef HAVE_SYS_PARAM_H
766 #include <sys/param.h>
768 #ifdef HAVE_SYS_MOUNT_H
769 #include <sys/mount.h>
771 #ifdef HAVE_SYS_FS_TYPES_H
772 #include <sys/fs_types.h>
777 /* Ultrix's statfs returns 1 for success,
778 0 for not mounted, -1 for failure. */
779 exit (statfs (".", &fsd) != 1);
781 fu_cv_sys_stat_fs_data=yes,
782 fu_cv_sys_stat_fs_data=no,
783 fu_cv_sys_stat_fs_data=no)])
784 AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
785 if test $fu_cv_sys_stat_fs_data = yes; then
787 AC_DEFINE(STAT_STATFS2_FS_DATA)
791 echo "checking configure summary"
792 AC_TRY_RUN([#include "${srcdir-.}/tests/summary.c"],
793 echo "configure OK";,
794 AC_MSG_ERROR([summary failure. Aborting config]),:)
797 AC_OUTPUT(Makefile tests/dummy client/dummy lib/dummy ubiqx/dummy
798 web/dummy param/dummy nmbd/dummy smbd/dummy rpc_server/dummy
799 rpc_client/dummy rpc_parse/dummy locking/dummy passdb/dummy
800 script/dummy include/dummy codepages/dummy libsmb/dummy bin/dummy
801 utils/dummy printing/dummy include/stamp-h)