Mercurial > hg > nginx-ranges
comparison auto/unix @ 0:f0b350454894 NGINX_0_1_0
nginx 0.1.0
*) The first public version.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 04 Oct 2004 00:00:00 +0400 |
parents | |
children | 4b2dafa26fe2 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0b350454894 |
---|---|
1 | |
2 # Copyright (C) Igor Sysoev | |
3 | |
4 | |
5 CC_WARN=$CC | |
6 ngx_fmt_collect=yes | |
7 | |
8 # C types | |
9 | |
10 ngx_type="int"; . auto/types/sizeof | |
11 ngx_formats="%d"; . auto/fmt/fmt | |
12 | |
13 ngx_type="long"; . auto/types/sizeof | |
14 ngx_formats="%ld"; . auto/fmt/fmt | |
15 | |
16 ngx_type="long long"; . auto/types/sizeof | |
17 ngx_formats="%lld %qd"; . auto/fmt/fmt | |
18 | |
19 ngx_type="void *"; . auto/types/sizeof; ngx_ptr_size=$ngx_size | |
20 ngx_fmt_name=PTR_FMT; | |
21 eval ngx_formats=\${ngx_${ngx_ptr_size}_fmt}; . auto/fmt/ptrfmt | |
22 | |
23 | |
24 # POSIX types | |
25 | |
26 NGX_AUTO_CONFIG="#include \"../$NGX_AUTO_CONFIG_H\"" | |
27 | |
28 ngx_type="uint64_t"; ngx_types="u_int64_t"; . auto/types/typedef | |
29 | |
30 ngx_type="sig_atomic_t"; ngx_types="int"; . auto/types/typedef | |
31 . auto/types/sizeof | |
32 ngx_param=SIG_ATOMIC_T_SIZE; ngx_value=$ngx_size; . auto/types/value | |
33 | |
34 ngx_type="socklen_t"; ngx_types="uint32_t"; . auto/types/typedef | |
35 | |
36 ngx_type="in_addr_t"; ngx_types="uint32_t"; . auto/types/typedef | |
37 | |
38 ngx_type="in_port_t"; ngx_types="u_short"; . auto/types/typedef | |
39 | |
40 ngx_type="rlim_t"; ngx_types="int"; . auto/types/typedef | |
41 | |
42 . auto/types/uintptr_t | |
43 | |
44 . auto/endianess | |
45 | |
46 | |
47 # printf() formats | |
48 | |
49 CC_WARN=$CC_STRONG | |
50 ngx_fmt_collect=no | |
51 | |
52 ngx_fmt_name=OFF_T_FMT; ngx_type="off_t"; . auto/types/sizeof | |
53 ngx_param=OFF_T_MAX_VALUE; ngx_value=$ngx_max_value; . auto/types/value | |
54 eval ngx_formats=\${ngx_${ngx_size}_fmt}; . auto/fmt/fmt | |
55 | |
56 ngx_fmt_name=TIME_T_FMT; ngx_type="time_t"; . auto/types/sizeof | |
57 ngx_param=TIME_T_SIZE; ngx_value=$ngx_size; . auto/types/value | |
58 ngx_param=TIME_T_LEN; ngx_value=$ngx_max_len; . auto/types/value | |
59 eval ngx_formats=\${ngx_${ngx_size}_fmt}; . auto/fmt/fmt | |
60 | |
61 ngx_fmt_name=SIZE_T_FMT; ngx_type="size_t"; . auto/types/sizeof | |
62 eval ngx_formats=\${ngx_${ngx_size}_fmt}; . auto/fmt/fmt | |
63 | |
64 ngx_fmt_name=SIZE_T_X_FMT; . auto/fmt/xfmt | |
65 | |
66 ngx_fmt_name=PID_T_FMT; ngx_type="pid_t"; . auto/types/sizeof | |
67 eval ngx_formats=\${ngx_${ngx_size}_fmt}; . auto/fmt/fmt | |
68 | |
69 ngx_fmt_name=RLIM_T_FMT; ngx_type="rlim_t"; . auto/types/sizeof | |
70 eval ngx_formats=\${ngx_${ngx_size}_fmt}; . auto/fmt/fmt | |
71 | |
72 | |
73 # syscalls, libc calls and some features | |
74 | |
75 ngx_feature_libs= | |
76 ngx_func_libs= | |
77 | |
78 | |
79 ngx_func="pread()" | |
80 ngx_func_inc= | |
81 ngx_func_test="char buf[1]; ssize_t n; n = pread(0, buf, 1, 0)" | |
82 . auto/func | |
83 | |
84 | |
85 ngx_func="pwrite()" | |
86 ngx_func_inc= | |
87 ngx_func_test="char buf[1]; ssize_t n; n = pwrite(1, buf, 1, 0)" | |
88 . auto/func | |
89 | |
90 | |
91 #ngx_func="strsignal()" | |
92 #ngx_func_inc="#include <string.h>" | |
93 #ngx_func_test="char *s = strsignal(1)" | |
94 #. auto/func | |
95 | |
96 | |
97 ngx_func="strerror_r()" | |
98 ngx_func_inc="#include <string.h>" | |
99 ngx_func_test="char buf[20]; int n; n = strerror_r(1, buf, 20)" | |
100 . auto/func | |
101 | |
102 | |
103 ngx_func="gnu_strerror_r()" | |
104 ngx_func_inc="#include <string.h>" | |
105 ngx_func_test="char buf[20], *str; str = strerror_r(1, buf, 20)" | |
106 . auto/func | |
107 | |
108 | |
109 ngx_func="localtime_r()" | |
110 ngx_func_inc="#include <time.h>" | |
111 ngx_func_test="struct tm t; time_t c=0; localtime_r(&c, &t)" | |
112 . auto/func | |
113 | |
114 | |
115 ngx_func="posix_memalign()" | |
116 ngx_func_inc="#include <stdlib.h>" | |
117 ngx_func_test="void *p; int n; n = posix_memalign(&p, 4096, 4096)" | |
118 . auto/func | |
119 | |
120 | |
121 ngx_func="memalign()" | |
122 ngx_func_inc="#include <stdlib.h>" | |
123 ngx_func_test="void *p; p = memalign(4096, 4096)" | |
124 . auto/func | |
125 | |
126 | |
127 | |
128 ngx_feature="mmap(MAP_ANON|MAP_SHARED)" | |
129 ngx_feature_name="MAP_ANON" | |
130 ngx_feature_inc="#include <sys/mman.h>" | |
131 ngx_feature_test="void *p; | |
132 p = mmap(NULL, 4096, PROT_READ|PROT_WRITE, | |
133 MAP_ANON|MAP_SHARED, -1, 0); | |
134 if (p == MAP_FAILED) return 1;" | |
135 ngx_feature_run=yes | |
136 . auto/feature | |
137 | |
138 | |
139 ngx_feature='mmap("/dev/zero", MAP_SHARED)' | |
140 ngx_feature_name="MAP_DEVZERO" | |
141 ngx_feature_inc="#include <sys/mman.h> | |
142 #include <sys/stat.h> | |
143 #include <fcntl.h>" | |
144 ngx_feature_test='void *p; int fd; | |
145 fd = open("/dev/zero", O_RDWR); | |
146 p = mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); | |
147 if (p == MAP_FAILED) return 1;' | |
148 . auto/feature | |
149 | |
150 | |
151 ngx_feature="System V shared memory" | |
152 ngx_feature_name="SYSVSHM" | |
153 ngx_feature_inc="#include <sys/ipc.h> | |
154 #include <sys/shm.h>" | |
155 ngx_feature_test="int id; | |
156 id = shmget(IPC_PRIVATE, 4096, (SHM_R|SHM_W|IPC_CREAT)); | |
157 if (id == -1) return 1; | |
158 shmctl(id, IPC_RMID, NULL);" | |
159 . auto/feature | |
160 | |
161 | |
162 | |
163 ngx_feature="struct sockaddr_in.sin_len" | |
164 ngx_feature_name="sin_len" | |
165 ngx_feature_inc="#include <sys/socket.h> | |
166 #include <netinet/in.h>" | |
167 ngx_feature_test="struct sockaddr_in sa; sa.sin_len = 5" | |
168 ngx_feature_run=no | |
169 . auto/feature | |
170 | |
171 | |
172 ngx_feature="struct msghdr.msg_control" | |
173 ngx_feature_name="msghdr_msg_control" | |
174 ngx_feature_inc="#include <sys/socket.h>" | |
175 ngx_feature_test="struct msghdr msg; msg.msg_control = NULL" | |
176 . auto/feature | |
177 | |
178 | |
179 case $PLATFORM in | |
180 Linux:*) | |
181 ngx_feature_inc="#include <sys/ioctl.h>" | |
182 ;; | |
183 | |
184 *) | |
185 ngx_feature_inc="#include <sys/filio.h>" | |
186 ;; | |
187 esac | |
188 | |
189 ngx_feature="ioctl(FIONBIO)" | |
190 ngx_feature_name="FIONBIO" | |
191 ngx_feature_test="int i; i = FIONBIO" | |
192 . auto/feature | |
193 | |
194 | |
195 ngx_feature="struct tm.tm_gmtoff" | |
196 ngx_feature_name="gmtoff" | |
197 ngx_feature_inc="#include <time.h>" | |
198 ngx_feature_test="struct tm tm; tm.tm_gmtoff = 0" | |
199 . auto/feature |