modules 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. # Copyright (C) Igor Sysoev
  2. if [ $EVENT_SELECT = NO -a $EVENT_FOUND = NO ]; then
  3. EVENT_SELECT=YES
  4. fi
  5. if [ $EVENT_SELECT = YES ]; then
  6. have=NGX_HAVE_SELECT . auto/have
  7. CORE_SRCS="$CORE_SRCS $SELECT_SRCS"
  8. EVENT_MODULES="$EVENT_MODULES $SELECT_MODULE"
  9. fi
  10. if [ $EVENT_POLL = NO -a $EVENT_FOUND = NO ]; then
  11. EVENT_POLL=YES
  12. fi
  13. if [ $EVENT_POLL = YES ]; then
  14. have=NGX_HAVE_POLL . auto/have
  15. CORE_SRCS="$CORE_SRCS $POLL_SRCS"
  16. EVENT_MODULES="$EVENT_MODULES $POLL_MODULE"
  17. fi
  18. if [ $NGX_TEST_BUILD_DEVPOLL = YES ]; then
  19. have=NGX_HAVE_DEVPOLL . auto/have
  20. have=NGX_TEST_BUILD_DEVPOLL . auto/have
  21. EVENT_MODULES="$EVENT_MODULES $DEVPOLL_MODULE"
  22. CORE_SRCS="$CORE_SRCS $DEVPOLL_SRCS"
  23. fi
  24. if [ $NGX_TEST_BUILD_EVENTPORT = YES ]; then
  25. have=NGX_HAVE_EVENTPORT . auto/have
  26. have=NGX_TEST_BUILD_EVENTPORT . auto/have
  27. EVENT_MODULES="$EVENT_MODULES $EVENTPORT_MODULE"
  28. CORE_SRCS="$CORE_SRCS $EVENTPORT_SRCS"
  29. fi
  30. if [ $NGX_TEST_BUILD_EPOLL = YES ]; then
  31. have=NGX_HAVE_EPOLL . auto/have
  32. have=NGX_TEST_BUILD_EPOLL . auto/have
  33. EVENT_MODULES="$EVENT_MODULES $EPOLL_MODULE"
  34. CORE_SRCS="$CORE_SRCS $EPOLL_SRCS"
  35. fi
  36. if [ $NGX_TEST_BUILD_RTSIG = YES ]; then
  37. have=NGX_HAVE_RTSIG . auto/have
  38. have=NGX_TEST_BUILD_RTSIG . auto/have
  39. EVENT_MODULES="$EVENT_MODULES $RTSIG_MODULE"
  40. CORE_SRCS="$CORE_SRCS $RTSIG_SRCS"
  41. fi
  42. if [ $NGX_TEST_BUILD_SOLARIS_SENDFILEV = YES ]; then
  43. have=NGX_TEST_BUILD_SOLARIS_SENDFILEV . auto/have
  44. CORE_SRCS="$CORE_SRCS $SOLARIS_SENDFILEV_SRCS"
  45. fi
  46. if [ $HTTP != YES ]; then
  47. have=NGX_CRYPT . auto/nohave
  48. CRYPT_LIB=
  49. fi
  50. if [ $HTTP_SSI = YES ]; then
  51. HTTP_POSTPONE=YES
  52. fi
  53. if [ $HTTP_ADDITION = YES ]; then
  54. HTTP_POSTPONE=YES
  55. fi
  56. # the module order is important
  57. # ngx_http_autoindex_module
  58. # ngx_http_index_module
  59. #
  60. # ngx_http_access_module
  61. # ngx_http_realip_module
  62. #
  63. #
  64. # the filter order is important
  65. # ngx_http_write_filter
  66. # ngx_http_header_filter
  67. # ngx_http_chunked_filter
  68. # ngx_http_range_header_filter
  69. # ngx_http_gzip_filter
  70. # ngx_http_postpone_filter
  71. # ngx_http_charset_filter
  72. # ngx_http_ssi_filter
  73. # ngx_http_addition_filter
  74. # ngx_http_userid_filter
  75. # ngx_http_headers_filter
  76. # ngx_http_copy_filter
  77. # ngx_http_range_body_filter
  78. # ngx_http_not_modified_filter
  79. HTTP_FILTER_MODULES="$HTTP_WRITE_FILTER_MODULE \
  80. $HTTP_HEADER_FILTER_MODULE \
  81. $HTTP_CHUNKED_FILTER_MODULE \
  82. $HTTP_RANGE_HEADER_FILTER_MODULE"
  83. if [ $HTTP_GZIP = YES ]; then
  84. have=NGX_HTTP_GZIP . auto/have
  85. USE_ZLIB=YES
  86. HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_GZIP_FILTER_MODULE"
  87. HTTP_SRCS="$HTTP_SRCS $HTTP_GZIP_SRCS"
  88. fi
  89. if [ $HTTP_POSTPONE = YES ]; then
  90. HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_POSTPONE_FILTER_MODULE"
  91. HTTP_SRCS="$HTTP_SRCS $HTPP_POSTPONE_FILTER_SRCS"
  92. fi
  93. if [ $HTTP_CHARSET = YES ]; then
  94. have=NGX_HTTP_CHARSET . auto/have
  95. HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_CHARSET_FILTER_MODULE"
  96. HTTP_SRCS="$HTTP_SRCS $HTTP_CHARSET_SRCS"
  97. fi
  98. if [ $HTTP_SSI = YES ]; then
  99. have=NGX_HTTP_SSI . auto/have
  100. HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_SSI_FILTER_MODULE"
  101. HTTP_DEPS="$HTTP_DEPS $HTTP_SSI_DEPS"
  102. HTTP_SRCS="$HTTP_SRCS $HTTP_SSI_SRCS"
  103. fi
  104. if [ $HTTP_SUB = YES ]; then
  105. HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_SUB_FILTER_MODULE"
  106. HTTP_SRCS="$HTTP_SRCS $HTTP_SUB_SRCS"
  107. fi
  108. if [ $HTTP_ADDITION = YES ]; then
  109. HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_ADDITION_FILTER_MODULE"
  110. HTTP_SRCS="$HTTP_SRCS $HTTP_ADDITION_SRCS"
  111. fi
  112. if [ $HTTP_USERID = YES ]; then
  113. HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_USERID_FILTER_MODULE"
  114. HTTP_SRCS="$HTTP_SRCS $HTTP_USERID_SRCS"
  115. fi
  116. HTTP_MODULES="$HTTP_MODULES $HTTP_STATIC_MODULE"
  117. if [ $HTTP_DAV = YES ]; then
  118. have=NGX_HTTP_DAV . auto/have
  119. HTTP_MODULES="$HTTP_MODULES $HTTP_DAV_MODULE"
  120. HTTP_SRCS="$HTTP_SRCS $HTTP_DAV_SRCS"
  121. fi
  122. if [ $HTTP_AUTOINDEX = YES ]; then
  123. have=NGX_HTTP_AUTOINDEX . auto/have
  124. HTTP_MODULES="$HTTP_MODULES $HTTP_AUTOINDEX_MODULE"
  125. HTTP_SRCS="$HTTP_SRCS $HTTP_AUTOINDEX_SRCS"
  126. fi
  127. HTTP_MODULES="$HTTP_MODULES $HTTP_INDEX_MODULE"
  128. if [ $HTTP_AUTH_BASIC = YES ]; then
  129. have=NGX_HTTP_AUTH_BASIC . auto/have
  130. have=NGX_CRYPT . auto/have
  131. HTTP_MODULES="$HTTP_MODULES $HTTP_AUTH_BASIC_MODULE"
  132. HTTP_SRCS="$HTTP_SRCS $HTTP_AUTH_BASIC_SRCS"
  133. CORE_LIBS="$CORE_LIBS $CRYPT_LIB"
  134. fi
  135. if [ $HTTP_ACCESS = YES ]; then
  136. have=NGX_HTTP_ACCESS . auto/have
  137. HTTP_MODULES="$HTTP_MODULES $HTTP_ACCESS_MODULE"
  138. HTTP_SRCS="$HTTP_SRCS $HTTP_ACCESS_SRCS"
  139. fi
  140. if [ $HTTP_LIMIT_ZONE = YES ]; then
  141. HTTP_MODULES="$HTTP_MODULES $HTTP_LIMIT_ZONE_MODULE"
  142. HTTP_SRCS="$HTTP_SRCS $HTTP_LIMIT_ZONE_SRCS"
  143. fi
  144. if [ $HTTP_REALIP = YES ]; then
  145. have=NGX_HTTP_REALIP . auto/have
  146. HTTP_MODULES="$HTTP_MODULES $HTTP_REALIP_MODULE"
  147. HTTP_SRCS="$HTTP_SRCS $HTTP_REALIP_SRCS"
  148. fi
  149. if [ $HTTP_STATUS = YES ]; then
  150. have=NGX_HTTP_STATUS . auto/have
  151. HTTP_MODULES="$HTTP_MODULES $HTTP_STATUS_MODULE"
  152. HTTP_SRCS="$HTTP_SRCS $HTTP_STATUS_SRCS"
  153. fi
  154. if [ $HTTP_GEO = YES ]; then
  155. have=NGX_HTTP_GEO . auto/have
  156. HTTP_MODULES="$HTTP_MODULES $HTTP_GEO_MODULE"
  157. HTTP_SRCS="$HTTP_SRCS $HTTP_GEO_SRCS"
  158. fi
  159. if [ $HTTP_MAP = YES ]; then
  160. have=NGX_HTTP_MAP . auto/have
  161. HTTP_MODULES="$HTTP_MODULES $HTTP_MAP_MODULE"
  162. HTTP_SRCS="$HTTP_SRCS $HTTP_MAP_SRCS"
  163. fi
  164. if [ $HTTP_REFERER = YES ]; then
  165. HTTP_MODULES="$HTTP_MODULES $HTTP_REFERER_MODULE"
  166. HTTP_SRCS="$HTTP_SRCS $HTTP_REFERER_SRCS"
  167. fi
  168. if [ $HTTP_REWRITE = YES -a $USE_PCRE != DISABLED ]; then
  169. have=NGX_HTTP_REWRITE . auto/have
  170. USE_PCRE=YES
  171. HTTP_MODULES="$HTTP_MODULES $HTTP_REWRITE_MODULE"
  172. HTTP_SRCS="$HTTP_SRCS $HTTP_REWRITE_SRCS"
  173. fi
  174. if [ $HTTP_SSL = YES ]; then
  175. USE_OPENSSL=YES
  176. have=NGX_HTTP_SSL . auto/have
  177. HTTP_MODULES="$HTTP_MODULES $HTTP_SSL_MODULE"
  178. HTTP_DEPS="$HTTP_DEPS $HTTP_SSL_DEPS"
  179. HTTP_SRCS="$HTTP_SRCS $HTTP_SSL_SRCS"
  180. fi
  181. if [ $HTTP_PROXY = YES ]; then
  182. have=NGX_HTTP_PROXY . auto/have
  183. #USE_MD5=YES
  184. HTTP_MODULES="$HTTP_MODULES $HTTP_PROXY_MODULE"
  185. HTTP_DEPS="$HTTP_DEPS $HTTP_PROXY_DEPS"
  186. HTTP_SRCS="$HTTP_SRCS $HTTP_PROXY_SRCS"
  187. fi
  188. if [ $HTTP_FASTCGI = YES ]; then
  189. HTTP_MODULES="$HTTP_MODULES $HTTP_FASTCGI_MODULE"
  190. HTTP_SRCS="$HTTP_SRCS $HTTP_FASTCGI_SRCS"
  191. fi
  192. if [ $HTTP_PERL = YES ]; then
  193. USE_PERL=YES
  194. have=NGX_HTTP_PERL . auto/have
  195. HTTP_MODULES="$HTTP_MODULES $HTTP_PERL_MODULE"
  196. HTTP_INCS="$HTTP_INCS $HTTP_PERL_INCS"
  197. HTTP_DEPS="$HTTP_DEPS $HTTP_PERL_DEPS"
  198. HTTP_SRCS="$HTTP_SRCS $HTTP_PERL_SRCS"
  199. fi
  200. if [ $HTTP_MEMCACHED = YES ]; then
  201. HTTP_MODULES="$HTTP_MODULES $HTTP_MEMCACHED_MODULE"
  202. HTTP_SRCS="$HTTP_SRCS $HTTP_MEMCACHED_SRCS"
  203. fi
  204. if [ $HTTP_EMPTY_GIF = YES ]; then
  205. HTTP_MODULES="$HTTP_MODULES $HTTP_EMPTY_GIF_MODULE"
  206. HTTP_SRCS="$HTTP_SRCS $HTTP_EMPTY_GIF_SRCS"
  207. fi
  208. if [ $HTTP_BROWSER = YES ]; then
  209. HTTP_MODULES="$HTTP_MODULES $HTTP_BROWSER_MODULE"
  210. HTTP_SRCS="$HTTP_SRCS $HTTP_BROWSER_SRCS"
  211. fi
  212. if [ $HTTP_FLV = YES ]; then
  213. HTTP_MODULES="$HTTP_MODULES $HTTP_FLV_MODULE"
  214. HTTP_SRCS="$HTTP_SRCS $HTTP_FLV_SRCS"
  215. fi
  216. if [ $HTTP_UPSTREAM_IP_HASH = YES ]; then
  217. HTTP_MODULES="$HTTP_MODULES $HTTP_UPSTREAM_IP_HASH_MODULE"
  218. HTTP_SRCS="$HTTP_SRCS $HTTP_UPSTREAM_IP_HASH_SRCS"
  219. fi
  220. # STUB
  221. #USE_MD5=YES
  222. #HTTP_SRCS="$HTTP_SRCS $HTPP_CACHE_SRCS"
  223. #HTTP_SRCS="$HTTP_SRCS $HTPP_FILE_CACHE_SRCS"
  224. if [ $HTTP_STUB_STATUS = YES ]; then
  225. have=NGX_STAT_STUB . auto/have
  226. HTTP_MODULES="$HTTP_MODULES ngx_http_stub_status_module"
  227. HTTP_SRCS="$HTTP_SRCS src/http/modules/ngx_http_stub_status_module.c"
  228. fi
  229. #if [ -r $NGX_OBJS/auto ]; then
  230. # . $NGX_OBJS/auto
  231. #fi
  232. if test -n "$NGX_ADDONS"; then
  233. echo configuring additional modules
  234. for ngx_addon_dir in $NGX_ADDONS
  235. do
  236. echo "adding module in $ngx_addon_dir"
  237. if test -f $ngx_addon_dir/config; then
  238. . $ngx_addon_dir/config
  239. echo " + $ngx_addon_name was configured"
  240. else
  241. echo "$0: error: no $ngx_addon_dir/config was found"
  242. exit 1
  243. fi
  244. done
  245. fi
  246. if [ $MAIL_SSL = YES ]; then
  247. have=NGX_MAIL_SSL . auto/have
  248. USE_OPENSSL=YES
  249. fi
  250. modules="$CORE_MODULES $EVENT_MODULES"
  251. if [ $USE_OPENSSL = YES ]; then
  252. modules="$modules $OPENSSL_MODULE"
  253. CORE_DEPS="$CORE_DEPS $OPENSSL_DEPS"
  254. CORE_SRCS="$CORE_SRCS $OPENSSL_SRCS"
  255. fi
  256. if [ $HTTP = YES ]; then
  257. modules="$modules $HTTP_MODULES $HTTP_FILTER_MODULES \
  258. $HTTP_HEADERS_FILTER_MODULE \
  259. $HTTP_AUX_FILTER_MODULES \
  260. $HTTP_COPY_FILTER_MODULE \
  261. $HTTP_RANGE_BODY_FILTER_MODULE \
  262. $HTTP_NOT_MODIFIED_FILTER_MODULE"
  263. NGX_ADDON_DEPS="$NGX_ADDON_DEPS \$(HTTP_DEPS)"
  264. fi
  265. if [ $MAIL = YES ]; then
  266. modules="$modules $MAIL_MODULES"
  267. if [ $MAIL_SSL = YES ]; then
  268. modules="$modules $MAIL_SSL_MODULE"
  269. MAIL_DEPS="$MAIL_DEPS $MAIL_SSL_DEPS"
  270. MAIL_SRCS="$MAIL_SRCS $MAIL_SSL_SRCS"
  271. fi
  272. if [ $MAIL_POP3 = YES ]; then
  273. modules="$modules $MAIL_POP3_MODULE"
  274. MAIL_DEPS="$MAIL_DEPS $MAIL_POP3_DEPS"
  275. MAIL_SRCS="$MAIL_SRCS $MAIL_POP3_SRCS"
  276. fi
  277. if [ $MAIL_IMAP = YES ]; then
  278. modules="$modules $MAIL_IMAP_MODULE"
  279. MAIL_DEPS="$MAIL_DEPS $MAIL_IMAP_DEPS"
  280. MAIL_SRCS="$MAIL_SRCS $MAIL_IMAP_SRCS"
  281. fi
  282. if [ $MAIL_SMTP = YES ]; then
  283. modules="$modules $MAIL_SMTP_MODULE"
  284. MAIL_DEPS="$MAIL_DEPS $MAIL_SMTP_DEPS"
  285. MAIL_SRCS="$MAIL_SRCS $MAIL_SMTP_SRCS"
  286. fi
  287. modules="$modules $MAIL_AUTH_HTTP_MODULE"
  288. MAIL_SRCS="$MAIL_SRCS $MAIL_AUTH_HTTP_SRCS"
  289. modules="$modules $MAIL_PROXY_MODULE"
  290. MAIL_SRCS="$MAIL_SRCS $MAIL_PROXY_SRCS"
  291. fi
  292. cat << END > $NGX_MODULES_C
  293. #include <ngx_config.h>
  294. #include <ngx_core.h>
  295. $NGX_PRAGMA
  296. END
  297. for mod in $modules
  298. do
  299. echo "extern ngx_module_t $mod;" >> $NGX_MODULES_C
  300. done
  301. echo >> $NGX_MODULES_C
  302. echo 'ngx_module_t *ngx_modules[] = {' >> $NGX_MODULES_C
  303. for mod in $modules
  304. do
  305. echo " &$mod," >> $NGX_MODULES_C
  306. done
  307. cat << END >> $NGX_MODULES_C
  308. NULL
  309. };
  310. END