2 # Copyright (C) Igor Sysoev
5 NGX_USER=${NGX_USER:-nobody}
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"
13 echo "checking for nobody group ... not found"
15 if grep nogroup /etc/group 2>&1 >/dev/null; then
16 echo "checking for nogroup group ... found"
19 echo "checking for nogroup group ... not found"
32 ngx_feature_incs="#include <poll.h>"
35 ngx_feature_test="int n, dp; struct pollfd pl;
43 if [ $ngx_found = no ]; then
48 ngx_feature="/dev/poll"
49 ngx_feature_name="NGX_HAVE_DEVPOLL"
51 ngx_feature_incs="#include <sys/devpoll.h>"
54 ngx_feature_test="int n, dp; struct dvpoll dvp;
59 n = ioctl(dp, DP_POLL, &dvp)"
62 if [ $ngx_found = yes ]; then
63 CORE_SRCS="$CORE_SRCS $DEVPOLL_SRCS"
64 EVENT_MODULES="$EVENT_MODULES $DEVPOLL_MODULE"
69 if test -z "$NGX_KQUEUE_CHECKED"; then
71 ngx_feature_name="NGX_HAVE_KQUEUE"
73 ngx_feature_incs="#include <sys/event.h>"
76 ngx_feature_test="int kq; kq = kqueue()"
79 if [ $ngx_found = yes ]; then
81 have=NGX_HAVE_CLEAR_EVENT . auto/have
82 EVENT_MODULES="$EVENT_MODULES $KQUEUE_MODULE"
83 CORE_SRCS="$CORE_SRCS $KQUEUE_SRCS"
86 ngx_feature="kqueue's NOTE_LOWAT"
87 ngx_feature_name="NGX_HAVE_LOWAT_EVENT"
89 ngx_feature_incs="#include <sys/event.h>"
92 ngx_feature_test="struct kevent kev;
93 kev.fflags = NOTE_LOWAT;"
97 ngx_feature="kqueue's EVFILT_TIMER"
98 ngx_feature_name="NGX_HAVE_TIMER_EVENT"
100 ngx_feature_incs="#include <sys/event.h>
101 #include <sys/time.h>"
104 ngx_feature_test="int kq;
108 if ((kq = kqueue()) == -1) return 1;
111 kev.filter = EVFILT_TIMER;
112 kev.flags = EV_ADD|EV_ENABLE;
120 if (kevent(kq, &kev, 1, &kev, 1, &ts) == -1) return 1;
122 if (kev.flags & EV_ERROR) return 1;"
129 if [ "$NGX_SYSTEM" = "NetBSD" ]; then
131 # NetBSD 2.0 incompatibly defines kevent.udata as "intptr_t"
133 cat << END >> $NGX_AUTO_CONFIG_H
135 #define NGX_KQUEUE_UDATA_T
140 cat << END >> $NGX_AUTO_CONFIG_H
142 #define NGX_KQUEUE_UDATA_T (void *)
149 ngx_feature="crypt()"
155 ngx_feature_test="crypt(\"test\", \"salt\");"
159 if [ $ngx_found = no ]; then
161 ngx_feature="crypt() in libcrypt"
166 ngx_feature_libs=-lcrypt
169 if [ $ngx_found = yes ]; then
175 ngx_feature="O_DIRECT"
176 ngx_feature_name="NGX_HAVE_O_DIRECT"
178 ngx_feature_incs="#include <fcntl.h>"
181 ngx_feature_test="fcntl(0, F_SETFL, O_DIRECT);"
185 if [ $ngx_found = yes -a "$NGX_SYSTEM" = "Linux" ]; then
186 have=NGX_HAVE_ALIGNED_DIRECTIO . auto/have
189 ngx_feature="F_NOCACHE"
190 ngx_feature_name="NGX_HAVE_F_NOCACHE"
192 ngx_feature_incs="#include <fcntl.h>"
195 ngx_feature_test="fcntl(0, F_NOCACHE, 1);"
199 ngx_feature="directio()"
200 ngx_feature_name="NGX_HAVE_DIRECTIO"
202 ngx_feature_incs="#include <sys/types.h>
203 #include <sys/fcntl.h>"
206 ngx_feature_test="directio(0, DIRECTIO_ON);"
210 ngx_feature="statfs()"
211 ngx_feature_name="NGX_HAVE_STATFS"
213 ngx_feature_incs="$NGX_INCLUDE_SYS_PARAM_H
214 $NGX_INCLUDE_SYS_MOUNT_H
215 $NGX_INCLUDE_SYS_VFS_H"
218 ngx_feature_test="struct statfs fs;
223 ngx_feature="statvfs()"
224 ngx_feature_name="NGX_HAVE_STATVFS"
226 ngx_feature_incs="#include <sys/types.h>
227 #include <sys/statvfs.h>"
230 ngx_feature_test="struct statvfs fs;
235 ngx_feature="dlopen()"
238 ngx_feature_incs="#include <dlfcn.h>"
241 ngx_feature_test="dlopen(NULL, 0)"
245 if [ $ngx_found != yes ]; then
247 ngx_feature="dlopen() in libdl"
248 ngx_feature_libs="-ldl"
251 if [ $ngx_found = yes ]; then
257 ngx_feature="sched_yield()"
258 ngx_feature_name="NGX_HAVE_SCHED_YIELD"
260 ngx_feature_incs="#include <sched.h>"
263 ngx_feature_test="sched_yield()"
267 if [ $ngx_found != yes ]; then
269 ngx_feature="sched_yield() in librt"
270 ngx_feature_libs="-lrt"
273 if [ $ngx_found = yes ]; then
274 CORE_LIBS="$CORE_LIBS -lrt"