blob: 259c049adee170f361cab3d1e021bbffed22b59f [file] [log] [blame]
Igor Sysoeva8fa0a62003-11-25 20:44:56 +00001
Igor Sysoevff8da912004-09-29 16:00:49 +00002# Copyright (C) Igor Sysoev
3
Igor Sysoevdc867cd2003-12-14 20:10:27 +00004help=no
Igor Sysoeva8fa0a62003-11-25 20:44:56 +00005
Igor Sysoev090849d2004-05-18 20:28:54 +00006PREFIX=
7SBIN_PATH=
8CONF_PATH=
9HTTP_LOG_PATH=
10ERROR_LOG_PATH=
11PID_PATH=
12
Igor Sysoeva8fa0a62003-11-25 20:44:56 +000013CC=gcc
Igor Sysoeva893eab2004-03-11 21:34:52 +000014CPP=
Igor Sysoeva8fa0a62003-11-25 20:44:56 +000015OBJS=objs
16
Igor Sysoev6bb889f2004-03-11 15:42:41 +000017DEBUG=NO
Igor Sysoevb3968b32004-04-14 17:44:28 +000018CC_OPT=
Igor Sysoev7b908342004-03-10 20:56:39 +000019CPU=NO
Igor Sysoev24b56c92004-03-10 17:55:19 +000020
Igor Sysoeva8fa0a62003-11-25 20:44:56 +000021TEST_BUILD_DEVPOLL=NO
Igor Sysoev10318a22004-01-29 21:45:01 +000022TEST_BUILD_EPOLL=NO
Igor Sysoev9139cd22004-02-17 17:53:12 +000023TEST_BUILD_RTSIG=NO
Igor Sysoeva8fa0a62003-11-25 20:44:56 +000024
Igor Sysoeva4b16df2004-02-02 21:19:52 +000025EVENT_FOUND=NO
26
Igor Sysoev9139cd22004-02-17 17:53:12 +000027EVENT_RTSIG=NO
Igor Sysoeva4b16df2004-02-02 21:19:52 +000028EVENT_SELECT=NO
29EVENT_POLL=NO
30EVENT_AIO=NO
Igor Sysoev5c8c52f2004-01-23 09:26:18 +000031
Igor Sysoevb54698b2004-02-23 20:57:12 +000032USE_THREADS=NO
33
Igor Sysoev980a9242004-09-05 19:54:02 +000034HTTP=YES
Igor Sysoev3d5c0fc2004-06-22 16:43:09 +000035HTTP_CHARSET=YES
Igor Sysoeva8fa0a62003-11-25 20:44:56 +000036HTTP_GZIP=YES
Igor Sysoev75569452004-07-08 15:17:47 +000037HTTP_SSL=NO
Igor Sysoev6d2a14a2004-09-27 16:03:21 +000038HTTP_SSI=NO
Igor Sysoev59f3aa32004-06-24 16:07:04 +000039HTTP_ACCESS=YES
Igor Sysoev967fd632004-08-27 15:40:59 +000040HTTP_USERID=YES
Igor Sysoev6d2a14a2004-09-27 16:03:21 +000041HTTP_STATUS=NO
Igor Sysoevc83f6832004-06-24 07:53:37 +000042HTTP_REWRITE=YES
Igor Sysoeva8fa0a62003-11-25 20:44:56 +000043HTTP_PROXY=YES
44
Igor Sysoev59cf56c2004-09-07 15:29:22 +000045IMAP=NO
46
Igor Sysoeve9b2cb12004-02-09 20:47:18 +000047USE_PCRE=NO
Igor Sysoev43c3cd92004-02-19 08:45:27 +000048PCRE=NONE
Igor Sysoeva893eab2004-03-11 21:34:52 +000049PCRE_OPT=
Igor Sysoeva8fa0a62003-11-25 20:44:56 +000050
Igor Sysoev0599b112004-07-25 18:34:14 +000051USE_OPENSSL=NO
52OPENSSL=NONE
53
Igor Sysoeva4b16df2004-02-02 21:19:52 +000054USE_MD5=NO
Igor Sysoev7af6b162004-02-09 07:46:43 +000055MD5=NONE
Igor Sysoeva893eab2004-03-11 21:34:52 +000056MD5_OPT=
Igor Sysoev7b908342004-03-10 20:56:39 +000057MD5_ASM=NO
Igor Sysoeva8fa0a62003-11-25 20:44:56 +000058
Igor Sysoeva4b16df2004-02-02 21:19:52 +000059USE_ZLIB=NO
Igor Sysoev7af6b162004-02-09 07:46:43 +000060ZLIB=NONE
Igor Sysoeva893eab2004-03-11 21:34:52 +000061ZLIB_OPT=
Igor Sysoev7b908342004-03-10 20:56:39 +000062ZLIB_ASM=NO
Igor Sysoeva8fa0a62003-11-25 20:44:56 +000063
64
65for option
66do
67 case "$option" in
68 -*=*) value=`echo "$option" | sed -e 's/[-_a-zA-Z0-9]*=//'` ;;
69 *) value="" ;;
70 esac
71
72 case "$option" in
Igor Sysoevdc867cd2003-12-14 20:10:27 +000073 --help) help=yes ;;
Igor Sysoeva8fa0a62003-11-25 20:44:56 +000074
Igor Sysoev090849d2004-05-18 20:28:54 +000075 --prefix=*) PREFIX="$value" ;;
76 --sbin-path=*) SBIN_PATH="$value" ;;
77 --conf-path=*) CONF_PATH="$value" ;;
Igor Sysoev090849d2004-05-18 20:28:54 +000078 --error-log-path=*) ERROR_LOG_PATH="$value" ;;
79 --pid-path=*) PID_PATH="$value" ;;
80
Igor Sysoeva8fa0a62003-11-25 20:44:56 +000081 --crossbuild=*) PLATFORM="$value" ;;
82
83 --builddir=*) OBJS="$value" ;;
84
Igor Sysoev9139cd22004-02-17 17:53:12 +000085 --with-rtsig_module) EVENT_RTSIG=YES ;;
Igor Sysoeva4b16df2004-02-02 21:19:52 +000086 --with-select_module) EVENT_SELECT=YES ;;
Igor Sysoeve9b2cb12004-02-09 20:47:18 +000087 --without-select_module) EVENT_SELECT=NONE ;;
Igor Sysoeva4b16df2004-02-02 21:19:52 +000088 --with-poll_module) EVENT_POLL=YES ;;
Igor Sysoeve9b2cb12004-02-09 20:47:18 +000089 --without-poll_module) EVENT_POLL=NONE ;;
Igor Sysoeva4b16df2004-02-02 21:19:52 +000090 --with-aio_module) EVENT_AIO=YES ;;
Igor Sysoev5c8c52f2004-01-23 09:26:18 +000091
Igor Sysoevb54698b2004-02-23 20:57:12 +000092 --with-threads=*) USE_THREADS="$value" ;;
93 --with-threads) USE_THREADS="pthreads" ;;
94
Igor Sysoev980a9242004-09-05 19:54:02 +000095 --without-http) HTTP=NO ;;
96 --http-log-path=*) HTTP_LOG_PATH="$value" ;;
97
Igor Sysoev75569452004-07-08 15:17:47 +000098 --with-http_ssl_module) HTTP_SSL=YES ;;
Igor Sysoev3d5c0fc2004-06-22 16:43:09 +000099 --without-http_charset_module) HTTP_CHARSET=NO ;;
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000100 --without-http_gzip_module) HTTP_GZIP=NO ;;
Igor Sysoev75569452004-07-08 15:17:47 +0000101 --without-http_ssi_module) HTTP_SSI=NO ;;
Igor Sysoev967fd632004-08-27 15:40:59 +0000102 --without-http_userid_module) HTTP_USERID=NO ;;
Igor Sysoeva7c4a2a2004-08-29 03:55:41 +0000103 --without-http_access_module) HTTP_ACCESS=NO ;;
Igor Sysoevc83f6832004-06-24 07:53:37 +0000104 --without-http_status_module) HTTP_STATUS=NO ;;
105 --without-http_rewrite_module) HTTP_REWRITE=NO ;;
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000106 --without-http_proxy_module) HTTP_PROXY=NO ;;
107
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000108 --with-imap) IMAP=YES ;;
109
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000110 --with-cc=*) CC="$value" ;;
Igor Sysoeva893eab2004-03-11 21:34:52 +0000111 --with-cpp=*) CPP="$value" ;;
Igor Sysoevb3968b32004-04-14 17:44:28 +0000112 --with-cc-opt=*) CC_OPT="$value" ;;
Igor Sysoev7b908342004-03-10 20:56:39 +0000113 --with-cpu-opt=*) CPU="$value" ;;
Igor Sysoev6bb889f2004-03-11 15:42:41 +0000114 --with-debug) DEBUG=YES ;;
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000115
Igor Sysoevbb1ba3f2004-02-19 16:48:14 +0000116 --without-pcre) USE_PCRE=DISABLED ;;
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000117 --with-pcre=*) PCRE="$value" ;;
Igor Sysoev7b908342004-03-10 20:56:39 +0000118 --with-pcre-opt=*) PCRE_OPT="$value" ;;
119
Igor Sysoev0599b112004-07-25 18:34:14 +0000120 --with-openssl=*) OPENSSL="$value" ;;
121
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000122 --with-md5=*) MD5="$value" ;;
Igor Sysoev7b908342004-03-10 20:56:39 +0000123 --with-md5-opt=*) MD5_OPT="$value" ;;
124 --with-md5-asm) MD5_ASM=YES ;;
125
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000126 --with-zlib=*) ZLIB="$value" ;;
Igor Sysoev24b56c92004-03-10 17:55:19 +0000127 --with-zlib-opt=*) ZLIB_OPT="$value" ;;
Igor Sysoev7b908342004-03-10 20:56:39 +0000128 --with-zlib-asm=*) ZLIB_ASM="$value" ;;
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000129
130 --test-build-devpoll) TEST_BUILD_DEVPOLL=YES ;;
Igor Sysoev10318a22004-01-29 21:45:01 +0000131 --test-build-epoll) TEST_BUILD_EPOLL=YES ;;
Igor Sysoev9139cd22004-02-17 17:53:12 +0000132 --test-build-rtsig) TEST_BUILD_RTSIG=YES ;;
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000133
134 *)
135 echo "$0: error: invalid option \"$option\""
136 exit 1
137 ;;
138 esac
139done
140
141
Igor Sysoevdc867cd2003-12-14 20:10:27 +0000142if [ $help = yes ]; then
143 echo
Igor Sysoev5c8c52f2004-01-23 09:26:18 +0000144 echo " --help this message"
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000145 echo
146
Igor Sysoev5c8c52f2004-01-23 09:26:18 +0000147 echo " --without-select_module disable select_module"
148 echo " --without-poll_module disable poll_module"
149
150 echo " --without-http_rewrite_module disable http_rewrite_module"
151 echo " --without-http_gzip_module disable http_gzip_module"
152 echo " --without-http_proxy_module disable http_proxy_module"
153
154 echo " --with-cc=NAME name of or path to C compiler"
155 echo
156
157 echo " --with-pcre=DIR path to PCRE library"
158 echo " --with-md5=DIR path to md5 library"
159 echo " --with-zlib=DIR path to zlib library"
Igor Sysoevdc867cd2003-12-14 20:10:27 +0000160 echo
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000161
162 exit 1
163fi
Igor Sysoev732a2712004-04-21 18:54:33 +0000164
165
Igor Sysoev562626a2004-09-14 05:45:22 +0000166if [ $HTTP = NO ]; then
167 HTTP_CHARSET=NO
168 HTTP_GZIP=NO
169 HTTP_SSI=NO
170 HTTP_USERID=NO
171 HTTP_ACCESS=NO
172 HTTP_STATUS=NO
173 HTTP_REWRITE=NO
174 HTTP_PROXY=NO
175fi
176
177
Igor Sysoev732a2712004-04-21 18:54:33 +0000178if [ ".$PLATFORM" = ".win32" -a $EVENT_POLL = YES ]; then
179 EVENT_POLL=NO
180 echo "$0: warning: --with-poll_module option is ignored for win32"
181fi
Igor Sysoev090849d2004-05-18 20:28:54 +0000182
183
184if [ ".$PREFIX" = "." ]; then
185 PREFIX=/usr/local/nginx
186fi
187
Igor Sysoev090849d2004-05-18 20:28:54 +0000188
Igor Sysoev6d2a14a2004-09-27 16:03:21 +0000189case ".$SBIN_PATH" in
190 ./*)
191 ;;
Igor Sysoev090849d2004-05-18 20:28:54 +0000192
Igor Sysoev6d2a14a2004-09-27 16:03:21 +0000193 .)
194 SBIN_PATH=$PREFIX/sbin/nginx
195 ;;
Igor Sysoev090849d2004-05-18 20:28:54 +0000196
Igor Sysoev6d2a14a2004-09-27 16:03:21 +0000197 *)
198 SBIN_PATH=$PREFIX/$SBIN_PATH
199 ;;
200esac
Igor Sysoev090849d2004-05-18 20:28:54 +0000201
Igor Sysoev6d2a14a2004-09-27 16:03:21 +0000202
203case ".$CONF_PATH" in
204 ./*)
205 ;;
206
207 .)
208 CONF_PATH=$PREFIX/conf/nginx.conf
209 ;;
210
211 *)
212 CONF_PATH=$PREFIX/$CONF_PATH
213 ;;
214esac
215
216
217case ".$PID_PATH" in
218 ./*)
219 ;;
220
221 .)
222 PID_PATH=$PREFIX/logs/nginx.pid
223 ;;
224
225 *)
226 PID_PATH=$PREFIX/$PID_PATH
227 ;;
228esac
229
230
231case ".$ERROR_LOG_PATH" in
232 ./*)
233 ;;
234
235 .)
236 ERROR_LOG_PATH=$PREFIX/logs/error.log
237 ;;
238
Igor Sysoevff8da912004-09-29 16:00:49 +0000239 .stderr)
240 ERROR_LOG_PATH=
241 ;;
242
Igor Sysoev6d2a14a2004-09-27 16:03:21 +0000243 *)
244 ERROR_LOG_PATH=$PREFIX/$ERROR_LOG_PATH
245 ;;
246esac
247
248
249case ".$HTTP_LOG_PATH" in
250 ./*)
251 ;;
252
253 .)
254 HTTP_LOG_PATH=$PREFIX/logs/access.log
255 ;;
256
257 *)
258 HTTP_LOG_PATH=$PREFIX/$HTTP_LOG_PATH
259 ;;
260esac