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