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