More 64 bit stuff - now the fcntl locks are 64 bit clean.
[tprouty/samba.git] / source3 / configure.in
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)
4
5 dnl Checks for programs.
6 AC_PROG_CC
7 AC_PROG_INSTALL
8 AC_SUBST(SHELL)
9 AC_PROG_AWK
10
11 AC_CANONICAL_SYSTEM
12 case "$host_os" in
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);;
23 esac
24
25 AC_INLINE
26 AC_HEADER_STDC
27 AC_HEADER_DIRENT
28 AC_HEADER_TIME
29 AC_HEADER_SYS_WAIT
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)
40
41 AC_CHECK_SIZEOF(int)
42 AC_CHECK_SIZEOF(long)
43 AC_CHECK_SIZEOF(short)
44
45 AC_C_CONST
46 AC_C_INLINE
47 AC_C_BIGENDIAN
48 AC_C_CHAR_UNSIGNED
49
50 AC_TYPE_SIGNAL
51 AC_TYPE_UID_T
52 AC_TYPE_MODE_T
53 AC_TYPE_OFF_T
54 AC_TYPE_SIZE_T
55 AC_TYPE_PID_T
56 AC_STRUCT_ST_RDEV
57 AC_CHECK_TYPE(ino_t,unsigned)
58
59 echo $ac_n "checking for errno in errno.h... $ac_c"
60 AC_TRY_COMPILE([#include <errno.h>],[int i = errno],
61 echo yes; AC_DEFINE(HAVE_ERRNO_DECL),
62 echo no)
63
64 # stupid glibc has the functions but no declaration. grrrr.
65 echo $ac_n "checking for setresuid declaration $ac_c"
66 AC_TRY_COMPILE([#include <unistd.h>],[int i = setresuid],
67 echo yes; AC_DEFINE(HAVE_SETRESUID_DECL),
68 echo no)
69
70 # and glibc has setresuid under linux but the function does
71 # nothing until kernel 2.1.44! very dumb.
72 echo $ac_n "checking for real setresuid $ac_c"
73 AC_TRY_RUN([#include <errno.h>
74 main() { setresuid(1,1,1); setresuid(2,2,2); exit(errno==EPERM?0:1);}],
75 echo yes;AC_DEFINE(HAVE_SETRESUID), 
76 echo no)
77
78
79 AC_FUNC_MEMCMP
80
81 ###############################################
82 # test for where we get crypt() from
83 if test "$ac_cv_lib_crypt_crypt" = "yes"; then
84   AC_CHECK_LIB(crypt, crypt)
85   AC_DEFINE(HAVE_CRYPT)
86 fi
87 if test "$ac_cv_lib_crypt_crypt" = "no" || 
88    test "$ac_cv_lib_crypt_crypt" = ""; then
89 # look for crypt 
90 AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT), 
91 [case "$LIBS" in
92 *-lcrypt*) ;;
93 *) AC_CHECK_LIB(crypt, crypt) ;;
94 esac
95 if test "$ac_cv_lib_crypt_crypt" = "yes"; then
96   ac_cv_func_crypt=yes
97   AC_DEFINE(HAVE_CRYPT)
98 fi])
99 fi
100
101
102 ###############################################
103 # test for where we get pam_authenticate() from
104 # might need libdl for this to work
105 if test "$ac_cv_header_security_pam_appl_h" = "yes"; then
106   AC_HAVE_LIBRARY(dl)
107 fi
108 if test "$ac_cv_lib_pam_pam_authenticate" = "yes"; then
109   AC_CHECK_LIB(pam, pam_authenticate)
110   AC_DEFINE(HAVE_PAM_AUTHENTICATE)
111 fi
112 if test "$ac_cv_lib_pam_pam_authenticate" = "no" || 
113    test "$ac_cv_lib_pam_pam_authenticate" = ""; then
114 # look for pam_authenticate
115 AC_CHECK_FUNC(pam_authenticate, AC_DEFINE(HAVE_PAM_AUTHENTICATE), 
116 [case "$LIBS" in
117 *-lpam*) ;;
118 *) AC_CHECK_LIB(pam, pam_authenticate) ;;
119 esac
120 if test "$ac_cv_lib_pam_pam_authenticate" = "yes"; then
121   ac_cv_func_pam_authenticate=yes
122   AC_DEFINE(HAVE_PAM_AUTHENTICATE)
123 fi])
124 fi
125
126 # The following test taken from the cvs sources
127 # If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
128 # The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
129 # libsocket.so which has a bad implementation of gethostbyname (it
130 # only looks in /etc/hosts), so we only look for -lsocket if we need
131 # it.
132 AC_CHECK_FUNC(connect, :, 
133 [case "$LIBS" in
134 *-lnsl*) ;;
135 *) AC_CHECK_LIB(nsl_s, printf) ;;
136 esac
137 case "$LIBS" in
138 *-lnsl*) ;;
139 *) AC_CHECK_LIB(nsl, printf) ;;
140 esac
141 case "$LIBS" in
142 *-lsocket*) ;;
143 *) AC_CHECK_LIB(socket, connect) ;;
144 esac
145 case "$LIBS" in
146 *-linet*) ;;
147 *) AC_CHECK_LIB(inet, connect) ;;
148 esac
149 dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value
150 dnl has been cached.
151 if test "$ac_cv_lib_socket_connect" = "yes" || 
152    test "$ac_cv_lib_inet_connect" = "yes"; then
153   ac_cv_func_connect=yes
154   AC_DEFINE(HAVE_CONNECT)
155 fi])
156
157
158 AC_CHECK_FUNCS(waitpid getcwd strdup strerror chown chmod chroot)
159 AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync execl bzero memset)
160 AC_CHECK_FUNCS(memmove vsnprintf setsid glob strpbrk pipe crypt16 getauthuid)
161 AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction innetgr)
162 AC_CHECK_FUNCS(initgroups select rdchk getgrnam pathconf putprpwnam)
163 AC_CHECK_FUNCS(setuidx setgroups mktime rename ftruncate stat64 fstat64 lstat64)
164 AC_CHECK_FUNCS(set_auth_parameters atexit grantpt getspnam dup2 lseek64 ftruncate64)
165 AC_CHECK_FUNCS(bigcrypt getprpwnam setluid yp_get_default_domain getpwanam)
166
167 echo $ac_n "checking for long long ... $ac_c"
168 AC_TRY_RUN([#include <stdio.h>
169 main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
170 echo yes;AC_DEFINE(HAVE_LONGLONG), 
171 echo no)
172
173 echo $ac_n "checking for 64 bit off_t ... $ac_c"
174 AC_TRY_RUN([#include <stdio.h>
175 #include <sys/stat.h>
176 main() { exit((sizeof(off_t) == 8) ? 0 : 1); }],
177 echo yes;AC_DEFINE(SIZEOF_OFF_T,8),
178 echo no)
179
180 echo $ac_n "checking for off64_t ... $ac_c"
181 AC_TRY_RUN([#include <stdio.h>
182 #include <sys/stat.h>
183 main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
184 echo yes;AC_DEFINE(HAVE_OFF64_T), 
185 echo no)
186
187 echo $ac_n "checking for union semun ... $ac_c"
188 AC_TRY_RUN([
189 #include <sys/types.h>
190 #include <sys/ipc.h>
191 #include <sys/sem.h>
192 main() { union semun ss; exit(0); }],
193 echo yes;AC_DEFINE(HAVE_UNION_SEMUN), 
194 echo no)
195
196 echo $ac_n "checking for unsigned char ... $ac_c"
197 AC_TRY_RUN([#include <stdio.h>
198 main() { char c; c=250; exit((c > 0)?0:1); }],
199 echo yes;AC_DEFINE(HAVE_UNSIGNED_CHAR), 
200 echo no)
201
202 echo $ac_n "checking for sin_len in sock ... $ac_c"
203 AC_TRY_COMPILE([#include <sys/types.h>
204 #include <sys/socket.h>
205 #include <netinet/in.h>],
206 [struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
207 echo yes;AC_DEFINE(HAVE_SOCK_SIN_LEN), 
208 echo no)
209
210 echo $ac_n "checking for __FILE__ macro ... $ac_c"
211 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FILE__);],
212 echo yes;AC_DEFINE(HAVE_FILE_MACRO), 
213 echo no)
214
215 echo $ac_n "checking for __FUNCTION__ macro ... $ac_c"
216 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FUNCTION__);],
217 echo yes;AC_DEFINE(HAVE_FUNCTION_MACRO), 
218 echo no)
219
220 echo $ac_n "checking if gettimeofday takes tz argument ... $ac_c"
221 AC_TRY_RUN([
222 #include <sys/time.h>
223 #include <unistd.h>
224 main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}],
225            echo yes;AC_DEFINE(HAVE_GETTIMEOFDAY_TZ),
226            echo no)
227
228
229 echo $ac_n "checking for broken readdir ... $ac_c"
230 AC_TRY_RUN([#include <sys/types.h>
231 #include <dirent.h>
232 main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
233 if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
234 di->d_name[0] == 0) exit(0); exit(1);} ],
235 echo yes - you are using the broken /usr/ucb/cc;AC_DEFINE(HAVE_BROKEN_READDIR), 
236 echo no)
237
238 echo $ac_n "checking for utimbuf ... $ac_c"
239 AC_TRY_COMPILE([#include <sys/types.h>
240 #include <utime.h>],
241 [struct utimbuf tbuf;  tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf));],
242 echo yes;AC_DEFINE(HAVE_UTIMBUF), 
243 echo no)
244
245 echo $ac_n "checking for ftruncate extend ... $ac_c"
246 AC_TRY_RUN([#include "tests/ftruncate.c"],
247            echo yes;AC_DEFINE(HAVE_FTRUNCATE_EXTEND), 
248            echo no)
249
250 echo $ac_n "checking for broken getgroups ... $ac_c"
251 AC_TRY_RUN([#include "tests/getgroups.c"],
252            echo yes;AC_DEFINE(HAVE_BROKEN_GETGROUPS), 
253            echo no)
254
255
256 echo $ac_n "checking for broken inet_ntoa ... $ac_c"
257 AC_TRY_RUN([
258 #include <stdio.h>
259 #include <sys/types.h>
260 #include <netinet/in.h>
261 #include <arpa/inet.h>
262 main() { struct in_addr ip; ip.s_addr = 0x12345678;
263 if (strcmp(inet_ntoa(ip),"18.52.86.120") &&
264     strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); } 
265 exit(1);}],
266            echo yes;AC_DEFINE(REPLACE_INET_NTOA), 
267            echo no)
268
269 echo $ac_n "checking for root ... $ac_c"
270 AC_TRY_RUN([main() { exit(getuid() != 0); }],
271            echo yes;AC_DEFINE(HAVE_ROOT), 
272            echo WARNING: running as non-root will disable some tests;)
273
274 netmask=no;
275 echo $ac_n "checking for netmask ifconf ... $ac_c"
276 AC_TRY_RUN([
277 #define HAVE_NETMASK_IFCONF 1
278 #define AUTOCONF 1
279 #include "lib/netmask.c"],
280            echo yes;netmask=yes;AC_DEFINE(HAVE_NETMASK_IFCONF),
281            echo no)
282
283 if test $netmask = no; then
284 echo $ac_n "checking for netmask ifreq ... $ac_c"
285 AC_TRY_RUN([
286 #define HAVE_NETMASK_IFREQ 1
287 #define AUTOCONF 1
288 #include "lib/netmask.c"],
289            echo yes;netmask=yes;AC_DEFINE(HAVE_NETMASK_IFREQ),
290            echo no)
291 fi
292
293 if test $netmask = no; then
294 echo $ac_n "checking for netmask AIX ... $ac_c"
295 AC_TRY_RUN([
296 #define HAVE_NETMASK_AIX 1
297 #define AUTOCONF 1
298 #include "lib/netmask.c"],
299            echo yes;netmask=yes;AC_DEFINE(HAVE_NETMASK_AIX),
300            echo no)
301 fi
302
303 echo $ac_n "checking for trapdoor seteuid ... $ac_c"
304 AC_TRY_RUN([#include "tests/trapdoor.c"],
305            echo no,
306            echo yes;AC_DEFINE(HAVE_TRAPDOOR_UID))
307
308 echo $ac_n "checking for shared mmap ... $ac_c"
309 AC_TRY_RUN([#include "tests/shared_mmap.c"],
310            echo yes;AC_DEFINE(HAVE_SHARED_MMAP), 
311            echo no)
312
313 echo $ac_n "checking for fcntl locking ... $ac_c"
314 AC_TRY_RUN([#include "tests/fcntl_lock.c"],
315            echo yes;AC_DEFINE(HAVE_FCNTL_LOCK), 
316            echo no)
317
318 echo $ac_n "checking for 64 bit fcntl locking ... $ac_c"
319 AC_TRY_RUN([
320 #include <stdio.h>
321 #include <stdlib.h>
322
323 #ifdef HAVE_FCNTL_H
324 #include <fcntl.h>
325 #endif
326
327 #ifdef HAVE_SYS_FCNTL_H
328 #include <sys/fcntl.h>
329 #endif
330 main() { struct flock64 fl64;
331 #if defined(F_SETLKW64) && defined(F_SETLK64) && defined(F_GETLK64)
332 exit(0);
333 #else
334 exit(1);
335 #endif
336 }],
337        echo yes;AC_DEFINE(HAVE_STRUCT_FLOCK64),
338        echo no)
339
340 echo $ac_n "checking for sysv ipc ... $ac_c"
341 AC_TRY_RUN([#include "tests/sysv_ipc.c"],
342            echo yes;AC_DEFINE(HAVE_SYSV_IPC), 
343            echo no)
344
345 #################################################
346 # check for the AFS filesystem
347 AC_MSG_CHECKING(whether to use AFS)
348 AC_ARG_WITH(afs,
349 [  --with-afs     Include AFS support
350   --without-afs  Don't include AFS support (default)],
351 [ case "$withval" in
352   yes)
353     AC_MSG_RESULT(yes)
354     AC_DEFINE(WITH_AFS)
355     ;;
356   *)
357     AC_MSG_RESULT(no)
358     ;;
359   esac ],
360   AC_MSG_RESULT(no)
361 )
362
363
364 #################################################
365 # check for the DFS auth system
366 AC_MSG_CHECKING(whether to use DFS auth)
367 AC_ARG_WITH(dfs,
368 [  --with-dfs     Include DFS support
369   --without-dfs  Don't include DFS support (default)],
370 [ case "$withval" in
371   yes)
372     AC_MSG_RESULT(yes)
373     AC_DEFINE(WITH_DFS)
374     ;;
375   *)
376     AC_MSG_RESULT(no)
377     ;;
378   esac ],
379   AC_MSG_RESULT(no)
380 )
381
382 #################################################
383 # check for automount support
384 AC_MSG_CHECKING(whether to use AUTOMOUNT)
385 AC_ARG_WITH(automount,
386 [  --with-automount     Include AUTOMOUNT support
387   --without-automount  Don't include AUTOMOUNT support (default)],
388 [ case "$withval" in
389   yes)
390     AC_MSG_RESULT(yes)
391     AC_DEFINE(WITH_AUTOMOUNT)
392     ;;
393   *)
394     AC_MSG_RESULT(no)
395     ;;
396   esac ],
397   AC_MSG_RESULT(no)
398 )
399
400 #################################################
401 # check for a LDAP password database
402 AC_MSG_CHECKING(whether to use LDAP password database)
403 AC_ARG_WITH(ldap,
404 [  --with-ldap     Include LDAP support
405   --without-ldap  Don't include LDAP support (default)],
406 [ case "$withval" in
407   yes)
408     AC_MSG_RESULT(yes)
409     AC_DEFINE(WITH_LDAP)
410     ;;
411   *)
412     AC_MSG_RESULT(no)
413     ;;
414   esac ],
415   AC_MSG_RESULT(no)
416 )
417
418 #################################################
419 # check for a NISPLUS password database
420 AC_MSG_CHECKING(whether to use NISPLUS password database)
421 AC_ARG_WITH(nisplus,
422 [  --with-nisplus     Include NISPLUS password database support
423   --without-nisplus  Don't include NISPLUS password database support (default)],
424 [ case "$withval" in
425   yes)
426     AC_MSG_RESULT(yes)
427     AC_DEFINE(WITH_NISPLUS)
428     ;;
429   *)
430     AC_MSG_RESULT(no)
431     ;;
432   esac ],
433   AC_MSG_RESULT(no)
434 )
435
436 #################################################
437 # check for a NISPLUS_HOME support 
438 AC_MSG_CHECKING(whether to use NISPLUS_HOME)
439 AC_ARG_WITH(nisplus-home,
440 [  --with-nisplus-home     Include NISPLUS_HOME support
441   --without-nisplus-home  Don't include NISPLUS_HOME support (default)],
442 [ case "$withval" in
443   yes)
444     AC_MSG_RESULT(yes)
445     AC_DEFINE(WITH_NISPLUS_HOME)
446     ;;
447   *)
448     AC_MSG_RESULT(no)
449     ;;
450   esac ],
451   AC_MSG_RESULT(no)
452 )
453
454 #################################################
455 # check for the secure socket layer
456 AC_MSG_CHECKING(whether to use SSL)
457 AC_ARG_WITH(ssl,
458 [  --with-ssl     Include SSL support
459   --without-ssl  Don't include SSL support (default)],
460 [ case "$withval" in
461   yes)
462     AC_MSG_RESULT(yes)
463     AC_DEFINE(WITH_SSL)
464     ;;
465   *)
466     AC_MSG_RESULT(no)
467     ;;
468   esac ],
469   AC_MSG_RESULT(no)
470 )
471
472 #################################################
473 # check for experimental mmap support
474 AC_MSG_CHECKING(whether to use MMAP)
475 AC_ARG_WITH(mmap,
476 [  --with-mmap     Include experimental MMAP support
477   --without-mmap  Don't include MMAP support (default)],
478 [ case "$withval" in
479   yes)
480     AC_MSG_RESULT(yes)
481     AC_DEFINE(WITH_MMAP)
482     ;;
483   *)
484     AC_MSG_RESULT(no)
485     ;;
486   esac ],
487   AC_MSG_RESULT(no)
488 )
489
490 #################################################
491 # check for syslog logging
492 AC_MSG_CHECKING(whether to use syslog logging)
493 AC_ARG_WITH(syslog,
494 [  --with-syslog     Include experimental SYSLOG support
495   --without-syslog  Don't include SYSLOG support (default)],
496 [ case "$withval" in
497   yes)
498     AC_MSG_RESULT(yes)
499     AC_DEFINE(WITH_SYSLOG)
500     ;;
501   *)
502     AC_MSG_RESULT(no)
503     ;;
504   esac ],
505   AC_MSG_RESULT(no)
506 )
507
508 #################################################
509 # check for experimental netatalk resource fork support
510 AC_MSG_CHECKING(whether to support netatalk)
511 AC_ARG_WITH(netatalk,
512 [  --with-netatalk     Include experimental Netatalk support
513   --without-netatalk  Don't include experimental Netatalk support (default)],
514 [ case "$withval" in
515   yes)
516     AC_MSG_RESULT(yes)
517     AC_DEFINE(WITH_NETATALK)
518     ;;
519   *)
520     AC_MSG_RESULT(no)
521     ;;
522   esac ],
523   AC_MSG_RESULT(no)
524 )
525
526
527 #################################################
528 # these tests are taken from the GNU fileutils package
529 AC_CHECKING(how to get filesystem space usage)
530 space=no
531
532 # Perform only the link test since it seems there are no variants of the
533 # statvfs function.  This check is more than just AC_CHECK_FUNCS(statvfs)
534 # because that got a false positive on SCO OSR5.  Adding the declaration
535 # of a `struct statvfs' causes this test to fail (as it should) on such
536 # systems.  That system is reported to work fine with STAT_STATFS4 which
537 # is what it gets when this test fails.
538 if test $space = no; then
539   # SVR4
540   AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
541                  [AC_TRY_LINK([#include <sys/types.h>
542 #include <sys/statvfs.h>],
543                               [struct statvfs fsd; statvfs (0, &fsd);],
544                               fu_cv_sys_stat_statvfs=yes,
545                               fu_cv_sys_stat_statvfs=no)])
546   if test $fu_cv_sys_stat_statvfs = yes; then
547     space=yes
548     AC_DEFINE(STAT_STATVFS)
549   fi
550 fi
551
552 if test $space = no; then
553   # DEC Alpha running OSF/1
554   AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
555   AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
556   [AC_TRY_RUN([
557 #include <sys/param.h>
558 #include <sys/types.h>
559 #include <sys/mount.h>
560   main ()
561   {
562     struct statfs fsd;
563     fsd.f_fsize = 0;
564     exit (statfs (".", &fsd, sizeof (struct statfs)));
565   }],
566   fu_cv_sys_stat_statfs3_osf1=yes,
567   fu_cv_sys_stat_statfs3_osf1=no,
568   fu_cv_sys_stat_statfs3_osf1=no)])
569   AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
570   if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
571     space=yes
572     AC_DEFINE(STAT_STATFS3_OSF1)
573   fi
574 fi
575
576 if test $space = no; then
577 # AIX
578   AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
579 member (AIX, 4.3BSD)])
580   AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
581   [AC_TRY_RUN([
582 #ifdef HAVE_SYS_PARAM_H
583 #include <sys/param.h>
584 #endif
585 #ifdef HAVE_SYS_MOUNT_H
586 #include <sys/mount.h>
587 #endif
588 #ifdef HAVE_SYS_VFS_H
589 #include <sys/vfs.h>
590 #endif
591   main ()
592   {
593   struct statfs fsd;
594   fsd.f_bsize = 0;
595   exit (statfs (".", &fsd));
596   }],
597   fu_cv_sys_stat_statfs2_bsize=yes,
598   fu_cv_sys_stat_statfs2_bsize=no,
599   fu_cv_sys_stat_statfs2_bsize=no)])
600   AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
601   if test $fu_cv_sys_stat_statfs2_bsize = yes; then
602     space=yes
603     AC_DEFINE(STAT_STATFS2_BSIZE)
604   fi
605 fi
606
607 if test $space = no; then
608 # SVR3
609   AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
610   AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
611   [AC_TRY_RUN([#include <sys/types.h>
612 #include <sys/statfs.h>
613   main ()
614   {
615   struct statfs fsd;
616   exit (statfs (".", &fsd, sizeof fsd, 0));
617   }],
618     fu_cv_sys_stat_statfs4=yes,
619     fu_cv_sys_stat_statfs4=no,
620     fu_cv_sys_stat_statfs4=no)])
621   AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
622   if test $fu_cv_sys_stat_statfs4 = yes; then
623     space=yes
624     AC_DEFINE(STAT_STATFS4)
625   fi
626 fi
627
628 if test $space = no; then
629 # 4.4BSD and NetBSD
630   AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
631 member (4.4BSD and NetBSD)])
632   AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
633   [AC_TRY_RUN([#include <sys/types.h>
634 #ifdef HAVE_SYS_PARAM_H
635 #include <sys/param.h>
636 #endif
637 #ifdef HAVE_SYS_MOUNT_H
638 #include <sys/mount.h>
639 #endif
640   main ()
641   {
642   struct statfs fsd;
643   fsd.f_fsize = 0;
644   exit (statfs (".", &fsd));
645   }],
646   fu_cv_sys_stat_statfs2_fsize=yes,
647   fu_cv_sys_stat_statfs2_fsize=no,
648   fu_cv_sys_stat_statfs2_fsize=no)])
649   AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
650   if test $fu_cv_sys_stat_statfs2_fsize = yes; then
651     space=yes
652     AC_DEFINE(STAT_STATFS2_FSIZE)
653   fi
654 fi
655
656 if test $space = no; then
657   # Ultrix
658   AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
659   AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
660   [AC_TRY_RUN([#include <sys/types.h>
661 #ifdef HAVE_SYS_PARAM_H
662 #include <sys/param.h>
663 #endif
664 #ifdef HAVE_SYS_MOUNT_H
665 #include <sys/mount.h>
666 #endif
667 #ifdef HAVE_SYS_FS_TYPES_H
668 #include <sys/fs_types.h>
669 #endif
670   main ()
671   {
672   struct fs_data fsd;
673   /* Ultrix's statfs returns 1 for success,
674      0 for not mounted, -1 for failure.  */
675   exit (statfs (".", &fsd) != 1);
676   }],
677   fu_cv_sys_stat_fs_data=yes,
678   fu_cv_sys_stat_fs_data=no,
679   fu_cv_sys_stat_fs_data=no)])
680   AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
681   if test $fu_cv_sys_stat_fs_data = yes; then
682     space=yes
683     AC_DEFINE(STAT_STATFS2_FS_DATA)
684   fi
685 fi
686
687
688 AC_OUTPUT(Makefile tests/dummy client/dummy lib/dummy ubiqx/dummy
689 web/dummy param/dummy nmbd/dummy smbd/dummy rpc_server/dummy
690 rpc_parse/dummy script/dummy include/dummy codepages/dummy
691 libsmb/dummy bin/dummy printing/dummy)