spruced up SWAT a bit - it now uses the new Samba logo at the top and
[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)
164 AC_CHECK_FUNCS(set_auth_parameters atexit grantpt getspnam dup2)
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 off64_t ... $ac_c"
174 AC_TRY_RUN([#include <stdio.h>
175 #include <sys/stat.h>
176 main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
177 echo yes;AC_DEFINE(HAVE_OFF64_T), 
178 echo no)
179
180 echo $ac_n "checking for union semun ... $ac_c"
181 AC_TRY_RUN([
182 #include <sys/types.h>
183 #include <sys/ipc.h>
184 #include <sys/sem.h>
185 main() { union semun ss; exit(0); }],
186 echo yes;AC_DEFINE(HAVE_UNION_SEMUN), 
187 echo no)
188
189 echo $ac_n "checking for unsigned char ... $ac_c"
190 AC_TRY_RUN([#include <stdio.h>
191 main() { char c; c=250; exit((c > 0)?0:1); }],
192 echo yes;AC_DEFINE(HAVE_UNSIGNED_CHAR), 
193 echo no)
194
195 echo $ac_n "checking for sin_len in sock ... $ac_c"
196 AC_TRY_COMPILE([#include <sys/types.h>
197 #include <sys/socket.h>
198 #include <netinet/in.h>],
199 [struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
200 echo yes;AC_DEFINE(HAVE_SOCK_SIN_LEN), 
201 echo no)
202
203 echo $ac_n "checking for __FILE__ macro ... $ac_c"
204 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FILE__);],
205 echo yes;AC_DEFINE(HAVE_FILE_MACRO), 
206 echo no)
207
208 echo $ac_n "checking for __FUNCTION__ macro ... $ac_c"
209 AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FUNCTION__);],
210 echo yes;AC_DEFINE(HAVE_FUNCTION_MACRO), 
211 echo no)
212
213 echo $ac_n "checking if gettimeofday takes tz argument ... $ac_c"
214 AC_TRY_RUN([
215 #include <sys/time.h>
216 #include <unistd.h>
217 main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}],
218            echo yes;AC_DEFINE(HAVE_GETTIMEOFDAY_TZ),
219            echo no)
220
221
222 echo $ac_n "checking for broken readdir ... $ac_c"
223 AC_TRY_RUN([#include <sys/types.h>
224 #include <dirent.h>
225 main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
226 if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
227 di->d_name[0] == 0) exit(0); exit(1);} ],
228 echo yes - you are using the broken /usr/ucb/cc;AC_DEFINE(HAVE_BROKEN_READDIR), 
229 echo no)
230
231 echo $ac_n "checking for utimbuf ... $ac_c"
232 AC_TRY_COMPILE([#include <sys/types.h>
233 #include <utime.h>],
234 [struct utimbuf tbuf;  tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf));],
235 echo yes;AC_DEFINE(HAVE_UTIMBUF), 
236 echo no)
237
238 echo $ac_n "checking for ftruncate extend ... $ac_c"
239 AC_TRY_RUN([#include "tests/ftruncate.c"],
240            echo yes;AC_DEFINE(HAVE_FTRUNCATE_EXTEND), 
241            echo no)
242
243 echo $ac_n "checking for broken getgroups ... $ac_c"
244 AC_TRY_RUN([#include "tests/getgroups.c"],
245            echo yes;AC_DEFINE(HAVE_BROKEN_GETGROUPS), 
246            echo no)
247
248
249 echo $ac_n "checking for broken inet_ntoa ... $ac_c"
250 AC_TRY_RUN([
251 #include <stdio.h>
252 #include <sys/types.h>
253 #include <netinet/in.h>
254 #include <arpa/inet.h>
255 main() { struct in_addr ip; ip.s_addr = 0x12345678;
256 if (strcmp(inet_ntoa(ip),"18.52.86.120") &&
257     strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); } 
258 exit(1);}],
259            echo yes;AC_DEFINE(REPLACE_INET_NTOA), 
260            echo no)
261
262 echo $ac_n "checking for root ... $ac_c"
263 AC_TRY_RUN([main() { exit(getuid() != 0); }],
264            echo yes;AC_DEFINE(HAVE_ROOT), 
265            echo WARNING: running as non-root will disable some tests;)
266
267 netmask=no;
268 echo $ac_n "checking for netmask ifconf ... $ac_c"
269 AC_TRY_RUN([
270 #define HAVE_NETMASK_IFCONF 1
271 #define AUTOCONF 1
272 #include "lib/netmask.c"],
273            echo yes;netmask=yes;AC_DEFINE(HAVE_NETMASK_IFCONF),
274            echo no)
275
276 if test $netmask = no; then
277 echo $ac_n "checking for netmask ifreq ... $ac_c"
278 AC_TRY_RUN([
279 #define HAVE_NETMASK_IFREQ 1
280 #define AUTOCONF 1
281 #include "lib/netmask.c"],
282            echo yes;netmask=yes;AC_DEFINE(HAVE_NETMASK_IFREQ),
283            echo no)
284 fi
285
286 if test $netmask = no; then
287 echo $ac_n "checking for netmask AIX ... $ac_c"
288 AC_TRY_RUN([
289 #define HAVE_NETMASK_AIX 1
290 #define AUTOCONF 1
291 #include "lib/netmask.c"],
292            echo yes;netmask=yes;AC_DEFINE(HAVE_NETMASK_AIX),
293            echo no)
294 fi
295
296 echo $ac_n "checking for trapdoor seteuid ... $ac_c"
297 AC_TRY_RUN([#include "tests/trapdoor.c"],
298            echo no,
299            echo yes;AC_DEFINE(HAVE_TRAPDOOR_UID))
300
301 echo $ac_n "checking for shared mmap ... $ac_c"
302 AC_TRY_RUN([#include "tests/shared_mmap.c"],
303            echo yes;AC_DEFINE(HAVE_SHARED_MMAP), 
304            echo no)
305
306 echo $ac_n "checking for fcntl locking ... $ac_c"
307 AC_TRY_RUN([#include "tests/fcntl_lock.c"],
308            echo yes;AC_DEFINE(HAVE_FCNTL_LOCK), 
309            echo no)
310
311 echo $ac_n "checking for sysv ipc ... $ac_c"
312 AC_TRY_RUN([#include "tests/sysv_ipc.c"],
313            echo yes;AC_DEFINE(HAVE_SYSV_IPC), 
314            echo no)
315
316 #################################################
317 # check for the AFS filesystem
318 AC_MSG_CHECKING(whether to use AFS)
319 AC_ARG_WITH(afs,
320 [  --with-afs     Include AFS support
321   --without-afs  Don't include AFS support (default)],
322 [ case "$withval" in
323   yes)
324     AC_MSG_RESULT(yes)
325     AC_DEFINE(WITH_AFS)
326     ;;
327   *)
328     AC_MSG_RESULT(no)
329     ;;
330   esac ],
331   AC_MSG_RESULT(no)
332 )
333
334
335 #################################################
336 # check for the DFS auth system
337 AC_MSG_CHECKING(whether to use DFS auth)
338 AC_ARG_WITH(dfs,
339 [  --with-dfs     Include DFS support
340   --without-dfs  Don't include DFS support (default)],
341 [ case "$withval" in
342   yes)
343     AC_MSG_RESULT(yes)
344     AC_DEFINE(WITH_DFS)
345     ;;
346   *)
347     AC_MSG_RESULT(no)
348     ;;
349   esac ],
350   AC_MSG_RESULT(no)
351 )
352
353 #################################################
354 # check for automount support
355 AC_MSG_CHECKING(whether to use AUTOMOUNT)
356 AC_ARG_WITH(automount,
357 [  --with-automount     Include AUTOMOUNT support
358   --without-automount  Don't include AUTOMOUNT support (default)],
359 [ case "$withval" in
360   yes)
361     AC_MSG_RESULT(yes)
362     AC_DEFINE(WITH_AUTOMOUNT)
363     ;;
364   *)
365     AC_MSG_RESULT(no)
366     ;;
367   esac ],
368   AC_MSG_RESULT(no)
369 )
370
371 #################################################
372 # check for a LDAP password database
373 AC_MSG_CHECKING(whether to use LDAP password database)
374 AC_ARG_WITH(ldap,
375 [  --with-ldap     Include LDAP support
376   --without-ldap  Don't include LDAP support (default)],
377 [ case "$withval" in
378   yes)
379     AC_MSG_RESULT(yes)
380     AC_DEFINE(WITH_LDAP)
381     ;;
382   *)
383     AC_MSG_RESULT(no)
384     ;;
385   esac ],
386   AC_MSG_RESULT(no)
387 )
388
389 #################################################
390 # check for a NISPLUS password database
391 AC_MSG_CHECKING(whether to use NISPLUS password database)
392 AC_ARG_WITH(nisplus,
393 [  --with-nisplus     Include NISPLUS password database support
394   --without-nisplus  Don't include NISPLUS password database support (default)],
395 [ case "$withval" in
396   yes)
397     AC_MSG_RESULT(yes)
398     AC_DEFINE(WITH_NISPLUS)
399     ;;
400   *)
401     AC_MSG_RESULT(no)
402     ;;
403   esac ],
404   AC_MSG_RESULT(no)
405 )
406
407 #################################################
408 # check for a NISPLUS_HOME support 
409 AC_MSG_CHECKING(whether to use NISPLUS_HOME)
410 AC_ARG_WITH(nisplus-home,
411 [  --with-nisplus-home     Include NISPLUS_HOME support
412   --without-nisplus-home  Don't include NISPLUS_HOME support (default)],
413 [ case "$withval" in
414   yes)
415     AC_MSG_RESULT(yes)
416     AC_DEFINE(WITH_NISPLUS_HOME)
417     ;;
418   *)
419     AC_MSG_RESULT(no)
420     ;;
421   esac ],
422   AC_MSG_RESULT(no)
423 )
424
425 #################################################
426 # check for the secure socket layer
427 AC_MSG_CHECKING(whether to use SSL)
428 AC_ARG_WITH(ssl,
429 [  --with-ssl     Include SSL support
430   --without-ssl  Don't include SSL support (default)],
431 [ case "$withval" in
432   yes)
433     AC_MSG_RESULT(yes)
434     AC_DEFINE(WITH_SSL)
435     ;;
436   *)
437     AC_MSG_RESULT(no)
438     ;;
439   esac ],
440   AC_MSG_RESULT(no)
441 )
442
443 #################################################
444 # check for experimental mmap support
445 AC_MSG_CHECKING(whether to use MMAP)
446 AC_ARG_WITH(mmap,
447 [  --with-mmap     Include experimental MMAP support
448   --without-mmap  Don't include MMAP support (default)],
449 [ case "$withval" in
450   yes)
451     AC_MSG_RESULT(yes)
452     AC_DEFINE(WITH_MMAP)
453     ;;
454   *)
455     AC_MSG_RESULT(no)
456     ;;
457   esac ],
458   AC_MSG_RESULT(no)
459 )
460
461 #################################################
462 # check for syslog logging
463 AC_MSG_CHECKING(whether to use syslog logging)
464 AC_ARG_WITH(syslog,
465 [  --with-syslog     Include experimental SYSLOG support
466   --without-syslog  Don't include SYSLOG support (default)],
467 [ case "$withval" in
468   yes)
469     AC_MSG_RESULT(yes)
470     AC_DEFINE(WITH_SYSLOG)
471     ;;
472   *)
473     AC_MSG_RESULT(no)
474     ;;
475   esac ],
476   AC_MSG_RESULT(no)
477 )
478
479 #################################################
480 # check for experimental netatalk resource fork support
481 AC_MSG_CHECKING(whether to support netatalk)
482 AC_ARG_WITH(netatalk,
483 [  --with-netatalk     Include experimental Netatalk support
484   --without-netatalk  Don't include experimental Netatalk support (default)],
485 [ case "$withval" in
486   yes)
487     AC_MSG_RESULT(yes)
488     AC_DEFINE(WITH_NETATALK)
489     ;;
490   *)
491     AC_MSG_RESULT(no)
492     ;;
493   esac ],
494   AC_MSG_RESULT(no)
495 )
496
497
498 #################################################
499 # these tests are taken from the GNU fileutils package
500 AC_CHECKING(how to get filesystem space usage)
501 space=no
502
503 # Perform only the link test since it seems there are no variants of the
504 # statvfs function.  This check is more than just AC_CHECK_FUNCS(statvfs)
505 # because that got a false positive on SCO OSR5.  Adding the declaration
506 # of a `struct statvfs' causes this test to fail (as it should) on such
507 # systems.  That system is reported to work fine with STAT_STATFS4 which
508 # is what it gets when this test fails.
509 if test $space = no; then
510   # SVR4
511   AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
512                  [AC_TRY_LINK([#include <sys/types.h>
513 #include <sys/statvfs.h>],
514                               [struct statvfs fsd; statvfs (0, &fsd);],
515                               fu_cv_sys_stat_statvfs=yes,
516                               fu_cv_sys_stat_statvfs=no)])
517   if test $fu_cv_sys_stat_statvfs = yes; then
518     space=yes
519     AC_DEFINE(STAT_STATVFS)
520   fi
521 fi
522
523 if test $space = no; then
524   # DEC Alpha running OSF/1
525   AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
526   AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
527   [AC_TRY_RUN([
528 #include <sys/param.h>
529 #include <sys/types.h>
530 #include <sys/mount.h>
531   main ()
532   {
533     struct statfs fsd;
534     fsd.f_fsize = 0;
535     exit (statfs (".", &fsd, sizeof (struct statfs)));
536   }],
537   fu_cv_sys_stat_statfs3_osf1=yes,
538   fu_cv_sys_stat_statfs3_osf1=no,
539   fu_cv_sys_stat_statfs3_osf1=no)])
540   AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
541   if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
542     space=yes
543     AC_DEFINE(STAT_STATFS3_OSF1)
544   fi
545 fi
546
547 if test $space = no; then
548 # AIX
549   AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
550 member (AIX, 4.3BSD)])
551   AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
552   [AC_TRY_RUN([
553 #ifdef HAVE_SYS_PARAM_H
554 #include <sys/param.h>
555 #endif
556 #ifdef HAVE_SYS_MOUNT_H
557 #include <sys/mount.h>
558 #endif
559 #ifdef HAVE_SYS_VFS_H
560 #include <sys/vfs.h>
561 #endif
562   main ()
563   {
564   struct statfs fsd;
565   fsd.f_bsize = 0;
566   exit (statfs (".", &fsd));
567   }],
568   fu_cv_sys_stat_statfs2_bsize=yes,
569   fu_cv_sys_stat_statfs2_bsize=no,
570   fu_cv_sys_stat_statfs2_bsize=no)])
571   AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
572   if test $fu_cv_sys_stat_statfs2_bsize = yes; then
573     space=yes
574     AC_DEFINE(STAT_STATFS2_BSIZE)
575   fi
576 fi
577
578 if test $space = no; then
579 # SVR3
580   AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
581   AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
582   [AC_TRY_RUN([#include <sys/types.h>
583 #include <sys/statfs.h>
584   main ()
585   {
586   struct statfs fsd;
587   exit (statfs (".", &fsd, sizeof fsd, 0));
588   }],
589     fu_cv_sys_stat_statfs4=yes,
590     fu_cv_sys_stat_statfs4=no,
591     fu_cv_sys_stat_statfs4=no)])
592   AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
593   if test $fu_cv_sys_stat_statfs4 = yes; then
594     space=yes
595     AC_DEFINE(STAT_STATFS4)
596   fi
597 fi
598
599 if test $space = no; then
600 # 4.4BSD and NetBSD
601   AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
602 member (4.4BSD and NetBSD)])
603   AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
604   [AC_TRY_RUN([#include <sys/types.h>
605 #ifdef HAVE_SYS_PARAM_H
606 #include <sys/param.h>
607 #endif
608 #ifdef HAVE_SYS_MOUNT_H
609 #include <sys/mount.h>
610 #endif
611   main ()
612   {
613   struct statfs fsd;
614   fsd.f_fsize = 0;
615   exit (statfs (".", &fsd));
616   }],
617   fu_cv_sys_stat_statfs2_fsize=yes,
618   fu_cv_sys_stat_statfs2_fsize=no,
619   fu_cv_sys_stat_statfs2_fsize=no)])
620   AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
621   if test $fu_cv_sys_stat_statfs2_fsize = yes; then
622     space=yes
623     AC_DEFINE(STAT_STATFS2_FSIZE)
624   fi
625 fi
626
627 if test $space = no; then
628   # Ultrix
629   AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
630   AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
631   [AC_TRY_RUN([#include <sys/types.h>
632 #ifdef HAVE_SYS_PARAM_H
633 #include <sys/param.h>
634 #endif
635 #ifdef HAVE_SYS_MOUNT_H
636 #include <sys/mount.h>
637 #endif
638 #ifdef HAVE_SYS_FS_TYPES_H
639 #include <sys/fs_types.h>
640 #endif
641   main ()
642   {
643   struct fs_data fsd;
644   /* Ultrix's statfs returns 1 for success,
645      0 for not mounted, -1 for failure.  */
646   exit (statfs (".", &fsd) != 1);
647   }],
648   fu_cv_sys_stat_fs_data=yes,
649   fu_cv_sys_stat_fs_data=no,
650   fu_cv_sys_stat_fs_data=no)])
651   AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
652   if test $fu_cv_sys_stat_fs_data = yes; then
653     space=yes
654     AC_DEFINE(STAT_STATFS2_FS_DATA)
655   fi
656 fi
657
658
659 AC_OUTPUT(Makefile tests/dummy client/dummy lib/dummy ubiqx/dummy
660 web/dummy param/dummy nmbd/dummy smbd/dummy rpc_server/dummy
661 rpc_parse/dummy script/dummy include/dummy codepages/dummy
662 libsmb/dummy bin/dummy printing/dummy)