0
|
1
|
|
2 # Copyright (C) Igor Sysoev
|
644
|
3 # Copyright (C) Nginx, Inc.
|
0
|
4
|
|
5
|
628
|
6 NGX_USER=${NGX_USER:-nobody}
|
|
7
|
|
8 if [ -z "$NGX_GROUP" ]; then
|
|
9 if [ $NGX_USER = nobody ]; then
|
|
10 if grep nobody /etc/group 2>&1 >/dev/null; then
|
|
11 echo "checking for nobody group ... found"
|
|
12 NGX_GROUP=nobody
|
|
13 else
|
|
14 echo "checking for nobody group ... not found"
|
|
15
|
|
16 if grep nogroup /etc/group 2>&1 >/dev/null; then
|
|
17 echo "checking for nogroup group ... found"
|
|
18 NGX_GROUP=nogroup
|
|
19 else
|
|
20 echo "checking for nogroup group ... not found"
|
|
21 NGX_GROUP=nobody
|
|
22 fi
|
|
23 fi
|
|
24 else
|
|
25 NGX_GROUP=$NGX_USER
|
|
26 fi
|
|
27 fi
|
|
28
|
|
29
|
|
30 ngx_feature="poll()"
|
|
31 ngx_feature_name=
|
|
32 ngx_feature_run=no
|
|
33 ngx_feature_incs="#include <poll.h>"
|
|
34 ngx_feature_path=
|
|
35 ngx_feature_libs=
|
|
36 ngx_feature_test="int n, dp; struct pollfd pl;
|
|
37 dp = 0;
|
|
38 pl.fd = 0;
|
|
39 pl.events = 0;
|
|
40 pl.revents = 0;
|
|
41 n = poll(&pl, 1, 0)"
|
|
42 . auto/feature
|
|
43
|
|
44 if [ $ngx_found = no ]; then
|
|
45 EVENT_POLL=NONE
|
|
46 fi
|
|
47
|
|
48
|
|
49 ngx_feature="/dev/poll"
|
|
50 ngx_feature_name="NGX_HAVE_DEVPOLL"
|
|
51 ngx_feature_run=no
|
|
52 ngx_feature_incs="#include <sys/devpoll.h>"
|
|
53 ngx_feature_path=
|
|
54 ngx_feature_libs=
|
|
55 ngx_feature_test="int n, dp; struct dvpoll dvp;
|
|
56 dp = 0;
|
|
57 dvp.dp_fds = NULL;
|
|
58 dvp.dp_nfds = 0;
|
|
59 dvp.dp_timeout = 0;
|
|
60 n = ioctl(dp, DP_POLL, &dvp)"
|
|
61 . auto/feature
|
|
62
|
|
63 if [ $ngx_found = yes ]; then
|
|
64 CORE_SRCS="$CORE_SRCS $DEVPOLL_SRCS"
|
|
65 EVENT_MODULES="$EVENT_MODULES $DEVPOLL_MODULE"
|
|
66 EVENT_FOUND=YES
|
|
67 fi
|
|
68
|
|
69
|
|
70 if test -z "$NGX_KQUEUE_CHECKED"; then
|
|
71 ngx_feature="kqueue"
|
|
72 ngx_feature_name="NGX_HAVE_KQUEUE"
|
|
73 ngx_feature_run=no
|
|
74 ngx_feature_incs="#include <sys/event.h>"
|
|
75 ngx_feature_path=
|
|
76 ngx_feature_libs=
|
|
77 ngx_feature_test="int kq; kq = kqueue()"
|
|
78 . auto/feature
|
|
79
|
|
80 if [ $ngx_found = yes ]; then
|
|
81
|
|
82 have=NGX_HAVE_CLEAR_EVENT . auto/have
|
|
83 EVENT_MODULES="$EVENT_MODULES $KQUEUE_MODULE"
|
|
84 CORE_SRCS="$CORE_SRCS $KQUEUE_SRCS"
|
|
85 EVENT_FOUND=YES
|
|
86
|
|
87 ngx_feature="kqueue's NOTE_LOWAT"
|
|
88 ngx_feature_name="NGX_HAVE_LOWAT_EVENT"
|
|
89 ngx_feature_run=no
|
|
90 ngx_feature_incs="#include <sys/event.h>"
|
|
91 ngx_feature_path=
|
|
92 ngx_feature_libs=
|
|
93 ngx_feature_test="struct kevent kev;
|
|
94 kev.fflags = NOTE_LOWAT;"
|
|
95 . auto/feature
|
|
96
|
|
97
|
|
98 ngx_feature="kqueue's EVFILT_TIMER"
|
|
99 ngx_feature_name="NGX_HAVE_TIMER_EVENT"
|
|
100 ngx_feature_run=yes
|
|
101 ngx_feature_incs="#include <sys/event.h>
|
|
102 #include <sys/time.h>"
|
|
103 ngx_feature_path=
|
|
104 ngx_feature_libs=
|
|
105 ngx_feature_test="int kq;
|
|
106 struct kevent kev;
|
|
107 struct timespec ts;
|
|
108
|
|
109 if ((kq = kqueue()) == -1) return 1;
|
|
110
|
|
111 kev.ident = 0;
|
|
112 kev.filter = EVFILT_TIMER;
|
|
113 kev.flags = EV_ADD|EV_ENABLE;
|
|
114 kev.fflags = 0;
|
|
115 kev.data = 1000;
|
|
116 kev.udata = 0;
|
|
117
|
|
118 ts.tv_sec = 0;
|
|
119 ts.tv_nsec = 0;
|
|
120
|
|
121 if (kevent(kq, &kev, 1, &kev, 1, &ts) == -1) return 1;
|
|
122
|
|
123 if (kev.flags & EV_ERROR) return 1;"
|
|
124
|
|
125 . auto/feature
|
|
126 fi
|
|
127 fi
|
|
128
|
|
129
|
|
130 if [ "$NGX_SYSTEM" = "NetBSD" ]; then
|
|
131
|
|
132 # NetBSD 2.0 incompatibly defines kevent.udata as "intptr_t"
|
|
133
|
|
134 cat << END >> $NGX_AUTO_CONFIG_H
|
|
135
|
|
136 #define NGX_KQUEUE_UDATA_T
|
|
137
|
|
138 END
|
|
139
|
|
140 else
|
|
141 cat << END >> $NGX_AUTO_CONFIG_H
|
|
142
|
|
143 #define NGX_KQUEUE_UDATA_T (void *)
|
|
144
|
|
145 END
|
|
146
|
|
147 fi
|
|
148
|
|
149
|
|
150 ngx_feature="crypt()"
|
|
151 ngx_feature_name=
|
|
152 ngx_feature_run=no
|
|
153 ngx_feature_incs=
|
|
154 ngx_feature_path=
|
|
155 ngx_feature_libs=
|
|
156 ngx_feature_test="crypt(\"test\", \"salt\");"
|
|
157 . auto/feature
|
|
158
|
|
159
|
|
160 if [ $ngx_found = no ]; then
|
|
161
|
|
162 ngx_feature="crypt() in libcrypt"
|
|
163 ngx_feature_name=
|
|
164 ngx_feature_run=no
|
|
165 ngx_feature_incs=
|
|
166 ngx_feature_path=
|
|
167 ngx_feature_libs=-lcrypt
|
|
168 . auto/feature
|
|
169
|
|
170 if [ $ngx_found = yes ]; then
|
|
171 CRYPT_LIB="-lcrypt"
|
|
172 fi
|
|
173 fi
|
|
174
|
|
175
|
|
176 ngx_feature="F_READAHEAD"
|
|
177 ngx_feature_name="NGX_HAVE_F_READAHEAD"
|
|
178 ngx_feature_run=no
|
|
179 ngx_feature_incs="#include <fcntl.h>"
|
|
180 ngx_feature_path=
|
|
181 ngx_feature_libs=
|
|
182 ngx_feature_test="fcntl(0, F_READAHEAD, 1);"
|
|
183 . auto/feature
|
|
184
|
|
185
|
|
186 ngx_feature="posix_fadvise()"
|
|
187 ngx_feature_name="NGX_HAVE_POSIX_FADVISE"
|
|
188 ngx_feature_run=no
|
|
189 ngx_feature_incs="#include <fcntl.h>"
|
|
190 ngx_feature_path=
|
|
191 ngx_feature_libs=
|
|
192 ngx_feature_test="posix_fadvise(0, 0, 0, POSIX_FADV_SEQUENTIAL);"
|
|
193 . auto/feature
|
|
194
|
|
195
|
|
196 ngx_feature="O_DIRECT"
|
|
197 ngx_feature_name="NGX_HAVE_O_DIRECT"
|
|
198 ngx_feature_run=no
|
|
199 ngx_feature_incs="#include <fcntl.h>"
|
|
200 ngx_feature_path=
|
|
201 ngx_feature_libs=
|
|
202 ngx_feature_test="fcntl(0, F_SETFL, O_DIRECT);"
|
|
203 . auto/feature
|
|
204
|
|
205
|
|
206 if [ $ngx_found = yes -a "$NGX_SYSTEM" = "Linux" ]; then
|
|
207 have=NGX_HAVE_ALIGNED_DIRECTIO . auto/have
|
|
208 fi
|
|
209
|
|
210 ngx_feature="F_NOCACHE"
|
|
211 ngx_feature_name="NGX_HAVE_F_NOCACHE"
|
|
212 ngx_feature_run=no
|
|
213 ngx_feature_incs="#include <fcntl.h>"
|
|
214 ngx_feature_path=
|
|
215 ngx_feature_libs=
|
|
216 ngx_feature_test="fcntl(0, F_NOCACHE, 1);"
|
|
217 . auto/feature
|
|
218
|
|
219
|
|
220 ngx_feature="directio()"
|
|
221 ngx_feature_name="NGX_HAVE_DIRECTIO"
|
|
222 ngx_feature_run=no
|
|
223 ngx_feature_incs="#include <sys/types.h>
|
|
224 #include <sys/fcntl.h>"
|
|
225 ngx_feature_path=
|
|
226 ngx_feature_libs=
|
|
227 ngx_feature_test="directio(0, DIRECTIO_ON);"
|
|
228 . auto/feature
|
|
229
|
|
230
|
|
231 ngx_feature="statfs()"
|
|
232 ngx_feature_name="NGX_HAVE_STATFS"
|
|
233 ngx_feature_run=no
|
|
234 ngx_feature_incs="$NGX_INCLUDE_SYS_PARAM_H
|
|
235 $NGX_INCLUDE_SYS_MOUNT_H
|
|
236 $NGX_INCLUDE_SYS_VFS_H"
|
|
237 ngx_feature_path=
|
|
238 ngx_feature_libs=
|
|
239 ngx_feature_test="struct statfs fs;
|
|
240 statfs(NULL, &fs);"
|
|
241 . auto/feature
|
|
242
|
|
243
|
|
244 ngx_feature="statvfs()"
|
|
245 ngx_feature_name="NGX_HAVE_STATVFS"
|
|
246 ngx_feature_run=no
|
|
247 ngx_feature_incs="#include <sys/types.h>
|
|
248 #include <sys/statvfs.h>"
|
|
249 ngx_feature_path=
|
|
250 ngx_feature_libs=
|
|
251 ngx_feature_test="struct statvfs fs;
|
|
252 statvfs(NULL, &fs);"
|
|
253 . auto/feature
|
|
254
|
|
255
|
|
256 ngx_feature="dlopen()"
|
|
257 ngx_feature_name=
|
|
258 ngx_feature_run=no
|
|
259 ngx_feature_incs="#include <dlfcn.h>"
|
|
260 ngx_feature_path=
|
|
261 ngx_feature_libs=
|
|
262 ngx_feature_test="dlopen(NULL, 0)"
|
|
263 . auto/feature
|
|
264
|
|
265
|
|
266 if [ $ngx_found != yes ]; then
|
|
267
|
|
268 ngx_feature="dlopen() in libdl"
|
|
269 ngx_feature_libs="-ldl"
|
|
270 . auto/feature
|
|
271
|
|
272 if [ $ngx_found = yes ]; then
|
|
273 NGX_LIBDL="-ldl"
|
|
274 fi
|
|
275 fi
|
|
276
|
|
277
|
|
278 ngx_feature="sched_yield()"
|
|
279 ngx_feature_name="NGX_HAVE_SCHED_YIELD"
|
|
280 ngx_feature_run=no
|
|
281 ngx_feature_incs="#include <sched.h>"
|
|
282 ngx_feature_path=
|
|
283 ngx_feature_libs=
|
|
284 ngx_feature_test="sched_yield()"
|
|
285 . auto/feature
|
|
286
|
|
287
|
|
288 if [ $ngx_found != yes ]; then
|
|
289
|
|
290 ngx_feature="sched_yield() in librt"
|
|
291 ngx_feature_libs="-lrt"
|
|
292 . auto/feature
|
|
293
|
|
294 if [ $ngx_found = yes ]; then
|
|
295 CORE_LIBS="$CORE_LIBS -lrt"
|
|
296 fi
|
|
297 fi
|
|
298
|
638
|
299
|
628
|
300 ngx_feature="SO_SETFIB"
|
|
301 ngx_feature_name="NGX_HAVE_SETFIB"
|
|
302 ngx_feature_run=no
|
|
303 ngx_feature_incs="#include <sys/socket.h>"
|
|
304 ngx_feature_path=
|
|
305 ngx_feature_libs=
|
|
306 ngx_feature_test="setsockopt(0, SOL_SOCKET, SO_SETFIB, NULL, 4)"
|
|
307 . auto/feature
|
|
308
|
|
309
|
638
|
310 ngx_feature="SO_ACCEPTFILTER"
|
|
311 ngx_feature_name="NGX_HAVE_DEFERRED_ACCEPT"
|
|
312 ngx_feature_run=no
|
|
313 ngx_feature_incs="#include <sys/socket.h>"
|
|
314 ngx_feature_path=
|
|
315 ngx_feature_libs=
|
|
316 ngx_feature_test="setsockopt(0, SOL_SOCKET, SO_ACCEPTFILTER, NULL, 0)"
|
|
317 . auto/feature
|
|
318
|
|
319
|
|
320 ngx_feature="TCP_DEFER_ACCEPT"
|
|
321 ngx_feature_name="NGX_HAVE_DEFERRED_ACCEPT"
|
|
322 ngx_feature_run=no
|
|
323 ngx_feature_incs="#include <sys/socket.h>
|
|
324 #include <netinet/in.h>
|
|
325 #include <netinet/tcp.h>"
|
|
326 ngx_feature_path=
|
|
327 ngx_feature_libs=
|
|
328 ngx_feature_test="setsockopt(0, IPPROTO_TCP, TCP_DEFER_ACCEPT, NULL, 0)"
|
|
329 . auto/feature
|
|
330
|
|
331
|
628
|
332 ngx_feature="accept4()"
|
|
333 ngx_feature_name="NGX_HAVE_ACCEPT4"
|
|
334 ngx_feature_run=no
|
|
335 ngx_feature_incs="#include <sys/socket.h>"
|
|
336 ngx_feature_path=
|
|
337 ngx_feature_libs=
|
|
338 ngx_feature_test="accept4(0, NULL, NULL, SOCK_NONBLOCK)"
|
|
339 . auto/feature
|
|
340
|
|
341 if [ $NGX_FILE_AIO = YES ]; then
|
|
342
|
|
343 ngx_feature="kqueue AIO support"
|
|
344 ngx_feature_name="NGX_HAVE_FILE_AIO"
|
|
345 ngx_feature_run=no
|
|
346 ngx_feature_incs="#include <aio.h>"
|
|
347 ngx_feature_path=
|
|
348 ngx_feature_libs=
|
|
349 ngx_feature_test="int n; struct aiocb iocb;
|
|
350 iocb.aio_sigevent.sigev_notify = SIGEV_KEVENT;
|
|
351 n = aio_read(&iocb)"
|
|
352 . auto/feature
|
|
353
|
|
354 if [ $ngx_found = yes ]; then
|
|
355 CORE_SRCS="$CORE_SRCS $FILE_AIO_SRCS"
|
|
356
|
|
357 elif [ $ngx_found = no ]; then
|
|
358
|
|
359 ngx_feature="Linux AIO support"
|
|
360 ngx_feature_name="NGX_HAVE_FILE_AIO"
|
|
361 ngx_feature_run=no
|
|
362 ngx_feature_incs="#include <linux/aio_abi.h>
|
|
363 #include <sys/syscall.h>"
|
|
364 ngx_feature_path=
|
|
365 ngx_feature_libs=
|
|
366 ngx_feature_test="int n = SYS_eventfd;
|
|
367 struct iocb iocb;
|
|
368 iocb.aio_lio_opcode = IOCB_CMD_PREAD;
|
|
369 iocb.aio_flags = IOCB_FLAG_RESFD;
|
|
370 iocb.aio_resfd = -1;"
|
|
371 . auto/feature
|
|
372
|
|
373 if [ $ngx_found = yes ]; then
|
|
374 have=NGX_HAVE_EVENTFD . auto/have
|
|
375 CORE_SRCS="$CORE_SRCS $LINUX_AIO_SRCS"
|
|
376
|
|
377 else
|
|
378 cat << END
|
|
379
|
|
380 $0: no supported file AIO was found
|
|
381 Currently file AIO is supported on FreeBSD 4.3+ and Linux 2.6.22+ only
|
|
382
|
|
383 END
|
|
384 exit 1
|
|
385 fi
|
|
386 fi
|
|
387 fi
|
|
388
|
|
389
|
28
|
390 have=NGX_HAVE_UNIX_DOMAIN . auto/have
|
|
391
|
132
|
392 ngx_feature_libs=
|
0
|
393
|
42
|
394
|
0
|
395 # C types
|
|
396
|
|
397 ngx_type="int"; . auto/types/sizeof
|
|
398
|
|
399 ngx_type="long"; . auto/types/sizeof
|
|
400
|
|
401 ngx_type="long long"; . auto/types/sizeof
|
|
402
|
|
403 ngx_type="void *"; . auto/types/sizeof; ngx_ptr_size=$ngx_size
|
42
|
404 ngx_param=NGX_PTR_SIZE; ngx_value=$ngx_size; . auto/types/value
|
0
|
405
|
|
406
|
|
407 # POSIX types
|
|
408
|
214
|
409 case "$NGX_AUTO_CONFIG_H" in
|
|
410 /*)
|
|
411 NGX_INCLUDE_AUTO_CONFIG_H="#include \"$NGX_AUTO_CONFIG_H\""
|
|
412 ;;
|
|
413 *)
|
|
414 NGX_INCLUDE_AUTO_CONFIG_H="#include \"../$NGX_AUTO_CONFIG_H\""
|
|
415 ;;
|
|
416 esac
|
0
|
417
|
|
418 ngx_type="uint64_t"; ngx_types="u_int64_t"; . auto/types/typedef
|
|
419
|
|
420 ngx_type="sig_atomic_t"; ngx_types="int"; . auto/types/typedef
|
|
421 . auto/types/sizeof
|
26
|
422 ngx_param=NGX_SIG_ATOMIC_T_SIZE; ngx_value=$ngx_size; . auto/types/value
|
0
|
423
|
64
|
424 ngx_type="socklen_t"; ngx_types="int"; . auto/types/typedef
|
0
|
425
|
|
426 ngx_type="in_addr_t"; ngx_types="uint32_t"; . auto/types/typedef
|
|
427
|
|
428 ngx_type="in_port_t"; ngx_types="u_short"; . auto/types/typedef
|
|
429
|
|
430 ngx_type="rlim_t"; ngx_types="int"; . auto/types/typedef
|
|
431
|
|
432 . auto/types/uintptr_t
|
|
433
|
|
434 . auto/endianess
|
|
435
|
22
|
436 ngx_type="size_t"; . auto/types/sizeof
|
26
|
437 ngx_param=NGX_MAX_SIZE_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
|
|
438 ngx_param=NGX_SIZE_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
|
0
|
439
|
22
|
440 ngx_type="off_t"; . auto/types/sizeof
|
26
|
441 ngx_param=NGX_MAX_OFF_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
|
|
442 ngx_param=NGX_OFF_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
|
22
|
443
|
|
444 ngx_type="time_t"; . auto/types/sizeof
|
26
|
445 ngx_param=NGX_TIME_T_SIZE; ngx_value=$ngx_size; . auto/types/value
|
|
446 ngx_param=NGX_TIME_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
|
0
|
447
|
|
448
|
|
449 # syscalls, libc calls and some features
|
|
450
|
4
|
451
|
448
|
452 if [ $NGX_IPV6 = YES ]; then
|
|
453 ngx_feature="AF_INET6"
|
|
454 ngx_feature_name="NGX_HAVE_INET6"
|
|
455 ngx_feature_run=no
|
|
456 ngx_feature_incs="#include <sys/socket.h>
|
|
457 #include <netinet/in.h>
|
|
458 #include <arpa/inet.h>"
|
|
459 ngx_feature_path=
|
|
460 ngx_feature_libs=
|
|
461 ngx_feature_test="struct sockaddr_in6 sin6;
|
|
462 sin6.sin6_family = AF_INET6;"
|
|
463 . auto/feature
|
|
464 fi
|
|
465
|
|
466
|
16
|
467 ngx_feature="setproctitle()"
|
18
|
468 ngx_feature_name="NGX_HAVE_SETPROCTITLE"
|
16
|
469 ngx_feature_run=no
|
|
470 ngx_feature_incs=
|
258
|
471 ngx_feature_path=
|
58
|
472 ngx_feature_libs=$NGX_SETPROCTITLE_LIB
|
16
|
473 ngx_feature_test="setproctitle(\"test\");"
|
|
474 . auto/feature
|
|
475
|
|
476
|
4
|
477 ngx_feature="pread()"
|
18
|
478 ngx_feature_name="NGX_HAVE_PREAD"
|
4
|
479 ngx_feature_run=no
|
|
480 ngx_feature_incs=
|
258
|
481 ngx_feature_path=
|
0
|
482 ngx_feature_libs=
|
4
|
483 ngx_feature_test="char buf[1]; ssize_t n; n = pread(0, buf, 1, 0)"
|
|
484 . auto/feature
|
0
|
485
|
|
486
|
4
|
487 ngx_feature="pwrite()"
|
18
|
488 ngx_feature_name="NGX_HAVE_PWRITE"
|
4
|
489 ngx_feature_run=no
|
|
490 ngx_feature_incs=
|
258
|
491 ngx_feature_path=
|
4
|
492 ngx_feature_libs=
|
|
493 ngx_feature_test="char buf[1]; ssize_t n; n = pwrite(1, buf, 1, 0)"
|
|
494 . auto/feature
|
0
|
495
|
|
496
|
604
|
497 ngx_feature="sys_nerr"
|
|
498 ngx_feature_name="NGX_SYS_NERR"
|
|
499 ngx_feature_run=value
|
642
|
500 ngx_feature_incs='#include <errno.h>
|
|
501 #include <stdio.h>'
|
258
|
502 ngx_feature_path=
|
4
|
503 ngx_feature_libs=
|
604
|
504 ngx_feature_test='printf("%d", sys_nerr);'
|
566
|
505 . auto/feature
|
|
506
|
|
507
|
610
|
508 if [ $ngx_found = no ]; then
|
|
509
|
|
510 # Cygiwn defines _sys_nerr
|
|
511 ngx_feature="_sys_nerr"
|
|
512 ngx_feature_name="NGX_SYS_NERR"
|
|
513 ngx_feature_run=value
|
|
514 ngx_feature_incs='#include <errno.h>
|
|
515 #include <stdio.h>'
|
|
516 ngx_feature_path=
|
|
517 ngx_feature_libs=
|
|
518 ngx_feature_test='printf("%d", _sys_nerr);'
|
|
519 . auto/feature
|
|
520 fi
|
|
521
|
|
522
|
|
523 if [ $ngx_found = no ]; then
|
|
524
|
|
525 # Solaris has no sys_nerr
|
|
526 ngx_feature='maximum errno'
|
|
527 ngx_feature_name=NGX_SYS_NERR
|
|
528 ngx_feature_run=value
|
|
529 ngx_feature_incs='#include <errno.h>
|
624
|
530 #include <string.h>
|
610
|
531 #include <stdio.h>'
|
|
532 ngx_feature_path=
|
|
533 ngx_feature_libs=
|
|
534 ngx_feature_test='int n;
|
622
|
535 char *p;
|
610
|
536 for (n = 1; n < 1000; n++) {
|
|
537 errno = 0;
|
622
|
538 p = strerror(n);
|
|
539 if (errno == EINVAL
|
|
540 || p == NULL
|
|
541 || strncmp(p, "Unknown error", 13) == 0)
|
|
542 {
|
642
|
543 break;
|
610
|
544 }
|
642
|
545 }
|
|
546 printf("%d", n);'
|
610
|
547 . auto/feature
|
|
548 fi
|
608
|
549
|
|
550
|
4
|
551 ngx_feature="localtime_r()"
|
18
|
552 ngx_feature_name="NGX_HAVE_LOCALTIME_R"
|
4
|
553 ngx_feature_run=no
|
|
554 ngx_feature_incs="#include <time.h>"
|
258
|
555 ngx_feature_path=
|
4
|
556 ngx_feature_libs=
|
|
557 ngx_feature_test="struct tm t; time_t c=0; localtime_r(&c, &t)"
|
|
558 . auto/feature
|
0
|
559
|
|
560
|
4
|
561 ngx_feature="posix_memalign()"
|
18
|
562 ngx_feature_name="NGX_HAVE_POSIX_MEMALIGN"
|
4
|
563 ngx_feature_run=no
|
|
564 ngx_feature_incs="#include <stdlib.h>"
|
258
|
565 ngx_feature_path=
|
4
|
566 ngx_feature_libs=
|
|
567 ngx_feature_test="void *p; int n; n = posix_memalign(&p, 4096, 4096)"
|
|
568 . auto/feature
|
0
|
569
|
|
570
|
4
|
571 ngx_feature="memalign()"
|
18
|
572 ngx_feature_name="NGX_HAVE_MEMALIGN"
|
4
|
573 ngx_feature_run=no
|
|
574 ngx_feature_incs="#include <stdlib.h>"
|
258
|
575 ngx_feature_path=
|
4
|
576 ngx_feature_libs=
|
|
577 ngx_feature_test="void *p; p = memalign(4096, 4096)"
|
|
578 . auto/feature
|
0
|
579
|
|
580
|
|
581 ngx_feature="mmap(MAP_ANON|MAP_SHARED)"
|
18
|
582 ngx_feature_name="NGX_HAVE_MAP_ANON"
|
4
|
583 ngx_feature_run=yes
|
|
584 ngx_feature_incs="#include <sys/mman.h>"
|
258
|
585 ngx_feature_path=
|
4
|
586 ngx_feature_libs=
|
0
|
587 ngx_feature_test="void *p;
|
|
588 p = mmap(NULL, 4096, PROT_READ|PROT_WRITE,
|
|
589 MAP_ANON|MAP_SHARED, -1, 0);
|
|
590 if (p == MAP_FAILED) return 1;"
|
|
591 . auto/feature
|
|
592
|
|
593
|
|
594 ngx_feature='mmap("/dev/zero", MAP_SHARED)'
|
18
|
595 ngx_feature_name="NGX_HAVE_MAP_DEVZERO"
|
4
|
596 ngx_feature_run=yes
|
|
597 ngx_feature_incs="#include <sys/mman.h>
|
466
|
598 #include <sys/stat.h>
|
|
599 #include <fcntl.h>"
|
258
|
600 ngx_feature_path=
|
4
|
601 ngx_feature_libs=
|
0
|
602 ngx_feature_test='void *p; int fd;
|
|
603 fd = open("/dev/zero", O_RDWR);
|
|
604 p = mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
|
|
605 if (p == MAP_FAILED) return 1;'
|
|
606 . auto/feature
|
|
607
|
|
608
|
|
609 ngx_feature="System V shared memory"
|
18
|
610 ngx_feature_name="NGX_HAVE_SYSVSHM"
|
4
|
611 ngx_feature_run=yes
|
|
612 ngx_feature_incs="#include <sys/ipc.h>
|
466
|
613 #include <sys/shm.h>"
|
258
|
614 ngx_feature_path=
|
4
|
615 ngx_feature_libs=
|
0
|
616 ngx_feature_test="int id;
|
|
617 id = shmget(IPC_PRIVATE, 4096, (SHM_R|SHM_W|IPC_CREAT));
|
|
618 if (id == -1) return 1;
|
|
619 shmctl(id, IPC_RMID, NULL);"
|
|
620 . auto/feature
|
|
621
|
|
622
|
624
|
623 ngx_feature="POSIX semaphores"
|
|
624 ngx_feature_name="NGX_HAVE_POSIX_SEM"
|
|
625 ngx_feature_run=yes
|
|
626 ngx_feature_incs="#include <semaphore.h>"
|
|
627 ngx_feature_path=
|
|
628 ngx_feature_libs=
|
|
629 ngx_feature_test="sem_t sem;
|
|
630 if (sem_init(&sem, 1, 0) == -1) return 1;
|
|
631 sem_destroy(&sem);"
|
|
632 . auto/feature
|
|
633
|
|
634
|
628
|
635 if [ $ngx_found = no ]; then
|
|
636
|
|
637 # Linux has POSIX semaphores in libpthread
|
|
638 ngx_feature="POSIX semaphores in libpthread"
|
|
639 ngx_feature_libs=-lpthread
|
|
640 . auto/feature
|
|
641
|
|
642 if [ $ngx_found = yes ]; then
|
|
643 CORE_LIBS="$CORE_LIBS -lpthread"
|
|
644 fi
|
|
645 fi
|
|
646
|
|
647
|
632
|
648 if [ $ngx_found = no ]; then
|
|
649
|
|
650 # Solaris has POSIX semaphores in librt
|
|
651 ngx_feature="POSIX semaphores in librt"
|
|
652 ngx_feature_libs=-lrt
|
|
653 . auto/feature
|
|
654
|
|
655 if [ $ngx_found = yes ]; then
|
|
656 CORE_LIBS="$CORE_LIBS -lrt"
|
|
657 fi
|
|
658 fi
|
|
659
|
|
660
|
0
|
661 ngx_feature="struct msghdr.msg_control"
|
18
|
662 ngx_feature_name="NGX_HAVE_MSGHDR_MSG_CONTROL"
|
4
|
663 ngx_feature_run=no
|
|
664 ngx_feature_incs="#include <sys/socket.h>"
|
258
|
665 ngx_feature_path=
|
4
|
666 ngx_feature_libs=
|
0
|
667 ngx_feature_test="struct msghdr msg; msg.msg_control = NULL"
|
|
668 . auto/feature
|
|
669
|
|
670
|
|
671 ngx_feature="ioctl(FIONBIO)"
|
18
|
672 ngx_feature_name="NGX_HAVE_FIONBIO"
|
4
|
673 ngx_feature_run=no
|
|
674 ngx_feature_incs="#include <sys/ioctl.h>
|
466
|
675 $NGX_INCLUDE_SYS_FILIO_H"
|
258
|
676 ngx_feature_path=
|
4
|
677 ngx_feature_libs=
|
0
|
678 ngx_feature_test="int i; i = FIONBIO"
|
|
679 . auto/feature
|
|
680
|
|
681
|
|
682 ngx_feature="struct tm.tm_gmtoff"
|
18
|
683 ngx_feature_name="NGX_HAVE_GMTOFF"
|
4
|
684 ngx_feature_run=no
|
|
685 ngx_feature_incs="#include <time.h>"
|
258
|
686 ngx_feature_path=
|
4
|
687 ngx_feature_libs=
|
0
|
688 ngx_feature_test="struct tm tm; tm.tm_gmtoff = 0"
|
|
689 . auto/feature
|
406
|
690
|
|
691
|
|
692 ngx_feature="struct dirent.d_namlen"
|
|
693 ngx_feature_name="NGX_HAVE_D_NAMLEN"
|
|
694 ngx_feature_run=no
|
|
695 ngx_feature_incs="#include <dirent.h>"
|
|
696 ngx_feature_path=
|
|
697 ngx_feature_libs=
|
|
698 ngx_feature_test="struct dirent dir; dir.d_namlen = 0"
|
|
699 . auto/feature
|
|
700
|
|
701
|
|
702 ngx_feature="struct dirent.d_type"
|
|
703 ngx_feature_name="NGX_HAVE_D_TYPE"
|
|
704 ngx_feature_run=no
|
|
705 ngx_feature_incs="#include <dirent.h>"
|
|
706 ngx_feature_path=
|
|
707 ngx_feature_libs=
|
|
708 ngx_feature_test="struct dirent dir; dir.d_type = DT_REG"
|
|
709 . auto/feature
|
646
|
710
|
|
711
|
|
712 ngx_feature="sysconf(_SC_NPROCESSORS_ONLN)"
|
|
713 ngx_feature_name="NGX_HAVE_SC_NPROCESSORS_ONLN"
|
|
714 ngx_feature_run=no
|
|
715 ngx_feature_incs=
|
|
716 ngx_feature_path=
|
|
717 ngx_feature_libs=
|
|
718 ngx_feature_test="sysconf(_SC_NPROCESSORS_ONLN)"
|
|
719 . auto/feature
|