Commit | Line | Data |
---|---|---|
c627d613 AT |
1 | dnl Process this file with autoconf to produce a configure script. |
2 | AC_INIT(byteorder.h) | |
3 | AC_CONFIG_HEADER(config.h) | |
4 | ||
5 | dnl Checks for programs. | |
6 | AC_PROG_CC | |
7 | AC_PROG_INSTALL | |
8 | AC_SUBST(SHELL) | |
9 | ||
7b8356d0 AT |
10 | AC_CHECK_PROG(HAVE_REMSH, remsh, 1, 0) |
11 | AC_DEFINE_UNQUOTED(HAVE_REMSH, $HAVE_REMSH) | |
12 | ||
c627d613 | 13 | AC_HEADER_DIRENT |
c627d613 AT |
14 | AC_HEADER_TIME |
15 | AC_HEADER_SYS_WAIT | |
8bf73749 | 16 | AC_CHECK_HEADERS(sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h unistd.h utime.h grp.h) |
94481d91 | 17 | AC_CHECK_HEADERS(compat.h sys/param.h ctype.h sys/wait.h sys/ioctl.h) |
fdd71e17 | 18 | AC_CHECK_HEADERS(sys/filio.h string.h stdlib.h sys/socket.h sys/mode.h) |
c627d613 AT |
19 | |
20 | AC_CHECK_SIZEOF(int) | |
21 | AC_CHECK_SIZEOF(long) | |
22 | AC_CHECK_SIZEOF(short) | |
23 | ||
24 | AC_C_INLINE | |
25 | ||
26 | AC_TYPE_SIGNAL | |
27 | AC_TYPE_UID_T | |
28 | AC_TYPE_MODE_T | |
29 | AC_TYPE_OFF_T | |
30 | AC_TYPE_SIZE_T | |
31 | AC_TYPE_PID_T | |
32 | AC_STRUCT_ST_RDEV | |
dc5ddbcc | 33 | AC_CHECK_TYPE(ino_t,unsigned) |
c627d613 | 34 | |
e260d7fb | 35 | echo $ac_n "checking for errno in errno.h... $ac_c" |
c627d613 AT |
36 | AC_TRY_COMPILE([#include <errno.h>],[int i = errno], |
37 | echo yes; AC_DEFINE(HAVE_ERRNO_DECL), | |
38 | echo no) | |
39 | ||
40 | AC_FUNC_MEMCMP | |
c627d613 | 41 | AC_FUNC_UTIME_NULL |
bb0f7089 | 42 | AC_CHECK_FUNCS(mmap munmap waitpid getcwd strdup strerror chown chmod mknod) |
f5780433 | 43 | AC_CHECK_FUNCS(fchmod fstat strchr readlink link utime utimes) |
bcf5b133 | 44 | AC_CHECK_FUNCS(memmove getopt_long lchown vsnprintf setsid glob strpbrk) |
c627d613 | 45 | |
e260d7fb | 46 | echo $ac_n "checking for working fnmatch... $ac_c" |
c627d613 AT |
47 | AC_TRY_RUN([#include <fnmatch.h> |
48 | main() { exit(fnmatch("*.o", "x.o", 0) == 0? 0: 1); }], | |
49 | echo yes;AC_DEFINE(HAVE_FNMATCH), | |
50 | echo no) | |
51 | ||
3bee6733 | 52 | echo $ac_n "checking for long long ... $ac_c" |
0d0e2e93 | 53 | AC_TRY_RUN([#include <stdio.h> |
efb2f6bf | 54 | main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }], |
0d0e2e93 AT |
55 | echo yes;AC_DEFINE(HAVE_LONGLONG), |
56 | echo no) | |
57 | ||
bcacc18b AT |
58 | echo $ac_n "checking for off64_t ... $ac_c" |
59 | AC_TRY_RUN([#include <stdio.h> | |
60 | #include <sys/stat.h> | |
fa37d4bb | 61 | main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) return 1; exit((lstat64("/dev/null", &st)==0)?0:1); }], |
debb4505 AT |
62 | echo yes;AC_DEFINE(HAVE_OFF64_T), |
63 | echo no) | |
64 | ||
c29ee43d AT |
65 | echo $ac_n "checking for short ino_t ... $ac_c" |
66 | AC_TRY_RUN([#include <stdio.h> | |
67 | #include <sys/types.h> | |
68 | #include <sys/stat.h> | |
69 | main() { if (sizeof(ino_t) < sizeof(unsigned int)) return 0; return 1; }], | |
70 | echo yes;AC_DEFINE(HAVE_SHORT_INO_T), | |
71 | echo no) | |
72 | ||
debb4505 AT |
73 | echo $ac_n "checking for unsigned char ... $ac_c" |
74 | AC_TRY_RUN([#include <stdio.h> | |
75 | main() { char c; c=250; exit((c > 0)?0:1); }], | |
76 | echo yes;AC_DEFINE(HAVE_UNSIGNED_CHAR), | |
bcacc18b AT |
77 | echo no) |
78 | ||
59503278 AT |
79 | echo $ac_n "checking for broken readdir ... $ac_c" |
80 | AC_TRY_RUN([#include <sys/types.h> | |
81 | #include <dirent.h> | |
82 | main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d); | |
83 | if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 && | |
84 | di->d_name[0] == 0) return 0; return 1;} ], | |
94f3c3b0 | 85 | echo yes - you are using the broken /usr/ucb/cc;AC_DEFINE(HAVE_BROKEN_READDIR), |
1e9f155a AT |
86 | echo no) |
87 | ||
59503278 | 88 | echo $ac_n "checking for utimbuf ... $ac_c" |
d6e6ecbd AT |
89 | AC_TRY_COMPILE([#include <sys/types.h> |
90 | #include <utime.h>], | |
91 | [struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime = 1; return utime("foo.c",&tbuf);], | |
92 | echo yes;AC_DEFINE(HAVE_UTIMBUF), | |
93 | echo no) | |
94 | ||
8ef4ffd6 | 95 | # The following test taken from the cvs sources |
7d29d4ba AT |
96 | # If we can't find connect, try looking in -lsocket, -lnsl, and -linet. |
97 | # The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has | |
98 | # libsocket.so which has a bad implementation of gethostbyname (it | |
99 | # only looks in /etc/hosts), so we only look for -lsocket if we need | |
100 | # it. | |
101 | AC_CHECK_FUNC(connect, :, | |
102 | [case "$LIBS" in | |
103 | *-lnsl*) ;; | |
104 | *) AC_CHECK_LIB(nsl_s, printf) ;; | |
105 | esac | |
106 | case "$LIBS" in | |
107 | *-lnsl*) ;; | |
108 | *) AC_CHECK_LIB(nsl, printf) ;; | |
109 | esac | |
110 | case "$LIBS" in | |
111 | *-lsocket*) ;; | |
112 | *) AC_CHECK_LIB(socket, connect) ;; | |
113 | esac | |
114 | case "$LIBS" in | |
115 | *-linet*) ;; | |
116 | *) AC_CHECK_LIB(inet, connect) ;; | |
117 | esac | |
118 | dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value | |
119 | dnl has been cached. | |
c596dad1 AT |
120 | if test "$ac_cv_lib_socket_connect" = "yes" || |
121 | test "$ac_cv_lib_inet_connect" = "yes"; then | |
7d29d4ba AT |
122 | ac_cv_func_connect=yes |
123 | AC_DEFINE(HAVE_CONNECT) | |
124 | fi]) | |
125 | ||
126 | ||
db199cfa | 127 | AC_OUTPUT(Makefile lib/dummy zlib/dummy) |