1 dnl Process this file with autoconf to produce a configure script.
3 AC_CONFIG_HEADER(config.h)
6 AC_VALIDATE_CACHE_SYSTEM_TYPE
8 dnl Checks for programs.
13 AC_CHECK_PROG(HAVE_REMSH, remsh, 1, 0)
14 AC_DEFINE_UNQUOTED(HAVE_REMSH, $HAVE_REMSH)
19 AC_CHECK_HEADERS(sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h unistd.h utime.h grp.h)
20 AC_CHECK_HEADERS(compat.h sys/param.h ctype.h sys/wait.h sys/ioctl.h)
21 AC_CHECK_HEADERS(sys/filio.h string.h stdlib.h sys/socket.h sys/mode.h)
22 AC_CHECK_HEADERS(glob.h)
26 AC_CHECK_SIZEOF(short)
37 AC_CHECK_TYPE(ino_t,unsigned)
39 echo $ac_n "checking for errno in errno.h... $ac_c"
40 AC_TRY_COMPILE([#include <errno.h>],[int i = errno],
41 echo yes; AC_DEFINE(HAVE_ERRNO_DECL),
46 AC_CHECK_FUNCS(mmap munmap waitpid getcwd strdup strerror chown chmod mknod)
47 AC_CHECK_FUNCS(fchmod fstat strchr readlink link utime utimes strftime)
48 AC_CHECK_FUNCS(memmove getopt_long lchown vsnprintf snprintf setsid glob strpbrk)
50 echo $ac_n "checking for working fnmatch... $ac_c"
51 AC_TRY_RUN([#include <fnmatch.h>
52 main() { exit(fnmatch("*.o", "x.o", 0) == 0? 0: 1); }],
53 echo yes;AC_DEFINE(HAVE_FNMATCH),
56 echo $ac_n "checking for long long ... $ac_c"
57 AC_TRY_RUN([#include <stdio.h>
58 main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
59 echo yes;AC_DEFINE(HAVE_LONGLONG),
62 echo $ac_n "checking for off64_t ... $ac_c"
63 AC_TRY_RUN([#include <stdio.h>
65 main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) return 1; exit((lstat64("/dev/null", &st)==0)?0:1); }],
66 echo yes;AC_DEFINE(HAVE_OFF64_T),
69 echo $ac_n "checking for short ino_t ... $ac_c"
70 AC_TRY_RUN([#include <stdio.h>
71 #include <sys/types.h>
73 main() { if (sizeof(ino_t) < sizeof(unsigned int)) return 0; return 1; }],
74 echo yes;AC_DEFINE(HAVE_SHORT_INO_T),
77 echo $ac_n "checking for unsigned char ... $ac_c"
78 AC_TRY_RUN([#include <stdio.h>
79 main() { char c; c=250; exit((c > 0)?0:1); }],
80 echo yes;AC_DEFINE(HAVE_UNSIGNED_CHAR),
83 echo $ac_n "checking for broken readdir ... $ac_c"
84 AC_TRY_RUN([#include <sys/types.h>
86 main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
87 if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
88 di->d_name[0] == 0) return 0; return 1;} ],
89 echo yes - you are using the broken /usr/ucb/cc;AC_DEFINE(HAVE_BROKEN_READDIR),
92 echo $ac_n "checking for utimbuf ... $ac_c"
93 AC_TRY_COMPILE([#include <sys/types.h>
95 [struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime = 1; return utime("foo.c",&tbuf);],
96 echo yes;AC_DEFINE(HAVE_UTIMBUF),
99 # The following test taken from the cvs sources
100 # If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
101 # The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
102 # libsocket.so which has a bad implementation of gethostbyname (it
103 # only looks in /etc/hosts), so we only look for -lsocket if we need
105 AC_CHECK_FUNC(connect, :,
108 *) AC_CHECK_LIB(nsl_s, printf) ;;
112 *) AC_CHECK_LIB(nsl, printf) ;;
116 *) AC_CHECK_LIB(socket, connect) ;;
120 *) AC_CHECK_LIB(inet, connect) ;;
122 dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value
124 if test "$ac_cv_lib_socket_connect" = "yes" ||
125 test "$ac_cv_lib_inet_connect" = "yes"; then
126 ac_cv_func_connect=yes
127 AC_DEFINE(HAVE_CONNECT)
131 AC_OUTPUT(Makefile lib/dummy zlib/dummy)