Correct PPTP server firewall rules chain.
[tomato/davidwu.git] / release / src / router / nginx / auto / os / linux
blobc1b25ed80047df743a427943a536efb57fe650d7
2 # Copyright (C) Igor Sysoev
3 # Copyright (C) Nginx, Inc.
6 have=NGX_LINUX . auto/have_headers
8 CORE_INCS="$UNIX_INCS"
9 CORE_DEPS="$UNIX_DEPS $LINUX_DEPS"
10 CORE_SRCS="$UNIX_SRCS $LINUX_SRCS"
12 ngx_spacer='
15 cc_aux_flags="$CC_AUX_FLAGS"
16 CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"
19 # Linux kernel version
21 version=$((`uname -r \
22     | sed -n -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/ \
23                                                  \1*256*256+\2*256+\3/p' \
24              -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\1*256*256+\2*256/p'`))
26 version=${version:-0}
29 # enable the rt signals on Linux between 2.2.19 and 2.6.17
31 if [ \( $version -ge 131603 -a $version -lt 132626 \) -o $EVENT_RTSIG = YES ]
32 then
33     echo " + rt signals found"
34     have=NGX_HAVE_RTSIG . auto/have
35     EVENT_MODULES="$EVENT_MODULES $RTSIG_MODULE"
36     CORE_SRCS="$CORE_SRCS $RTSIG_SRCS"
37     EVENT_FOUND=YES
41 # posix_fadvise64() had been implemented in 2.5.60
43 if [ $version -lt 132412 ]; then
44     have=NGX_HAVE_POSIX_FADVISE . auto/nohave
47 # epoll, EPOLLET version
49 ngx_feature="epoll"
50 ngx_feature_name="NGX_HAVE_EPOLL"
51 ngx_feature_run=no
52 ngx_feature_incs="#include <sys/epoll.h>"
53 ngx_feature_path=
54 ngx_feature_libs=
55 ngx_feature_test="int efd = 0;
56                   struct epoll_event ee;
57                   ee.events = EPOLLIN|EPOLLOUT|EPOLLET;
58                   ee.data.ptr = NULL;
59                   efd = epoll_create(100);
60                   if (efd == -1) return 1;"
61 . auto/feature
63 if [ $ngx_found = yes ]; then
64     have=NGX_HAVE_CLEAR_EVENT . auto/have
65     CORE_SRCS="$CORE_SRCS $EPOLL_SRCS"
66     EVENT_MODULES="$EVENT_MODULES $EPOLL_MODULE"
67     EVENT_FOUND=YES
70     # EPOLLRDHUP appeared in Linux 2.6.17, glibc 2.8
72     ngx_feature="EPOLLRDHUP"
73     ngx_feature_name="NGX_HAVE_EPOLLRDHUP"
74     ngx_feature_run=no
75     ngx_feature_incs="#include <sys/epoll.h>"
76     ngx_feature_path=
77     ngx_feature_libs=
78     ngx_feature_test="int efd = 0, fd = 0;
79                       struct epoll_event ee;
80                       ee.events = EPOLLIN|EPOLLRDHUP|EPOLLET;
81                       ee.data.ptr = NULL;
82                       epoll_ctl(efd, EPOLL_CTL_ADD, fd, &ee)"
83     . auto/feature
87 # O_PATH and AT_EMPTY_PATH were introduced in 2.6.39, glibc 2.14
89 ngx_feature="O_PATH"
90 ngx_feature_name="NGX_HAVE_O_PATH"
91 ngx_feature_run=no
92 ngx_feature_incs="#include <sys/types.h>
93                   #include <sys/stat.h>
94                   #include <fcntl.h>"
95 ngx_feature_path=
96 ngx_feature_libs=
97 ngx_feature_test="int fd; struct stat sb;
98                   fd = openat(AT_FDCWD, \".\", O_PATH|O_DIRECTORY|O_NOFOLLOW);
99                   if (fstatat(fd, \"\", &sb, AT_EMPTY_PATH) != 0) return 1"
100 . auto/feature
103 # sendfile()
105 CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE"
106 ngx_feature="sendfile()"
107 ngx_feature_name="NGX_HAVE_SENDFILE"
108 ngx_feature_run=no
109 ngx_feature_incs="#include <sys/sendfile.h>
110                   #include <errno.h>"
111 ngx_feature_path=
112 ngx_feature_libs=
113 ngx_feature_test="int s = 0, fd = 1;
114                   ssize_t n; off_t off = 0;
115                   n = sendfile(s, fd, &off, 1);
116                   if (n == -1 && errno == ENOSYS) return 1"
117 . auto/feature
119 if [ $ngx_found = yes ]; then
120     CORE_SRCS="$CORE_SRCS $LINUX_SENDFILE_SRCS"
124 # sendfile64()
126 CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"
127 ngx_feature="sendfile64()"
128 ngx_feature_name="NGX_HAVE_SENDFILE64"
129 ngx_feature_run=no
130 ngx_feature_incs="#include <sys/sendfile.h>
131                   #include <errno.h>"
132 ngx_feature_path=
133 ngx_feature_libs=
134 ngx_feature_test="int s = 0, fd = 1;
135                   ssize_t n; off_t off = 0;
136                   n = sendfile(s, fd, &off, 1);
137                   if (n == -1 && errno == ENOSYS) return 1"
138 . auto/feature
141 ngx_include="sys/prctl.h"; . auto/include
143 # prctl(PR_SET_DUMPABLE)
145 ngx_feature="prctl(PR_SET_DUMPABLE)"
146 ngx_feature_name="NGX_HAVE_PR_SET_DUMPABLE"
147 ngx_feature_run=no
148 ngx_feature_incs="#include <sys/prctl.h>"
149 ngx_feature_path=
150 ngx_feature_libs=
151 ngx_feature_test="if (prctl(PR_SET_DUMPABLE, 1, 0, 0, 0) == -1) return 1"
152 . auto/feature
155 # sched_setaffinity()
157 ngx_feature="sched_setaffinity()"
158 ngx_feature_name="NGX_HAVE_SCHED_SETAFFINITY"
159 ngx_feature_run=no
160 ngx_feature_incs="#include <sched.h>"
161 ngx_feature_path=
162 ngx_feature_libs=
163 ngx_feature_test="cpu_set_t mask;
164                   CPU_ZERO(&mask);
165                   sched_setaffinity(0, sizeof(cpu_set_t), &mask)"
166 . auto/feature
169 # crypt_r()
171 ngx_feature="crypt_r()"
172 ngx_feature_name="NGX_HAVE_GNU_CRYPT_R"
173 ngx_feature_run=no
174 ngx_feature_incs="#include <crypt.h>"
175 ngx_feature_path=
176 ngx_feature_libs=-lcrypt
177 ngx_feature_test="struct crypt_data  cd;
178                   crypt_r(\"key\", \"salt\", &cd);"
179 . auto/feature
182 ngx_include="sys/vfs.h";     . auto/include
185 CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"