1 dnl Process this file with autoconf to produce a configure script.
3 AC_CONFIG_HEADER(config.h)
5 dnl Checks for programs.
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);;
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 net/if.h)
32 AC_CHECK_HEADERS(compat.h sys/param.h ctype.h sys/wait.h sys/ioctl.h)
33 AC_CHECK_HEADERS(sys/filio.h string.h stdlib.h sys/socket.h sys/mode.h)
34 AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h)
35 AC_CHECK_HEADERS(sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h)
36 AC_CHECK_HEADERS(shadow.h netinet/tcp.h sys/security.h security/pam_appl.h)
40 AC_CHECK_SIZEOF(short)
54 AC_CHECK_TYPE(ino_t,unsigned)
56 echo $ac_n "checking for errno in errno.h... $ac_c"
57 AC_TRY_COMPILE([#include <errno.h>],[int i = errno],
58 echo yes; AC_DEFINE(HAVE_ERRNO_DECL),
63 ###############################################
64 # test for where we get crypt() from
65 if test "$ac_cv_lib_crypt_crypt" = "yes"; then
66 AC_CHECK_LIB(crypt, crypt)
69 if test "$ac_cv_lib_crypt_crypt" = "no" ||
70 test "$ac_cv_lib_crypt_crypt" = ""; then
72 AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT),
75 *) AC_CHECK_LIB(crypt, crypt) ;;
77 if test "$ac_cv_lib_crypt_crypt" = "yes"; then
84 ###############################################
85 # test for where we get pam_authenticate() from
86 # might need libdl for this to work
87 if test "$ac_cv_header_security_pam_appl_h" = "yes"; then
90 if test "$ac_cv_lib_pam_pam_authenticate" = "yes"; then
91 AC_CHECK_LIB(pam, pam_authenticate)
92 AC_DEFINE(HAVE_PAM_AUTHENTICATE)
94 if test "$ac_cv_lib_pam_pam_authenticate" = "no" ||
95 test "$ac_cv_lib_pam_pam_authenticate" = ""; then
96 # look for pam_authenticate
97 AC_CHECK_FUNC(pam_authenticate, AC_DEFINE(HAVE_PAM_AUTHENTICATE),
100 *) AC_CHECK_LIB(pam, pam_authenticate) ;;
102 if test "$ac_cv_lib_pam_pam_authenticate" = "yes"; then
103 ac_cv_func_pam_authenticate=yes
104 AC_DEFINE(HAVE_PAM_AUTHENTICATE)
109 AC_CHECK_FUNCS(waitpid getcwd strdup strerror chown chmod chroot)
110 AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync execl)
111 AC_CHECK_FUNCS(memmove vsnprintf setsid glob strpbrk pipe crypt16 getauthuid)
112 AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction innetgr)
113 AC_CHECK_FUNCS(initgroups select rdchk getgrnam pathconf putprpwnam)
114 AC_CHECK_FUNCS(setresuid setuidx setgroups mktime rename ftruncate)
115 AC_CHECK_FUNCS(set_auth_parameters atexit grantpt getspnam dup2)
116 AC_CHECK_FUNCS(bigcrypt getprpwnam setluid yp_get_default_domain)
118 echo $ac_n "checking for long long ... $ac_c"
119 AC_TRY_RUN([#include <stdio.h>
120 main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
121 echo yes;AC_DEFINE(HAVE_LONGLONG),
124 echo $ac_n "checking for off64_t ... $ac_c"
125 AC_TRY_RUN([#include <stdio.h>
126 #include <sys/stat.h>
127 main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
128 echo yes;AC_DEFINE(HAVE_OFF64_T),
131 echo $ac_n "checking for union semun ... $ac_c"
133 #include <sys/types.h>
136 main() { union semun ss; exit(0); }],
137 echo yes;AC_DEFINE(HAVE_UNION_SEMUN),
140 echo $ac_n "checking for unsigned char ... $ac_c"
141 AC_TRY_RUN([#include <stdio.h>
142 main() { char c; c=250; exit((c > 0)?0:1); }],
143 echo yes;AC_DEFINE(HAVE_UNSIGNED_CHAR),
146 echo $ac_n "checking for sin_len in sock ... $ac_c"
147 AC_TRY_COMPILE([#include <sys/types.h>
148 #include <sys/socket.h>],
149 [struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
150 echo yes;AC_DEFINE(HAVE_SOCK_SIN_LEN),
153 echo $ac_n "checking if gettimeofday takes tz argument ... $ac_c"
155 #include <sys/time.h>
157 main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}],
158 echo yes;AC_DEFINE(HAVE_GETTIMEOFDAY_TZ),
162 echo $ac_n "checking for broken readdir ... $ac_c"
163 AC_TRY_RUN([#include <sys/types.h>
165 main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
166 if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
167 di->d_name[0] == 0) exit(0); exit(1);} ],
168 echo yes - you are using the broken /usr/ucb/cc;AC_DEFINE(HAVE_BROKEN_READDIR),
171 echo $ac_n "checking for utimbuf ... $ac_c"
172 AC_TRY_COMPILE([#include <sys/types.h>
174 [struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf));],
175 echo yes;AC_DEFINE(HAVE_UTIMBUF),
178 echo $ac_n "checking for ftruncate extend ... $ac_c"
179 AC_TRY_RUN([#include "tests/ftruncate.c"],
180 echo yes;AC_DEFINE(HAVE_FTRUNCATE_EXTEND),
183 # The following test taken from the cvs sources
184 # If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
185 # The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
186 # libsocket.so which has a bad implementation of gethostbyname (it
187 # only looks in /etc/hosts), so we only look for -lsocket if we need
189 AC_CHECK_FUNC(connect, :,
192 *) AC_CHECK_LIB(nsl_s, printf) ;;
196 *) AC_CHECK_LIB(nsl, printf) ;;
200 *) AC_CHECK_LIB(socket, connect) ;;
204 *) AC_CHECK_LIB(inet, connect) ;;
206 dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value
208 if test "$ac_cv_lib_socket_connect" = "yes" ||
209 test "$ac_cv_lib_inet_connect" = "yes"; then
210 ac_cv_func_connect=yes
211 AC_DEFINE(HAVE_CONNECT)
214 echo $ac_n "checking for broken getgroups ... $ac_c"
215 AC_TRY_RUN([#include "tests/getgroups.c"],
216 echo yes;AC_DEFINE(HAVE_BROKEN_GETGROUPS),
220 echo $ac_n "checking for root ... $ac_c"
221 AC_TRY_RUN([main() { exit(getuid() != 0); }],
222 echo yes;AC_DEFINE(HAVE_ROOT),
223 echo WARNING: running as non-root will disable some tests;)
226 echo $ac_n "checking for netmask ifconf ... $ac_c"
228 #define HAVE_NETMASK_IFCONF 1
230 #include "netmask.c"],
231 echo yes;netmask=yes;AC_DEFINE(HAVE_NETMASK_IFCONF),
234 if test $netmask = no; then
235 echo $ac_n "checking for netmask ifreq ... $ac_c"
237 #define HAVE_NETMASK_IFREQ 1
239 #include "netmask.c"],
240 echo yes;netmask=yes;AC_DEFINE(HAVE_NETMASK_IFREQ),
244 if test $netmask = no; then
245 echo $ac_n "checking for netmask AIX ... $ac_c"
247 #define HAVE_NETMASK_AIX 1
249 #include "netmask.c"],
250 echo yes;netmask=yes;AC_DEFINE(HAVE_NETMASK_AIX),
254 echo $ac_n "checking for trapdoor seteuid ... $ac_c"
255 AC_TRY_RUN([#include "tests/trapdoor.c"],
257 echo yes;AC_DEFINE(HAVE_TRAPDOOR_UID))
259 echo $ac_n "checking for shared mmap ... $ac_c"
260 AC_TRY_RUN([#include "tests/shared_mmap.c"],
261 echo yes;AC_DEFINE(HAVE_SHARED_MMAP),
264 echo $ac_n "checking for fcntl locking ... $ac_c"
265 AC_TRY_RUN([#include "tests/fcntl_lock.c"],
266 echo yes;AC_DEFINE(HAVE_FCNTL_LOCK),
269 echo $ac_n "checking for sysv ipc ... $ac_c"
270 AC_TRY_RUN([#include "tests/sysv_ipc.c"],
271 echo yes;AC_DEFINE(HAVE_SYSV_IPC),
274 #################################################
275 # check for the AFS filesystem
276 AC_MSG_CHECKING(whether to use AFS)
278 [ --with-afs Include AFS support
279 --without-afs Don't include AFS support (default)],
293 #################################################
294 # check for the DFS auth system
295 AC_MSG_CHECKING(whether to use DFS auth)
297 [ --with-dfs Include DFS support
298 --without-dfs Don't include DFS support (default)],
311 #################################################
312 # check for automount support
313 AC_MSG_CHECKING(whether to use AUTOMOUNT)
314 AC_ARG_WITH(automount,
315 [ --with-automount Include AUTOMOUNT support
316 --without-automount Don't include AUTOMOUNT support (default)],
320 AC_DEFINE(WITH_AUTOMOUNT)
329 #################################################
330 # check for a LDAP password database
331 AC_MSG_CHECKING(whether to use LDAP password database)
333 [ --with-ldap Include LDAP support
334 --without-ldap Don't include LDAP support (default)],
347 #################################################
348 # check for a NISPLUS password database
349 AC_MSG_CHECKING(whether to use NISPLUS password database)
351 [ --with-nisplus Include NISPLUS password database support
352 --without-nisplus Don't include NISPLUS password database support (default)],
356 AC_DEFINE(WITH_NISPLUS)
365 #################################################
366 # check for the secure socket layer
367 AC_MSG_CHECKING(whether to use SSL)
369 [ --with-ssl Include SSL support
370 --without-ssl Don't include SSL support (default)],
383 #################################################
384 # check for experimental mmap support
385 AC_MSG_CHECKING(whether to use MMAP)
387 [ --with-mmap Include experimental MMAP support
388 --without-mmap Don't include MMAP support (default)],
401 #################################################
402 # check for syslog logging
403 AC_MSG_CHECKING(whether to use syslog logging)
405 [ --with-syslog Include experimental SYSLOG support
406 --without-syslog Don't include SYSLOG support (default)],
410 AC_DEFINE(WITH_SYSLOG)
420 #################################################
421 # these tests are taken from the GNU fileutils package
422 AC_CHECKING(how to get filesystem space usage)
425 # Perform only the link test since it seems there are no variants of the
426 # statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
427 # because that got a false positive on SCO OSR5. Adding the declaration
428 # of a `struct statvfs' causes this test to fail (as it should) on such
429 # systems. That system is reported to work fine with STAT_STATFS4 which
430 # is what it gets when this test fails.
431 if test $space = no; then
433 AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
434 [AC_TRY_LINK([#include <sys/types.h>
435 #include <sys/statvfs.h>],
436 [struct statvfs fsd; statvfs (0, &fsd);],
437 fu_cv_sys_stat_statvfs=yes,
438 fu_cv_sys_stat_statvfs=no)])
439 if test $fu_cv_sys_stat_statvfs = yes; then
441 AC_DEFINE(STAT_STATVFS)
445 if test $space = no; then
446 # DEC Alpha running OSF/1
447 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
448 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
450 #include <sys/param.h>
451 #include <sys/types.h>
452 #include <sys/mount.h>
457 exit (statfs (".", &fsd, sizeof (struct statfs)));
459 fu_cv_sys_stat_statfs3_osf1=yes,
460 fu_cv_sys_stat_statfs3_osf1=no,
461 fu_cv_sys_stat_statfs3_osf1=no)])
462 AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
463 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
465 AC_DEFINE(STAT_STATFS3_OSF1)
469 if test $space = no; then
471 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
472 member (AIX, 4.3BSD)])
473 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
475 #ifdef HAVE_SYS_PARAM_H
476 #include <sys/param.h>
478 #ifdef HAVE_SYS_MOUNT_H
479 #include <sys/mount.h>
481 #ifdef HAVE_SYS_VFS_H
488 exit (statfs (".", &fsd));
490 fu_cv_sys_stat_statfs2_bsize=yes,
491 fu_cv_sys_stat_statfs2_bsize=no,
492 fu_cv_sys_stat_statfs2_bsize=no)])
493 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
494 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
496 AC_DEFINE(STAT_STATFS2_BSIZE)
500 if test $space = no; then
502 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
503 AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
504 [AC_TRY_RUN([#include <sys/types.h>
505 #include <sys/statfs.h>
509 exit (statfs (".", &fsd, sizeof fsd, 0));
511 fu_cv_sys_stat_statfs4=yes,
512 fu_cv_sys_stat_statfs4=no,
513 fu_cv_sys_stat_statfs4=no)])
514 AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
515 if test $fu_cv_sys_stat_statfs4 = yes; then
517 AC_DEFINE(STAT_STATFS4)
521 if test $space = no; then
523 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
524 member (4.4BSD and NetBSD)])
525 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
526 [AC_TRY_RUN([#include <sys/types.h>
527 #ifdef HAVE_SYS_PARAM_H
528 #include <sys/param.h>
530 #ifdef HAVE_SYS_MOUNT_H
531 #include <sys/mount.h>
537 exit (statfs (".", &fsd));
539 fu_cv_sys_stat_statfs2_fsize=yes,
540 fu_cv_sys_stat_statfs2_fsize=no,
541 fu_cv_sys_stat_statfs2_fsize=no)])
542 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
543 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
545 AC_DEFINE(STAT_STATFS2_FSIZE)
549 if test $space = no; then
551 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
552 AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
553 [AC_TRY_RUN([#include <sys/types.h>
554 #ifdef HAVE_SYS_PARAM_H
555 #include <sys/param.h>
557 #ifdef HAVE_SYS_MOUNT_H
558 #include <sys/mount.h>
560 #ifdef HAVE_SYS_FS_TYPES_H
561 #include <sys/fs_types.h>
566 /* Ultrix's statfs returns 1 for success,
567 0 for not mounted, -1 for failure. */
568 exit (statfs (".", &fsd) != 1);
570 fu_cv_sys_stat_fs_data=yes,
571 fu_cv_sys_stat_fs_data=no,
572 fu_cv_sys_stat_fs_data=no)])
573 AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
574 if test $fu_cv_sys_stat_fs_data = yes; then
576 AC_DEFINE(STAT_STATFS2_FS_DATA)
581 AC_OUTPUT(Makefile tests/dummy client/dummy lib/dummy lib/rpc/dummy
582 lib/rpc/client/dummy lib/rpc/include/dummy lib/rpc/parse/dummy
583 lib/rpc/server/dummy lib/smb/dummy ubiqx/dummy web/dummy)