Mercurial > hg > nginx-quic
annotate auto/os/features @ 2389:ad08367a257b
compact win32 errno logging
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 09 Dec 2008 17:41:17 +0000 |
parents | 1adec90a0e46 |
children | 87e739049e93 |
rev | line source |
---|---|
515 | 1 |
2 # Copyright (C) Igor Sysoev | |
3 | |
4 | |
5 NGX_USER=${NGX_USER:-nobody} | |
6 | |
839 | 7 if [ -z "$NGX_GROUP" ]; then |
8 if [ $NGX_USER = nobody ]; then | |
9 if grep nobody /etc/group 2>&1 >/dev/null; then | |
10 echo "checking for nobody group ... found" | |
11 NGX_GROUP=nobody | |
12 else | |
13 echo "checking for nobody group ... not found" | |
515 | 14 |
839 | 15 if grep nogroup /etc/group 2>&1 >/dev/null; then |
16 echo "checking for nogroup group ... found" | |
17 NGX_GROUP=nogroup | |
18 else | |
19 echo "checking for nogroup group ... not found" | |
20 NGX_GROUP=nobody | |
21 fi | |
515 | 22 fi |
839 | 23 else |
24 NGX_GROUP=$NGX_USER | |
515 | 25 fi |
26 fi | |
577 | 27 |
515 | 28 |
29 ngx_feature="poll()" | |
30 ngx_feature_name= | |
31 ngx_feature_run=no | |
32 ngx_feature_incs="#include <poll.h>" | |
875
7af8276b1c2f
test PCRE in FreeBSD, Linux, and NetBSD
Igor Sysoev <igor@sysoev.ru>
parents:
839
diff
changeset
|
33 ngx_feature_path= |
515 | 34 ngx_feature_libs= |
35 ngx_feature_test="int n, dp; struct pollfd pl; | |
577 | 36 dp = 0; |
515 | 37 pl.fd = 0; |
38 pl.events = 0; | |
39 pl.revents = 0; | |
40 n = poll(&pl, 1, 0)" | |
41 . auto/feature | |
577 | 42 |
515 | 43 if [ $ngx_found = no ]; then |
44 EVENT_POLL=NONE | |
45 fi | |
577 | 46 |
515 | 47 |
48 ngx_feature="/dev/poll" | |
49 ngx_feature_name="NGX_HAVE_DEVPOLL" | |
50 ngx_feature_run=no | |
51 ngx_feature_incs="#include <sys/devpoll.h>" | |
875
7af8276b1c2f
test PCRE in FreeBSD, Linux, and NetBSD
Igor Sysoev <igor@sysoev.ru>
parents:
839
diff
changeset
|
52 ngx_feature_path= |
515 | 53 ngx_feature_libs= |
54 ngx_feature_test="int n, dp; struct dvpoll dvp; | |
55 dp = 0; | |
56 dvp.dp_fds = NULL; | |
57 dvp.dp_nfds = 0; | |
58 dvp.dp_timeout = 0; | |
59 n = ioctl(dp, DP_POLL, &dvp)" | |
60 . auto/feature | |
61 | |
62 if [ $ngx_found = yes ]; then | |
63 CORE_SRCS="$CORE_SRCS $DEVPOLL_SRCS" | |
64 EVENT_MODULES="$EVENT_MODULES $DEVPOLL_MODULE" | |
65 EVENT_FOUND=YES | |
66 fi | |
67 | |
68 | |
69 if test -z "$NGX_KQUEUE_CHECKED"; then | |
70 ngx_feature="kqueue" | |
71 ngx_feature_name="NGX_HAVE_KQUEUE" | |
72 ngx_feature_run=no | |
73 ngx_feature_incs="#include <sys/event.h>" | |
875
7af8276b1c2f
test PCRE in FreeBSD, Linux, and NetBSD
Igor Sysoev <igor@sysoev.ru>
parents:
839
diff
changeset
|
74 ngx_feature_path= |
515 | 75 ngx_feature_libs= |
76 ngx_feature_test="int kq; kq = kqueue()" | |
77 . auto/feature | |
78 | |
79 if [ $ngx_found = yes ]; then | |
80 | |
81 have=NGX_HAVE_CLEAR_EVENT . auto/have | |
82 EVENT_MODULES="$EVENT_MODULES $KQUEUE_MODULE" | |
83 CORE_SRCS="$CORE_SRCS $KQUEUE_SRCS" | |
84 EVENT_FOUND=YES | |
85 | |
86 ngx_feature="kqueue's NOTE_LOWAT" | |
87 ngx_feature_name="NGX_HAVE_LOWAT_EVENT" | |
88 ngx_feature_run=no | |
89 ngx_feature_incs="#include <sys/event.h>" | |
875
7af8276b1c2f
test PCRE in FreeBSD, Linux, and NetBSD
Igor Sysoev <igor@sysoev.ru>
parents:
839
diff
changeset
|
90 ngx_feature_path= |
515 | 91 ngx_feature_libs= |
92 ngx_feature_test="struct kevent kev; | |
93 kev.fflags = NOTE_LOWAT;" | |
94 . auto/feature | |
619 | 95 |
96 | |
97 ngx_feature="kqueue's EVFILT_TIMER" | |
98 ngx_feature_name="NGX_HAVE_TIMER_EVENT" | |
99 ngx_feature_run=yes | |
100 ngx_feature_incs="#include <sys/event.h> | |
101 #include <sys/time.h>" | |
875
7af8276b1c2f
test PCRE in FreeBSD, Linux, and NetBSD
Igor Sysoev <igor@sysoev.ru>
parents:
839
diff
changeset
|
102 ngx_feature_path= |
619 | 103 ngx_feature_libs= |
104 ngx_feature_test="int kq; | |
105 struct kevent kev; | |
106 struct timespec ts; | |
107 | |
108 if ((kq = kqueue()) == -1) return 1; | |
109 | |
110 kev.ident = 0; | |
111 kev.filter = EVFILT_TIMER; | |
112 kev.flags = EV_ADD|EV_ENABLE; | |
113 kev.fflags = 0; | |
114 kev.data = 1000; | |
115 kev.udata = 0; | |
116 | |
117 ts.tv_sec = 0; | |
118 ts.tv_nsec = 0; | |
119 | |
120 if (kevent(kq, &kev, 1, &kev, 1, &ts) == -1) return 1; | |
121 | |
122 if (kev.flags & EV_ERROR) return 1;" | |
123 | |
124 . auto/feature | |
515 | 125 fi |
126 fi | |
127 | |
619 | 128 |
129 if [ "$NGX_SYSTEM" = "NetBSD" ]; then | |
563 | 130 |
515 | 131 # NetBSD 2.0 incompatibly defines kevent.udata as "intptr_t" |
132 | |
133 cat << END >> $NGX_AUTO_CONFIG_H | |
134 | |
135 #define NGX_KQUEUE_UDATA_T | |
136 | |
137 END | |
138 | |
139 else | |
140 cat << END >> $NGX_AUTO_CONFIG_H | |
141 | |
142 #define NGX_KQUEUE_UDATA_T (void *) | |
143 | |
144 END | |
145 | |
146 fi | |
147 | |
148 | |
149 ngx_feature="crypt()" | |
150 ngx_feature_name= | |
151 ngx_feature_run=no | |
152 ngx_feature_incs= | |
875
7af8276b1c2f
test PCRE in FreeBSD, Linux, and NetBSD
Igor Sysoev <igor@sysoev.ru>
parents:
839
diff
changeset
|
153 ngx_feature_path= |
515 | 154 ngx_feature_libs= |
155 ngx_feature_test="crypt(\"test\", \"salt\");" | |
156 . auto/feature | |
157 | |
158 | |
159 if [ $ngx_found = no ]; then | |
160 | |
161 ngx_feature="crypt() in libcrypt" | |
875
7af8276b1c2f
test PCRE in FreeBSD, Linux, and NetBSD
Igor Sysoev <igor@sysoev.ru>
parents:
839
diff
changeset
|
162 ngx_feature_name= |
7af8276b1c2f
test PCRE in FreeBSD, Linux, and NetBSD
Igor Sysoev <igor@sysoev.ru>
parents:
839
diff
changeset
|
163 ngx_feature_run=no |
7af8276b1c2f
test PCRE in FreeBSD, Linux, and NetBSD
Igor Sysoev <igor@sysoev.ru>
parents:
839
diff
changeset
|
164 ngx_feature_incs= |
7af8276b1c2f
test PCRE in FreeBSD, Linux, and NetBSD
Igor Sysoev <igor@sysoev.ru>
parents:
839
diff
changeset
|
165 ngx_feature_path= |
515 | 166 ngx_feature_libs=-lcrypt |
167 . auto/feature | |
168 | |
169 if [ $ngx_found = yes ]; then | |
170 CRYPT_LIB="-lcrypt" | |
171 fi | |
172 fi | |
2129 | 173 |
174 | |
175 ngx_feature="O_DIRECT" | |
176 ngx_feature_name="NGX_HAVE_O_DIRECT" | |
177 ngx_feature_run=no | |
178 ngx_feature_incs="#include <fcntl.h>" | |
179 ngx_feature_path= | |
180 ngx_feature_libs= | |
181 ngx_feature_test="fcntl(0, F_SETFL, O_DIRECT);" | |
182 . auto/feature | |
183 | |
184 | |
2248
1adec90a0e46
disable directio for unaligned reads in Linux
Igor Sysoev <igor@sysoev.ru>
parents:
2143
diff
changeset
|
185 if [ $ngx_found = yes -a "$NGX_SYSTEM" = "Linux" ]; then |
1adec90a0e46
disable directio for unaligned reads in Linux
Igor Sysoev <igor@sysoev.ru>
parents:
2143
diff
changeset
|
186 have=NGX_HAVE_ALIGNED_DIRECTIO . auto/have |
1adec90a0e46
disable directio for unaligned reads in Linux
Igor Sysoev <igor@sysoev.ru>
parents:
2143
diff
changeset
|
187 fi |
1adec90a0e46
disable directio for unaligned reads in Linux
Igor Sysoev <igor@sysoev.ru>
parents:
2143
diff
changeset
|
188 |
2129 | 189 ngx_feature="F_NOCACHE" |
190 ngx_feature_name="NGX_HAVE_F_NOCACHE" | |
191 ngx_feature_run=no | |
192 ngx_feature_incs="#include <fcntl.h>" | |
193 ngx_feature_path= | |
194 ngx_feature_libs= | |
195 ngx_feature_test="fcntl(0, F_NOCACHE, 1);" | |
196 . auto/feature | |
2143 | 197 |
198 | |
199 ngx_feature="directio()" | |
200 ngx_feature_name="NGX_HAVE_DIRECTIO" | |
201 ngx_feature_run=no | |
202 ngx_feature_incs="#include <sys/types.h> | |
203 #include <sys/fcntl.h>" | |
204 ngx_feature_path= | |
205 ngx_feature_libs= | |
206 ngx_feature_test="directio(0, DIRECTIO_ON);" | |
207 . auto/feature |