2 # Copyright (C) Igor Sysoev
28 NGX_TEST_BUILD_DEVPOLL=NO
29 NGX_TEST_BUILD_EVENTPORT=NO
30 NGX_TEST_BUILD_EPOLL=NO
31 NGX_TEST_BUILD_RTSIG=NO
32 NGX_TEST_BUILD_SOLARIS_SENDFILEV=NO
55 NGX_HTTP_CLIENT_TEMP_PATH=
56 NGX_HTTP_PROXY_TEMP_PATH=
57 NGX_HTTP_FASTCGI_TEMP_PATH=
58 NGX_HTTP_UWSGI_TEMP_PATH=
82 HTTP_SPLIT_CLIENTS=YES
100 HTTP_UPSTREAM_IP_HASH=YES
103 HTTP_UPSTREAM_KEEPALIVE=YES
145 NGX_GOOGLE_PERFTOOLS=NO
149 NGX_CLOCK_GETTIMEOFDAY=NO
162 opt="$opt `echo $option | sed -e \"s/\(--[^=]*=\)\(.* .*\)/\1'\2'/\"`"
165 -*=*) value=`echo "$option" | sed -e 's/[-_a-zA-Z0-9]*=//'` ;;
172 --prefix=) NGX_PREFIX="!" ;;
173 --prefix=*) NGX_PREFIX="$value" ;;
174 --sbin-path=*) NGX_SBIN_PATH="$value" ;;
175 --conf-path=*) NGX_CONF_PATH="$value" ;;
176 --error-log-path=*) NGX_ERROR_LOG_PATH="$value";;
177 --pid-path=*) NGX_PID_PATH="$value" ;;
178 --lock-path=*) NGX_LOCK_PATH="$value" ;;
179 --user=*) NGX_USER="$value" ;;
180 --group=*) NGX_GROUP="$value" ;;
182 --crossbuild=*) NGX_PLATFORM="$value" ;;
184 --builddir=*) NGX_OBJS="$value" ;;
186 --with-rtsig_module) EVENT_RTSIG=YES ;;
187 --with-select_module) EVENT_SELECT=YES ;;
188 --without-select_module) EVENT_SELECT=NONE ;;
189 --with-poll_module) EVENT_POLL=YES ;;
190 --without-poll_module) EVENT_POLL=NONE ;;
191 --with-aio_module) EVENT_AIO=YES ;;
193 --with-obsd_malloc) USE_OBSD_MALLOC=YES ;;
194 --with-jemalloc) USE_JEMALLOC=YES ;;
197 #--with-threads=*) USE_THREADS="$value" ;;
198 #--with-threads) USE_THREADS="pthreads" ;;
200 --with-file-aio) NGX_FILE_AIO=YES ;;
201 --with-ipv6) NGX_IPV6=YES ;;
203 --without-http) HTTP=NO ;;
204 --without-http-cache) HTTP_CACHE=NO ;;
206 --http-log-path=*) NGX_HTTP_LOG_PATH="$value" ;;
207 --http-client-body-temp-path=*) NGX_HTTP_CLIENT_TEMP_PATH="$value" ;;
208 --http-proxy-temp-path=*) NGX_HTTP_PROXY_TEMP_PATH="$value" ;;
209 --http-fastcgi-temp-path=*) NGX_HTTP_FASTCGI_TEMP_PATH="$value" ;;
210 --http-uwsgi-temp-path=*) NGX_HTTP_UWSGI_TEMP_PATH="$value" ;;
212 --with-http_ssl_module) HTTP_SSL=YES ;;
213 --with-http_realip_module) HTTP_REALIP=YES ;;
214 --with-http_addition_module) HTTP_ADDITION=YES ;;
215 --with-http_xslt_module) HTTP_XSLT=YES ;;
216 --with-http_image_filter_module) HTTP_IMAGE_FILTER=YES ;;
217 --with-http_geoip_module) HTTP_GEOIP=YES ;;
218 --with-http_sub_module) HTTP_SUB=YES ;;
219 --with-http_rnd_module) HTTP_RND=YES ;;
220 --with-http_dav_module) HTTP_DAV=YES ;;
221 --with-http_flv_module) HTTP_FLV=YES ;;
222 --with-http_is_bot_module) HTTP_IS_BOT=YES ;;
223 --with-http_gzip_static_module) HTTP_GZIP_STATIC=YES ;;
224 --with-http_random_index_module) HTTP_RANDOM_INDEX=YES ;;
225 --with-http_secure_link_module) HTTP_SECURE_LINK=YES ;;
226 --with-http_response_module) HTTP_RESPONSE=YES ;;
227 --with-http_degradation_module) HTTP_DEGRADATION=YES ;;
229 --without-http_charset_module) HTTP_CHARSET=NO ;;
230 --without-http_gzip_module) HTTP_GZIP=NO ;;
231 --without-http_ssi_module) HTTP_SSI=NO ;;
232 --without-http_userid_module) HTTP_USERID=NO ;;
233 --without-http_access_module) HTTP_ACCESS=NO ;;
234 --without-http_auth_basic_module) HTTP_AUTH_BASIC=NO ;;
235 --without-http_autoindex_module) HTTP_AUTOINDEX=NO ;;
236 --without-http_status_module) HTTP_STATUS=NO ;;
237 --without-http_geo_module) HTTP_GEO=NO ;;
238 --without-http_map_module) HTTP_MAP=NO ;;
239 --without-http_split_clients_module) HTTP_SPLIT_CLIENTS=NO ;;
240 --without-http_referer_module) HTTP_REFERER=NO ;;
241 --without-http_rewrite_module) HTTP_REWRITE=NO ;;
242 --without-http_proxy_module) HTTP_PROXY=NO ;;
243 --without-http_fastcgi_module) HTTP_FASTCGI=NO ;;
244 --without-http_uwsgi_module) HTTP_UWSGI=NO ;;
245 --without-http_memcached_module) HTTP_MEMCACHED=NO ;;
246 --without-http_limit_zone_module) HTTP_LIMIT_ZONE=NO ;;
247 --without-http_limit_var_module) HTTP_LIMIT_VAR=NO ;;
248 --without-http_limit_req_module) HTTP_LIMIT_REQ=NO ;;
249 --without-http_empty_gif_module) HTTP_EMPTY_GIF=NO ;;
250 --without-http_browser_module) HTTP_BROWSER=NO ;;
251 --without-http_eval_module) HTTP_EVAL=NO ;;
252 --without-http_upstream_ip_hash_module) HTTP_UPSTREAM_IP_HASH=NO ;;
253 --without-http_upstream_keepalive_module) HTTP_UPSTREAM_KEEPALIVE=NO ;;
255 --with-http_perl_module) HTTP_PERL=YES ;;
256 --with-perl_modules_path=*) NGX_PERL_MODULES="$value" ;;
257 --with-perl=*) NGX_PERL="$value" ;;
260 --with-http_stub_status_module) HTTP_STUB_STATUS=YES ;;
261 --with-http_status_heap_module) HTTP_STATUS_HEAP=YES ;;
263 --with-mail) MAIL=YES ;;
264 --with-mail_ssl_module) MAIL_SSL=YES ;;
266 --with-imap) MAIL=YES ;;
267 --with-imap_ssl_module) MAIL_SSL=YES ;;
268 --without-mail_pop3_module) MAIL_POP3=NO ;;
269 --without-mail_imap_module) MAIL_IMAP=NO ;;
270 --without-mail_smtp_module) MAIL_SMTP=NO ;;
272 --with-google_perftools_module) NGX_GOOGLE_PERFTOOLS=YES ;;
273 --with-cpp_test_module) NGX_CPP_TEST=YES ;;
275 --without-clock) NGX_CLOCK=NO ;;
276 --with-clock_gettimeofday) NGX_CLOCK_GETTIMEOFDAY=YES ;;
278 --add-module=*) NGX_ADDONS="$NGX_ADDONS $value" ;;
280 --with-cc=*) CC="$value" ;;
281 --with-cpp=*) CPP="$value" ;;
282 --with-cc-opt=*) NGX_CC_OPT="$value" ;;
283 --with-ld-opt=*) NGX_LD_OPT="$value" ;;
284 --with-cpu-opt=*) CPU="$value" ;;
285 --with-debug) NGX_DEBUG=YES ;;
287 --without-pcre) USE_PCRE=DISABLED ;;
288 --with-pcre) USE_PCRE=YES ;;
289 --with-pcre=*) PCRE="$value" ;;
290 --with-pcre-opt=*) PCRE_OPT="$value" ;;
292 --with-openssl=*) OPENSSL="$value" ;;
293 --with-openssl-opt=*) OPENSSL_OPT="$value" ;;
295 --with-md5=*) MD5="$value" ;;
296 --with-md5-opt=*) MD5_OPT="$value" ;;
297 --with-md5-asm) MD5_ASM=YES ;;
299 --with-sha1=*) SHA1="$value" ;;
300 --with-sha1-opt=*) SHA1_OPT="$value" ;;
301 --with-sha1-asm) SHA1_ASM=YES ;;
303 --with-zlib=*) ZLIB="$value" ;;
304 --with-zlib-opt=*) ZLIB_OPT="$value" ;;
305 --with-zlib-asm=*) ZLIB_ASM="$value" ;;
307 --without-status) NGX_STATUS=NO ;;
308 --without-http_status_txt) NGX_HTTP_STATUS_TXT=NO ;;
309 --without-http_status_xml) NGX_HTTP_STATUS_XML=NO ;;
311 --with-libatomic) NGX_LIBATOMIC=YES ;;
312 --with-libatomic=*) NGX_LIBATOMIC="$value" ;;
314 --test-build-devpoll) NGX_TEST_BUILD_DEVPOLL=YES ;;
315 --test-build-eventport) NGX_TEST_BUILD_EVENTPORT=YES ;;
316 --test-build-epoll) NGX_TEST_BUILD_EPOLL=YES ;;
317 --test-build-rtsig) NGX_TEST_BUILD_RTSIG=YES ;;
318 --test-build-solaris-sendfilev) NGX_TEST_BUILD_SOLARIS_SENDFILEV=YES ;;
321 echo "$0: error: invalid option \"$option\""
331 if [ $help = yes ]; then
337 --prefix=PATH set the installation prefix
338 --sbin-path=PATH set path to the nginx binary file
339 --conf-path=PATH set path to the nginx.conf file
340 --error-log-path=PATH set path to the error log
341 --pid-path=PATH set path to nginx.pid file
342 --lock-path=PATH set path to nginx.lock file
344 --user=USER set non-privilege user
345 for the worker processes
346 --group=GROUP set non-privilege group
347 for the worker processes
349 --builddir=DIR set the build directory
351 --with-rtsig_module enable rtsig module
352 --with-select_module enable select module
353 --without-select_module disable select module
354 --with-poll_module enable poll module
355 --without-poll_module disable poll module
357 --with-obsd_malloc enable obsd-like malloc
358 --with-jemalloc enable jemalloc
360 --with-file-aio enable file aio support
361 --with-ipv6 enable ipv6 support
363 --with-http_ssl_module enable ngx_http_ssl_module
364 --with-http_realip_module enable ngx_http_realip_module
365 --with-http_addition_module enable ngx_http_addition_module
366 --with-http_xslt_module enable ngx_http_xslt_module
367 --with-http_image_filter_module enable ngx_http_image_filter_module
368 --with-http_geoip_module enable ngx_http_geoip_module
369 --with-http_sub_module enable ngx_http_sub_module
370 --with-http_rnd_module enable ngx_http_rnd_module
371 --with-http_dav_module enable ngx_http_dav_module
372 --with-http_flv_module enable ngx_http_flv_module
373 --with-http_is_bot_module enable ngx_http_is_bot_module
374 --with-http_gzip_static_module enable ngx_http_gzip_static_module
375 --with-http_random_index_module enable ngx_http_random_index_module
376 --with-http_secure_link_module enable ngx_http_secure_link_module
377 --with-http_degradation_module enable ngx_http_degradation_module
378 --with-http_stub_status_module enable ngx_http_stub_status_module
379 --with-http_response_module enable ngx_http_response_module
380 --with-http_status_heap_module enable ngx_http_status_heap_module
382 --without-http_charset_module disable ngx_http_charset_module
383 --without-http_gzip_module disable ngx_http_gzip_module
384 --without-http_ssi_module disable ngx_http_ssi_module
385 --without-http_userid_module disable ngx_http_userid_module
386 --without-http_access_module disable ngx_http_access_module
387 --without-http_auth_basic_module disable ngx_http_auth_basic_module
388 --without-http_autoindex_module disable ngx_http_autoindex_module
389 --without-http_geo_module disable ngx_http_geo_module
390 --without-http_map_module disable ngx_http_map_module
391 --without-http_split_clients_module disable ngx_http_split_clients_module
392 --without-http_referer_module disable ngx_http_referer_module
393 --without-http_rewrite_module disable ngx_http_rewrite_module
394 --without-http_proxy_module disable ngx_http_proxy_module
395 --without-http_fastcgi_module disable ngx_http_fastcgi_module
396 --without-http_uwsgi_module disable ngx_http_uwsgi_module
397 --without-http_memcached_module disable ngx_http_memcached_module
398 --without-http_limit_zone_module disable ngx_http_limit_zone_module
399 --without-http_limit_var_module disable ngx_http_limit_var_module
400 --without-http_limit_req_module disable ngx_http_limit_req_module
401 --without-http_empty_gif_module disable ngx_http_empty_gif_module
402 --without-http_browser_module disable ngx_http_browser_module
403 --without-http_upstream_ip_hash_module
404 disable ngx_http_upstream_ip_hash_module
406 --with-http_perl_module enable ngx_http_perl_module
407 --with-perl_modules_path=PATH set path to the perl modules
408 --with-perl=PATH set path to the perl binary
410 --http-log-path=PATH set path to the http access log
411 --http-client-body-temp-path=PATH set path to the http client request body
413 --http-proxy-temp-path=PATH set path to the http proxy temporary files
414 --http-fastcgi-temp-path=PATH set path to the http fastcgi temporary
416 --http-uwsgi-temp-path=PATH set path to the http uwsgi temporary files
418 --without-http disable HTTP server
419 --without-http-cache disable HTTP cache
421 --with-mail enable POP3/IMAP4/SMTP proxy module
422 --with-mail_ssl_module enable ngx_mail_ssl_module
423 --without-mail_pop3_module disable ngx_mail_pop3_module
424 --without-mail_imap_module disable ngx_mail_imap_module
425 --without-mail_smtp_module disable ngx_mail_smtp_module
427 --with-google_perftools_module enable ngx_google_perftools_module
428 --with-cpp_test_module enable ngx_cpp_test_module
430 --without-clock disable clock_gettime usage
431 --with-clock_gettimeofday enable clock_gettimeofday usage if it possible
433 --add-module=PATH enable an external module
435 --with-cc=PATH set path to C compiler
436 --with-cpp=PATH set path to C preprocessor
437 --with-cc-opt=OPTIONS set additional options for C compiler
438 --with-ld-opt=OPTIONS set additional options for linker
439 --with-cpu-opt=CPU build for specified CPU, the valid values:
440 pentium, pentiumpro, pentium3, pentium4,
441 prescott, nocona, core2, athlon, opteron,
442 opteron-sse3, opteron, sparc32, sparc64,
445 --without-pcre disable PCRE library usage
446 --with-pcre force PCRE library usage
447 --with-pcre=DIR set path to PCRE library sources
448 --with-pcre-opt=OPTIONS set additional options for PCRE building
450 --with-md5=DIR set path to md5 library sources
451 --with-md5-opt=OPTIONS set additional options for md5 building
452 --with-md5-asm use md5 assembler sources
454 --with-sha1=DIR set path to sha1 library sources
455 --with-sha1-opt=OPTIONS set additional options for sha1 building
456 --with-sha1-asm use sha1 assembler sources
458 --with-zlib=DIR set path to zlib library sources
459 --with-zlib-opt=OPTIONS set additional options for zlib building
460 --with-zlib-asm=CPU use zlib assembler sources optimized
461 for specified CPU, the valid values:
464 --with-libatomic force libatomic_ops library usage
465 --with-libatomic=DIR set path to libatomic_ops library sources
467 --with-openssl=DIR set path to OpenSSL library sources
468 --with-openssl-opt=OPTIONS set additional options for OpenSSL building
470 --without-status disable status
471 --without-http_status_txt disable http_status_txt
472 --without-http_status_xml disable http_status_xml
474 --with-debug enable the debugging logging
482 if [ $HTTP = NO ]; then
495 if [ ".$NGX_PLATFORM" = ".win32" ]; then
500 NGX_CONF_PATH=${NGX_CONF_PATH:-conf/nginx.conf}
501 NGX_CONF_PREFIX=`dirname $NGX_CONF_PATH`
502 NGX_PID_PATH=${NGX_PID_PATH:-logs/nginx.pid}
503 NGX_LOCK_PATH=${NGX_LOCK_PATH:-logs/nginx.lock}
505 if [ ".$NGX_ERROR_LOG_PATH" = ".stderr" ]; then
508 NGX_ERROR_LOG_PATH=${NGX_ERROR_LOG_PATH:-logs/error.log}
511 NGX_HTTP_LOG_PATH=${NGX_HTTP_LOG_PATH:-logs/access.log}
512 NGX_HTTP_CLIENT_TEMP_PATH=${NGX_HTTP_CLIENT_TEMP_PATH:-client_body_temp}
513 NGX_HTTP_PROXY_TEMP_PATH=${NGX_HTTP_PROXY_TEMP_PATH:-proxy_temp}
514 NGX_HTTP_FASTCGI_TEMP_PATH=${NGX_HTTP_FASTCGI_TEMP_PATH:-fastcgi_temp}
515 NGX_HTTP_UWSGI_TEMP_PATH=${NGX_HTTP_UWSGI_TEMP_PATH:-uwsgi_temp}
517 case ".$NGX_PERL_MODULES" in
525 NGX_PERL_MODULES=$NGX_PREFIX/$NGX_PERL_MODULES