options 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491
  1. # Copyright (C) Igor Sysoev
  2. # Copyright (C) Nginx, Inc.
  3. help=no
  4. NGX_PREFIX=
  5. NGX_SBIN_PATH=
  6. NGX_CONF_PREFIX=
  7. NGX_CONF_PATH=
  8. NGX_ERROR_LOG_PATH=
  9. NGX_PID_PATH=
  10. NGX_LOCK_PATH=
  11. NGX_USER=
  12. NGX_GROUP=
  13. CC=${CC:-gcc}
  14. CPP=
  15. NGX_OBJS=objs
  16. NGX_DEBUG=NO
  17. NGX_CC_OPT=
  18. NGX_LD_OPT=
  19. CPU=NO
  20. NGX_RPATH=NO
  21. NGX_TEST_BUILD_DEVPOLL=NO
  22. NGX_TEST_BUILD_EVENTPORT=NO
  23. NGX_TEST_BUILD_EPOLL=NO
  24. NGX_TEST_BUILD_RTSIG=NO
  25. NGX_TEST_BUILD_SOLARIS_SENDFILEV=NO
  26. NGX_PLATFORM=
  27. NGX_WINE=
  28. EVENT_FOUND=NO
  29. EVENT_RTSIG=NO
  30. EVENT_SELECT=NO
  31. EVENT_POLL=NO
  32. EVENT_AIO=NO
  33. USE_THREADS=NO
  34. NGX_FILE_AIO=NO
  35. NGX_IPV6=NO
  36. HTTP=YES
  37. NGX_HTTP_LOG_PATH=
  38. NGX_HTTP_CLIENT_TEMP_PATH=
  39. NGX_HTTP_PROXY_TEMP_PATH=
  40. NGX_HTTP_FASTCGI_TEMP_PATH=
  41. NGX_HTTP_UWSGI_TEMP_PATH=
  42. NGX_HTTP_SCGI_TEMP_PATH=
  43. HTTP_CACHE=YES
  44. HTTP_CHARSET=YES
  45. HTTP_GZIP=YES
  46. HTTP_SSL=NO
  47. HTTP_SSI=YES
  48. HTTP_POSTPONE=NO
  49. HTTP_REALIP=NO
  50. HTTP_XSLT=NO
  51. HTTP_IMAGE_FILTER=NO
  52. HTTP_SUB=NO
  53. HTTP_ADDITION=NO
  54. HTTP_DAV=NO
  55. HTTP_ACCESS=YES
  56. HTTP_AUTH_BASIC=YES
  57. HTTP_USERID=YES
  58. HTTP_AUTOINDEX=YES
  59. HTTP_RANDOM_INDEX=NO
  60. HTTP_STATUS=NO
  61. HTTP_GEO=YES
  62. HTTP_GEOIP=NO
  63. HTTP_MAP=YES
  64. HTTP_SPLIT_CLIENTS=YES
  65. HTTP_REFERER=YES
  66. HTTP_REWRITE=YES
  67. HTTP_PROXY=YES
  68. HTTP_FASTCGI=YES
  69. HTTP_UWSGI=YES
  70. HTTP_SCGI=YES
  71. HTTP_PERL=NO
  72. HTTP_MEMCACHED=YES
  73. HTTP_LIMIT_ZONE=YES
  74. HTTP_LIMIT_REQ=YES
  75. HTTP_EMPTY_GIF=YES
  76. HTTP_BROWSER=YES
  77. HTTP_SECURE_LINK=NO
  78. HTTP_DEGRADATION=NO
  79. HTTP_FLV=NO
  80. HTTP_MP4=NO
  81. HTTP_GZIP_STATIC=NO
  82. HTTP_UPSTREAM_IP_HASH=YES
  83. # STUB
  84. HTTP_STUB_STATUS=NO
  85. MAIL=NO
  86. MAIL_SSL=NO
  87. MAIL_POP3=YES
  88. MAIL_IMAP=YES
  89. MAIL_SMTP=YES
  90. NGX_ADDONS=
  91. USE_PCRE=NO
  92. PCRE=NONE
  93. PCRE_OPT=
  94. USE_OPENSSL=NO
  95. OPENSSL=NONE
  96. USE_MD5=NO
  97. MD5=NONE
  98. MD5_OPT=
  99. MD5_ASM=NO
  100. USE_SHA1=NO
  101. SHA1=NONE
  102. SHA1_OPT=
  103. SHA1_ASM=NO
  104. USE_ZLIB=NO
  105. ZLIB=NONE
  106. ZLIB_OPT=
  107. ZLIB_ASM=NO
  108. USE_PERL=NO
  109. NGX_PERL=perl
  110. USE_LIBXSLT=NO
  111. USE_LIBGD=NO
  112. NGX_GOOGLE_PERFTOOLS=NO
  113. NGX_CPP_TEST=NO
  114. NGX_LIBATOMIC=NO
  115. NGX_CPU_CACHE_LINE=
  116. opt=
  117. for option
  118. do
  119. opt="$opt `echo $option | sed -e \"s/\(--[^=]*=\)\(.* .*\)/\1'\2'/\"`"
  120. case "$option" in
  121. -*=*) value=`echo "$option" | sed -e 's/[-_a-zA-Z0-9]*=//'` ;;
  122. *) value="" ;;
  123. esac
  124. case "$option" in
  125. --help) help=yes ;;
  126. --prefix=) NGX_PREFIX="!" ;;
  127. --prefix=*) NGX_PREFIX="$value" ;;
  128. --sbin-path=*) NGX_SBIN_PATH="$value" ;;
  129. --conf-path=*) NGX_CONF_PATH="$value" ;;
  130. --error-log-path=*) NGX_ERROR_LOG_PATH="$value";;
  131. --pid-path=*) NGX_PID_PATH="$value" ;;
  132. --lock-path=*) NGX_LOCK_PATH="$value" ;;
  133. --user=*) NGX_USER="$value" ;;
  134. --group=*) NGX_GROUP="$value" ;;
  135. --crossbuild=*) NGX_PLATFORM="$value" ;;
  136. --builddir=*) NGX_OBJS="$value" ;;
  137. --with-rtsig_module) EVENT_RTSIG=YES ;;
  138. --with-select_module) EVENT_SELECT=YES ;;
  139. --without-select_module) EVENT_SELECT=NONE ;;
  140. --with-poll_module) EVENT_POLL=YES ;;
  141. --without-poll_module) EVENT_POLL=NONE ;;
  142. --with-aio_module) EVENT_AIO=YES ;;
  143. #--with-threads=*) USE_THREADS="$value" ;;
  144. #--with-threads) USE_THREADS="pthreads" ;;
  145. --with-file-aio) NGX_FILE_AIO=YES ;;
  146. --with-ipv6) NGX_IPV6=YES ;;
  147. --without-http) HTTP=NO ;;
  148. --without-http-cache) HTTP_CACHE=NO ;;
  149. --http-log-path=*) NGX_HTTP_LOG_PATH="$value" ;;
  150. --http-client-body-temp-path=*) NGX_HTTP_CLIENT_TEMP_PATH="$value" ;;
  151. --http-proxy-temp-path=*) NGX_HTTP_PROXY_TEMP_PATH="$value" ;;
  152. --http-fastcgi-temp-path=*) NGX_HTTP_FASTCGI_TEMP_PATH="$value" ;;
  153. --http-uwsgi-temp-path=*) NGX_HTTP_UWSGI_TEMP_PATH="$value" ;;
  154. --http-scgi-temp-path=*) NGX_HTTP_SCGI_TEMP_PATH="$value" ;;
  155. --with-http_ssl_module) HTTP_SSL=YES ;;
  156. --with-http_realip_module) HTTP_REALIP=YES ;;
  157. --with-http_addition_module) HTTP_ADDITION=YES ;;
  158. --with-http_xslt_module) HTTP_XSLT=YES ;;
  159. --with-http_image_filter_module) HTTP_IMAGE_FILTER=YES ;;
  160. --with-http_geoip_module) HTTP_GEOIP=YES ;;
  161. --with-http_sub_module) HTTP_SUB=YES ;;
  162. --with-http_dav_module) HTTP_DAV=YES ;;
  163. --with-http_flv_module) HTTP_FLV=YES ;;
  164. --with-http_mp4_module) HTTP_MP4=YES ;;
  165. --with-http_gzip_static_module) HTTP_GZIP_STATIC=YES ;;
  166. --with-http_random_index_module) HTTP_RANDOM_INDEX=YES ;;
  167. --with-http_secure_link_module) HTTP_SECURE_LINK=YES ;;
  168. --with-http_degradation_module) HTTP_DEGRADATION=YES ;;
  169. --without-http_charset_module) HTTP_CHARSET=NO ;;
  170. --without-http_gzip_module) HTTP_GZIP=NO ;;
  171. --without-http_ssi_module) HTTP_SSI=NO ;;
  172. --without-http_userid_module) HTTP_USERID=NO ;;
  173. --without-http_access_module) HTTP_ACCESS=NO ;;
  174. --without-http_auth_basic_module) HTTP_AUTH_BASIC=NO ;;
  175. --without-http_autoindex_module) HTTP_AUTOINDEX=NO ;;
  176. --without-http_status_module) HTTP_STATUS=NO ;;
  177. --without-http_geo_module) HTTP_GEO=NO ;;
  178. --without-http_map_module) HTTP_MAP=NO ;;
  179. --without-http_split_clients_module) HTTP_SPLIT_CLIENTS=NO ;;
  180. --without-http_referer_module) HTTP_REFERER=NO ;;
  181. --without-http_rewrite_module) HTTP_REWRITE=NO ;;
  182. --without-http_proxy_module) HTTP_PROXY=NO ;;
  183. --without-http_fastcgi_module) HTTP_FASTCGI=NO ;;
  184. --without-http_uwsgi_module) HTTP_UWSGI=NO ;;
  185. --without-http_scgi_module) HTTP_SCGI=NO ;;
  186. --without-http_memcached_module) HTTP_MEMCACHED=NO ;;
  187. --without-http_limit_zone_module) HTTP_LIMIT_ZONE=NO ;;
  188. --without-http_limit_req_module) HTTP_LIMIT_REQ=NO ;;
  189. --without-http_empty_gif_module) HTTP_EMPTY_GIF=NO ;;
  190. --without-http_browser_module) HTTP_BROWSER=NO ;;
  191. --without-http_upstream_ip_hash_module) HTTP_UPSTREAM_IP_HASH=NO ;;
  192. --with-http_perl_module) HTTP_PERL=YES ;;
  193. --with-perl_modules_path=*) NGX_PERL_MODULES="$value" ;;
  194. --with-perl=*) NGX_PERL="$value" ;;
  195. # STUB
  196. --with-http_stub_status_module) HTTP_STUB_STATUS=YES ;;
  197. --with-mail) MAIL=YES ;;
  198. --with-mail_ssl_module) MAIL_SSL=YES ;;
  199. # STUB
  200. --with-imap) MAIL=YES ;;
  201. --with-imap_ssl_module) MAIL_SSL=YES ;;
  202. --without-mail_pop3_module) MAIL_POP3=NO ;;
  203. --without-mail_imap_module) MAIL_IMAP=NO ;;
  204. --without-mail_smtp_module) MAIL_SMTP=NO ;;
  205. --with-google_perftools_module) NGX_GOOGLE_PERFTOOLS=YES ;;
  206. --with-cpp_test_module) NGX_CPP_TEST=YES ;;
  207. --add-module=*) NGX_ADDONS="$NGX_ADDONS $value" ;;
  208. --with-cc=*) CC="$value" ;;
  209. --with-cpp=*) CPP="$value" ;;
  210. --with-cc-opt=*) NGX_CC_OPT="$value" ;;
  211. --with-ld-opt=*) NGX_LD_OPT="$value" ;;
  212. --with-cpu-opt=*) CPU="$value" ;;
  213. --with-debug) NGX_DEBUG=YES ;;
  214. --without-pcre) USE_PCRE=DISABLED ;;
  215. --with-pcre) USE_PCRE=YES ;;
  216. --with-pcre=*) PCRE="$value" ;;
  217. --with-pcre-opt=*) PCRE_OPT="$value" ;;
  218. --with-openssl=*) OPENSSL="$value" ;;
  219. --with-openssl-opt=*) OPENSSL_OPT="$value" ;;
  220. --with-md5=*) MD5="$value" ;;
  221. --with-md5-opt=*) MD5_OPT="$value" ;;
  222. --with-md5-asm) MD5_ASM=YES ;;
  223. --with-sha1=*) SHA1="$value" ;;
  224. --with-sha1-opt=*) SHA1_OPT="$value" ;;
  225. --with-sha1-asm) SHA1_ASM=YES ;;
  226. --with-zlib=*) ZLIB="$value" ;;
  227. --with-zlib-opt=*) ZLIB_OPT="$value" ;;
  228. --with-zlib-asm=*) ZLIB_ASM="$value" ;;
  229. --with-libatomic) NGX_LIBATOMIC=YES ;;
  230. --with-libatomic=*) NGX_LIBATOMIC="$value" ;;
  231. --test-build-devpoll) NGX_TEST_BUILD_DEVPOLL=YES ;;
  232. --test-build-eventport) NGX_TEST_BUILD_EVENTPORT=YES ;;
  233. --test-build-epoll) NGX_TEST_BUILD_EPOLL=YES ;;
  234. --test-build-rtsig) NGX_TEST_BUILD_RTSIG=YES ;;
  235. --test-build-solaris-sendfilev) NGX_TEST_BUILD_SOLARIS_SENDFILEV=YES ;;
  236. *)
  237. echo "$0: error: invalid option \"$option\""
  238. exit 1
  239. ;;
  240. esac
  241. done
  242. NGX_CONFIGURE="$opt"
  243. if [ $help = yes ]; then
  244. cat << END
  245. --help print this message
  246. --prefix=PATH set installation prefix
  247. --sbin-path=PATH set nginx binary pathname
  248. --conf-path=PATH set nginx.conf pathname
  249. --error-log-path=PATH set error log pathname
  250. --pid-path=PATH set nginx.pid pathname
  251. --lock-path=PATH set nginx.lock pathname
  252. --user=USER set non-privileged user for
  253. worker processes
  254. --group=GROUP set non-privileged group for
  255. worker processes
  256. --builddir=DIR set build directory
  257. --with-rtsig_module enable rtsig module
  258. --with-select_module enable select module
  259. --without-select_module disable select module
  260. --with-poll_module enable poll module
  261. --without-poll_module disable poll module
  262. --with-file-aio enable file AIO support
  263. --with-ipv6 enable IPv6 support
  264. --with-http_ssl_module enable ngx_http_ssl_module
  265. --with-http_realip_module enable ngx_http_realip_module
  266. --with-http_addition_module enable ngx_http_addition_module
  267. --with-http_xslt_module enable ngx_http_xslt_module
  268. --with-http_image_filter_module enable ngx_http_image_filter_module
  269. --with-http_geoip_module enable ngx_http_geoip_module
  270. --with-http_sub_module enable ngx_http_sub_module
  271. --with-http_dav_module enable ngx_http_dav_module
  272. --with-http_flv_module enable ngx_http_flv_module
  273. --with-http_mp4_module enable ngx_http_mp4_module
  274. --with-http_gzip_static_module enable ngx_http_gzip_static_module
  275. --with-http_random_index_module enable ngx_http_random_index_module
  276. --with-http_secure_link_module enable ngx_http_secure_link_module
  277. --with-http_degradation_module enable ngx_http_degradation_module
  278. --with-http_stub_status_module enable ngx_http_stub_status_module
  279. --without-http_charset_module disable ngx_http_charset_module
  280. --without-http_gzip_module disable ngx_http_gzip_module
  281. --without-http_ssi_module disable ngx_http_ssi_module
  282. --without-http_userid_module disable ngx_http_userid_module
  283. --without-http_access_module disable ngx_http_access_module
  284. --without-http_auth_basic_module disable ngx_http_auth_basic_module
  285. --without-http_autoindex_module disable ngx_http_autoindex_module
  286. --without-http_geo_module disable ngx_http_geo_module
  287. --without-http_map_module disable ngx_http_map_module
  288. --without-http_split_clients_module disable ngx_http_split_clients_module
  289. --without-http_referer_module disable ngx_http_referer_module
  290. --without-http_rewrite_module disable ngx_http_rewrite_module
  291. --without-http_proxy_module disable ngx_http_proxy_module
  292. --without-http_fastcgi_module disable ngx_http_fastcgi_module
  293. --without-http_uwsgi_module disable ngx_http_uwsgi_module
  294. --without-http_scgi_module disable ngx_http_scgi_module
  295. --without-http_memcached_module disable ngx_http_memcached_module
  296. --without-http_limit_zone_module disable ngx_http_limit_zone_module
  297. --without-http_limit_req_module disable ngx_http_limit_req_module
  298. --without-http_empty_gif_module disable ngx_http_empty_gif_module
  299. --without-http_browser_module disable ngx_http_browser_module
  300. --without-http_upstream_ip_hash_module
  301. disable ngx_http_upstream_ip_hash_module
  302. --with-http_perl_module enable ngx_http_perl_module
  303. --with-perl_modules_path=PATH set Perl modules path
  304. --with-perl=PATH set perl binary pathname
  305. --http-log-path=PATH set http access log pathname
  306. --http-client-body-temp-path=PATH set path to store
  307. http client request body temporary files
  308. --http-proxy-temp-path=PATH set path to store
  309. http proxy temporary files
  310. --http-fastcgi-temp-path=PATH set path to store
  311. http fastcgi temporary files
  312. --http-uwsgi-temp-path=PATH set path to store
  313. http uwsgi temporary files
  314. --http-scgi-temp-path=PATH set path to store
  315. http scgi temporary files
  316. --without-http disable HTTP server
  317. --without-http-cache disable HTTP cache
  318. --with-mail enable POP3/IMAP4/SMTP proxy module
  319. --with-mail_ssl_module enable ngx_mail_ssl_module
  320. --without-mail_pop3_module disable ngx_mail_pop3_module
  321. --without-mail_imap_module disable ngx_mail_imap_module
  322. --without-mail_smtp_module disable ngx_mail_smtp_module
  323. --with-google_perftools_module enable ngx_google_perftools_module
  324. --with-cpp_test_module enable ngx_cpp_test_module
  325. --add-module=PATH enable an external module
  326. --with-cc=PATH set C compiler pathname
  327. --with-cpp=PATH set C preprocessor pathname
  328. --with-cc-opt=OPTIONS set additional C compiler options
  329. --with-ld-opt=OPTIONS set additional linker options
  330. --with-cpu-opt=CPU build for the specified CPU, valid values:
  331. pentium, pentiumpro, pentium3, pentium4,
  332. athlon, opteron, sparc32, sparc64, ppc64
  333. --without-pcre disable PCRE library usage
  334. --with-pcre force PCRE library usage
  335. --with-pcre=DIR set path to PCRE library sources
  336. --with-pcre-opt=OPTIONS set additional build options for PCRE
  337. --with-md5=DIR set path to md5 library sources
  338. --with-md5-opt=OPTIONS set additional build options for md5
  339. --with-md5-asm use md5 assembler sources
  340. --with-sha1=DIR set path to sha1 library sources
  341. --with-sha1-opt=OPTIONS set additional build options for sha1
  342. --with-sha1-asm use sha1 assembler sources
  343. --with-zlib=DIR set path to zlib library sources
  344. --with-zlib-opt=OPTIONS set additional build options for zlib
  345. --with-zlib-asm=CPU use zlib assembler sources optimized
  346. for the specified CPU, valid values:
  347. pentium, pentiumpro
  348. --with-libatomic force libatomic_ops library usage
  349. --with-libatomic=DIR set path to libatomic_ops library sources
  350. --with-openssl=DIR set path to OpenSSL library sources
  351. --with-openssl-opt=OPTIONS set additional build options for OpenSSL
  352. --with-debug enable debug logging
  353. END
  354. exit 1
  355. fi
  356. if [ $HTTP = NO ]; then
  357. HTTP_CHARSET=NO
  358. HTTP_GZIP=NO
  359. HTTP_SSI=NO
  360. HTTP_USERID=NO
  361. HTTP_ACCESS=NO
  362. HTTP_STATUS=NO
  363. HTTP_REWRITE=NO
  364. HTTP_PROXY=NO
  365. HTTP_FASTCGI=NO
  366. fi
  367. if [ ".$NGX_PLATFORM" = ".win32" ]; then
  368. NGX_WINE=$WINE
  369. fi
  370. NGX_CONF_PATH=${NGX_CONF_PATH:-conf/nginx.conf}
  371. NGX_CONF_PREFIX=`dirname $NGX_CONF_PATH`
  372. NGX_PID_PATH=${NGX_PID_PATH:-logs/nginx.pid}
  373. NGX_LOCK_PATH=${NGX_LOCK_PATH:-logs/nginx.lock}
  374. if [ ".$NGX_ERROR_LOG_PATH" = ".stderr" ]; then
  375. NGX_ERROR_LOG_PATH=
  376. else
  377. NGX_ERROR_LOG_PATH=${NGX_ERROR_LOG_PATH:-logs/error.log}
  378. fi
  379. NGX_HTTP_LOG_PATH=${NGX_HTTP_LOG_PATH:-logs/access.log}
  380. NGX_HTTP_CLIENT_TEMP_PATH=${NGX_HTTP_CLIENT_TEMP_PATH:-client_body_temp}
  381. NGX_HTTP_PROXY_TEMP_PATH=${NGX_HTTP_PROXY_TEMP_PATH:-proxy_temp}
  382. NGX_HTTP_FASTCGI_TEMP_PATH=${NGX_HTTP_FASTCGI_TEMP_PATH:-fastcgi_temp}
  383. NGX_HTTP_UWSGI_TEMP_PATH=${NGX_HTTP_UWSGI_TEMP_PATH:-uwsgi_temp}
  384. NGX_HTTP_SCGI_TEMP_PATH=${NGX_HTTP_SCGI_TEMP_PATH:-scgi_temp}
  385. case ".$NGX_PERL_MODULES" in
  386. ./*)
  387. ;;
  388. .)
  389. ;;
  390. *)
  391. NGX_PERL_MODULES=$NGX_PREFIX/$NGX_PERL_MODULES
  392. ;;
  393. esac