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