options 15 KB

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