Mercurial > hg > nginx-quic
annotate auto/os/features @ 3126:a1cc758ca002 stable-0.7
release-0.7.62 tag
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 14 Sep 2009 13:09:55 +0000 |
parents | cb3d4dc8c6db |
children | 6060225e9261 |
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> | |
2598 | 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 | |
2615 | 208 |
209 | |
210 ngx_feature="statfs()" | |
211 ngx_feature_name="NGX_HAVE_STATFS" | |
212 ngx_feature_run=no | |
2624
418c9f97bd01
fix FreeBSD before 7 building, broken in r2616
Igor Sysoev <igor@sysoev.ru>
parents:
2615
diff
changeset
|
213 ngx_feature_incs="$NGX_INCLUDE_SYS_PARAM_H |
418c9f97bd01
fix FreeBSD before 7 building, broken in r2616
Igor Sysoev <igor@sysoev.ru>
parents:
2615
diff
changeset
|
214 $NGX_INCLUDE_SYS_MOUNT_H |
2615 | 215 $NGX_INCLUDE_SYS_VFS_H" |
216 ngx_feature_path= | |
217 ngx_feature_libs= | |
218 ngx_feature_test="struct statfs fs; | |
219 statfs(NULL, &fs);" | |
220 . auto/feature | |
221 | |
222 | |
223 ngx_feature="statvfs()" | |
224 ngx_feature_name="NGX_HAVE_STATVFS" | |
225 ngx_feature_run=no | |
226 ngx_feature_incs="#include <sys/types.h> | |
227 #include <sys/statvfs.h>" | |
228 ngx_feature_path= | |
229 ngx_feature_libs= | |
230 ngx_feature_test="struct statvfs fs; | |
231 statvfs(NULL, &fs);" | |
232 . auto/feature | |
2880
ed741daa010a
test libdl before OpenSSL configuration
Igor Sysoev <igor@sysoev.ru>
parents:
2624
diff
changeset
|
233 |
ed741daa010a
test libdl before OpenSSL configuration
Igor Sysoev <igor@sysoev.ru>
parents:
2624
diff
changeset
|
234 |
ed741daa010a
test libdl before OpenSSL configuration
Igor Sysoev <igor@sysoev.ru>
parents:
2624
diff
changeset
|
235 ngx_feature="dlopen()" |
ed741daa010a
test libdl before OpenSSL configuration
Igor Sysoev <igor@sysoev.ru>
parents:
2624
diff
changeset
|
236 ngx_feature_name= |
ed741daa010a
test libdl before OpenSSL configuration
Igor Sysoev <igor@sysoev.ru>
parents:
2624
diff
changeset
|
237 ngx_feature_run=no |
ed741daa010a
test libdl before OpenSSL configuration
Igor Sysoev <igor@sysoev.ru>
parents:
2624
diff
changeset
|
238 ngx_feature_incs="#include <dlfcn.h>" |
ed741daa010a
test libdl before OpenSSL configuration
Igor Sysoev <igor@sysoev.ru>
parents:
2624
diff
changeset
|
239 ngx_feature_path= |
ed741daa010a
test libdl before OpenSSL configuration
Igor Sysoev <igor@sysoev.ru>
parents:
2624
diff
changeset
|
240 ngx_feature_libs= |
ed741daa010a
test libdl before OpenSSL configuration
Igor Sysoev <igor@sysoev.ru>
parents:
2624
diff
changeset
|
241 ngx_feature_test="dlopen(NULL, 0)" |
ed741daa010a
test libdl before OpenSSL configuration
Igor Sysoev <igor@sysoev.ru>
parents:
2624
diff
changeset
|
242 . auto/feature |
ed741daa010a
test libdl before OpenSSL configuration
Igor Sysoev <igor@sysoev.ru>
parents:
2624
diff
changeset
|
243 |
ed741daa010a
test libdl before OpenSSL configuration
Igor Sysoev <igor@sysoev.ru>
parents:
2624
diff
changeset
|
244 |
ed741daa010a
test libdl before OpenSSL configuration
Igor Sysoev <igor@sysoev.ru>
parents:
2624
diff
changeset
|
245 if [ $ngx_found != yes ]; then |
ed741daa010a
test libdl before OpenSSL configuration
Igor Sysoev <igor@sysoev.ru>
parents:
2624
diff
changeset
|
246 |
ed741daa010a
test libdl before OpenSSL configuration
Igor Sysoev <igor@sysoev.ru>
parents:
2624
diff
changeset
|
247 ngx_feature="dlopen() in libdl" |
ed741daa010a
test libdl before OpenSSL configuration
Igor Sysoev <igor@sysoev.ru>
parents:
2624
diff
changeset
|
248 ngx_feature_libs="-ldl" |
ed741daa010a
test libdl before OpenSSL configuration
Igor Sysoev <igor@sysoev.ru>
parents:
2624
diff
changeset
|
249 . auto/feature |
ed741daa010a
test libdl before OpenSSL configuration
Igor Sysoev <igor@sysoev.ru>
parents:
2624
diff
changeset
|
250 |
ed741daa010a
test libdl before OpenSSL configuration
Igor Sysoev <igor@sysoev.ru>
parents:
2624
diff
changeset
|
251 if [ $ngx_found = yes ]; then |
ed741daa010a
test libdl before OpenSSL configuration
Igor Sysoev <igor@sysoev.ru>
parents:
2624
diff
changeset
|
252 NGX_LIBDL="-ldl" |
ed741daa010a
test libdl before OpenSSL configuration
Igor Sysoev <igor@sysoev.ru>
parents:
2624
diff
changeset
|
253 fi |
ed741daa010a
test libdl before OpenSSL configuration
Igor Sysoev <igor@sysoev.ru>
parents:
2624
diff
changeset
|
254 fi |
2940
cb3d4dc8c6db
merge r2893, r2894, and r2917:
Igor Sysoev <igor@sysoev.ru>
parents:
2880
diff
changeset
|
255 |
cb3d4dc8c6db
merge r2893, r2894, and r2917:
Igor Sysoev <igor@sysoev.ru>
parents:
2880
diff
changeset
|
256 |
cb3d4dc8c6db
merge r2893, r2894, and r2917:
Igor Sysoev <igor@sysoev.ru>
parents:
2880
diff
changeset
|
257 ngx_feature="sched_yield()" |
cb3d4dc8c6db
merge r2893, r2894, and r2917:
Igor Sysoev <igor@sysoev.ru>
parents:
2880
diff
changeset
|
258 ngx_feature_name="NGX_HAVE_SCHED_YIELD" |
cb3d4dc8c6db
merge r2893, r2894, and r2917:
Igor Sysoev <igor@sysoev.ru>
parents:
2880
diff
changeset
|
259 ngx_feature_run=no |
cb3d4dc8c6db
merge r2893, r2894, and r2917:
Igor Sysoev <igor@sysoev.ru>
parents:
2880
diff
changeset
|
260 ngx_feature_incs="#include <sched.h>" |
cb3d4dc8c6db
merge r2893, r2894, and r2917:
Igor Sysoev <igor@sysoev.ru>
parents:
2880
diff
changeset
|
261 ngx_feature_path= |
cb3d4dc8c6db
merge r2893, r2894, and r2917:
Igor Sysoev <igor@sysoev.ru>
parents:
2880
diff
changeset
|
262 ngx_feature_libs= |
cb3d4dc8c6db
merge r2893, r2894, and r2917:
Igor Sysoev <igor@sysoev.ru>
parents:
2880
diff
changeset
|
263 ngx_feature_test="sched_yield()" |
cb3d4dc8c6db
merge r2893, r2894, and r2917:
Igor Sysoev <igor@sysoev.ru>
parents:
2880
diff
changeset
|
264 . auto/feature |
cb3d4dc8c6db
merge r2893, r2894, and r2917:
Igor Sysoev <igor@sysoev.ru>
parents:
2880
diff
changeset
|
265 |
cb3d4dc8c6db
merge r2893, r2894, and r2917:
Igor Sysoev <igor@sysoev.ru>
parents:
2880
diff
changeset
|
266 |
cb3d4dc8c6db
merge r2893, r2894, and r2917:
Igor Sysoev <igor@sysoev.ru>
parents:
2880
diff
changeset
|
267 if [ $ngx_found != yes ]; then |
cb3d4dc8c6db
merge r2893, r2894, and r2917:
Igor Sysoev <igor@sysoev.ru>
parents:
2880
diff
changeset
|
268 |
cb3d4dc8c6db
merge r2893, r2894, and r2917:
Igor Sysoev <igor@sysoev.ru>
parents:
2880
diff
changeset
|
269 ngx_feature="sched_yield() in librt" |
cb3d4dc8c6db
merge r2893, r2894, and r2917:
Igor Sysoev <igor@sysoev.ru>
parents:
2880
diff
changeset
|
270 ngx_feature_libs="-lrt" |
cb3d4dc8c6db
merge r2893, r2894, and r2917:
Igor Sysoev <igor@sysoev.ru>
parents:
2880
diff
changeset
|
271 . auto/feature |
cb3d4dc8c6db
merge r2893, r2894, and r2917:
Igor Sysoev <igor@sysoev.ru>
parents:
2880
diff
changeset
|
272 |
cb3d4dc8c6db
merge r2893, r2894, and r2917:
Igor Sysoev <igor@sysoev.ru>
parents:
2880
diff
changeset
|
273 if [ $ngx_found = yes ]; then |
cb3d4dc8c6db
merge r2893, r2894, and r2917:
Igor Sysoev <igor@sysoev.ru>
parents:
2880
diff
changeset
|
274 CORE_LIBS="$CORE_LIBS -lrt" |
cb3d4dc8c6db
merge r2893, r2894, and r2917:
Igor Sysoev <igor@sysoev.ru>
parents:
2880
diff
changeset
|
275 fi |
cb3d4dc8c6db
merge r2893, r2894, and r2917:
Igor Sysoev <igor@sysoev.ru>
parents:
2880
diff
changeset
|
276 fi |