Mercurial > hg > nginx
annotate auto/os/features @ 1291:13a4ce6e7f1e
proxy_store and fastcgi_store
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 12 Jul 2007 11:19:05 +0000 |
parents | 7af8276b1c2f |
children | 345a014436d4 |
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 | |
125 | |
126 | |
127 if [ "$NGX_SYSTEM" = "Darwin" ]; then | |
128 | |
623 | 129 ngx_feature="Darwin 64-bit kqueue millisecond timeout bug" |
130 ngx_feature_name=NGX_DARWIN_KEVENT_BUG | |
619 | 131 ngx_feature_run=bug |
132 ngx_feature_incs="#include <sys/event.h> | |
133 #include <sys/time.h>" | |
875
7af8276b1c2f
test PCRE in FreeBSD, Linux, and NetBSD
Igor Sysoev <igor@sysoev.ru>
parents:
839
diff
changeset
|
134 ngx_feature_path= |
619 | 135 ngx_feature_libs= |
136 ngx_feature_test="int kq; | |
137 struct kevent kev; | |
138 struct timespec ts; | |
139 struct timeval tv, tv0; | |
140 | |
141 kq = kqueue(); | |
142 | |
143 ts.tv_sec = 0; | |
144 ts.tv_nsec = 999000000; | |
145 | |
146 gettimeofday(&tv, 0); | |
147 kevent(kq, NULL, 0, &kev, 1, &ts); | |
148 gettimeofday(&tv0, 0); | |
149 timersub(&tv0, &tv, &tv); | |
150 | |
151 if (tv.tv_sec * 1000000 + tv.tv_usec < 900000) return 1;" | |
152 | |
153 . auto/feature | |
154 fi | |
515 | 155 fi |
156 fi | |
157 | |
619 | 158 |
159 if [ "$NGX_SYSTEM" = "NetBSD" ]; then | |
563 | 160 |
515 | 161 # NetBSD 2.0 incompatibly defines kevent.udata as "intptr_t" |
162 | |
163 cat << END >> $NGX_AUTO_CONFIG_H | |
164 | |
165 #define NGX_KQUEUE_UDATA_T | |
166 | |
167 END | |
168 | |
169 else | |
170 cat << END >> $NGX_AUTO_CONFIG_H | |
171 | |
172 #define NGX_KQUEUE_UDATA_T (void *) | |
173 | |
174 END | |
175 | |
176 fi | |
177 | |
178 | |
179 ngx_feature="crypt()" | |
180 ngx_feature_name= | |
181 ngx_feature_run=no | |
182 ngx_feature_incs= | |
875
7af8276b1c2f
test PCRE in FreeBSD, Linux, and NetBSD
Igor Sysoev <igor@sysoev.ru>
parents:
839
diff
changeset
|
183 ngx_feature_path= |
515 | 184 ngx_feature_libs= |
185 ngx_feature_test="crypt(\"test\", \"salt\");" | |
186 . auto/feature | |
187 | |
188 | |
189 if [ $ngx_found = no ]; then | |
190 | |
191 ngx_feature="crypt() in libcrypt" | |
875
7af8276b1c2f
test PCRE in FreeBSD, Linux, and NetBSD
Igor Sysoev <igor@sysoev.ru>
parents:
839
diff
changeset
|
192 ngx_feature_name= |
7af8276b1c2f
test PCRE in FreeBSD, Linux, and NetBSD
Igor Sysoev <igor@sysoev.ru>
parents:
839
diff
changeset
|
193 ngx_feature_run=no |
7af8276b1c2f
test PCRE in FreeBSD, Linux, and NetBSD
Igor Sysoev <igor@sysoev.ru>
parents:
839
diff
changeset
|
194 ngx_feature_incs= |
7af8276b1c2f
test PCRE in FreeBSD, Linux, and NetBSD
Igor Sysoev <igor@sysoev.ru>
parents:
839
diff
changeset
|
195 ngx_feature_path= |
515 | 196 ngx_feature_libs=-lcrypt |
197 . auto/feature | |
198 | |
199 if [ $ngx_found = yes ]; then | |
200 CRYPT_LIB="-lcrypt" | |
201 fi | |
202 fi |